From report at bugs.python.org Wed Sep 1 00:05:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 01 Sep 2021 04:05:28 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630469128.22.0.684725505166.issue45020@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: I don't want all frozen header files to be committed in git repository. Can't we just build them during build process? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 1 00:39:04 2021 From: report at bugs.python.org (DMI-1407) Date: Wed, 01 Sep 2021 04:39:04 +0000 Subject: [issue45073] windows installer quiet installation targetdir escapes "quote"-symbol Message-ID: <1630471144.03.0.656994517168.issue45073@roundup.psfhosted.org> New submission from DMI-1407 <dmi-1407 at live.de>: If the windows installer (Python 3.8.9 64bit exe) is run in quiet mode and the TargetDir option is used, then the last quote (") symbol gets escaped if the path ends with an backslash (\). Example: /quiet TargetDir="D:\pyt hon\" AssociateFiles=0 Result: TargetDir=hon\" AssociateFiles=0 this raises the error that the path contains a invalid character... (the quote ofc) Example: /quiet TargetDir="D:\pyt hon" AssociateFiles=0 Result: installs correctly so in general "D:\pyt hon" indicates a file thats named "pyt hon" where "D:\pyt hon\" indicates a folder. whatever "D:\pyt hon\" should be valid and i dont understand why the first backslash does not escape the p and leads to "D:pyt hon" ... its really annoying, pls do at least write a notice into the docs that the installer behaves like this. :/ ---------- components: Installation messages: 400809 nosy: DMI-1407 priority: normal severity: normal status: open title: windows installer quiet installation targetdir escapes "quote"-symbol type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45073> _______________________________________ From report at bugs.python.org Wed Sep 1 01:10:33 2021 From: report at bugs.python.org (William Fisher) Date: Wed, 01 Sep 2021 05:10:33 +0000 Subject: [issue45074] asyncio hang in subprocess wait_closed() on Windows, BrokenPipeError Message-ID: <1630473033.57.0.597404080995.issue45074@roundup.psfhosted.org> New submission from William Fisher <william.w.fisher at gmail.com>: I have a reproducible case where stdin.wait_closed() is hanging on Windows. This happens in response to a BrokenPipeError. The same code works fine on Linux and MacOS. Please see the attached code for the demo. I believe the hang is related to this debug message from the logs: DEBUG <_ProactorWritePipeTransport closing fd=632>: Fatal write error on pipe transport Traceback (most recent call last): File "C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\proactor_events.py", line 379, in _loop_writing f.result() File "C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\windows_events.py", line 812, in _poll value = callback(transferred, key, ov) File "C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\windows_events.py", line 538, in finish_send return ov.getresult() BrokenPipeError: [WinError 109] The pipe has been ended It appears that the function that logs "Fatal write error on pipe transport" also calls _abort on the stream. If _abort is called before stdin.close(), everything is okay. If _abort is called after stdin.close(), stdin.wait_closed() will hang. Please see issue #44428 for another instance of a similar hang in wait_closed(). ---------- components: asyncio files: wait_closed.py messages: 400810 nosy: asvetlov, byllyfish, yselivanov priority: normal severity: normal status: open title: asyncio hang in subprocess wait_closed() on Windows, BrokenPipeError type: behavior versions: Python 3.10, Python 3.9 Added file: https://bugs.python.org/file50250/wait_closed.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45074> _______________________________________ From report at bugs.python.org Wed Sep 1 01:21:47 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 01 Sep 2021 05:21:47 +0000 Subject: [issue45073] windows installer quiet installation targetdir escapes "quote"-symbol In-Reply-To: <1630471144.03.0.656994517168.issue45073@roundup.psfhosted.org> Message-ID: <1630473707.6.0.218281221859.issue45073@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: A literal backlash has to be escaped by doubling it if it precedes a double quote, else it escapes the double quote character. This is how typical command-line argument parsing handles backslash in Windows [1]: * 2n backslashes followed by a quotation mark produce n backslashes followed by begin/end quote. This does not become part of the parsed argument, but toggles the "in quotes" mode. * (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark literal ("). This does not toggle the "in quotes" mode. * n backslashes not followed by a quotation mark simply produce n backslashes. For example: import ctypes shell32 = ctypes.WinDLL('shell32', use_last_error=True) shell32.CommandLineToArgvW.restype = ctypes.POINTER(ctypes.c_wchar_p) n = ctypes.c_int() Escape the trailing backslash as a literal backslash: >>> cmd = r'/quiet TargetDir="D:\pyt hon\\" AssociateFiles=0' >>> args = shell32.CommandLineToArgvW(cmd, ctypes.byref(n)) >>> args[:n.value] ['/quiet', 'TargetDir=D:\\pyt hon\\', 'AssociateFiles=0'] Escape the double quote as a literal double quote: >>> cmd = r'/quiet TargetDir="D:\pyt hon\" AssociateFiles=0' >>> args = shell32.CommandLineToArgvW(cmd, ctypes.byref(n)) >>> args[:n.value] ['/quiet', 'TargetDir=D:\\pyt hon" AssociateFiles=0'] --- [1] https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45073> _______________________________________ From report at bugs.python.org Wed Sep 1 02:28:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 06:28:25 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630477705.94.0.078943535039.issue45053@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: $ touch ???? $ ./python Tools/scripts/md5sum.py ???? d41d8cd98f00b204e9800998ecf8427e ???? $ LC_ALL=uk_UA.koi8u PYTHONIOENCODING=koi8-u ./python Tools/scripts/md5sum.py ???? d41d8cd98f00b204e9800998ecf8427e ???? $ LC_ALL=uk_UA.koi8u PYTHONIOENCODING=utf-8 ./python Tools/scripts/md5sum.py ???? d41d8cd98f00b204e9800998ecf8427e ???????? $ PYTHONIOENCODING=koi8-u ./python Tools/scripts/md5sum.py ???? d41d8cd98f00b204e9800998ecf8427e ???? $ PYTHONIOENCODING=latin-1 ./python Tools/scripts/md5sum.py ???? Traceback (most recent call last): File "/home/serhiy/py/cpython/Tools/scripts/md5sum.py", line 93, in <module> sys.exit(main(sys.argv[1:], sys.stdout)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/scripts/md5sum.py", line 90, in main return sum(args, out) ^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/scripts/md5sum.py", line 39, in sum sts = printsum(f, out) or sts ^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/scripts/md5sum.py", line 53, in printsum sts = printsumfp(fp, filename, out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/scripts/md5sum.py", line 69, in printsumfp out.write('%s %s\n' % (m.hexdigest(), filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeEncodeError: 'latin-1' codec can't encode characters in position 33-36: ordinal not in range(256) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45053> _______________________________________ From report at bugs.python.org Wed Sep 1 02:45:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 06:45:13 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630478713.44.0.333606930205.issue45057@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset e527f79fa8b472dd534fc360e998fe8213e6471e by Serhiy Storchaka in branch '3.9': [3.9] bpo-45057: Simplify RegressionTestResult (GH-28081) (GH-28103) https://github.com/python/cpython/commit/e527f79fa8b472dd534fc360e998fe8213e6471e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45057> _______________________________________ From report at bugs.python.org Wed Sep 1 02:45:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 06:45:50 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630478750.47.0.714652920595.issue45057@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 3d56272e4ecaef9f38c1f48430364701d34b3ee4 by Miss Islington (bot) in branch '3.10': bpo-45057: Simplify RegressionTestResult (GH-28081) (GH-28101) https://github.com/python/cpython/commit/3d56272e4ecaef9f38c1f48430364701d34b3ee4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45057> _______________________________________ From report at bugs.python.org Wed Sep 1 02:51:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 06:51:08 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630479068.33.0.35352091111.issue45060@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset e09dd8aafd6f9aef03945c417267806d47084a5d by Serhiy Storchaka in branch '3.9': [3.9] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28093) https://github.com/python/cpython/commit/e09dd8aafd6f9aef03945c417267806d47084a5d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45060> _______________________________________ From report at bugs.python.org Wed Sep 1 02:52:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 06:52:03 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630479123.46.0.574916052922.issue45057@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45057> _______________________________________ From report at bugs.python.org Wed Sep 1 03:01:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 07:01:16 +0000 Subject: [issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter In-Reply-To: <1630409490.64.0.879285632353.issue45058@roundup.psfhosted.org> Message-ID: <1630479676.05.0.377454350538.issue45058@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Yes, it is syntactically correct. It can even make sense. But the meaning is different from "except (AError, BError)". If it looks confusing to you, it is a work of linters to warn about misleading or suspicions code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45058> _______________________________________ From report at bugs.python.org Wed Sep 1 03:08:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 07:08:14 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630480094.83.0.788412211685.issue27175@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It would be nice to have simple general mechanism for everloading names of modules, classes and functions, similar to _compat_pickle. Currently you can do this with creating a subclass of Unpickler and overloading find_class(), but it is not so convenient. There is no way to register standard replacements globally. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27175> _______________________________________ From report at bugs.python.org Wed Sep 1 03:22:39 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 01 Sep 2021 07:22:39 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630480959.61.0.0838117671677.issue45056@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: I found anther example for unused constants. The `readall()` function. https://github.com/python/cpython/blob/863154c9292e70c5a8a1a3f22ef4ee42e2304281/Lib/_pyio.py#L663-L675 Python 3.9.5: co_consts = ('Read until EOF, using multiple read() call.', None) Python 3.10rc1: co_consts = ('Read until EOF, using multiple read() call.', True, None) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 1 03:23:49 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 01 Sep 2021 07:23:49 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1630481029.51.0.790833274893.issue45067@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: You stripped too much output from the build, in particular you removed the part where _curses failed to build. The output you show only says that _cursus_panel failed verification because _cursus could not be imported. Could you add the build failure for the _cursus module as well? Rerunning make should give a more manageable output. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Wed Sep 1 03:57:55 2021 From: report at bugs.python.org (Antony Lee) Date: Wed, 01 Sep 2021 07:57:55 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630483075.19.0.552384343021.issue27175@roundup.psfhosted.org> Antony Lee <anntzer.lee at gmail.com> added the comment: I guess I could instead add some OS-dependent entries for Path classes into _compat_pickle (to do the remapping at load time) if you prefer? I don't have a strong preference either-way. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27175> _______________________________________ From report at bugs.python.org Wed Sep 1 04:03:16 2021 From: report at bugs.python.org (Antony Lee) Date: Wed, 01 Sep 2021 08:03:16 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1630483396.74.0.356886668664.issue44019@roundup.psfhosted.org> Antony Lee <anntzer.lee at gmail.com> added the comment: Python2's apply has different semantics: it takes non-unpacked arguments, i.e. def apply(f, args, kwargs={}): return f(*args, **kwargs) rather than def call(f, *args, **kwargs): return f(*args, **kwargs) I agree that both functions can be written in two (or one) line, but the same can be said of most functions in the operator module (def add(x, y): return x + y); from the module's doc ("efficient functions corresponding to the intrinsic operators"), I would argue that the criteria for inclusion are efficiency (operator.call is indeed fast, see the linked PR) and intrinsicness (I don't know if there's a hard definition, but function calling certainly seems intrinsic). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44019> _______________________________________ From report at bugs.python.org Wed Sep 1 04:14:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Sep 2021 08:14:57 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630484097.3.0.907368447761.issue27175@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: _compat_pickle is only used with protocol < 3. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27175> _______________________________________ From report at bugs.python.org Wed Sep 1 04:16:35 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 01 Sep 2021 08:16:35 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630484195.13.0.27698613181.issue45056@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: ---------- keywords: +patch pull_requests: +26551 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28109 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 1 04:22:44 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 01 Sep 2021 08:22:44 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630484564.88.0.680817317586.issue45056@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: @Pablo This issue seems an optimization rather than bugfix. But since Python 3.10 produces more unused constants than 3.9, this is a regression. GH-28109 removes not all unused constants, but only trailing unused constants. I think it is enough to fix the regression. I want to backport it to 3.10 or 3.10.1 after Mark's review. ---------- nosy: +pablogsal versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 1 05:08:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 01 Sep 2021 09:08:30 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630487310.38.0.250792949872.issue45056@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I want to backport it to 3.10 or 3.10.1 after Mark's review. Ok, please, add me as a reviewer to the backport once is ready. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 1 07:45:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 11:45:44 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module Message-ID: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: def format_frame(frame) should be renamed to format_frame_summary(frame_summary) because it takes a FrameSummary obejct and not a frame. This is a new API in 3.11 so it can be changed now. There are also local variables in traceback.py which are called frame but actually represent FrameSummary. This can be confusing and should be fixed at the same time where it doesn't break API. ---------- messages: 400825 nosy: iritkatriel priority: normal severity: normal status: open title: confusion between frame and frame_summary in traceback module _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 07:56:20 2021 From: report at bugs.python.org (otn) Date: Wed, 01 Sep 2021 11:56:20 +0000 Subject: [issue45076] open "r+" problem Message-ID: <1630497380.88.0.961026516524.issue45076@roundup.psfhosted.org> New submission from otn <ootani.takashi at gmail.com>: For opened file as "r+", even if write() then readline(), readline() is executed first. When add tell() after write(), it works correctly. ========================================== data1 = "aa\nbb\ncc\n" data2 = "xx\n" with open("data.txt","w") as f: f.write(data1) with open("data.txt","r+") as f: f.write(data2) # f.tell() print("Line:",repr(f.readline())) with open("data.txt") as f: print("All:",repr(f.read())) ========================================== OUTPUT: Line: 'aa\n' All: 'aa\nbb\ncc\nxx\n' EXPECTED: Line: 'bb\n' All: 'xx\nbb\ncc\n' ---------- components: IO messages: 400826 nosy: otn priority: normal severity: normal status: open title: open "r+" problem type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45076> _______________________________________ From report at bugs.python.org Wed Sep 1 08:09:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 12:09:54 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630498194.42.0.00731487245088.issue45075@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: There are places where f is used for an arg or local variable which is a frame, so I'll try f_summary when it's a FrameSummary. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 08:29:19 2021 From: report at bugs.python.org (Christian Tismer) Date: Wed, 01 Sep 2021 12:29:19 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630499359.6.0.218796672741.issue45061@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: What about an even more flexible solution? A debug option could memorize always the last object deallocated and give full info (the object's repr) before the crash would happen. ---------- nosy: +Christian.Tismer _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Wed Sep 1 08:32:21 2021 From: report at bugs.python.org (Christian Tismer) Date: Wed, 01 Sep 2021 12:32:21 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630499541.79.0.951008993378.issue45061@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: Ah, that would be really much to store: every object with a refcount going to zero would have to be memorized :/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Wed Sep 1 08:54:50 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Wed, 01 Sep 2021 12:54:50 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630500890.45.0.83814743038.issue44689@roundup.psfhosted.org> Tobias Bergkvist <tobias at bergkv.ist> added the comment: It seems like _dyld_shared_cache_contains_path exists, while the define flag HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH has not been set. Essentially, the define-flags being used does not seem to agree with the SDK version you are using. Could you try adding HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH like this and see if it builds correctly? clang -Wno-unused-result -Wsign-compare -g -O0 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH=1 -DPy_BUILD_CORE_BUILTIN -I_ctypes/darwin -c ./Modules/_ctypes/callproc.c -o Modules/callproc.o ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Wed Sep 1 08:55:57 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Wed, 01 Sep 2021 12:55:57 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630500957.93.0.910130137798.issue44689@roundup.psfhosted.org> Tobias Bergkvist <tobias at bergkv.ist> added the comment: I made a typo (forgetting the -D): clang -Wno-unused-result -Wsign-compare -g -O0 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -DHAVE_DYLD_SHARED_CACHE_CONTAINS_PATH=1 -DPy_BUILD_CORE_BUILTIN -I_ctypes/darwin -c ./Modules/_ctypes/callproc.c -o Modules/callproc.o ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Wed Sep 1 09:00:26 2021 From: report at bugs.python.org (=?utf-8?q?Benjamin_Sz=C5=91ke?=) Date: Wed, 01 Sep 2021 13:00:26 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1630501226.17.0.884024763677.issue21302@roundup.psfhosted.org> Change by Benjamin Sz?ke <egyszeregy at freemail.hu>: ---------- nosy: +Livius nosy_count: 5.0 -> 6.0 pull_requests: +26552 pull_request: https://github.com/python/cpython/pull/28111 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 1 09:20:44 2021 From: report at bugs.python.org (Kagami Sascha Rosylight) Date: Wed, 01 Sep 2021 13:20:44 +0000 Subject: [issue45077] multiprocessing.Pool(64) crashes on Windows Message-ID: <1630502444.21.0.00996444749357.issue45077@roundup.psfhosted.org> New submission from Kagami Sascha Rosylight <saschanaz at outlook.com>: Similar issue as the previous issue 26903. ``` Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing >>> multiprocessing.cpu_count() 64 >>> multiprocessing.Pool(multiprocessing.cpu_count()) Exception in thread Thread-1: Traceback (most recent call last): <multiprocessing.pool.Pool state=RUN pool_size=64> File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner >>> self.run() File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 519, in _handle_workers cls._wait_for_updates(current_sentinels, change_notifier) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 499, in _wait_for_updates wait(sentinels, timeout=timeout) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\connection.py", line 884, in wait ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait res = _winapi.WaitForMultipleObjects(L, False, timeout) ValueError: need at most 63 handles, got a sequence of length 66 ``` ---------- components: Windows messages: 400832 nosy: paul.moore, saschanaz, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: multiprocessing.Pool(64) crashes on Windows type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45077> _______________________________________ From report at bugs.python.org Wed Sep 1 09:22:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 13:22:15 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630502535.59.0.602056531347.issue45075@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28112 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 09:26:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 01 Sep 2021 13:26:31 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1630502791.95.0.579042347017.issue43976@roundup.psfhosted.org> Filipe La?ns <lains at riseup.net> added the comment: Matthias, can you check if bpo-44982 solves your issues related to the conflicts you were experiencing for the Debian patching? If so, it would unblock this issue. I am probably gonna discuss this proposal with the conda-forge folks next week, to get some feedback from the Conda perspective. I would like to have this unblocked so that we can move forward, as far as I know the only issues are the ones Debian is experiencing about this proposal alone not being able to completely replace the downstream patching. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43976> _______________________________________ From report at bugs.python.org Wed Sep 1 09:34:19 2021 From: report at bugs.python.org (Kagami Sascha Rosylight) Date: Wed, 01 Sep 2021 13:34:19 +0000 Subject: [issue45077] multiprocessing.Pool(64) crashes on Windows In-Reply-To: <1630502444.21.0.00996444749357.issue45077@roundup.psfhosted.org> Message-ID: <1630503259.48.0.511164445629.issue45077@roundup.psfhosted.org> Kagami Sascha Rosylight <saschanaz at outlook.com> added the comment: The argument-less instantiation also fails, which is worse. ``` >>> multiprocessing.Pool() <multiprocessing.pool.Pool state=RUN pool_size=64> >>> Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner self.run() File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 519, in _handle_workers cls._wait_for_updates(current_sentinels, change_notifier) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 499, in _wait_for_updates wait(sentinels, timeout=timeout) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\connection.py", line 884, in wait ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout) File "C:\Users\sasch\AppData\Local\Programs\Python\Python39\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait res = _winapi.WaitForMultipleObjects(L, False, timeout) ValueError: need at most 63 handles, got a sequence of length 66 ``` ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45077> _______________________________________ From report at bugs.python.org Wed Sep 1 09:49:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 13:49:26 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1630504166.97.0.204690231411.issue43592@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: x86-64 macOS 3.10: https://buildbot.python.org/all/#/builders/681/builds/345 ====================================================================== FAIL: test_multiprocessing_pool_circular_import (test.test_importlib.test_threaded_import.ThreadedImportTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/test_importlib/test_threaded_import.py", line 258, in test_multiprocessing_pool_circular_import script_helper.assert_python_ok(fn) File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/support/script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/support/script_helper.py", line 145, in _assert_python res.fail(cmd_line) File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/support/script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" AssertionError: Process return code is 1 command line: ['/Users/buildbot/buildarea/3.10.billenstein-macos/build/python.exe', '-X', 'faulthandler', '-I', '/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/test_importlib/partial/pool_in_threads.py'] stdout: --- --- stderr: --- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static w.start() File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/process.py", line 121, in start File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/popen_spawn_posix.py", line 32, in __init__ File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/popen_spawn_posix.py", line 53, in _launch OSError: [Errno 24] Too many open files /Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 120 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' /Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-klnfwvgv': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/buildbot/buildarea/3.10.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-phgypx9f': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) --- ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43592> _______________________________________ From report at bugs.python.org Wed Sep 1 09:54:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 13:54:52 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1630504492.22.0.399936094683.issue43592@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > x86-64 macOS 3.10: https://buildbot.python.org/all/#/builders/681/builds/345 On this machine, RLIMIT_NOFILE soft limit is 256. test.pythoninfo: resource.RLIMIT_NOFILE: (256, 9223372036854775807) platform.platform: macOS-11.5.2-x86_64-i386-64bit socket.hostname: mattb-mbp2 All limits: resource.RLIMIT_AS: (9223372036854775807, 9223372036854775807) resource.RLIMIT_CORE: (0, 9223372036854775807) resource.RLIMIT_CPU: (9223372036854775807, 9223372036854775807) resource.RLIMIT_DATA: (9223372036854775807, 9223372036854775807) resource.RLIMIT_FSIZE: (9223372036854775807, 9223372036854775807) resource.RLIMIT_MEMLOCK: (9223372036854775807, 9223372036854775807) resource.RLIMIT_NOFILE: (256, 9223372036854775807) resource.RLIMIT_NPROC: (2784, 4176) resource.RLIMIT_RSS: (9223372036854775807, 9223372036854775807) resource.RLIMIT_STACK: (67104768, 67104768) resource.pagesize: 4096 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43592> _______________________________________ From report at bugs.python.org Wed Sep 1 09:56:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 01 Sep 2021 13:56:08 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1630504568.65.0.764856771507.issue43592@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Try setting the following: $ sudo sysctl -w kern.maxfiles=65536 $ sudo sysctl -w kern.maxfilesperproc=65536 $ sudo ulimit -n 65536 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43592> _______________________________________ From report at bugs.python.org Wed Sep 1 10:10:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 01 Sep 2021 14:10:58 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1630505458.21.0.800353529011.issue43592@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Before you do it, check the defaults with: $ launchctl limit maxfiles I'm curious. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43592> _______________________________________ From report at bugs.python.org Wed Sep 1 10:27:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 14:27:00 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630506420.45.0.369803418049.issue45061@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Christian Tismer: "What about an even more flexible solution? A debug option could memorize always the last object deallocated and give full info (the object's repr) before the crash would happen." Bugs in object_dealloc() are rare. Apart None, True and False, do you know other objects which must not be deleted? Calling repr(obj) can crash during late Python finalization for many reasons. It is slow and can consume significant memory. Not all object types detect loops (a container storing indirectly itself) and so it can fail with a MemoryError: repr() is not "safe". Using gdb, it is easy to dump the object currently being deleted: go the object_dealloc() frame and use "print self" command. Example using attached os_uname_refcount_bug.patch: ------------ $ gdb ./python (...) (gdb) run >>> import os; os.uname() >>> exit() Debug memory block at address p=0x886e60: API '' 0 bytes originally requested The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfd): at p-7: 0x00 *** OUCH at p-6: 0x00 *** OUCH at p-5: 0x00 *** OUCH at p-4: 0x00 *** OUCH at p-3: 0x00 *** OUCH at p-2: 0x00 *** OUCH at p-1: 0x00 *** OUCH Because memory is corrupted at the start, the count of bytes requested may be bogus, and checking the trailing pad bytes may segfault. The 8 pad bytes at tail=0x886e60 are not all FORBIDDENBYTE (0xfd): at tail+0: 0x00 *** OUCH at tail+1: 0x00 *** OUCH at tail+2: 0x00 *** OUCH at tail+3: 0x00 *** OUCH at tail+4: 0x00 *** OUCH at tail+5: 0x00 *** OUCH at tail+6: 0x00 *** OUCH at tail+7: 0x00 *** OUCH Enable tracemalloc to get the memory block allocation traceback Fatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API '', verified using API 'o' Python runtime state: finalizing (tstate=0x00000000008e1a80) Current thread 0x00007ffff7c24740 (most recent call first): Garbage-collecting <no Python frame> Program received signal SIGABRT, Aborted. 0x00007ffff7c662a2 in raise () from /lib64/libc.so.6 (...) (gdb) frame 9 #9 0x0000000000499dd7 in object_dealloc (self=True) at Objects/typeobject.c:4497 4497 Py_TYPE(self)->tp_free(self); (gdb) print self $2 = True ------------ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Wed Sep 1 11:06:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:06:03 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630508763.63.0.803154384827.issue44895@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I changed dash_R_cleanup to put the sys._clear_type_cache() after clear_caches() and the leak is gone Aha! The order of function calls in dash_R_cleanup() matters. Calling sys._clear_type_cache() at the end of dash_R_cleanup() perfectly makes sense. If you do that, please add a comment to explain that the order matters. For example, the code about ABC classes is likely to modify classes. About the gc_collect() call, I dislike calling it in clear_caches() and then again in dash_R_cleanup(). I would even prefer to *remove* it from both functions and call it explicitly at the call site: in dash_R() and in runtest.py. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 11:14:17 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Wed, 01 Sep 2021 15:14:17 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630509257.89.0.892173309751.issue45075@roundup.psfhosted.org> Chris Jerdonek <chris.jerdonek at gmail.com> added the comment: It might be good to have consistency with what will be used for StackSummary so two different approaches to naming aren't used. By the way, frame_sum is another possibility since I see frame_gen being used. ---------- nosy: +chris.jerdonek _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 11:19:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 15:19:56 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630509596.0.0.943514415381.issue45075@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I'm not sure I follow. We don't have a similar issue with StackSummary - there is no interpreter type for "stack" that you can confuse it with. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 11:26:30 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 15:26:30 +0000 Subject: [issue45076] open "r+" problem In-Reply-To: <1630497380.88.0.961026516524.issue45076@roundup.psfhosted.org> Message-ID: <1630509990.93.0.0301789706068.issue45076@roundup.psfhosted.org> Zachary Ware <zachary.ware at gmail.com> added the comment: Usage questions like this are better suited to the Users category at https://discuss.python.org/c/users/7 or the python-list at python.org mailing list. The write is buffered. If you want it to be written before you read, add `f.flush()` after the write; `f.tell()` causes an implicit flush. See also the `buffering` argument to `open`. ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45076> _______________________________________ From report at bugs.python.org Wed Sep 1 11:26:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:26:25 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630509985.41.0.676270321478.issue44895@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26554 pull_request: https://github.com/python/cpython/pull/28113 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 11:45:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:45:35 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630511135.38.0.740919195049.issue44895@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 679cb4781ea370c3b3ce40d3334dc404d7e9d92b by Victor Stinner in branch 'main': bpo-44895: libregrtest: refleak check clears types later (GH-28113) https://github.com/python/cpython/commit/679cb4781ea370c3b3ce40d3334dc404d7e9d92b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 11:48:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:48:46 +0000 Subject: [issue31962] test_importlib double free or corruption In-Reply-To: <1510001792.72.0.213398074469.issue31962@psf.upfronthosting.co.za> Message-ID: <1630511326.59.0.678780093383.issue31962@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I close the issue as out of date, since there is no activity for 4 years. Maybe it was fixed in the meanwhile. If it's not the case, please reopen the issue. If someone can still reproduce the issue, it would help to write a short reproducer script based on the test causing the crash. ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31962> _______________________________________ From report at bugs.python.org Wed Sep 1 11:50:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:50:04 +0000 Subject: [issue39326] Python-3.8.1 "test_importlib" failed In-Reply-To: <1578977546.19.0.0039726161306.issue39326@roundup.psfhosted.org> Message-ID: <1630511404.32.0.562869315368.issue39326@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Can you please attach the output log of the test? Since the original reporter didn't reply, we cannot investigate the issue and I close it. If you still have the issue, please reopen the issue with the full test output (attached as a file). ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39326> _______________________________________ From report at bugs.python.org Wed Sep 1 11:54:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:54:48 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x Message-ID: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: Since build 305 (commit a40675c659cd8c0699f85ee9ac31660f93f8c2f5), test_importlib fails on AMD64 Windows8.1 Non-Debug 3.x: https://buildbot.python.org/all/#/builders/405/builds/305 The last successful build wa the build 304 (commit ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7). Sadly, the test doesn't report the 'actual' variable value when the test fails. ====================================================================== FAIL: test_read_bytes (test.test_importlib.test_files.OpenNamespaceTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_importlib\test_files.py", line 14, in test_read_bytes assert actual == b'Hello, UTF-8 world!\n' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ---------- components: Tests messages: 400847 nosy: brett.cannon, jaraco, vstinner priority: normal severity: normal status: open title: test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 11:56:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 15:56:22 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630511782.27.0.363719914062.issue44895@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: With your patch I don't see a leak for refleak.py, but I still see one for ./python.exe -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory -F -j1 (once I remove the @skip on test_no_hang_on_context_chain_cycle2). However, if I make this change it looks better: --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -90,8 +90,9 @@ def get_pooled_int(value): for i in rep_range: test_func() - dash_R_cleanup(fs, ps, pic, zdc, abcs) - support.gc_collect() + for i in range(3): + dash_R_cleanup(fs, ps, pic, zdc, abcs) + support.gc_collect() ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 11:57:28 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Wed, 01 Sep 2021 15:57:28 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630511848.94.0.691791021439.issue45075@roundup.psfhosted.org> Chris Jerdonek <chris.jerdonek at gmail.com> added the comment: I was suggesting keeping more similarity between FrameSummary and StackSummary in addition to differentiating frame from FrameSummary. Since stack is used for StackSummary, frame_sum is more similar than f_summary while still providing the differentiation. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 11:58:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:58:01 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630511881.8.0.386836937888.issue45078@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Interesting commits from: $ git log ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7..a40675c659cd8c0699f85ee9ac31660f93f8c2f5 commit aaa83cdfab6817446285e631232f64b394ac6791 Author: Jason R. Coombs <jaraco at jaraco.com> Date: Thu Jul 29 21:05:05 2021 -0400 bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) * bpo-44771: Apply changes from importlib_resources at 3b24bd6307 * Add blurb * Exclude namespacedata01 from eol conversion. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 11:59:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 15:59:31 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1630511971.39.0.823043296957.issue44771@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_importlib.test_read_bytes() is failing for 1 month on AMD64 Windows8.1 Non-Debug 3.x. Please see bpo-45078, the regression may be caused by the commit aaa83cdfab6817446285e631232f64b394ac6791. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44771> _______________________________________ From report at bugs.python.org Wed Sep 1 12:01:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 16:01:09 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630512069.37.0.0464896680992.issue45078@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Maybe Git does change the end of line of Lib/test/test_importlib/namespacedata01/utf-8.file file, even if .gitattributes contains: "Lib/test/test_importlib/namespacedata01/* -text" ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 12:13:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 16:13:43 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630512823.92.0.866941971935.issue44895@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > (once I remove the @skip on test_no_hang_on_context_chain_cycle2). Oh. I forgot that the test is still skipped! > With your patch I don't see a leak for refleak.py, but I still see one for > ./python.exe -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory -F -j1 If I apply attached strict_refleak_check.patch and I remove @unittest.skip("See issue 44895") of test_no_hang_on_context_chain_cycle2(), I get: $ ./python -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory (...) test_exceptions leaked [6, -6, 6] references, sum=6 (...) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 12:18:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 16:18:25 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630513105.04.0.166396827997.issue44895@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I changed it to + for i in range(2): + dash_R_cleanup(fs, ps, pic, zdc, abcs) + support.gc_collect() (loop twice instead of 3 times) and that seems fine too. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 12:35:43 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 01 Sep 2021 16:35:43 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630469128.22.0.684725505166.issue45020@roundup.psfhosted.org> Message-ID: <CALFfu7D9Jvk6tRy+51gJjzfpWLCHTmN909fc-uAePxAT861krA@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Tue, Aug 31, 2021 at 10:05 PM Inada Naoki <report at bugs.python.org> wrote: > I don't want all frozen header files to be committed in git repository. > Can't we just build them during build process? That's a good point (and an interesting one). Only two of the frozen modules are necessary (_frozen_importlib_external and _frozen_importlib_external, to bootstrap the import system). So for those two it makes sense to have them in the git repository. For all the rest it isn't necessary. The only advantage is that contributors don't have to think about them and they will be guaranteed to be there. However, if someone clones the repo they have to build Python, so the frozen modules will get created anyway at that point. So I'm fine with not committing all those modules. This will require that all those files be added to the .gitignore file. (I'll update my PR accordingly.) -eric ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 1 12:36:57 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 01 Sep 2021 16:36:57 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630433679.71.0.35583706938.issue45020@roundup.psfhosted.org> Message-ID: <CALFfu7A=uw9kdnhTZVC8dpTpH5y=wY6F=dWLeZQdXpHSgRE2Hg@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Tue, Aug 31, 2021 at 12:14 PM Brett Cannon <report at bugs.python.org> wrote: > > set __file__ (and __path__) on frozen modules? > > See https://bugs.python.org/issue21736 Great! I'll take a look. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 1 12:43:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 16:43:27 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630514607.19.0.522533024964.issue44895@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: Added file: https://bugs.python.org/file50251/strict_refleak_check.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ From report at bugs.python.org Wed Sep 1 12:53:41 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 01 Sep 2021 16:53:41 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? Message-ID: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> New submission from Arcadiy Ivanov <arcadiy at ivanov.biz>: The following versions only contain tarballs with no Windows artifacts available. Is the build system OK? https://www.python.org/ftp/python/3.8.12/ https://www.python.org/ftp/python/3.8.11/ .10 is fine: https://www.python.org/ftp/python/3.8.10/ Latest 3.9 is OK as well. ---------- components: Windows messages: 400857 nosy: arcivanov, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Wed Sep 1 12:54:27 2021 From: report at bugs.python.org (Leopold Talirz) Date: Wed, 01 Sep 2021 16:54:27 +0000 Subject: [issue45080] functools._HashedSeq implements __hash__ but not __eq__ Message-ID: <1630515267.9.0.090925115847.issue45080@roundup.psfhosted.org> New submission from Leopold Talirz <leopold.talirz at epfl.ch>: Disclaimer: this is my first issue on the python bug tracker. Please feel free to close this issue and redirect this to a specific mailing list, if more appropriate. The implementation of `functools._HashedSeq` [1] does not include an implementation of `__eq__` that takes advantage of the hash: ``` class _HashedSeq(list): """ This class guarantees that hash() will be called no more than once per element. This is important because the lru_cache() will hash the key multiple times on a cache miss. """ __slots__ = 'hashvalue' def __init__(self, tup, hash=hash): self[:] = tup self.hashvalue = hash(tup) def __hash__(self): return self.hashvalue ``` As far as I can tell, the `_HashedSeq` object is used as a key for looking up values in the python dictionary that holds the LRU cache, and this lookup mechanism relies on `__eq__` over `__hash__` (besides shortcuts for objects with the same id, etc.). This can cause potentially expensive `__eq__` calls on the arguments of the cached function and I wonder whether this is intended? Here is a short example code to demonstrate this: ``` from functools import _HashedSeq class CompList(list): """Hashable list (please forgive)""" def __eq__(self, other): print("equality comparison") return super().__eq__(other) def __hash__(self): return hash(tuple(self)) args1=CompList((1,2,3)) # represents function arguments passed to lru_cache args2=CompList((1,2,3)) # identical content but different object hs1=_HashedSeq( (args1,)) hs2=_HashedSeq( (args2,)) hs1 == hs2 # True, prints "equality comparison" d={} d[hs1] = "cached" d[hs2] # "cached", prints "equality comparison" ``` Adding the following to the implementation of `_HashedSeq` gets rid of the calls to `__eq__`: ``` def __eq__(self, other): return self.hashvalue == other.hashvalue ``` Happy to open a PR for this. I'm certainly a bit out of my depth here, so apologies if that is all intended behavior. [1] https://github.com/python/cpython/blob/679cb4781ea370c3b3ce40d3334dc404d7e9d92b/Lib/functools.py#L432-L446 ---------- components: Library (Lib) messages: 400858 nosy: leopold.talirz priority: normal severity: normal status: open title: functools._HashedSeq implements __hash__ but not __eq__ type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45080> _______________________________________ From report at bugs.python.org Wed Sep 1 12:57:03 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 16:57:03 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630515423.54.0.18982834283.issue45079@roundup.psfhosted.org> Zachary Ware <zachary.ware at gmail.com> added the comment: 3.8 is in security-only maintenance mode, which means we no longer provide binary installers for this version. If you need binary installers, we highly recommend updating to a version in bugfix maintenance mode, which currently means 3.9. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Wed Sep 1 12:59:52 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Wed, 01 Sep 2021 16:59:52 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630515592.65.0.735619796095.issue45079@roundup.psfhosted.org> Arcadiy Ivanov <arcadiy at ivanov.biz> added the comment: Nevermind. Looks like the policy is not to build binaries once in security fixes only mode. I guess the build bot gets tired or something... ---------- resolution: not a bug -> wont fix _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Wed Sep 1 13:15:44 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Wed, 01 Sep 2021 17:15:44 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630516544.24.0.409042802017.issue45075@roundup.psfhosted.org> Chris Jerdonek <chris.jerdonek at gmail.com> added the comment: Or frame_info (more readable), since FrameSummary is proposed to be "Information about a single frame from a traceback." ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 13:42:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 17:42:57 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630518177.72.0.299393744498.issue45075@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Yes, frame_info is good. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Wed Sep 1 13:58:34 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 01 Sep 2021 17:58:34 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630519114.35.0.112077740489.issue45078@roundup.psfhosted.org> Change by Filipe La?ns <lains at riseup.net>: ---------- nosy: +FFY00 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 14:16:39 2021 From: report at bugs.python.org (Artem) Date: Wed, 01 Sep 2021 18:16:39 +0000 Subject: [issue39758] StreamWriter.wait_closed() can hang indefinitely. In-Reply-To: <1582713366.75.0.743984348325.issue39758@roundup.psfhosted.org> Message-ID: <1630520199.77.0.510654291584.issue39758@roundup.psfhosted.org> Artem <doomedseer at GMail.com> added the comment: See this issue on 3.9.6 No SSL, but plain sockets. This seems to appear when writer.write/writer.drain was cancelled, and writer.close/writer.wait_closed called after this. ---------- nosy: +aeros, seer versions: +Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39758> _______________________________________ From report at bugs.python.org Wed Sep 1 15:43:23 2021 From: report at bugs.python.org (Tim Peters) Date: Wed, 01 Sep 2021 19:43:23 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630525403.49.0.277695026051.issue34561@roundup.psfhosted.org> Tim Peters <tim at python.org> added the comment: I created a PR that implements the powersort merge strategy: https://github.com/python/cpython/pull/28108 Across all the time this issue report has been open, that strategy continues to be the top contender. Enough already ;-) It's indeed a more difficult change to make to the code, but that's in relative terms. In absolute terms, it's not at all a hard change. Laurent, if you find that some variant of ShiversSort actually runs faster than that, let us know here! I'm a big fan of Vincent's innovations too, but powersort seems to do somewhat better "on average" than even his length-adaptive ShiversSort (and implementing that too would require changing code outside of merge_collapse()). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34561> _______________________________________ From report at bugs.python.org Wed Sep 1 16:00:28 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 01 Sep 2021 20:00:28 +0000 Subject: [issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i In-Reply-To: <1630466357.81.0.93174296975.issue45069@roundup.psfhosted.org> Message-ID: <1630526428.81.0.769444762631.issue45069@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: What problem are you reporting here? Python 3.9.2 is no longer current nor supported; the most recent release is 3.9.7, which, among many other changes, now uses OpenSSL 1.1.1l. https://www.python.org/downloads/ https://www.python.org/dev/peps/pep-0596/ https://www.python.org/downloads/ ---------- nosy: +ned.deily resolution: -> out of date status: open -> pending versions: +Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45069> _______________________________________ From report at bugs.python.org Wed Sep 1 16:46:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 20:46:12 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using In-Reply-To: <1620580530.62.0.599288030317.issue44091@roundup.psfhosted.org> Message-ID: <1630529172.82.0.845333009652.issue44091@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: While we're changing code objects, perhaps consider this as well? ---------- nosy: +gvanrossum, iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44091> _______________________________________ From report at bugs.python.org Wed Sep 1 16:59:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 01 Sep 2021 20:59:53 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using In-Reply-To: <1620580530.62.0.599288030317.issue44091@roundup.psfhosted.org> Message-ID: <1630529993.31.0.780652308472.issue44091@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: This sounds like a project requiring a considerable amount of plumbing to get the info from where it's available to where it's needed. For example, importlib reads the PYC file, checks the header, and then passes the rest of the file to marshal.loads(), which creates the (nested) code objects. Similarly, when reading the PY file, the compile() builtin is called to create the code objects without access to metadata other than filename. I also question whether the software updates that fall prey to this issue are being done the right way -- maybe the server should be stopped before moving the new files in place. :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44091> _______________________________________ From report at bugs.python.org Wed Sep 1 17:06:11 2021 From: report at bugs.python.org (Julian Fortune) Date: Wed, 01 Sep 2021 21:06:11 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ Message-ID: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> New submission from Julian Fortune <juliandfortune at gmail.com>: I believe [`bpo-44806: Fix __init__ in subclasses of protocols`](https://github.com/python/cpython/pull/27545) has caused a regression when using a Dataclass. In Python `3.9.7`, a `dataclass` that inherits from a subclass of `typing.Protocol` (i.e., a user-defined protocol), does not have the correct `__init__`. ### Demonstration ```python from dataclasses import dataclass from typing import Protocol class P(Protocol): pass @dataclass class B(P): value: str print(B("test")) ``` In `3.9.7`: ```shell Traceback (most recent call last): File "test.py", line 11, in <module> print(B("test")) TypeError: B() takes no arguments ``` In `3.9.6`: ```shell B(value='test') ``` ### Affected Projects - [dbt](https://github.com/dbt-labs/dbt/issues/3843) ---------- components: Library (Lib) messages: 400868 nosy: julianfortune priority: normal severity: normal status: open title: dataclasses that inherit from Protocol subclasses have wrong __init__ type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Wed Sep 1 17:06:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 21:06:16 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using In-Reply-To: <1620580530.62.0.599288030317.issue44091@roundup.psfhosted.org> Message-ID: <1630530376.51.0.845021590945.issue44091@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: It's not only a software updates issue - these kinds of problems show up for developers when they change the code on disk while a program is running and some traceback or pdb show code from the disk which is confusing. I also saw an issue about changing directory in pdb and picking up a module of the same name in a different path (because the filename is relative). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44091> _______________________________________ From report at bugs.python.org Wed Sep 1 17:08:17 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 01 Sep 2021 21:08:17 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using In-Reply-To: <1630530376.51.0.845021590945.issue44091@roundup.psfhosted.org> Message-ID: <CAP7+vJJyfQx=QV_Kiwn_czLxKiKVg1y4753gO3fC5Wdhu9+oag@mail.gmail.com> Guido van Rossum <guido at python.org> added the comment: All legit cases, I agree, but are they worth the considerable work? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44091> _______________________________________ From report at bugs.python.org Wed Sep 1 17:30:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 21:30:22 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() Message-ID: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: Since the ctypes module was added to the stdlib (commit babddfca758abe34ff12023f63b18d745fae7ca9 in 2006), ctypes.c_buffer() was an alias to ctypes.create_string_buffer(). The implementation contains a commented deprecation: def c_buffer(init, size=None): ## "deprecated, use create_string_buffer instead" ## import warnings ## warnings.warn("c_buffer is deprecated, use create_string_buffer instead", ## DeprecationWarning, stacklevel=2) return create_string_buffer(init, size) I propose to start to deprecate ctypes.c_buffer(): use ctypes.create_string_buffer() directly. In older ctypes version, the function was called c_string(): it's still mentioned in the ctypes documentation. This legacy is confusion, and it's time to simplify the API to provide a single function. ---------- components: ctypes messages: 400871 nosy: vstinner priority: normal severity: normal status: open title: ctypes: Deprecate c_buffer() alias to create_string_buffer() versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Wed Sep 1 17:31:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 21:31:48 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630531908.92.0.0270740971971.issue45082@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26555 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28114 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Wed Sep 1 17:44:44 2021 From: report at bugs.python.org (otn) Date: Wed, 01 Sep 2021 21:44:44 +0000 Subject: [issue45076] open "r+" problem In-Reply-To: <1630497380.88.0.961026516524.issue45076@roundup.psfhosted.org> Message-ID: <1630532684.26.0.27427014313.issue45076@roundup.psfhosted.org> otn <ootani.takashi at gmail.com> added the comment: It works correct for ver2.6, and also "rb+". Buffering procsess should work the same as those case. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45076> _______________________________________ From report at bugs.python.org Wed Sep 1 17:46:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 21:46:35 +0000 Subject: [issue45083] Incorrect exception output in C Message-ID: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: iritkatriel at Irits-MBP cpython % cat exc.py class A: class B: class E(Exception): pass raise A.B.E() iritkatriel at Irits-MBP cpython % cat test.py import exc iritkatriel at Irits-MBP cpython % ./python.exe test.py Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/test.py", line 2, in <module> import exc ^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/exc.py", line 7, in <module> raise A.B.E() ^^^^^^^^^^^^^ exc.E ============== See the last line of the output: there is no such thing as exc.E. There is exc.A.B.E. The traceback module doesn't have this issue: iritkatriel at Irits-MBP cpython % cat test.py import traceback try: import exc except Exception as e: traceback.print_exception(e) iritkatriel at Irits-MBP cpython % ./python.exe test.py Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/test.py", line 5, in <module> import exc ^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/exc.py", line 7, in <module> raise A.B.E() ^^^^^^^^^^^^^ exc.A.B.E ---------- components: Interpreter Core messages: 400873 nosy: iritkatriel priority: normal severity: normal status: open title: Incorrect exception output in C type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 1 17:47:12 2021 From: report at bugs.python.org (Stanislav Beblo) Date: Wed, 01 Sep 2021 21:47:12 +0000 Subject: [issue39758] StreamWriter.wait_closed() can hang indefinitely. In-Reply-To: <1582713366.75.0.743984348325.issue39758@roundup.psfhosted.org> Message-ID: <1630532832.23.0.804185199716.issue39758@roundup.psfhosted.org> Change by Stanislav Beblo <beblostanislav at gmail.com>: ---------- components: +Build, C API, Parser, Tests, email nosy: +barry, lys.nikolaou, pablogsal, r.david.murray type: behavior -> performance versions: +Python 3.10, Python 3.11 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39758> _______________________________________ From report at bugs.python.org Wed Sep 1 17:51:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 01 Sep 2021 21:51:44 +0000 Subject: [issue39758] StreamWriter.wait_closed() can hang indefinitely. In-Reply-To: <1582713366.75.0.743984348325.issue39758@roundup.psfhosted.org> Message-ID: <1630533104.0.0.570753916884.issue39758@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- components: -Build, C API, Parser, Tests, email nosy: -pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39758> _______________________________________ From report at bugs.python.org Wed Sep 1 17:58:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 21:58:56 +0000 Subject: [issue45084] urllib.parse: remove deprecated functions (splittype, to_bytes, etc.) Message-ID: <1630533536.1.0.485805644066.issue45084@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: bpo-27485 deprecated the following urllib.parse undocumented functions in Python 3.8: * splitattr() * splithost() * splitnport() * splitpasswd() * splitport() * splitquery() * splittag() * splittype() * splituser() * splitvalue() * to_bytes() (commit 0250de48199552cdaed5a4fe44b3f9cdb5325363) I propose to remove them. See attached PR. Note: The Quoter class is only deprecated since Python 3.11. It should be kept around for 2 releases (not removed before Python 3.13): PEP 387. ---------- components: Library (Lib) messages: 400874 nosy: vstinner priority: normal severity: normal status: open title: urllib.parse: remove deprecated functions (splittype, to_bytes, etc.) versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45084> _______________________________________ From report at bugs.python.org Wed Sep 1 18:06:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:06:55 +0000 Subject: [issue45084] urllib.parse: remove deprecated functions (splittype, to_bytes, etc.) In-Reply-To: <1630533536.1.0.485805644066.issue45084@roundup.psfhosted.org> Message-ID: <1630534015.79.0.673629961791.issue45084@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26556 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28115 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45084> _______________________________________ From report at bugs.python.org Wed Sep 1 18:07:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:07:44 +0000 Subject: [issue27485] urllib.splitport -- is it official or not? In-Reply-To: <1468260123.51.0.000787877209911.issue27485@psf.upfronthosting.co.za> Message-ID: <1630534064.5.0.523453267936.issue27485@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Follow-up: I created bpo-45084 to remove these undocumented and deprecated functions in Python 3.11. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27485> _______________________________________ From report at bugs.python.org Wed Sep 1 18:16:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:16:34 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630534594.13.0.126451872576.issue40360@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +vstinner nosy_count: 11.0 -> 12.0 pull_requests: +26557 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28116 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 18:23:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:23:26 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630535006.86.0.908531210815.issue40360@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created PR 28116 to deprecate the lib2to3 package: replace PendingDeprecationWarning to DeprecationWarning. In 2021, I don't think that we should keep the 2to3 tool in the stdlib. Python 2 reached end of line 1 year ago. For the lib2to3 *parser*, IMO it would be better to maintain it outside the stdlib, and collaborate with other existing forks, like the parser used by Black. The change is only about *deprecating* lib2to3, not *remove* it. For the removal, we should check if major projects which used it moved to something else. It's kind of a shame that Python stdlib (lib2to3) cannot parse valid Python 3.10 code :-( IMO it's better to deprecate (and then remove) lib2to3. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 18:23:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:23:58 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630535038.68.0.752965542192.issue40360@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I retarget this issue to Python 3.11, since lib2to3 is *not* deprecated in Python 3.10. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 18:29:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:29:18 +0000 Subject: [issue39353] Deprecate the binhex module In-Reply-To: <1579166085.65.0.30693146669.issue39353@roundup.psfhosted.org> Message-ID: <1630535358.5.0.777979763651.issue39353@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Deprecate the binhex module, binhex4 and hexbin4 standards -> Deprecate the binhex module _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39353> _______________________________________ From report at bugs.python.org Wed Sep 1 18:32:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:32:32 +0000 Subject: [issue39353] Deprecate the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1579166085.65.0.30693146669.issue39353@roundup.psfhosted.org> Message-ID: <1630535552.05.0.812180413272.issue39353@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Deprecate the binhex module -> Deprecate the binhex module, binhex4 and hexbin4 standards _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39353> _______________________________________ From report at bugs.python.org Wed Sep 1 18:44:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:44:58 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards Message-ID: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: The binhex module was deprecated in Python 3.9 by bpo-39353 (commit beea26b57e8c80f1eff0f967a0f9d083a7dc3d66). I propose to remove it: see attached PR. The PR also removes the following binascii functions, also deprecated in Python 3.9: * a2b_hqx(), b2a_hqx() * rlecode_hqx(), rledecode_hqx() The binascii.crc_hqx() function remains available. ---------- components: Library (Lib) messages: 400878 nosy: vstinner priority: normal severity: normal status: open title: Remove the binhex module, binhex4 and hexbin4 standards versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Wed Sep 1 18:46:46 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 01 Sep 2021 22:46:46 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630536406.06.0.887521384308.issue45081@roundup.psfhosted.org> Change by Eric V. Smith <eric at trueblade.com>: ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Wed Sep 1 18:49:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 01 Sep 2021 22:49:34 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1630535038.68.0.752965542192.issue40360@roundup.psfhosted.org> Message-ID: <CAP7+vJ+GL4OHP5EQSdoAZqK_25i-4XFboboq8pBKt-O-O90g7Q@mail.gmail.com> Guido van Rossum <guido at python.org> added the comment: How come the deprecation didn't happen in 3.10? Were people just not interested? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 18:52:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:52:16 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630536736.38.0.288710888689.issue45085@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26558 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28117 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Wed Sep 1 18:52:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:52:50 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630536770.29.0.450882691768.issue45085@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also the PEP 594: Removing dead batteries from the standard library https://www.python.org/dev/peps/pep-0594/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Wed Sep 1 18:57:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 22:57:29 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630537049.07.0.432119850245.issue45085@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The binhex module was deprecated in Python 3.9 by bpo-39353 (commit beea26b57e8c80f1eff0f967a0f9d083a7dc3d66). I have been asked there to keep binascii.crc_hqx() (not deprecated it). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Wed Sep 1 19:03:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 23:03:19 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630537399.22.0.0255551943061.issue45085@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: In bpo-39353, Serhiy Storchaka proposed: "But it would be nice to create a separate package on PyPI that provides such functionality before removing it from the stdlib." The purpose of the PEP 594 is to reduce the Python maintenance burden. Publishing a module on PyPI introduces a new maintenance burden, even if there is no plan to ever update the package. The PEP 594 is still a draft. So far, there was no agreement on the strategy to remove anything from the stdlib. In past, other stdlib modules have been removed silently and nobody complained. Likely because nobody used them. For example, the the Python 2 CDROM module of the old Lib/plat-linux2/ directory (CDROM.py, DLFCN.py, IN.py, regen, TYPES.py). If someone uses the binhex module, I suggest users to create a new project on PyPI to support binhex. Users who need binhex are likely the most motivated to *maintain* such code. You can start by copying Python 3.10 code. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Wed Sep 1 19:14:29 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 01 Sep 2021 23:14:29 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630538069.63.0.195946307881.issue40360@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: I think we just forgot to make the change in time. 3.11 is fine. We're not _maintaining_ lib2to3 or describing it as fit for any modern purpose regardless. It's just code that'll sit around in the back of the 3.10 stdlib but not be able to parse the new syntax in 3.10. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 19:32:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 23:32:13 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630539133.73.0.725173687829.issue37330@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26559 pull_request: https://github.com/python/cpython/pull/28118 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Wed Sep 1 19:32:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 23:32:54 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630539174.71.0.293959481895.issue37330@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I reopen the issue. I created PR 28118 to try again to remove the "U" mode in Python 3.11. ---------- resolution: fixed -> status: closed -> open versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Wed Sep 1 19:38:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Sep 2021 23:38:17 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630539496.99.0.209847267339.issue40360@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Guido: How come the deprecation didn't happen in 3.10? Were people just not interested? Well, if nobody deprecates it, it's not deprecated. It is simple as it it :-) IMO it's ok to only deprecate it in Python 3.11, unless Pablo *really* wants to deprecate lib2to3 before just Python 3.10 final. I dislike adding new warnings between a beta1 release and the final release :-( In my experience, it *does* break projects which care of warnings. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 19:46:54 2021 From: report at bugs.python.org (=?utf-8?q?Edgar_Ram=C3=ADrez?=) Date: Wed, 01 Sep 2021 23:46:54 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630540014.96.0.116932667659.issue45081@roundup.psfhosted.org> Change by Edgar Ram?rez <edgarrm358 at gmail.com>: ---------- nosy: +edgarrmondragon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Wed Sep 1 19:52:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 23:52:04 +0000 Subject: [issue45083] Incorrect exception output in C In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630540324.89.0.741727202629.issue45083@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26560 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28119 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 1 19:57:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 01 Sep 2021 23:57:43 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630540663.8.0.676151413696.issue45083@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- title: Incorrect exception output in C -> Need to use the exception class qualname when rendering exception (in C code) _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 1 20:04:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 00:04:14 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630541054.45.0.941872787361.issue45083@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I've reproduced this on 3.9 and 3.10 as well. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 1 20:13:40 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 02 Sep 2021 00:13:40 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630541620.94.0.4152570716.issue45078@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: There is an issue where that file originally got EOL conversions, so all Windows buildbots were failing (issue44779). I'd thought we'd worked around the issue by pushing out a PR that deleted the file and ensuring it ran on the buildbots (https://github.com/python/cpython/pull/27436#issuecomment-890029487). I knew it was a risk, however, that either that PR failed to checkout on the buildbot, checked out on a different shard, or that another PR subsequently managed to check out the code without the .gitattributes fix. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 20:16:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 00:16:21 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630541781.67.0.0627562018556.issue37330@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > This breaks Samba's build: > https://bugzilla.samba.org/show_bug.cgi?id=14266 Samba has been updated in the meanwhile, buildtools/wafsamba/samba_utils.py: - function_code = node.read('rU', None) + function_code = node.read('r', None) https://github.com/samba-team/samba/blob/1209c89dcf6371bbfa4f3929a47a573ef2916c1a/buildtools/wafsamba/samba_utils.py#L692 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Wed Sep 1 20:17:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 00:17:51 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630541871.4.0.212555402564.issue37330@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > docutils is already fixed in the development version. I requested a release: https://sourceforge.net/p/docutils/bugs/364/ At 2019-07-22, G?nter Milde wrote: "Docutils 0.15 is released" (with the fix). The latest docutils version is 0.17.1. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Wed Sep 1 20:18:31 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 02 Sep 2021 00:18:31 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630541911.71.0.575884486702.issue45078@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: I'm going to attempt that technique again and see if it's sufficient to bypass the symptom. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 20:28:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 02 Sep 2021 00:28:49 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630542529.59.0.935129613821.issue45078@roundup.psfhosted.org> Change by Jason R. Coombs <jaraco at jaraco.com>: ---------- keywords: +patch pull_requests: +26561 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28120 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 20:40:43 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 02 Sep 2021 00:40:43 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630543243.27.0.711623475861.issue45078@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: I've submitted a PR that deletes the file and requested it be built by the buildbots, but I also see that that bot hasn't built anything in 7 days (https://buildbot.python.org/all/#/builders/405), so I'm not hopeful my request for it to build that change will have any effect on that builder. ---------- stage: patch review -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 20:53:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 02 Sep 2021 00:53:52 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630544032.02.0.256620363502.issue40360@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: We can add to the 3.10 docs that it is deprecated without any code change. And in 3.11 we can add a warning. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Wed Sep 1 20:58:38 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 02 Sep 2021 00:58:38 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1630544318.96.0.0358032939026.issue45078@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: I'm not confident that I can get the message to the buildbot, so I sent a message to python-buildbots at python.org requesting to run the workaround on the buildbot. The message was flagged for moderation. My hope is that eventually goes through and will address the issue. ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Wed Sep 1 21:47:51 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 02 Sep 2021 01:47:51 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1630547271.72.0.653440849622.issue45067@roundup.psfhosted.org> Senthil Kumaran <senthil at python.org> added the comment: Here is the output of make with relevant lines. CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build running build running build_ext building '_curses' extension gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -DHAVE_NCURSESW=1 -I/usr/include/ncursesw -I./Include -I. -I/usr/local/include -I/local/home/senthilx/cpython/Include -I/local/home/senthilx/cpython -c /local/home/senthilx/cpython/Modules/_cursesmodule.c -o build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_cursesmodule.o -DPy_BUILD_CORE_MODULE /local/home/senthilx/cpython/Modules/_cursesmodule.c: In function ?_curses_color_content_impl?: /local/home/senthilx/cpython/Modules/_cursesmodule.c:149:41: error: implicit declaration of function ?extended_color_content?; did you mean ?_curses_color_content?? [-Werror=implicit-function-declaration] #define _COLOR_CONTENT_FUNC extended_color_content ^ /local/home/senthilx/cpython/Modules/_cursesmodule.c:2746:9: note: in expansion of macro ?_COLOR_CONTENT_FUNC? if (_COLOR_CONTENT_FUNC(color_number, &r, &g, &b) == ERR) { ^~~~~~~~~~~~~~~~~~~ /local/home/senthilx/cpython/Modules/_cursesmodule.c: In function ?_curses_init_color_impl?: /local/home/senthilx/cpython/Modules/_cursesmodule.c:147:41: error: implicit declaration of function ?init_extended_color?; did you mean ?initialize_color?? [-Werror=implicit-function-declaration] #define _CURSES_INIT_COLOR_FUNC init_extended_color ^ /local/home/senthilx/cpython/Modules/_cursesmodule.c:3194:29: note: in expansion of macro ?_CURSES_INIT_COLOR_FUNC? return PyCursesCheckERR(_CURSES_INIT_COLOR_FUNC(color_number, r, g, b), ^~~~~~~~~~~~~~~~~~~~~~~ /local/home/senthilx/cpython/Modules/_cursesmodule.c: In function ?_curses_init_pair_impl?: /local/home/senthilx/cpython/Modules/_cursesmodule.c:148:41: error: implicit declaration of function ?init_extended_pair?; did you mean ?use_extended_names?? [-Werror=implicit-function-declaration] #define _CURSES_INIT_PAIR_FUNC init_extended_pair ^ /local/home/senthilx/cpython/Modules/_cursesmodule.c:3222:9: note: in expansion of macro ?_CURSES_INIT_PAIR_FUNC? if (_CURSES_INIT_PAIR_FUNC(pair_number, fg, bg) == ERR) { ^~~~~~~~~~~~~~~~~~~~~~ /local/home/senthilx/cpython/Modules/_cursesmodule.c: In function ?_curses_pair_content_impl?: /local/home/senthilx/cpython/Modules/_cursesmodule.c:150:41: error: implicit declaration of function ?extended_pair_content?; did you mean ?_curses_pair_content?? [-Werror=implicit-function-declaration] #define _CURSES_PAIR_CONTENT_FUNC extended_pair_content ^ /local/home/senthilx/cpython/Modules/_cursesmodule.c:3868:9: note: in expansion of macro ?_CURSES_PAIR_CONTENT_FUNC? if (_CURSES_PAIR_CONTENT_FUNC(pair_number, &f, &b) == ERR) { ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors building '_curses_panel' extension gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -DHAVE_NCURSESW=1 -I/usr/include/ncursesw -I./Include -I. -I/usr/local/include -I/local/home/senthilx/cpython/Include -I/local/home/senthilx/cpython -c /local/home/senthilx/cpython/Modules/_curses_panel.c -o build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o gcc -pthread -shared build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o -L/usr/local/lib -lpanelw -lncursesw -o build/lib.linux-x86_64-3.11/_curses_panel.cpython-311-x86_64-linux-gnu.so *** WARNING: renaming "_curses_panel" since importing it failed: No module named '_curses' The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time Failed to build these modules: _curses Following modules built successfully but were removed because they could not be imported: _curses_panel running build_scripts copying and adjusting /local/home/senthilx/cpython/Tools/scripts/pydoc3 -> build/scripts-3.11 copying and adjusting /local/home/senthilx/cpython/Tools/scripts/idle3 -> build/scripts-3.11 copying and adjusting /local/home/senthilx/cpython/Tools/scripts/2to3 -> build/scripts-3.11 changing mode of build/scripts-3.11/pydoc3 from 644 to 755 changing mode of build/scripts-3.11/idle3 from 644 to 755 changing mode of build/scripts-3.11/2to3 from 644 to 755 renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11 renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11 renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Wed Sep 1 23:15:42 2021 From: report at bugs.python.org (Gregory Szorc) Date: Thu, 02 Sep 2021 03:15:42 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630552542.94.0.375767400946.issue44689@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: Oh, this might be my custom Modules file not passing the HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH define properly. I suspect I was working around this bug before by disabling the dyld bits. Sorry for the noise! (I should have reproduced with CPython's build system.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Wed Sep 1 23:42:45 2021 From: report at bugs.python.org (Gregory Szorc) Date: Thu, 02 Sep 2021 03:42:45 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630554164.99.0.979891152003.issue44689@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: I spoke too soon: you can reproduce this with CPython's build system and I think this is a legit regression. I think the function sniffing logic is subtly wrong. Here is the logic as written: #ifdef __APPLE__ #ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH #define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *) #else static bool (*_dyld_shared_cache_contains_path)(const char *path); #define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ _dyld_shared_cache_contains_path != NULL #endif #endif The fundamental problem is that HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH comes from configure. Configure is using the target settings to probe for function presence. If I set the deployment target to 10.9, it says `checking for _dyld_shared_cache_contains_path... no`. But if I set the deployment target to 11.0, it says `checking for _dyld_shared_cache_contains_path... yes`. Because we may be targeting a macOS without the function, the function appears as not available to configure. It may exist in the SDK, but it is masked behind availability checks for the test compile. The logic as written assumes that !HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH means the SDK doesn't contain the function at all. This just isn't true for SDKs >= 11.0. If you look at posixmodule.c, the logic for checking for function availability is typically this pattern: #ifdef __APPLE__ #ifdef HAVE_BUILTIN_AVAILABLE #define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *) #else #ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH #define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME (_dyld_shared_cache_contains_path != NULL) #endif #endif #endif This other pattern also reveals another regression with this patch: __builtin_available() may not be available on older compilers. See issue42692. I'm unsure what "older compilers" actually is. But someone is bound to complain about this (if they haven't already). Do these build regressions warrant an unplanned 3.9.8 release? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Thu Sep 2 01:29:48 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 02 Sep 2021 05:29:48 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630560588.87.0.255479080703.issue45056@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: Added file: https://bugs.python.org/file50252/dump_unused_consts.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 01:30:08 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 02 Sep 2021 05:30:08 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630560608.43.0.422835001895.issue45056@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: Added file: https://bugs.python.org/file50253/unused_39.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 01:30:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 02 Sep 2021 05:30:28 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630560628.37.0.512290396791.issue45056@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: Added file: https://bugs.python.org/file50254/unused_310rc1.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 01:30:50 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 02 Sep 2021 05:30:50 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630560650.41.0.194380668731.issue45056@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: Added file: https://bugs.python.org/file50255/unused_trimmed.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 01:50:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Sep 2021 05:50:55 +0000 Subject: [issue45080] functools._HashedSeq implements __hash__ but not __eq__ In-Reply-To: <1630515267.9.0.090925115847.issue45080@roundup.psfhosted.org> Message-ID: <1630561855.95.0.0262632634614.issue45080@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: 1. self.hashvalue == other.hashvalue is not enough. Different tuples can have the same hash value, so you steel need to compare their context. 2. _HashedSeq is only used as a key in a dictionary. When you look up a key in dictionary, it compares hashes first. __eq__ is only called when hashes match. ---------- nosy: +rhettinger, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45080> _______________________________________ From report at bugs.python.org Thu Sep 2 01:58:31 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 02 Sep 2021 05:58:31 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630562311.52.0.289111789587.issue44689@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: I don't think we have ever claimed to support building on an older system with a newer SDK, as in building on 10.15 with an 11 SDK. I am sure there have been problems with trying to do this in the past for some releases. It *may* work but there are no guarantees. If you want to build on an older system you should use the SDK for that system even if a newer version of Xcode / Command Line Tools is released that provides the newer SDK. That said, I have no objection to trying to fix this issue but I think we should avoid claiming to support such configurations and I don't see this issue as needing to make a new release. I am willing to be convinced otherwise :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Thu Sep 2 02:17:56 2021 From: report at bugs.python.org (Shrikant Narasimhan) Date: Thu, 02 Sep 2021 06:17:56 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630563476.05.0.355074480762.issue45081@roundup.psfhosted.org> Change by Shrikant Narasimhan <shrikant.n at gmail.com>: ---------- nosy: +shrik _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 02:44:53 2021 From: report at bugs.python.org (Gregory Szorc) Date: Thu, 02 Sep 2021 06:44:53 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1630562311.52.0.289111789587.issue44689@roundup.psfhosted.org> Message-ID: <9C77ACC0-2607-48EE-88E1-B5517F0C0E5D@gmail.com> Gregory Szorc <gregory.szorc at gmail.com> added the comment: > On Sep 1, 2021, at 22:58, Ned Deily <report at bugs.python.org> wrote: > > I don't think we have ever claimed to support building on an older system with a newer SDK, as in building on 10.15 with an 11 SDK. My initial report was from a 10.15 Intel machine in GitHub Actions. My comment a few hours ago was from an 11.3 M1 cross-compiling to x86_64 and targeting 10.9 from a 11.X SDK. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Thu Sep 2 04:19:59 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 02 Sep 2021 08:19:59 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630570799.64.0.843650059614.issue45082@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: I'm +0 to this. Since this alias is not a big maintenance burden, I think we can use deprecation period longer than minimum 2 releases. In sdist files of the top5000 pypi packages, I found 18 packages using it including false positive (e.g. mypi just have it in pyi file). ``` $ rg -z -w c_buffer *.gz *.zip *.bz2 *.tgz Binary file Django-3.2.6.tar.gz matches (found "\u{0}" byte around offset 14) Binary file Wand-0.6.7.tar.gz matches (found "\u{0}" byte around offset 14) Binary file av-8.0.3.tar.gz matches (found "\u{0}" byte around offset 9) Binary file eth-hash-0.3.1.tar.gz matches (found "\u{0}" byte around offset 14) Binary file eth-account-0.5.5.tar.gz matches (found "\u{0}" byte around offset 14) Binary file eth_abi-2.1.1.tar.gz matches (found "\u{0}" byte around offset 14) Binary file eth-utils-1.10.0.tar.gz matches (found "\u{0}" byte around offset 14) Binary file grpcio-1.39.0.tar.gz matches (found "\u{0}" byte around offset 14) Binary file grpcio-tools-1.39.0.tar.gz matches (found "\u{0}" byte around offset 20) Binary file hexbytes-0.2.2.tar.gz matches (found "\u{0}" byte around offset 14) Binary file jedi-0.18.0.tar.gz matches (found "\u{0}" byte around offset 14) Binary file lxml-4.6.3.tar.gz matches (found "\u{0}" byte around offset 14) Binary file mypy-0.910.tar.gz matches (found "\u{0}" byte around offset 11) Binary file os_sys-2.1.4.tar.gz matches (found "\u{0}" byte around offset 13) Binary file playsound-1.3.0.tar.gz matches (found "\u{0}" byte around offset 14) Binary file pyarrow-5.0.0.tar.gz matches (found "\u{0}" byte around offset 14) Binary file pylint-2.10.2.tar.gz matches (found "\u{0}" byte around offset 14) Binary file pytype-2021.8.24.tar.gz matches (found "\u{0}" byte around offset 17) ``` ---------- nosy: +methane _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 04:29:14 2021 From: report at bugs.python.org (=?utf-8?q?D=C3=A1vid_Nemeskey?=) Date: Thu, 02 Sep 2021 08:29:14 +0000 Subject: [issue39816] More descriptive error message than "too many values to unpack" In-Reply-To: <1583091348.39.0.0422747327362.issue39816@roundup.psfhosted.org> Message-ID: <1630571354.16.0.254208112789.issue39816@roundup.psfhosted.org> D?vid Nemeskey <nemeskeyd at gmail.com> added the comment: +1. When starting out, I always got confused about this message ("too many values to unpack? Does that mean my function returned too many items, which could not be unpacked into the expected number? Oh no, the opposite..."). Also, please note that the stack trace usually shows the offending line (e.g. x, y, z = fn(...)), so it is easy to see how many values are _expected_. It would be even more helpful to (also) show how many we _got_. ---------- nosy: +nemeskeyd _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39816> _______________________________________ From report at bugs.python.org Thu Sep 2 04:32:43 2021 From: report at bugs.python.org (Leopold Talirz) Date: Thu, 02 Sep 2021 08:32:43 +0000 Subject: [issue45080] functools._HashedSeq implements __hash__ but not __eq__ In-Reply-To: <1630515267.9.0.090925115847.issue45080@roundup.psfhosted.org> Message-ID: <1630571563.18.0.611451544619.issue45080@roundup.psfhosted.org> Leopold Talirz <leopold.talirz at epfl.ch> added the comment: Thanks a lot for the clarification, I get it now (I think). > 2. _HashedSeq is only used as a key in a dictionary. When you look up a key in dictionary, it compares hashes first. __eq__ is only called when hashes match. I was looking at the docs [1] and [2] and didn't come across this. For me, this explanation of how __hash__ and __eq__ are used in the LRU cache would have been helpful to read in [1], but of course there is a tradeoff in how long to make docstrings. If it is already explained somewhere else in the docs, linking to that place from [1] could be useful. [1] https://docs.python.org/3/library/functools.html#functools.lru_cache [2] https://docs.python.org/3/reference/datamodel.html#object.__hash__ ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45080> _______________________________________ From report at bugs.python.org Thu Sep 2 04:33:07 2021 From: report at bugs.python.org (Rainald Koch) Date: Thu, 02 Sep 2021 08:33:07 +0000 Subject: [issue33426] [doc] Behavior of os.path.join does not match documentation In-Reply-To: <1525459146.45.0.682650639539.issue33426@psf.upfronthosting.co.za> Message-ID: <1630571587.15.0.850546144234.issue33426@roundup.psfhosted.org> Rainald Koch <Rainald.Koch at t-online.de> added the comment: Minimal changes that would largely reduce the likelihood of being misunderstood: Remove "intelligently" or replace "following" by "added after". ---------- nosy: +Rainald Koch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33426> _______________________________________ From report at bugs.python.org Thu Sep 2 04:52:39 2021 From: report at bugs.python.org (Christian Tismer) Date: Thu, 02 Sep 2021 08:52:39 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630572759.26.0.306291334144.issue45061@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: > Apart None, True and False, do you know other objects which must not be deleted? Yes, what I can think of is the immutable empty tuple singleton which is such a candidate to be forgotten. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Thu Sep 2 05:45:45 2021 From: report at bugs.python.org (Yurii Karabas) Date: Thu, 02 Sep 2021 09:45:45 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630575945.79.0.676657679311.issue45081@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 4.0 -> 5.0 pull_requests: +26562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28121 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 05:46:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 09:46:51 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630576011.24.0.683185847166.issue40360@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d589a7e7eb56196c05337d37417479375878b127 by Victor Stinner in branch 'main': bpo-40360: Deprecate the lib2to3 package (GH-28116) https://github.com/python/cpython/commit/d589a7e7eb56196c05337d37417479375878b127 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 05:57:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 09:57:13 +0000 Subject: [issue22764] object lifetime fragility in unittest tests In-Reply-To: <1414663065.15.0.782385301612.issue22764@psf.upfronthosting.co.za> Message-ID: <1630576633.01.0.137678590752.issue22764@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22764> _______________________________________ From report at bugs.python.org Thu Sep 2 06:00:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:00:38 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630576838.92.0.664747046904.issue40360@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26563 pull_request: https://github.com/python/cpython/pull/28122 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 06:04:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:04:40 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630577080.89.0.176690159574.issue40360@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: > We can add to the 3.10 docs that it is deprecated without any code change. This was already the case: https://docs.python.org/3/library/2to3.html#module-lib2to3 The wording was a bit clumsy so I rephrased in GH-28122. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 06:10:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:10:20 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630577420.01.0.36696465685.issue45085@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a8066087054417885db0a2dbdce2ddb2ac498247 by Victor Stinner in branch 'main': bpo-45085: Remove the binhex module (GH-28117) https://github.com/python/cpython/commit/a8066087054417885db0a2dbdce2ddb2ac498247 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Thu Sep 2 06:21:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:21:19 +0000 Subject: [issue35190] doc: collections.abc.Sequence cannot be used to test whether a class provides a particular interface In-Reply-To: <1541688086.42.0.788709270274.issue35190@psf.upfronthosting.co.za> Message-ID: <1630578079.4.0.907704753781.issue35190@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +easy title: collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue) -> doc: collections.abc.Sequence cannot be used to test whether a class provides a particular interface versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35190> _______________________________________ From report at bugs.python.org Thu Sep 2 06:21:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:21:21 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1630578081.78.0.141682071862.issue23864@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: See also issue35190. ---------- keywords: +easy -patch nosy: +iritkatriel title: issubclass without registration only works for "one-trick pony" collections ABCs. -> doc: issubclass without registration only works for "one-trick pony" collections ABCs. type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Thu Sep 2 06:24:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:24:56 +0000 Subject: [issue45085] Remove the binhex module, binhex4 and hexbin4 standards In-Reply-To: <1630536298.51.0.0911172102047.issue45085@roundup.psfhosted.org> Message-ID: <1630578296.99.0.944123235976.issue45085@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Agreed with Victor. I'd go with the "traditional" flow of PendingDeprecationWarning in 3.9, DeprecationWarning in 3.10, and removal in 3.11; but since we kept DeprecationWarning for two releases, it's pretty much the same and fine to remove it now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45085> _______________________________________ From report at bugs.python.org Thu Sep 2 06:27:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:27:59 +0000 Subject: [issue32766] 4.7.7. Function Annotations In-Reply-To: <1517767044.74.0.467229070634.issue32766@psf.upfronthosting.co.za> Message-ID: <1630578479.63.0.143521863359.issue32766@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Mistaken notion in tutorial _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32766> _______________________________________ From report at bugs.python.org Thu Sep 2 06:30:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:30:07 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630578607.65.0.979575314739.issue42255@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Dong-hee Na, you can't remove it in 3.12 per PEP 387: > Unless it is going through the deprecation process below, the behavior of an API must not change in an incompatible fashion between any two consecutive releases. Python's yearly release process (PEP 602) means that the deprecation period must last at least two years. and: > Wait for the warning to appear in at least two minor Python versions of the same major version. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Thu Sep 2 06:33:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:33:31 +0000 Subject: [issue41367] Popen Timeout raised on 3.6 but not on 3.8 In-Reply-To: <1595407379.06.0.696065311763.issue41367@roundup.psfhosted.org> Message-ID: <1630578811.06.0.322936088175.issue41367@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: 3.6 is no longer maintained, so even if there was a bug in 3.6 that was fixed in 3.8 we aren't going to be able to do anything about it. If nobody objects I will close this issue soon. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41367> _______________________________________ From report at bugs.python.org Thu Sep 2 06:42:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:42:44 +0000 Subject: [issue35693] test_httpservers fails In-Reply-To: <1547010094.25.0.275369600875.issue35693@roundup.psfhosted.org> Message-ID: <1630579364.4.0.449316440142.issue35693@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as 3.7 is no longer maintained and this problem was not reproduced in 3.8. ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35693> _______________________________________ From report at bugs.python.org Thu Sep 2 06:55:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 10:55:55 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module In-Reply-To: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> Message-ID: <1630580155.57.0.419476844036.issue44226@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing again. In addition to what Eric said, both 2.7 and 3.6 are no longer maintained so you will need to reproduce the issue on a current version (>= 3.8) for any of us to investigate it. ---------- nosy: +iritkatriel resolution: remind -> third party status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44226> _______________________________________ From report at bugs.python.org Thu Sep 2 06:58:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 10:58:04 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630580284.89.0.381369535816.issue37330@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 19ba2122ac7313ac29207360cfa864a275b9489e by Victor Stinner in branch 'main': bpo-37330: open() no longer accept 'U' in file mode (GH-28118) https://github.com/python/cpython/commit/19ba2122ac7313ac29207360cfa864a275b9489e ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Thu Sep 2 07:02:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 11:02:10 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630580530.16.0.517043757344.issue45056@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 55c4a92fc1abfe388335071f1d64b3addfa5793f by Inada Naoki in branch 'main': bpo-45056: Remove trailing unused constants from co_consts (GH-28109) https://github.com/python/cpython/commit/55c4a92fc1abfe388335071f1d64b3addfa5793f ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 07:02:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 11:02:41 +0000 Subject: [issue39241] Popen of python3.6 hangs on os.read(errpipe_read, 50000) In-Reply-To: <1578360908.03.0.624419556785.issue39241@roundup.psfhosted.org> Message-ID: <1630580561.19.0.237081932837.issue39241@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I'm closing this because 1. both 2.7 and 3.6 are no longer maintained 2. This is not an actual bug report (we don't know what the hanging code was doing) so there is no chance of reproducing it. If you are having problems with this in a current version (>= 3.8) please create a new issue with a reproducible example of failing code. If you need debugging assistance, python-list might be a more appropriate place than the bug tracker to ask for that. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39241> _______________________________________ From report at bugs.python.org Thu Sep 2 07:16:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 11:16:54 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1630581414.12.0.0794492485695.issue37330@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Let's see how it goes. In the worst case, we have time before Python 3.11 final to revert it one more time. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37330> _______________________________________ From report at bugs.python.org Thu Sep 2 07:26:13 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 02 Sep 2021 11:26:13 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630581973.82.0.496743497739.issue45081@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +kj, lukasz.langa, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 07:49:41 2021 From: report at bugs.python.org (Laurent Lyaudet) Date: Thu, 02 Sep 2021 11:49:41 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630583381.45.0.559755416883.issue34561@roundup.psfhosted.org> Laurent Lyaudet <laurent.lyaudet at gmail.com> added the comment: Thanks for the patch Tim. If I find a rival that stands against power sort, I'll tell you. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34561> _______________________________________ From report at bugs.python.org Thu Sep 2 09:06:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 13:06:54 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630588014.5.0.258762097749.issue45083@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Thu Sep 2 10:03:38 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 02 Sep 2021 14:03:38 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1630591418.02.0.618968896898.issue45067@roundup.psfhosted.org> Charalampos Stratakis <cstratak at redhat.com> added the comment: You should use -lpaneltw instead of -lpanelw. See also: https://bugs.python.org/issue41981 ---------- nosy: +cstratak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 2 10:49:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 14:49:48 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630594188.37.0.271895863617.issue45019@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- nosy: +lukasz.langa nosy_count: 3.0 -> 4.0 pull_requests: +26565 pull_request: https://github.com/python/cpython/pull/28125 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Thu Sep 2 10:49:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 14:49:48 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630594188.25.0.350813235472.issue45056@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26564 pull_request: https://github.com/python/cpython/pull/28125 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Thu Sep 2 10:55:20 2021 From: report at bugs.python.org (Greg Kuhn) Date: Thu, 02 Sep 2021 14:55:20 +0000 Subject: [issue45086] f-string unmatched ']' Message-ID: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> New submission from Greg Kuhn <gregorykuhn at gmail.com>: Hi All, Is the below a bug? Shouldn't the interpreter be complaining about a curly brace? $ python Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> num = 10 >>> f'[{num]' File "<stdin>", line 1 SyntaxError: f-string: unmatched ']' >>> ---------- messages: 400920 nosy: Greg Kuhn priority: normal severity: normal status: open title: f-string unmatched ']' type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Thu Sep 2 11:03:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 15:03:11 +0000 Subject: [issue43613] gzip.compress and gzip.decompress are sub-optimally implemented. In-Reply-To: <1616567239.03.0.950381696666.issue43613@roundup.psfhosted.org> Message-ID: <1630594991.4.0.74584772581.issue43613@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ea23e7820f02840368569db8082bd0ca4d59b62a by Ruben Vorderman in branch 'main': bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941) https://github.com/python/cpython/commit/ea23e7820f02840368569db8082bd0ca4d59b62a ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43613> _______________________________________ From report at bugs.python.org Thu Sep 2 11:03:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 15:03:42 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1630595022.86.0.202109863979.issue43612@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for your contribution, Ruben! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43612> _______________________________________ From report at bugs.python.org Thu Sep 2 11:03:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 15:03:59 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1630595039.18.0.361335726473.issue43612@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- versions: -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43612> _______________________________________ From report at bugs.python.org Thu Sep 2 11:12:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 15:12:58 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630595578.14.0.515189609345.issue40360@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f0b63d5b56a6324f5f86807d9548c7b38aa2a8f7 by ?ukasz Langa in branch 'main': bpo-40360: [doc] Rephrase deprecation note about lib2to3 (GH-28122) https://github.com/python/cpython/commit/f0b63d5b56a6324f5f86807d9548c7b38aa2a8f7 ---------- message_count: 45.0 -> 46.0 pull_requests: +26566 pull_request: https://github.com/python/cpython/pull/28127 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 11:12:58 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 02 Sep 2021 15:12:58 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630595578.0.0.980126130628.issue40360@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26566 pull_request: https://github.com/python/cpython/pull/28127 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 11:22:14 2021 From: report at bugs.python.org (wodny) Date: Thu, 02 Sep 2021 15:22:14 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630596134.54.0.566207178629.issue44748@roundup.psfhosted.org> Change by wodny <github at wodny.org>: ---------- nosy: +wodny85 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 11:29:06 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 02 Sep 2021 15:29:06 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630596546.95.0.89804015909.issue45086@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I think the error is short for "I found a ']' without a matching '['". ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Thu Sep 2 11:28:45 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 02 Sep 2021 15:28:45 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1630596525.65.0.483405081051.issue45024@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: I suspect this may be intentional. See related issues https://bugs.python.org/issue35190 and https://bugs.python.org/issue23864. Copying verbatim from what Ivan said in the first issue: " The separation may look arbitrary, but the idea is quite simple. Only those classes with few methods support structural checks. Those classes have few independent abstract methods (or even just one method), while in classes with large APIs like `Sequence`, the methods are not logically independent, so you can't say a class is 100% a `Sequence` even if types/signatures of all methods are correct, because e.g. `__contains__()` and `index()` should behave in agreement with `__getitem__()`. " ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Thu Sep 2 11:35:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 15:35:16 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630596916.1.0.463843763798.issue45082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: -0 I'm not sure it's worth the hassle to remove this. I'd just delete the silly comment that this is supposedly deprecated since at least 2006. I still get 32,978 results looking at Github Search like this: https://github.com/search?q=c_buffer+-filename%3Atest_stringptr.py+language%3APython+language%3APython&type=Code Sure, there's some duplication there, it's not case-sensitive, and some of the c_buffer names might not even be ctypes. But the first few pages are all sensibly looking ctypes results. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 11:37:22 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 02 Sep 2021 15:37:22 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630597042.71.0.310231418281.issue40360@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 559af7434668e2950c08389515a52eba697ef6af by Miss Islington (bot) in branch '3.10': bpo-40360: [doc] Rephrase deprecation note about lib2to3 (GH-28122) https://github.com/python/cpython/commit/559af7434668e2950c08389515a52eba697ef6af ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 11:42:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 15:42:54 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630597374.38.0.103260597847.issue45082@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Since this alias is not a big maintenance burden, I think we can use deprecation period longer than minimum 2 releases. Ok. I modified my PR to only deprecate the alias without planning to remove it. Someone else can decide in at least 2 releases when it will be reasonable to remove the function. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 11:43:59 2021 From: report at bugs.python.org (=?utf-8?q?Micka=C3=ABl_Schoentgen?=) Date: Thu, 02 Sep 2021 15:43:59 +0000 Subject: [issue23493] optimize sort_keys in json module by using operator.itemgetter() In-Reply-To: <1424449556.4.0.766318893285.issue23493@psf.upfronthosting.co.za> Message-ID: <1630597439.5.0.607626621251.issue23493@roundup.psfhosted.org> Micka?l Schoentgen <contact at tiger-222.fr> added the comment: I am wondering why the change was not backported to 3.6 and 3.7? It introduces different behavior. For instance, I need to keep duplicate keys from JSON data (because it is allowed by the RFC and it is a missing feature for tools such like HTTPie). Have a look at repro-sorting.py. On Python 3.6 and 3.7, the output is not sorted: { "dps": { "1630064726": 5.0, "1630064726": 3.0, "1630064726": 6.0 } } Starting with Python 3.8, the output is sorted as expected: { "dps": { "1630064726": 3.0, "1630064726": 5.0, "1630064726": 6.0 } } I could open pull requests for both 3.6 and 3.7 branches, if you think it is worth and allowed by the current maintenance status. ---------- nosy: +Tiger-222 Added file: https://bugs.python.org/file50256/repro-sorting.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23493> _______________________________________ From report at bugs.python.org Thu Sep 2 11:46:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 15:46:06 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1630597566.62.0.215330650493.issue39573@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26567 pull_request: https://github.com/python/cpython/pull/28128 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Thu Sep 2 11:45:59 2021 From: report at bugs.python.org (Greg Kuhn) Date: Thu, 02 Sep 2021 15:45:59 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630597559.9.0.788060265045.issue45086@roundup.psfhosted.org> Greg Kuhn <gregorykuhn at gmail.com> added the comment: But doesn't the square bracket have no relevance here? It's not within a curly bracketed string so shouldn't be treated specially. I would have expected the error to be: SyntaxError: f-string: unmatched '}'. Unless I need to go back and reread pep498... ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Thu Sep 2 12:00:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 16:00:52 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630598452.04.0.40353213631.issue45082@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26568 pull_request: https://github.com/python/cpython/pull/28129 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 12:01:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 16:01:24 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630598484.48.0.840148188107.issue45082@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > -0 I'm not sure it's worth the hassle to remove this. I'd just delete the silly comment that this is supposedly deprecated since at least 2006. Ok, I created PR 28129 for that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 12:02:36 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 02 Sep 2021 16:02:36 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630598556.66.0.872944799235.issue45079@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: As the human "build bot" in question, yes, I do get tired :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Thu Sep 2 12:03:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 16:03:42 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630598622.32.0.913677062604.issue40360@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I close the issue: lib2to3 is now deprecated in Python 3.11. I propose to open a new issue in Python 3.13 or newer to remove it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 12:04:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Sep 2021 16:04:31 +0000 Subject: [issue23493] optimize sort_keys in json module by using operator.itemgetter() In-Reply-To: <1424449556.4.0.766318893285.issue23493@psf.upfronthosting.co.za> Message-ID: <1630598671.21.0.339172784962.issue23493@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I am wondering why the change was not backported to 3.6 and 3.7? These branches no longer accept optimizations or bugfixes, only security fixes: https://devguide.python.org/#status-of-python-branches ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23493> _______________________________________ From report at bugs.python.org Thu Sep 2 12:10:10 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 02 Sep 2021 16:10:10 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1630599010.53.0.158097733015.issue45055@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I use git worktree as well (it's great for backporting - I have all the release branches checked out all the time), but it likely means that you are regularly downloading and extracting these files. So whatever app is keeping the file handle open is probably doing it reliably for one of the files, which is why you'll hit it each time. Once it's been copied into place, you won't see it again. And once we have the retry logic in the script then you won't see it the first time either. This should be an easy project, though not trivial to test. ---------- keywords: +easy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Thu Sep 2 12:17:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 16:17:21 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630599441.28.0.998619088158.issue45081@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 0635e201beaf52373f776ff32702795e38f43ae3 by Yurii Karabas in branch 'main': bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) https://github.com/python/cpython/commit/0635e201beaf52373f776ff32702795e38f43ae3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 12:17:27 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 02 Sep 2021 16:17:27 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630599447.07.0.245282065789.issue45081@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26570 pull_request: https://github.com/python/cpython/pull/28132 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 12:17:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 02 Sep 2021 16:17:23 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630599443.34.0.180981173047.issue45081@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26569 pull_request: https://github.com/python/cpython/pull/28131 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 12:25:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 16:25:23 +0000 Subject: [issue40360] Deprecate lib2to3 (and 2to3) for future removal In-Reply-To: <1587530454.25.0.44181585934.issue40360@roundup.psfhosted.org> Message-ID: <1630599923.54.0.489814020063.issue40360@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: The "pending" deprecation status of lib2to3 in 3.9 and 3.10 is no worse than a vanilla deprecation in terms of visibility. It will appear just the same when run with pytest or `-X dev`. However, upgrading the deprecation between 3.10.0rc1 and 3.10.0rc2 really was too late. So we'll have it deprecated fully in 3.11 and removed in 3.13. One more year doesn't hurt us much but might be helpful for library maintainers to have more time to move off of the included lib2to3. Invoking `2to3` also generates the warning so I guess this can be closed: $ ./python.exe Tools/scripts/2to3 /private/tmp/cpy2/Tools/scripts/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ from lib2to3.main import main At least one file or directory argument required. Use --help to show usage. Thanks for the patches, Gregory, Carl, and Victor! ? ? ? Now we just have to remember to actually remove the damn thing in 3.13 ? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40360> _______________________________________ From report at bugs.python.org Thu Sep 2 12:39:04 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Thu, 02 Sep 2021 16:39:04 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630600744.02.0.692644367595.issue45079@roundup.psfhosted.org> Arcadiy Ivanov <arcadiy at ivanov.biz> added the comment: Wow, the artifacts are built and posted by hand??? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Thu Sep 2 13:01:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 17:01:40 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630602100.95.0.323602919584.issue45081@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 98eb40828af97760badfa7b8ff84bd4f7a079839 by Miss Islington (bot) in branch '3.9': bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) (GH-28132) https://github.com/python/cpython/commit/98eb40828af97760badfa7b8ff84bd4f7a079839 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 13:02:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 17:02:07 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630602127.07.0.779240019944.issue45082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a1e15a7a604e6f44cdaf4e106339df62eac5dc9f by Victor Stinner in branch 'main': bpo-45082: Cleanup ctypes.c_buffer alias (GH-28129) https://github.com/python/cpython/commit/a1e15a7a604e6f44cdaf4e106339df62eac5dc9f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 13:03:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 02 Sep 2021 17:03:51 +0000 Subject: [issue45082] ctypes: Deprecate c_buffer() alias to create_string_buffer() In-Reply-To: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> Message-ID: <1630602231.36.0.0194170906585.issue45082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Victor! ? ? ? ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45082> _______________________________________ From report at bugs.python.org Thu Sep 2 13:17:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 02 Sep 2021 17:17:34 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630603054.4.0.809104963812.issue45086@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I think it's basically this error: >>> num] File "<stdin>", line 1 num] ^ SyntaxError: unmatched ']' Although I'd have to look at it more to see why that's the error it chose to display, instead of the curly brace. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Thu Sep 2 14:15:20 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 02 Sep 2021 18:15:20 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630606520.73.0.926053242639.issue45079@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The build for Windows is mostly automated, but it's triggered and monitored by hand. The build steps are all in the source repo, and the builds themselves are public at https://dev.azure.com/Python/cpython/_build?definitionId=21, but I'm the only core dev with access to the code signing certificate, so the only one who can trigger an official Windows release. More importantly though is that we stop validating all the dependencies (e.g. OpenSSL) against security-fix only releases. These are optional dependencies from the POV of CPython, but required for a binary release. Maintaining support for them isn't free, so dropping the binary releases means we can focus on our active releases, rather than on regularly reintegrating other people's projects. Otherwise we'd have to do a new release every time OpenSSL/libffi/Tk/Tcl/Sqlite3/etc. fixed a security issue. *That's* the cost we avoid by not releasing binaries, even though the cost of the build itself is pretty low these days. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Thu Sep 2 14:46:32 2021 From: report at bugs.python.org (Julian Fortune) Date: Thu, 02 Sep 2021 18:46:32 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630608392.94.0.453240811125.issue45081@roundup.psfhosted.org> Change by Julian Fortune <juliandfortune at gmail.com>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Thu Sep 2 14:59:52 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 02 Sep 2021 18:59:52 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1630609192.72.0.99385860173.issue45027@roundup.psfhosted.org> Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment: Thanks, but ... > I observe that many Python users tend to use basicConfig() even when they would be better served by configuring only the logger(s) needed for their own app/library. First of all, library developers should not be configuring loggers at all, other than adding a NullHandler to their top-level logger. Secondly, it is fine to configure the root logger and then log to any other logger. The default mechanisms mean that handlers added to the root logger are used by loggers which are anywhere in the logger hierarchy. So users that are using basicConfig() but other loggers than the root logger may be using the system as designed. Thirdly, logging.config.dictConfig() allows usage of a dictionary to configure multiple loggers, handlers etc. all at once, for use cases which are more demanding than basicConfig(). It doesn't make sense to do what you're proposing, since it appears to offer a different way of configuring other loggers than the root logger, when dictConfig() already offers that. So, I am minded to not agree to this change, and would prefer that the PR and this issue be closed. ---------- nosy: +vinay.sajip _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45027> _______________________________________ From report at bugs.python.org Thu Sep 2 15:02:10 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 02 Sep 2021 19:02:10 +0000 Subject: [issue44489] _handle_existing_loggers should respect loggers that were manually disabled In-Reply-To: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> Message-ID: <1630609330.8.0.990580355919.issue44489@roundup.psfhosted.org> Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment: Closing, as no further feedback received on this issue. You can reopen if you have an answer to my question. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44489> _______________________________________ From report at bugs.python.org Thu Sep 2 15:07:09 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Thu, 02 Sep 2021 19:07:09 +0000 Subject: [issue45079] 3.8.11 and 3.8.12 missing Windows artifacts, only tarballs - build system failed? In-Reply-To: <1630515221.82.0.541526485344.issue45079@roundup.psfhosted.org> Message-ID: <1630609629.35.0.112501497942.issue45079@roundup.psfhosted.org> Arcadiy Ivanov <arcadiy at ivanov.biz> added the comment: Seems like integrating third party dependencies would be covered by integration tests as part of the automation. But if they are not available I understand it would be expensive, yes. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45079> _______________________________________ From report at bugs.python.org Thu Sep 2 15:33:52 2021 From: report at bugs.python.org (Gregory Szorc) Date: Thu, 02 Sep 2021 19:33:52 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630611232.02.0.0740520096762.issue44689@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: I cannot reproduce this on an 11.5 Intel MacBook Pro using an 11.5 SDK targeting x86_64 10.9. However, I can reproduce on a similarly configured M1 using the same OS and SDK but cross-compiling to single arch x86_64. The issue here may reside in how configure handles cross-compiling for Apple. The current logic in configure is a bit opinionated about how things should work and this patch may have tickled things into not working. My opinion is that configure should support various cross-compiling scenarios like this (including building non-fat x86_64 only binaries from an arm64 machine). However, it is clear from the implementation and comments in this issue and elsewhere that the CPython core devs want to limit which exact cross-compiling configurations are supported on Apple. If the core developers say various cross-compiling scenarios aren't supported build configuration any more, I'll accept that and work around the limitation on my end. However, do note there is a significant possibility that Apple stops selling Intel machines for various product models in a few weeks. I suspect various people will want to continue their practice of building x86_64 only binaries for the indefinite future. Regardless of when the ARM only transition occurs, arbitrary restrictions like not supporting Apple arm64 -> x86_64 cross-compiling will disappoint a growing cohort of users over time. I would encourage investing in less opinionated configure logic to support Apple cross-compiling. I could potentially contribute patches in this area, since I've already taught python-build-standalone to cross-compile more robustly (including to targets like iOS). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Thu Sep 2 15:37:44 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 19:37:44 +0000 Subject: [issue45087] Confusing error message when trying split bytes. Message-ID: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> New submission from Alex Zaslavskis <sahsariga111 at gmail.com>: If we will try to split bytes we will got quite strange error in console. Traceback (most recent call last): File "C:/Users/ProAdmin/Desktop/bug_in_python.py", line 6, in <module> byte_message.split(",") TypeError: a bytes-like object is required, not 'str' The problem here is that object should be string and in if I convert it to string the error is going. So that mean that there are error in mistake . Correct variant should be : Traceback (most recent call last): File "C:/Users/ProAdmin/Desktop/bug_in_python.py", line 6, in <module> byte_message.split(",") TypeError: str is required, not a bytes-like object message = 'Python is fun' byte_message = bytes(message, 'utf-8') print(byte_message) #byte_message.split(",") causes error str(byte_message).split(",") # works ---------- components: Argument Clinic files: bug_in_python.py messages: 400948 nosy: larry, sahsariga111 priority: normal severity: normal status: open title: Confusing error message when trying split bytes. type: compile error versions: Python 3.9 Added file: https://bugs.python.org/file50257/bug_in_python.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 15:54:43 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 19:54:43 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630612483.32.0.668977458533.issue45087@roundup.psfhosted.org> Change by Alex Zaslavskis <sahsariga111 at gmail.com>: ---------- type: compile error -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 15:57:05 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 19:57:05 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630612625.84.0.806300084831.issue45087@roundup.psfhosted.org> Change by Alex Zaslavskis <sahsariga111 at gmail.com>: Added file: https://bugs.python.org/file50258/bug_in_python.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 15:57:10 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 19:57:10 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630612630.77.0.52117112564.issue45087@roundup.psfhosted.org> Change by Alex Zaslavskis <sahsariga111 at gmail.com>: Removed file: https://bugs.python.org/file50257/bug_in_python.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 16:04:38 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 02 Sep 2021 20:04:38 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630613078.83.0.717568569478.issue44689@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: Thanks for the updates! >If the core developers say various cross-compiling scenarios aren't supported build configuration any more, I'll accept that and work around the limitation on my end. However, do note there is a significant possibility that Apple stops selling Intel machines for various product models in a few weeks. I suspect various people will want to continue their practice of building x86_64 only binaries for the indefinite future. I think you make very good points. I also think that we all agree that we do need to work towards better supporting the coming primarily non-Intel Mac world. I would rather put it that there are cross-compiling scenarios that were never supported before (but also not necessarily fully documented as such) but may have worked coincidentally some of the time; moving forward, we need to identify the important scenarios and make sure we fully support them. We're not there yet but I have some ideas on how to do that which I will try to get written down soon. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44689> _______________________________________ From report at bugs.python.org Thu Sep 2 16:28:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 02 Sep 2021 20:28:26 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630614506.81.0.466924747883.issue45087@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: This is working as designed. The error is telling you that the argument to bytes.split() must be a string: >>> b''.split(',') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: a bytes-like object is required, not 'str' >>> b''.split(b',') [b''] Same for str.split(): >>> ''.split(b',') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be str or None, not bytes >>> ''.split(',') [''] ---------- components: -Argument Clinic nosy: +eric.smith -larry _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 16:32:30 2021 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 02 Sep 2021 20:32:30 +0000 Subject: [issue45088] Coroutines & async generators disagree on the iteration protocol semantics Message-ID: <1630614750.42.0.345660375854.issue45088@roundup.psfhosted.org> New submission from Yury Selivanov <yselivanov at gmail.com>: See this script: https://gist.github.com/1st1/eccc32991dc2798f3fa0b4050ae2461d Somehow an identity async function alters the behavior of manual iteration though the wrapped nested generator. This is a very subtle bug and I'm not even sure if this is a bug or not. Opening the issue so that I don't forget about this and debug sometime later. ---------- components: Interpreter Core messages: 400951 nosy: lukasz.langa, pablogsal, yselivanov priority: normal severity: normal stage: needs patch status: open title: Coroutines & async generators disagree on the iteration protocol semantics type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45088> _______________________________________ From report at bugs.python.org Thu Sep 2 16:34:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 20:34:00 +0000 Subject: [issue26375] Python 2.7.10 and 3.4.4 hang on imaplib.IMAP4_SSL() In-Reply-To: <1455716357.67.0.858374272161.issue26375@psf.upfronthosting.co.za> Message-ID: <1630614840.41.0.42063418233.issue26375@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Michal, is still issue still relevant? The url you mention no longer exists so I can't see if it's still reproducible: % nslookup imap.home.pl Server: 192.168.1.254 Address: 192.168.1.254#53 ** server can't find imap.home.pl: NXDOMAIN ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue26375> _______________________________________ From report at bugs.python.org Thu Sep 2 16:36:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 02 Sep 2021 20:36:41 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1630615001.25.0.561092657074.issue45024@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: The docs need to clarify which ABCs can satisfy isinstance() based solely on hasattr() logic and which ABCs require registration or direct subclassing. The docs should also explain why the more complex ABCs can't reliably be recognized based on the presence of desired method names. One of the original motivating reasons for the ABCs was that the presence of __getitem__ was insufficient for determining whether a class was intended to be a Mapping or a Sequence. Accordingly, those classes have to subclass from an ABC or register with the ABC in order to declare intent. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Thu Sep 2 16:38:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 02 Sep 2021 20:38:02 +0000 Subject: [issue37694] Crash when calling zipimport.zipimporter.__new__().<method>() In-Reply-To: <1564260723.26.0.279102723907.issue37694@roundup.psfhosted.org> Message-ID: <1630615082.24.0.224036484773.issue37694@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as 2.7 and 3.6 are no longer maintained, and you say the crash was gone in 3.7+. On 3.11 it indeed doesn't crash: >>> zipimport.zipimporter.__new__(zipimport.zipimporter).find_module('') <frozen zipimport>:158: DeprecationWarning: zipimporter.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead <frozen zipimport>:122: DeprecationWarning: zipimporter.find_loader() is deprecated and slated for removal in Python 3.12; use find_spec() instead Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<frozen zipimport>", line 161, in find_module File "<frozen zipimport>", line 125, in find_loader File "<frozen zipimport>", line 372, in _get_module_info File "<frozen zipimport>", line 359, in _get_module_path AttributeError: 'zipimporter' object has no attribute 'prefix' ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37694> _______________________________________ From report at bugs.python.org Thu Sep 2 16:42:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 02 Sep 2021 20:42:26 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error Message-ID: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> New submission from Erlend E. Aasland <erlend.aasland at innova.no>: Currently, two calls can raise exceptions in the _trace_callback() in Modules/_sqlite/connection.c: 1. PyUnicode_DecodeUTF8() can raise an exception 2. PyObject_CallOneArg() ? calling the user callback ? can raise an exception Currently, we either PyErr_Print() the traceback, or we PyErr_Clear() it. In either case; we clear the current exception. The other SQLite callbacks pass some kind of return value back to SQLite to indicate failure (which is normally then passed to _pysqlite_seterror() via sqlite3_step() or sqlite3_finalize(), but the trace callback does not pass errors back to SQLite; we're unable to detect if the trace callback fails. ---------- components: Extension Modules files: reproducer.py messages: 400955 nosy: erlendaasland priority: normal severity: normal status: open title: [sqlite3] the trace callback does not raise exceptions on error versions: Python 3.11 Added file: https://bugs.python.org/file50259/reproducer.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Thu Sep 2 16:42:48 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 02 Sep 2021 20:42:48 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using In-Reply-To: <1620580530.62.0.599288030317.issue44091@roundup.psfhosted.org> Message-ID: <1630615368.05.0.365023083164.issue44091@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: FWIW I don't remember the context that led me to just file the issue this year. The most serious frequent instances of this I remember happening were all many years ago when a less capable software distribution mechanism was in use. A scenario where I would imagine it today aside from things like what Irit mentioned with the developer workflow: People using an OS distro's Python interpreter (and even OS distro supplied Python packages instead of pip in a virtualenv) in order to run their own potentially long running code. The OS distro does not know about their running processes as they haven't created OS packages with startup/restart/shutdown and dependency relationships expressed. So the OS updating Python packages does not trigger a restart of their software after updating a dependency out from underneath it. I know this happens, but I don't know how often it actually bites anyone. And there are workarounds if deemed serious (tie in with the OS package management). I personally wouldn't prioritize work on this issue unless it fits in naturally with other work going on to plumb the information through. Or without an ability to demonstrate a compelling frequently encountered user-confusion scenario. It's a "nice to have" more than a "need". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44091> _______________________________________ From report at bugs.python.org Thu Sep 2 16:55:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 02 Sep 2021 20:55: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: <1630616134.91.0.0106204926696.issue44748@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > 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. It seems to me that default values can already be used for this purpose: from argparse import ArgumentParser config = {'w': 5, 'x': 10, 'y': False, 'z': True} missing = object() p = ArgumentParser() p.add_argument('-x', type=int, default=missing) p.add_argument('-y', action='store_true', default=missing) ns = p.parse_args() # update config for specified values for parameter, value in vars(ns).items(): if value is not missing: config[parameter] = value print(config) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 17:07:23 2021 From: report at bugs.python.org (Thermi) Date: Thu, 02 Sep 2021 21:07:23 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630616843.29.0.965835503843.issue44748@roundup.psfhosted.org> Thermi <noel.kuntze+bugs-python-org at thermi.consulting> added the comment: Raymond, then you can't show the defaults in the help message. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 17:10:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 02 Sep 2021 21:10:32 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1630617032.29.0.275201532039.issue23864@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Maybe issue45024 is also connected? (It also seems to relate to hasattr() logic.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Thu Sep 2 17:10:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 02 Sep 2021 21:10:57 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1630617057.96.0.460281800301.issue45089@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- keywords: +patch pull_requests: +26571 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28133 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Thu Sep 2 17:30:37 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 21:30:37 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630618237.91.0.618692962336.issue45087@roundup.psfhosted.org> Alex Zaslavskis <sahsariga111 at gmail.com> added the comment: I am not really sure that it is working as it should be. Even with your example it gives : TypeError: a bytes-like object is required, not 'str' The problem is why error message says that bytes-like is required , when the string is required. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 17:35:08 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 21:35:08 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630618508.66.0.632003184142.issue45087@roundup.psfhosted.org> Alex Zaslavskis <sahsariga111 at gmail.com> added the comment: ''.split(',') # works as it should be b''.split(',') # gives strange error message. TypeError: a bytes-like object is required, not 'str' The problem here is that message is saying that for fix error you should use bytes-like object that not a true. In reality the string or None is required . ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 17:40:01 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 21:40:01 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630618801.55.0.340878388816.issue45087@roundup.psfhosted.org> Alex Zaslavskis <sahsariga111 at gmail.com> added the comment: Moreover according Python docs : This exception may be raised by user code to indicate that an attempted operation on an object is not supported. But also the Python interpreter gives that a bytes-like object is required, not 'str' that I am already passing , so it says that all fine. But the question is why then TypeError happens . ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 18:16:28 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 02 Sep 2021 22:16:28 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630620988.54.0.368996656661.issue45087@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: You said: """ b''.split(',') # gives strange error message. TypeError: a bytes-like object is required, not 'str' """ It is not a strange error message. You passed in a str (the ','), and you should have passed in bytes. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 18:29:15 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 22:29:15 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630621755.58.0.681673066576.issue45087@roundup.psfhosted.org> Alex Zaslavskis <sahsariga111 at gmail.com> added the comment: Thanks that really works. So as I understand that b''.split() != ''.split() ---------- resolution: -> not a bug _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 18:31:31 2021 From: report at bugs.python.org (Alex Zaslavskis) Date: Thu, 02 Sep 2021 22:31:31 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630621891.52.0.674476634514.issue45087@roundup.psfhosted.org> Alex Zaslavskis <sahsariga111 at gmail.com> added the comment: What about adding alert message for beginners that can stuck with that in docs? To warn others , is that good idea you think. Or it is redundant ? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 18:58:25 2021 From: report at bugs.python.org (Luciano Ramalho) Date: Thu, 02 Sep 2021 22:58:25 +0000 Subject: [issue45090] Add pairwise to What's New in Python 3.10; mark it as new in itertools docs Message-ID: <1630623505.93.0.223953840604.issue45090@roundup.psfhosted.org> New submission from Luciano Ramalho <luciano at ramalho.org>: Thanks for adding `itertools.pairwise()`! Let's make it easier to find by mentioning it in "What's New in Python 3.10" and also marking it as "New in Python 3.10" in the `itertools` module documentation. ---------- assignee: docs at python components: Documentation messages: 400966 nosy: docs at python, ramalho priority: normal severity: normal status: open title: Add pairwise to What's New in Python 3.10; mark it as new in itertools docs versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45090> _______________________________________ From report at bugs.python.org Thu Sep 2 19:11:57 2021 From: report at bugs.python.org (=?utf-8?q?Tin_Tvrtkovi=C4=87?=) Date: Thu, 02 Sep 2021 23:11:57 +0000 Subject: [issue44188] ThreadPoolExecutor unbalanced semaphore count In-Reply-To: <1621511496.17.0.839085647104.issue44188@roundup.psfhosted.org> Message-ID: <1630624317.9.0.85205345351.issue44188@roundup.psfhosted.org> Tin Tvrtkovi? <tinchester at gmail.com> added the comment: I was trying to instrument one of our executors to expose some metrics, so I tried using the value of the semaphore as the number of idle threads and I noticed it was way too large. If this was fixed getting these metrics would be easier. ---------- nosy: +tinchester _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44188> _______________________________________ From report at bugs.python.org Thu Sep 2 19:28:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 02 Sep 2021 23:28:01 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630625281.7.0.428883024348.issue44748@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > then you can't show the defaults in the help message. 1) The --help option doesn't normally show defaults. 2) Why would you show defaults in help, if you're going to ignore them in favor the values in config whenever they aren't specified. If ignored or overridden, they aren't actually default values. 3) Why not dynamically configure the argparse default values with data from config? config = {'w': 5, 'x': 10, 'y': False, 'z': True} p = ArgumentParser() p.add_argument('-x', type=int, default=config['x']) p.add_argument('-y', action='store_true', default=config['y']) ns = p.parse_args(['-h']) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 19:39:52 2021 From: report at bugs.python.org (Thermi) Date: Thu, 02 Sep 2021 23:39:52 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630625992.8.0.628058456487.issue44748@roundup.psfhosted.org> Thermi <noel.kuntze+bugs-python-org at thermi.consulting> added the comment: 1) True. That'd mean such functionality would not be usable by such a workaround though. 2) ANY setting has a default value. The output in the --help message has to, if any defaults at all are shown, be the same as the actual default values. Storing the default values as part of the argparse.ArgumentParser configuration prevents duplication of the default value declaration in the config file reader, and the argument parser. What I request is the reverse of what you wrote. I want the order of priority to fall back to the defaults, if no value is specified in the config file. And if an argument is passed via argv, then that value should take precedence over what is set in the config file. This is in the first message in this issue. 3) Two different places to touch when you want to add a new option: 1) Default config declared in program code 2) argparse.ArgumentParser configuration in code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 19:45:07 2021 From: report at bugs.python.org (Cooper Lees) Date: Thu, 02 Sep 2021 23:45:07 +0000 Subject: [issue31528] Let ConfigParser parse systemd units In-Reply-To: <1505896809.19.0.933904793139.issue31528@psf.upfronthosting.co.za> Message-ID: <1630626307.32.0.668466268713.issue31528@roundup.psfhosted.org> Change by Cooper Lees <me at cooperlees.com>: ---------- nosy: +cooperlees _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31528> _______________________________________ From report at bugs.python.org Thu Sep 2 20:05:24 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 03 Sep 2021 00:05:24 +0000 Subject: [issue45087] Confusing error message when trying split bytes. In-Reply-To: <1630611464.91.0.0686347967364.issue45087@roundup.psfhosted.org> Message-ID: <1630627524.87.0.507796321601.issue45087@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I (and many others) think the error message is fine the way it is. Also, it's hard for the error to be more specific about the method it's being called on. But if you have some concrete suggestions that can be implemented, you can add them to this issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45087> _______________________________________ From report at bugs.python.org Thu Sep 2 20:20:31 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 03 Sep 2021 00:20:31 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1630628431.41.0.29199414529.issue44980@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- nosy: +kj resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44980> _______________________________________ From report at bugs.python.org Thu Sep 2 20:56:47 2021 From: report at bugs.python.org (paul j3) Date: Fri, 03 Sep 2021 00:56:47 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630630607.34.0.70676626748.issue44748@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: Another way to play with the defaults is to use argparse.SUPPRESS. With such a default, the argument does not appear in the namespace, unless provided by the user. In [2]: p = argparse.ArgumentParser() ...: p.add_argument('--foo', default=argparse.SUPPRESS, help='foo help') ...: p.add_argument('--bar', default='default') ...: p.add_argument('--baz'); In [3]: args = p.parse_args([]) In [4]: args Out[4]: Namespace(bar='default', baz=None) Such a namespace can be used to update an existing dict (such as from a config file), changing only keys provided by user (and ones where SUPPRESS does not make sense, such as store_true and positionals). In [5]: adict = {'foo':'xxx', 'bar':'yyy', 'baz':'zzz'} In [6]: adict.update(vars(args)) In [7]: adict Out[7]: {'foo': 'xxx', 'bar': 'default', 'baz': None} User provided value: In [8]: args = p.parse_args(['--foo','foo','--baz','baz']) In [9]: args Out[9]: Namespace(bar='default', baz='baz', foo='foo') In this code sample I used Ipython. That IDE uses (or at least did some years ago) a custom integration of config and argparse. System default config file(s) set a large number of parameters. Users are encouraged to write their own profile configs (using provided templates). On starting a session, the config is loaded, and used to populate a parser, with arguments, helps and defaults. Thus values are set or reset upto 3 times - default, profile and commandline. I for example, usually start an ipython session with an alias alias inumpy3='ipython3 --pylab qt --nosep --term-title --InteractiveShellApp.pylab_import_all=False --TerminalInteractiveShell.xmode=Plain' Regarding this bug/issue, if someone can come up with a clever tweak that satisfies Thermi, is potentially useful to others, and is clearly backward compatible, great. But if this issue requires a less-than-ideal-compatible patch, or greater integration of config and argparse, then it needs to be developed as a separate project and tested on PyPi. Also search PyPi; someone may have already done the work. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 20:59:17 2021 From: report at bugs.python.org (paul j3) Date: Fri, 03 Sep 2021 00:59:17 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1630630757.78.0.966747136579.issue44986@roundup.psfhosted.org> Change by paul j3 <ajipanca at gmail.com>: ---------- nosy: +paul.j3 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44986> _______________________________________ From report at bugs.python.org Thu Sep 2 21:01:18 2021 From: report at bugs.python.org (paul j3) Date: Fri, 03 Sep 2021 01:01:18 +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: <1630630878.08.0.496884044315.issue44587@roundup.psfhosted.org> Change by paul j3 <ajipanca at gmail.com>: ---------- nosy: +paul.j3 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44587> _______________________________________ From report at bugs.python.org Thu Sep 2 21:25:32 2021 From: report at bugs.python.org (Antonio Caceres) Date: Fri, 03 Sep 2021 01:25:32 +0000 Subject: [issue45091] inspect.Parameter.__str__ does not include subscripted types in annotations Message-ID: <1630632332.35.0.622998937307.issue45091@roundup.psfhosted.org> New submission from Antonio Caceres <contact at antonio-caceres.com>: The __str__ method of the inspect.Parameter class in the standard library's inspect module does not include subscripted types in annotations. For example, consider the function foo(a: list[int]). When I run str(inspect.signature(foo)), I would expect the returned string to be '(a: list[int])', but instead the string is '(a: list)'. (I have tested this on Python 3.9.7, but the code I believe is the problem is on the branches for versions 3.9-3.11.) >From a first glance at the source code, the problem is in the inspect.formatannotation function. If the annotation is a type, the formatannotation uses the __qualname__ attribute of the annotation instead of its __repr__ attribute. Indeed, list[int].__qualname__ == 'list' and repr(list[int]) == 'list[int]'. This problem was probably code that should have been changed, but never was, after PEP 585. The only workarounds I have found is to implement an alternative string method that accepts inspect.Signature or subclass inspect.Parameter and override the __str__ method. ---------- components: Library (Lib) messages: 400972 nosy: antonio-caceres priority: normal severity: normal status: open title: inspect.Parameter.__str__ does not include subscripted types in annotations type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45091> _______________________________________ From report at bugs.python.org Thu Sep 2 21:29:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 03 Sep 2021 01:29:07 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630632547.86.0.172695537041.issue44748@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > I want the order of priority to fall back to the defaults, > if no value is specified in the config file. And if an argument > is passed via argv, then that value should take precedence > over what is set in the config file. from collections import ChainMap from argparse import ArgumentParser parser = ArgumentParser() missing = object() for arg in 'abcde': parser.add_argument(f'-{arg}', default=missing) system_defaults = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5} config_file = {'a': 6, 'c': 7, 'e': 8} command_line = vars(parser.parse_args('-a 8 -b 9'.split())) command_line = {k: v for k, v in command_line.items() if v is not missing} combined = ChainMap(command_line, config_file, system_defaults) print(dict(combined)) > This is in the first message in this issue. The feature request is clear. What problem you're trying to solve isn't clear. What you're looking for is likely some permutation of the above code or setting a argument default to a value in the ChainMap. I think you're ignoring that we already have ways to set default values to anything that is needed and we already have ways to tell is an argument was not encountered (but not both at the same time). [Paul J3] > So unless someone comes up with a really clever idea, > this is bigger request than it first impressions suggest. I recommend rejecting this feature request. The module is not obliged to be all things to all people. Most variations of the problem already have a solution. We should leave it at that. Extending the namespace with extra boolean arguments would just open a can of worms that would make most users worse off, likely breaking any code that expects the namespace to contain exactly what it already contains. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Thu Sep 2 23:26:08 2021 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 03 Sep 2021 03:26:08 +0000 Subject: [issue45088] Coroutines & async generators disagree on the iteration protocol semantics In-Reply-To: <1630614750.42.0.345660375854.issue45088@roundup.psfhosted.org> Message-ID: <1630639568.51.0.552394579221.issue45088@roundup.psfhosted.org> Change by Yury Selivanov <yselivanov at gmail.com>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45088> _______________________________________ From report at bugs.python.org Fri Sep 3 00:08:56 2021 From: report at bugs.python.org (Michael Rans) Date: Fri, 03 Sep 2021 04:08:56 +0000 Subject: [issue45092] Make set ordered like dict Message-ID: <1630642136.33.0.166486792809.issue45092@roundup.psfhosted.org> New submission from Michael Rans <mcarans at yahoo.co.uk>: Now that dict is ordered, it is a bit confusing that set isn't as well. I suggest making set ordered too. ---------- messages: 400974 nosy: mcarans priority: normal severity: normal status: open title: Make set ordered like dict type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45092> _______________________________________ From report at bugs.python.org Fri Sep 3 00:13:12 2021 From: report at bugs.python.org (Michael Rans) Date: Fri, 03 Sep 2021 04:13:12 +0000 Subject: [issue45093] Add method to compare dicts accounting for order Message-ID: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> New submission from Michael Rans <mcarans at yahoo.co.uk>: I suggest adding a method that allows comparing dicts taking into account the order - an ordered compare (since == does not do that). (Also for my other issue (https://bugs.python.org/issue45092) where I suggested that set be ordered to reduce confusion, the set could also have an ordered compare). ---------- messages: 400975 nosy: mcarans priority: normal severity: normal status: open title: Add method to compare dicts accounting for order versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 00:14:01 2021 From: report at bugs.python.org (Michael Rans) Date: Fri, 03 Sep 2021 04:14:01 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630642441.71.0.805779975446.issue45093@roundup.psfhosted.org> Change by Michael Rans <mcarans at yahoo.co.uk>: ---------- type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 00:26:15 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 03 Sep 2021 04:26:15 +0000 Subject: [issue45092] Make set ordered like dict In-Reply-To: <1630642136.33.0.166486792809.issue45092@roundup.psfhosted.org> Message-ID: <1630643175.91.0.217579633926.issue45092@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: See #42368 Also this thread: https://mail.python.org/pipermail/python-dev/2019-February/156466.html ---------- nosy: +steven.daprano type: behavior -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45092> _______________________________________ From report at bugs.python.org Fri Sep 3 00:44:56 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 03 Sep 2021 04:44:56 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630644296.95.0.338971052049.issue45093@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: What is your use-case for having dicts that differ only in order compare unequal? I can't think of any reason why I would want such a comparison, but if I did, it's a trivial one-liner: d1 == d2 and all(k1 == k2 for k1, k2 in zip(d1, d2)) ---------- nosy: +steven.daprano type: behavior -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 01:05:48 2021 From: report at bugs.python.org (Michael Rans) Date: Fri, 03 Sep 2021 05:05:48 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630645548.82.0.99172982601.issue45093@roundup.psfhosted.org> Michael Rans <mcarans at yahoo.co.uk> added the comment: My use case is in testing. Currently I use an OrderedDict, but since dict introduced ordering in 3.7, I was considering switching. For my test, I need to check that the dictionary is the same both in content and order. I can indeed use your one liner, but just thought it would be useful to have a method available. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 02:22:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Sep 2021 06:22:07 +0000 Subject: [issue45092] Make set ordered like dict In-Reply-To: <1630642136.33.0.166486792809.issue45092@roundup.psfhosted.org> Message-ID: <1630650127.28.0.663449747342.issue45092@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make set ordered _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45092> _______________________________________ From report at bugs.python.org Fri Sep 3 02:27:22 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 03 Sep 2021 06:27:22 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630650442.28.0.505381979742.issue45081@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 79e9f5a58427c73dc546cb571819d50defe2e14f by Miss Islington (bot) in branch '3.10': bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) https://github.com/python/cpython/commit/79e9f5a58427c73dc546cb571819d50defe2e14f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Fri Sep 3 02:28:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Sep 2021 06:28:13 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630650493.22.0.107358579615.issue45093@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: For tests it can be more convenient to use list(d1.items()) == list(d2.items()) because it can produce better report on failure. You can add a simple helper function if you use it multiple times in tests. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 02:28:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 06:28:16 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1630650496.26.0.913115291853.issue45081@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Fri Sep 3 03:13:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Sep 2021 07:13:36 +0000 Subject: [issue37694] Crash when calling zipimport.zipimporter.__new__().<method>() In-Reply-To: <1564260723.26.0.279102723907.issue37694@roundup.psfhosted.org> Message-ID: <1630653216.98.0.0292439365472.issue37694@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Because the zipimport module is now implemented in Python. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37694> _______________________________________ From report at bugs.python.org Fri Sep 3 03:15:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Sep 2021 07:15:06 +0000 Subject: [issue45090] Add pairwise to What's New in Python 3.10; mark it as new in itertools docs In-Reply-To: <1630623505.93.0.223953840604.issue45090@roundup.psfhosted.org> Message-ID: <1630653306.17.0.617345296066.issue45090@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +rhettinger stage: -> needs patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45090> _______________________________________ From report at bugs.python.org Fri Sep 3 03:28:10 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Fri, 03 Sep 2021 07:28:10 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1630654090.53.0.504988601571.issue43612@roundup.psfhosted.org> Ruben Vorderman <r.h.p.vorderman at lumc.nl> added the comment: Thanks for the review, Lukasz! It was fun to create the PR and optimize the performance for gzip.py as well. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43612> _______________________________________ From report at bugs.python.org Fri Sep 3 03:28:45 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Fri, 03 Sep 2021 07:28:45 +0000 Subject: [issue43613] gzip.compress and gzip.decompress are sub-optimally implemented. In-Reply-To: <1616567239.03.0.950381696666.issue43613@roundup.psfhosted.org> Message-ID: <1630654125.55.0.112002343806.issue43613@roundup.psfhosted.org> Change by Ruben Vorderman <r.h.p.vorderman at lumc.nl>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43613> _______________________________________ From report at bugs.python.org Fri Sep 3 03:30:44 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 03 Sep 2021 07:30:44 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630654244.62.0.747649277053.issue45083@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26573 pull_request: https://github.com/python/cpython/pull/28135 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Fri Sep 3 03:30:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 07:30:47 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630654247.98.0.817917865782.issue45083@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b4b6342848ec0459182a992151099252434cc619 by Irit Katriel in branch 'main': bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) https://github.com/python/cpython/commit/b4b6342848ec0459182a992151099252434cc619 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Fri Sep 3 03:30:40 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 03 Sep 2021 07:30:40 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630654240.99.0.771345380773.issue45083@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26572 pull_request: https://github.com/python/cpython/pull/28134 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Fri Sep 3 03:32:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 07:32:24 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1630654344.41.0.762970928843.issue34602@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset be9de8721d63b9d8e032d508069daf88c06542c6 by ?ukasz Langa in branch 'main': bpo-34602: Quadruple stack size on macOS when compiling with UBSAN (GH-27309) https://github.com/python/cpython/commit/be9de8721d63b9d8e032d508069daf88c06542c6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34602> _______________________________________ From report at bugs.python.org Fri Sep 3 03:37:25 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Fri, 03 Sep 2021 07:37:25 +0000 Subject: [issue43613] gzip.compress and gzip.decompress are sub-optimally implemented. In-Reply-To: <1616567239.03.0.950381696666.issue43613@roundup.psfhosted.org> Message-ID: <1630654645.09.0.997501497921.issue43613@roundup.psfhosted.org> Ruben Vorderman <r.h.p.vorderman at lumc.nl> added the comment: Issue was solved by moving code from _GzipReader to separate functions and maintaining the same error structure. This solved the problem with maximum code reuse and full backwards compatibility. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43613> _______________________________________ From report at bugs.python.org Fri Sep 3 03:39:47 2021 From: report at bugs.python.org (wodny) Date: Fri, 03 Sep 2021 07:39:47 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1630654787.65.0.767995404878.issue44748@roundup.psfhosted.org> wodny <github at wodny.org> added the comment: I used a wrapper to default values. This gives me nice help message with ArgumentDefaultsHelpFormatter and easy way to update a config file dictionary with results from parse_args(). ```python from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, Namespace from dataclasses import dataclass from typing import Any @dataclass class Default: value: Any def __str__(self): return str(self.value) @staticmethod def remove_defaults(ns): return Namespace(**{ k: v for k, v in ns.__dict__.items() if not isinstance(v, Default)}) @staticmethod def strip_defaults(ns): return Namespace(**{ k: v.value if isinstance(v, Default) else v for k, v in ns.__dict__.items() }) p = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) p.add_argument("--foo", "-f", default=Default(10), help="the foo arg") p.add_argument("--bar", "-b", default=Default("big-bar"), help="the bar arg") p.add_argument("--baz", "-z", default=True, help="the baz arg") options = p.parse_args() print(options) print(Default.remove_defaults(options)) print(Default.strip_defaults(options)) ``` ```sh $ ./arguments.py -b hello Namespace(bar='hello', baz=True, foo=Default(value=10)) Namespace(bar='hello', baz=True) Namespace(bar='hello', baz=True, foo=10) $ ./arguments.py -b hello -h usage: arguments.py [-h] [--foo FOO] [--bar BAR] [--baz BAZ] optional arguments: -h, --help show this help message and exit --foo FOO, -f FOO the foo arg (default: 10) --bar BAR, -b BAR the bar arg (default: big-bar) --baz BAZ, -z BAZ the baz arg (default: True) ``` ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44748> _______________________________________ From report at bugs.python.org Fri Sep 3 03:53:08 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 03 Sep 2021 07:53:08 +0000 Subject: [issue45077] multiprocessing.Pool(64) crashes on Windows In-Reply-To: <1630502444.21.0.00996444749357.issue45077@roundup.psfhosted.org> Message-ID: <1630655588.26.0.975262726386.issue45077@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: See bpo-26903 for a similar problem in concurrent.futures.ProcessPoolExecutor. It was resolved by adding a limit constant, _MAX_WINDOWS_WORKERS == 61. WaitForMultipleObjects() can wait on up to 64 object handles, but in this case 3 slots are already taken. The pool wait includes two events for its output and change-notifier queues (named pipes), plus the _winapi module always reserves a slot for the SIGINT event, even though this event is only used by waits on the main thread. To avoid the need to limit the pool size, connection._exhaustive_wait() could be modified to combine simultaneous waits on up to 63 threads, for which each thread exhaustively populates a list of up to 64 signaled objects. I wouldn't want to modify _winapi.WaitForMultipleObjects, but the exhaustive wait should still be implemented in C, probably in the _multiprocessing extension module. A benefit of implementing _exhaustive_wait() in C is lightweight thread creation, directly with CreateThread() and a relatively small stack commit size. ---------- components: +Library (Lib) nosy: +eryksun versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45077> _______________________________________ From report at bugs.python.org Fri Sep 3 04:11:12 2021 From: report at bugs.python.org (Tobias Bengfort) Date: Fri, 03 Sep 2021 08:11:12 +0000 Subject: [issue12499] textwrap.wrap: add control for fonts with different character widths In-Reply-To: <1309835004.91.0.584156217993.issue12499@psf.upfronthosting.co.za> Message-ID: <1630656672.75.0.663851876151.issue12499@roundup.psfhosted.org> Change by Tobias Bengfort <tobias.bengfort at posteo.de>: ---------- nosy: +xi2 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue12499> _______________________________________ From report at bugs.python.org Fri Sep 3 04:13:33 2021 From: report at bugs.python.org (Tobias Bengfort) Date: Fri, 03 Sep 2021 08:13:33 +0000 Subject: [issue12499] textwrap.wrap: add control for fonts with different character widths In-Reply-To: <1309835004.91.0.584156217993.issue12499@psf.upfronthosting.co.za> Message-ID: <1630656813.46.0.296192733075.issue12499@roundup.psfhosted.org> Change by Tobias Bengfort <tobias.bengfort at posteo.de>: ---------- pull_requests: +26574 pull_request: https://github.com/python/cpython/pull/28136 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue12499> _______________________________________ From report at bugs.python.org Fri Sep 3 04:13:33 2021 From: report at bugs.python.org (Tobias Bengfort) Date: Fri, 03 Sep 2021 08:13:33 +0000 Subject: [issue24665] CJK support for textwrap In-Reply-To: <1437276510.99.0.116072917153.issue24665@psf.upfronthosting.co.za> Message-ID: <1630656813.58.0.989935462721.issue24665@roundup.psfhosted.org> Change by Tobias Bengfort <tobias.bengfort at posteo.de>: ---------- nosy: +xi2 nosy_count: 10.0 -> 11.0 pull_requests: +26575 pull_request: https://github.com/python/cpython/pull/28136 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24665> _______________________________________ From report at bugs.python.org Fri Sep 3 04:20:15 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 03 Sep 2021 08:20:15 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1630657215.03.0.538806432082.issue42238@roundup.psfhosted.org> Change by Julien Palard <julien+python at palard.fr>: ---------- pull_requests: +26576 pull_request: https://github.com/python/cpython/pull/28137 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42238> _______________________________________ From report at bugs.python.org Fri Sep 3 07:09:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 03 Sep 2021 11:09:02 +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: <1630667342.13.0.214455206245.issue36521@roundup.psfhosted.org> Change by Inada Naoki <songofacandy at gmail.com>: ---------- keywords: +patch pull_requests: +26577 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28138 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Fri Sep 3 07:27:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 11:27:30 +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: <1630668450.12.0.523601902539.issue37596@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I reopen the issue. test_marshal failed on AMD64 Arch Linux Usan 3.x: https://buildbot.python.org/all/#/builders/719/builds/108 ====================================================================== FAIL: test_deterministic_sets (test.test_marshal.BugsTestCase) [set([('string', 1), ('string', 2), ('string', 3)])] ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_marshal.py", line 365, in test_deterministic_sets self.assertNotEqual(repr_0, repr_1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b"{('string', 1), ('string', 2), ('string', 3)}\n" == b"{('string', 1), ('string', 2), ('string', 3)}\n" ====================================================================== FAIL: test_deterministic_sets (test.test_marshal.BugsTestCase) [frozenset([('string', 1), ('string', 2), ('string', 3)])] ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_marshal.py", line 365, in test_deterministic_sets self.assertNotEqual(repr_0, repr_1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b"frozenset({('string', 1), ('string', 2), ('string', 3)})\n" == b"frozenset({('string', 1), ('string', 2), ('string', 3)})\n" ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 07:44:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 11:44:18 +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: <1630669458.92.0.739288668298.issue37596@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The test failed at: def test_deterministic_sets(self): # bpo-37596: To support reproducible builds, sets and frozensets need to # have their elements serialized in a consistent order (even when they # have been scrambled by hash randomization): for kind in ("set", "frozenset"): for elements in ( "float('nan'), b'a', b'b', b'c', 'x', 'y', 'z'", # Also test for bad interactions with backreferencing: "('string', 1), ('string', 2), ('string', 3)", ): s = f"{kind}([{elements}])" with self.subTest(s): # First, make sure that our test case still has different # orders under hash seeds 0 and 1. If this check fails, we # need to update this test with different elements: args = ["-c", f"print({s})"] _, repr_0, _ = assert_python_ok(*args, PYTHONHASHSEED="0") _, repr_1, _ = assert_python_ok(*args, PYTHONHASHSEED="1") self.assertNotEqual(repr_0, repr_1) # <=== HERE (...) It checks that the representation of a set is different for two different PYTHONHASHSEED values (0 and 1). On my Fedora 34, I confirm that they are different: PYTHONHASHSEED=0: vstinner at apu$ PYTHONHASHSEED=0 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" {('string', 1), ('string', 2), ('string', 3)} vstinner at apu$ PYTHONHASHSEED=0 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" {('string', 1), ('string', 2), ('string', 3)} vstinner at apu$ PYTHONHASHSEED=0 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" {('string', 1), ('string', 2), ('string', 3)} versus PYTHONHASHSEED=1: vstinner at apu$ PYTHONHASHSEED=1 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" {('string', 3), ('string', 1), ('string', 2)} vstinner at apu$ PYTHONHASHSEED=1 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" {('string', 3), ('string', 1), ('string', 2)} vstinner at apu$ PYTHONHASHSEED=1 ./python -c "print(set([('string', 1), ('string', 2), ('string', 3)]))" ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 08:32:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 12:32:44 +0000 Subject: [issue41031] Inconsistency in C and python traceback printers In-Reply-To: <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org> Message-ID: <1630672364.7.0.857154862991.issue41031@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch nosy: +iritkatriel nosy_count: 1.0 -> 2.0 pull_requests: +26578 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28139 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41031> _______________________________________ From report at bugs.python.org Fri Sep 3 08:36:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 12:36:26 +0000 Subject: [issue41031] Inconsistency in C and python traceback printers In-Reply-To: <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org> Message-ID: <1630672586.68.0.615444130545.issue41031@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41031> _______________________________________ From report at bugs.python.org Fri Sep 3 09:26:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:26:40 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) for debug builds Message-ID: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: I converted many C macros to static inline functions to reduce the risk of programming bugs (macros pitfalls), limit variable scopes to the function, have a more readable function, and benefit of the function name even when it's inlined in debuggers and profilers. When Py_INCREF() macro was converted to a static inline function, using __attribute__((always_inline)) was considered, but the idea was rejected. See bpo-35059. I'm now trying to convert the Py_TYPE() macro to a static inline function. The problem is that by default, MSC disables inlining and test_exceptions does crash with a stack overflow, since my PR 28128 increases the usage of the stack memory: see bpo-44348. For the specific case of CPython built by MSC, we can increase the stack size, or change compiler optimizations to enable inlining. But the problem is wider than just CPython built by MSC in debug mode. Third party C extensions built by distutils may get the same issue. Building CPython on other platforms on debug mode with all compiler optimizations disabled (ex: gcc -O0) can also have the same issue. I propose to reconsider the usage __forceinline (MSC) and __attribute__((always_inline)) (GCC, clang) on the most important static inline functions, like Py_INCREF() and Py_TYPE(), to avoid this issue. ---------- components: Interpreter Core messages: 400990 nosy: vstinner priority: normal severity: normal status: open title: Consider using __forceinline and __attribute__((always_inline)) for debug builds versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 09:26:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:26:54 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630675614.12.0.162926247927.issue45094@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Consider using __forceinline and __attribute__((always_inline)) for debug builds -> Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 09:27:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:27:09 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630675629.22.0.176765582309.issue45094@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +corona10, erlendaasland, pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 09:27:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:27:37 +0000 Subject: [issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions In-Reply-To: <1540391516.33.0.788709270274.issue35059@psf.upfronthosting.co.za> Message-ID: <1630675657.83.0.786587570598.issue35059@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See bpo-45094: "Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35059> _______________________________________ From report at bugs.python.org Fri Sep 3 09:27:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:27:41 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630675661.71.0.0342409733423.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See bpo-45094: "Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Fri Sep 3 09:36:38 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 03 Sep 2021 13:36:38 +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: <1630676198.45.0.16034809892.issue37596@roundup.psfhosted.org> Brandt Bucher <brandtbucher at gmail.com> added the comment: Thanks for finding this, Victor. That failure is surprising to me. Is it really possible for the order of the elements in a set to vary based on platform or build configuration (even with a fixed PYTHONHASHSEED at runtime)? Really, this looks like it?s only a bug in the test?s (read ?my?) assumptions, not really in marshal itself. I?m glad I added this little sanity check, though. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 09:37:05 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 03 Sep 2021 13:37:05 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630676225.55.0.206657515659.issue45094@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 09:53:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 13:53:06 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630677186.65.0.360262193321.issue45094@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26579 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28140 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:45:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:45:09 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680309.85.0.0368652300992.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7974c30b9fd84fa56ea1515ed2c08b38edf1a383 by Victor Stinner in branch 'main': bpo-45094: Add Py_NO_INLINE macro (GH-28140) https://github.com/python/cpython/commit/7974c30b9fd84fa56ea1515ed2c08b38edf1a383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:45:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:45:16 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680316.3.0.789390129899.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7974c30b9fd84fa56ea1515ed2c08b38edf1a383 by Victor Stinner in branch 'main': bpo-45094: Add Py_NO_INLINE macro (GH-28140) https://github.com/python/cpython/commit/7974c30b9fd84fa56ea1515ed2c08b38edf1a383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:45:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:45:09 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680309.59.0.422924820971.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7974c30b9fd84fa56ea1515ed2c08b38edf1a383 by Victor Stinner in branch 'main': bpo-45094: Add Py_NO_INLINE macro (GH-28140) https://github.com/python/cpython/commit/7974c30b9fd84fa56ea1515ed2c08b38edf1a383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:45:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:45:09 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680309.74.0.44636915052.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7974c30b9fd84fa56ea1515ed2c08b38edf1a383 by Victor Stinner in branch 'main': bpo-45094: Add Py_NO_INLINE macro (GH-28140) https://github.com/python/cpython/commit/7974c30b9fd84fa56ea1515ed2c08b38edf1a383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:45:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:45:09 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680309.74.0.44636915052.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7974c30b9fd84fa56ea1515ed2c08b38edf1a383 by Victor Stinner in branch 'main': bpo-45094: Add Py_NO_INLINE macro (GH-28140) https://github.com/python/cpython/commit/7974c30b9fd84fa56ea1515ed2c08b38edf1a383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:54:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Sep 2021 14:54:30 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630680870.16.0.491924254445.issue45094@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26580 pull_request: https://github.com/python/cpython/pull/28141 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 10:59:53 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 03 Sep 2021 14:59:53 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1630681193.89.0.567493550507.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya <isidentical at gmail.com>: ---------- pull_requests: +26581 pull_request: https://github.com/python/cpython/pull/28142 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43950> _______________________________________ From report at bugs.python.org Fri Sep 3 11:29:16 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 03 Sep 2021 15:29:16 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1630682956.98.0.104410779735.issue43950@roundup.psfhosted.org> Batuhan Taskaya <isidentical at gmail.com> added the comment: New changeset 85ea2d6165dec0cffa6302eb6dc40406eae1edf5 by Batuhan Taskaya in branch 'main': bpo-43950: support positions for dis.Instructions created through dis.Bytecode (GH-28142) https://github.com/python/cpython/commit/85ea2d6165dec0cffa6302eb6dc40406eae1edf5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43950> _______________________________________ From report at bugs.python.org Fri Sep 3 11:43:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 03 Sep 2021 15:43:14 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630683794.84.0.627897654621.issue45094@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: I like the idea of Py_ALWAYS_INLINE personally if we have to do that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Fri Sep 3 11:55:17 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 03 Sep 2021 15:55:17 +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: <1630684517.65.0.143444654095.issue37596@roundup.psfhosted.org> Brandt Bucher <brandtbucher at gmail.com> added the comment: I'm compiling Clang now to try to reproduce using a UBSan build (I'm on Ubuntu, though). I'm not entirely familiar with how these sanitizer builds work... could the implication be that we're hitting undefined behavior at some point? Or is it just a red herring? Note also that the "set([float('nan'), b'a', b'b', b'c', 'x', 'y', 'z'])" and "frozenset([float('nan'), b'a', b'b', b'c', 'x', 'y', 'z'])" tests seem to be working just fine... meaning their ordering on this buildbot is different under PYTHONHASHSEEDs 0 and 1 (as expected). It may still be a platform-or-configuration-dependent ordering, though. Raymond: off the top of your head, are there any obvious reasons this could be happening? ---------- assignee: -> brandtbucher _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 12:16:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 16:16:31 +0000 Subject: [issue1514420] Traceback display code can attempt to open a file named "<stdin>" Message-ID: <1630685791.72.0.888423489816.issue1514420@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26582 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28143 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1514420> _______________________________________ From report at bugs.python.org Fri Sep 3 12:18:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 16:18:35 +0000 Subject: [issue1514420] Traceback display code can attempt to open a file named "<stdin>" Message-ID: <1630685915.52.0.203591801258.issue1514420@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1514420> _______________________________________ From report at bugs.python.org Fri Sep 3 12:21:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 16:21:07 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630686067.15.0.992582484562.issue42255@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset bc1c49fa94b2abf70e6937373bf1e6b5378035c5 by Dong-hee Na in branch 'main': bpo-42255: Deprecate webbrowser.MacOSX from Python 3.11 (GH-27837) https://github.com/python/cpython/commit/bc1c49fa94b2abf70e6937373bf1e6b5378035c5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 12:26:21 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 03 Sep 2021 16:26:21 +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: <1630686381.96.0.552541768328.issue37596@roundup.psfhosted.org> Brandt Bucher <brandtbucher at gmail.com> added the comment: Found it. This particular build is configured with HAVE_ALIGNED_REQUIRED=1, which forces it to use fnv instead siphash24 as its string hashing algorithm. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 12:28:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 03 Sep 2021 16:28: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: <1630686500.35.0.749854416206.issue36521@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I am still not convinced that it's a good idea to put the docstring in the surrounding code object. I'd like to be able to see it when I introspect a code object, not just when introspecting a function object (I may be analyzing code only, and it's hard to connect the code object with the NEW_FUNCTION opcode in the parent code object -- you have to scan the bytecode, which is fragile.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Fri Sep 3 12:28:10 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 03 Sep 2021 16:28:10 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630686490.49.0.206190780871.issue42255@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- pull_requests: +26583 pull_request: https://github.com/python/cpython/pull/28144 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 12:30:11 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 03 Sep 2021 16:30:11 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630686611.59.0.57945949477.issue42255@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- pull_requests: +26584 pull_request: https://github.com/python/cpython/pull/28145 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 12:53:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 16:53:19 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630687999.58.0.625438953428.issue45022@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 8c3a10e58b12608c3759fee684e7aa399facae2a by Steve Dower in branch '3.8': bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982) (GH-28001) https://github.com/python/cpython/commit/8c3a10e58b12608c3759fee684e7aa399facae2a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Fri Sep 3 12:56:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 16:56:12 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1630688172.7.0.233723429264.issue45083@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 41c23740243cc3a0699bc4d5dcfd47a0007ff039 by Miss Islington (bot) in branch '3.9': [3.9] bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) (GH-28135) https://github.com/python/cpython/commit/41c23740243cc3a0699bc4d5dcfd47a0007ff039 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Fri Sep 3 13:01:49 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Fri, 03 Sep 2021 17:01:49 +0000 Subject: [issue45095] Easier loggers traversal tree with a logger.getChildren method Message-ID: <1630688509.83.0.0453605836271.issue45095@roundup.psfhosted.org> New submission from St?phane Blondon <stephane.blondon at gmail.com>: Currently, logging.root.manager.loggerDict is usable to do a homemade traversal of the loggers tree. However, it's not a public interface. Adding a 'logger.getChildren()' method would help to implement the traversal. The method would return a set of loggers. Usage example: >>> import logging >>> logging.basicConfig(level=logging.CRITICAL) >>> root_logger = logging.getLogger() <RootLogger root (CRITICAL)> >>> root_logger.getChildren() set() >>> a_logger = logging.getLogger("a") >>> root_logger.getChildren() {<Logger a. (CRITICAL)>} >>> logging.getLogger('a.b').setLevel(logging.DEBUG) >>> _ = logging.getLogger('a.c') >>> a_logger.getChildren() {<Logger a.c (CRITICAL)>, <Logger a.b (DEBUG)>} With such method, traverse the tree will be obvious to write with a recursive function. Use cases: - to check all the loggers are setted up correctly. I wrote a small function to get all loggers, and log on every level to check the real behaviour. - to draw the loggers tree like logging_tree library (https://pypi.org/project/logging_tree/). I didn't ask to logging_tree's maintainer but I don't think he would use such function because the library works for huge range of python releases. I plan to write a PR if someone thinks it's a good idea. ---------- components: Library (Lib) messages: 401006 nosy: sblondon priority: normal severity: normal status: open title: Easier loggers traversal tree with a logger.getChildren method type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45095> _______________________________________ From report at bugs.python.org Fri Sep 3 13:03:00 2021 From: report at bugs.python.org (Philip Prindeville) Date: Fri, 03 Sep 2021 17:03:00 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1630688580.32.0.0446029918826.issue43669@roundup.psfhosted.org> Change by Philip Prindeville <philipp at redfish-solutions.com>: ---------- nosy: +philipp _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43669> _______________________________________ From report at bugs.python.org Fri Sep 3 13:03:43 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 03 Sep 2021 17:03:43 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630688623.75.0.288378742705.issue45022@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- pull_requests: +26585 pull_request: https://github.com/python/cpython/pull/28146 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Fri Sep 3 13:04:05 2021 From: report at bugs.python.org (Philip Prindeville) Date: Fri, 03 Sep 2021 17:04:05 +0000 Subject: [issue33618] Support TLS 1.3 In-Reply-To: <1527086323.78.0.682650639539.issue33618@psf.upfronthosting.co.za> Message-ID: <1630688645.69.0.254453289182.issue33618@roundup.psfhosted.org> Change by Philip Prindeville <philipp at redfish-solutions.com>: ---------- nosy: +philipp _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33618> _______________________________________ From report at bugs.python.org Fri Sep 3 13:16:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 03 Sep 2021 17:16:21 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630689381.37.0.895189050954.issue45056@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Let's wait for 3.10.1 to backport this because I prefer to keep pyc files stable for the release candidate. Turns out that people are already preparing wheels to 3.10 and although this may be fine, I don't want to risk incompatibilities for the release. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Fri Sep 3 13:22:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 17:22:08 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630689728.37.0.524429891534.issue42255@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ce83e42437b8e5a4bf4237f981a7a90401922456 by Dong-hee Na in branch '3.9': bpo-42255: Update webbrowser doc for macOS (GH-28145) https://github.com/python/cpython/commit/ce83e42437b8e5a4bf4237f981a7a90401922456 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 13:22:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 17:22:26 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630689746.16.0.878726424159.issue42255@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 2a8956c268772fd31aeeb6ee522f123af94a2926 by Dong-hee Na in branch '3.10': bpo-42255: Update webbrowser doc for macOS (GH-28144) https://github.com/python/cpython/commit/2a8956c268772fd31aeeb6ee522f123af94a2926 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 13:23:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 17:23:08 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630689788.91.0.829146642664.issue42255@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 13:23:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 03 Sep 2021 17:23:03 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1630689783.83.0.515104425273.issue42255@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the patches, Dong-hee Na! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42255> _______________________________________ From report at bugs.python.org Fri Sep 3 14:32:07 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Sep 2021 18:32:07 +0000 Subject: [issue12499] textwrap.wrap: add control for fonts with different character widths In-Reply-To: <1309835004.91.0.584156217993.issue12499@psf.upfronthosting.co.za> Message-ID: <1630693927.78.0.797087245494.issue12499@roundup.psfhosted.org> ?ric Araujo <merwok at netwok.org> added the comment: A PR was opened for this. `text_len` is used as param/attribute name. ---------- versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue12499> _______________________________________ From report at bugs.python.org Fri Sep 3 14:37:40 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 03 Sep 2021 18:37:40 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630694260.11.0.145448599279.issue45022@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset 6f8bc464e006f672d1aeafbfd7c774a40215dab2 by Steve Dower in branch 'main': bpo-45022: Update libffi to 3.4.2 in Windows build (GH-28146) https://github.com/python/cpython/commit/6f8bc464e006f672d1aeafbfd7c774a40215dab2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Fri Sep 3 14:41:01 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 03 Sep 2021 18:41:01 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630694461.76.0.687902982493.issue45022@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: So on one hand, this change applies cleanly and it appears nothing needs to change to adopt the newer version. On the other hand, because the libffi DLL has a different name, it changes the layout on disk. I know we don't do that (except in exceptional circumstances) after beta, but perhaps this one is safe enough? We certainly don't "support" directly accessing the libffi DLL, but it still could break users (if, for example, they load another native module that implicitly used the older libffi and would now fail to load when it's missing). Any thoughts? ---------- stage: patch review -> backport needed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Fri Sep 3 14:57:00 2021 From: report at bugs.python.org (Michael Rans) Date: Fri, 03 Sep 2021 18:57:00 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630695420.71.0.301173157149.issue45093@roundup.psfhosted.org> Michael Rans <mcarans at yahoo.co.uk> added the comment: Thank you. Another case is in round trip processing of JSON or YML. Other cases are where you would prefer an OrderedDict over a dict. I think the method would help clarify things because it would make it obvious that it is for ordered comparisons while the existing == does not do that. eg. something like: d1.compare_ordered(d2) or: d1.compare(d2, ordered=True) # ordered could be by default True ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 15:02:38 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 03 Sep 2021 19:02:38 +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: <1630695758.29.0.696392872854.issue37596@roundup.psfhosted.org> Change by Brandt Bucher <brandtbucher at gmail.com>: ---------- pull_requests: +26586 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/28147 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Fri Sep 3 15:43:48 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 03 Sep 2021 19:43:48 +0000 Subject: [issue45096] Update Tools/freeze to make use of Tools/scripts/freeze_modules.py? Message-ID: <1630698228.01.0.74483718816.issue45096@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: In bpo-45019 we added Tools/scripts/freeze_modules.py to improve how we manage which modules get frozen by default. (We turned previously manual steps into automation of generated code.) There is probably some overlap with what we do in Tools/freeze/freeze.py. Is so, we should make changes for better re-use. ---------- components: Demos and Tools messages: 401015 nosy: eric.snow, lemburg priority: normal severity: normal stage: needs patch status: open title: Update Tools/freeze to make use of Tools/scripts/freeze_modules.py? type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45096> _______________________________________ From report at bugs.python.org Fri Sep 3 15:51:55 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 03 Sep 2021 19:51:55 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630698715.72.0.596916688735.issue45053@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Yes, it was encodings problem :) This line solved it (here: https://github.com/python/cpython/blob/6f8bc464e006f672d1aeafbfd7c774a40215dab2/Tools/scripts/md5sum.py#L69): ```python out.write('%s %s\n' % (m.hexdigest(), filename.encode( sys.getfilesystemencoding(), ).decode(sys.stdout.encoding))) ``` > The simplest way to "fix" the test is using TESTFN_ASCII instead of TESTFN. I haven't changed this, because right now it should work for non-ASCII symbols as well. I can even add an explicit ASCII test if needed. Shouldn't https://github.com/python/cpython/pull/28060 be merge before I submit a new PR, so we can be sure that test now works? In the current state it will be just ignored. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45053> _______________________________________ From report at bugs.python.org Fri Sep 3 16:12:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 03 Sep 2021 20:12:53 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630689381.37.0.895189050954.issue45056@roundup.psfhosted.org> Message-ID: <CAP7+vJJahbJZ2WTrfM8vXQeU1NZ_jOS5sprqz6NvuTbCLXdTwA@mail.gmail.com> Guido van Rossum <guido at python.org> added the comment: Are you sure? I know we're really close to the release, but I'd much rather change the PYC format during the RC cycle than once we're doing bugfix releases. I don't think we've ever changed the magic number between bugfix releases. (I realize this doesn't change the magic number, but it's probably also the first time we make a change that affects marshal output without requiring changes in marshal input. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Fri Sep 3 17:39:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 21:39:31 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630705171.74.0.243554529666.issue45075@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: New changeset 0b58e863df9970b290a4de90c67f9ac30c443817 by Irit Katriel in branch 'main': bpo-45075: distinguish between frame and FrameSummary in traceback mo? (GH-28112) https://github.com/python/cpython/commit/0b58e863df9970b290a4de90c67f9ac30c443817 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Fri Sep 3 17:41:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 21:41:37 +0000 Subject: [issue45075] confusion between frame and frame_summary in traceback module In-Reply-To: <1630496744.47.0.411180872388.issue45075@roundup.psfhosted.org> Message-ID: <1630705297.39.0.128895320314.issue45075@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45075> _______________________________________ From report at bugs.python.org Fri Sep 3 17:58:39 2021 From: report at bugs.python.org (Sam Bull) Date: Fri, 03 Sep 2021 21:58:39 +0000 Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org> Message-ID: <1630706319.22.0.945002772911.issue42130@roundup.psfhosted.org> Change by Sam Bull <m6f6g7 at sambull.org>: ---------- nosy: +dreamsorcerer nosy_count: 8.0 -> 9.0 pull_requests: +26587 pull_request: https://github.com/python/cpython/pull/28149 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42130> _______________________________________ From report at bugs.python.org Fri Sep 3 18:30:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 22:30:34 +0000 Subject: [issue23354] Loading 2 GiLOC file which raises exception causes wrong traceback In-Reply-To: <1422675641.92.0.509373230042.issue23354@psf.upfronthosting.co.za> Message-ID: <1630708234.11.0.240941000166.issue23354@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23354> _______________________________________ From report at bugs.python.org Fri Sep 3 19:33:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 03 Sep 2021 23:33:08 +0000 Subject: [issue25291] better Exception message for certain task termination scenario In-Reply-To: <1443729479.04.0.835148542508.issue25291@psf.upfronthosting.co.za> Message-ID: <1630711988.18.0.50679585427.issue25291@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: This is doing something different now (on 3.11): iritkatriel at Irits-MBP cpython % ./python.exe ttt.py /Users/iritkatriel/src/cpython/ttt.py:5: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() i am task.. [here it hangs and I kill it with ctrl-C] ^CTraceback (most recent call last): File "/Users/iritkatriel/src/cpython/ttt.py", line 12, in <module> loop.run_forever() ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/asyncio/base_events.py", line 595, in run_forever self._run_once() ^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/asyncio/base_events.py", line 1841, in _run_once event_list = self._selector.select(timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/selectors.py", line 562, in select kev_list = self._selector.control(None, max_ev, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyboardInterrupt Task exception was never retrieved future: <Task finished name='Task-1' coro=<task() done, defined at /Users/iritkatriel/src/cpython/ttt.py:6> exception=RuntimeError('Task does not support set_exception operation')> Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/ttt.py", line 8, in task myself.set_exception(RuntimeError('something bad')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Task does not support set_exception operation ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25291> _______________________________________ From report at bugs.python.org Fri Sep 3 19:39:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Sep 2021 23:39:51 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630712391.72.0.749516676171.issue20658@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20658> _______________________________________ From report at bugs.python.org Fri Sep 3 20:27:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 00:27:10 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1630715230.48.0.150516535695.issue45034@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: I agree, including use of hex, if possible, for unsigned (non-negative) values. Grepping 'format requires' returns F:\dev\3x\Modules\_struct.c: 365: "'%c' format requires 0 <= number <= %zu", F:\dev\3x\Modules\_struct.c: 371: "'%c' format requires %zd <= number <= %zd", F:\dev\3x\Modules\_struct.c: 550: "byte format requires -128 <= number <= 127"); F:\dev\3x\Modules\_struct.c: 565: "ubyte format requires 0 <= number <= 255"); F:\dev\3x\Modules\_struct.c: 577: "char format requires a bytes object of length 1"); F:\dev\3x\Modules\_struct.c: 593: "short format requires " Py_STRINGIFY(SHRT_MIN) F:\dev\3x\Modules\_struct.c: 611: "ushort format requires 0 <= number <= " Py_STRINGIFY(USHRT_MAX)); I believe l365 is the source for the 2nd example. AFAIK, 'zu' is not valid for either C printf or Python % formating. Lines 611 and 612 are the source for the 1st example. From comments before line 365, there can be issues with lefts shifts, but '0xffff', '0xffff_ffff', and '0xffff_ffff_ffff_ffff' could be hard-coded strings that would cover all 'normal' systems. Grepping "argument out of range" returns F:\dev\3x\Modules\_struct.c: 168: "argument out of range"); F:\dev\3x\Modules\_struct.c: 192: "argument out of range"); F:\dev\3x\Modules\_struct.c: 215: "argument out of range"); F:\dev\3x\Modules\_struct.c: 238: "argument out of range"); F:\dev\3x\Modules\_struct.c: 261: "argument out of range"); F:\dev\3x\Modules\_struct.c: 284: "argument out of range"); It is nnclear to me without more reading why some codes lead to this less helpful message. ---------- nosy: +terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Fri Sep 3 20:29:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 04 Sep 2021 00:29:53 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630715393.72.0.520957930053.issue45056@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I honestly want to backport it because I think it should not have any negative impact, but on the other hand I don't feel very confident as the release candidate phase is supposed to be as close as possible as the final release and this is not fixing a critical bug. The devguide says about the RC: >>Generally, these issues must be severe enough (e.g. crashes) that they deserve fixing before the final release. All other issues should be deferred to the next development cycle, since stability is the strongest concern at this point. I am just trying to be cautious but on the other hand we still have anltbet release candidate for people to try it out before the final release so if you all think is better to have this on the RC and this is not going to be an issue for existing universal wheels and the like, then I suppose we can merge it before Rc2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Fri Sep 3 20:34:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Sep 2021 00:34:38 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630715678.85.0.109566847712.issue45093@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: -1 The dict API is to important to be burdened with a mostly useless and rarely needed method. Besides we already have simple ways to do it, for example: assert list(d.items()) == list(e.items()) or: assert OrderedDict(d) == OrderedDict(e) ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 20:35:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 04 Sep 2021 00:35:37 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630715737.46.0.757568116715.issue45056@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Since we're not changing the magic number, wheels created for rc1 will still work with the final 3.10 (and vice versa!) -- creating a wheel or PYC file just will produce a different sequence of bytes, but there are other things that do that. Then again, since we're not changing the magic number, it's not the end of the world to put off the backport to 3.10.1. So I've convinced myself that it actually doesn't matter, and probably it's best to wait for 3.10.1 (changes to the compiler are always risky). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Fri Sep 3 20:52:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 04 Sep 2021 00:52:02 +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: <1630716722.13.0.707445591704.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: > I am still not convinced that it's a good idea to put the docstring in the surrounding code object. I'd like to be able to see it when I introspect a code object, not just when introspecting a function object (I may be analyzing code only, and it's hard to connect the code object with the NEW_FUNCTION opcode in the parent code object -- you have to scan the bytecode, which is fragile.) I think that reasoning is not strong enough to add new member to code object. * Modules and classes don't get docstring from their code objects. Why only functions need to store docstring? * Lambdas, comprehensions, and PEP 649 (if acceptted) uses code objects but no docstring. Why they need to pay cost of `co_doc` member? (cost = memory + unmarshal time). Code objects have filename and firstlineno. And there are many functions without docstring. So removing docstring from code object won't make inspection hard so much. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Fri Sep 3 21:03:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 04 Sep 2021 01:03:49 +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: <1630717429.05.0.453441880423.issue36521@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Let's wait until Mark Shannon is back from vacation (another week). Note that class docstrings *are* contained in the class body code object -- there's executable code equivalent to __doc__ = "this is the docstring" But I agree it's not easily found without analyzing the bytecode. Maybe the status quo is best after all? I would like to be able to identify code objects for functions, we could add a bit to co_flags for that. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Fri Sep 3 21:03:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 01:03:54 +0000 Subject: [issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter In-Reply-To: <1630409490.64.0.879285632353.issue45058@roundup.psfhosted.org> Message-ID: <1630717434.44.0.370739297945.issue45058@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: "except a or b:" should be same as "except (a or b):" which should be same as "except a:", which is current behavior in 3.10.0, etc. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45058> _______________________________________ From report at bugs.python.org Fri Sep 3 21:08:25 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 04 Sep 2021 01:08:25 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630717705.59.0.552743885416.issue45020@roundup.psfhosted.org> Nick Coghlan <ncoghlan at gmail.com> added the comment: For the module metadata problem: one potential approach to that for "designed to be frozen" stdlib modules is to set the values directly in the module code, rather than trying to set them automatically in the frozen import machinery. It should also be possible to delete the implicitly created metadata fields and use module level dynamic attribute retrieval to find the stdlib source code for tracebacks and introspection purposes without incurring any start up costs. ---------- nosy: +ncoghlan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 3 21:13:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 01:13:18 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630717998.1.0.328006158377.issue45060@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: New changeset e2b29304137e6253b7bb89c180ef5d113d60b4eb by Serhiy Storchaka in branch '3.10': [3.10] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28092) https://github.com/python/cpython/commit/e2b29304137e6253b7bb89c180ef5d113d60b4eb ---------- nosy: +terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45060> _______________________________________ From report at bugs.python.org Fri Sep 3 21:14:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 01:14:15 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630718055.22.0.57947541319.issue45060@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45060> _______________________________________ From report at bugs.python.org Fri Sep 3 22:07:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 02:07:00 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630721220.05.0.115323228855.issue45086@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: The behavior remains the same in 3.11 ('main' branch). New PEG parser parses this the same. (Pablo, if there is a mistake below, please correct.) Normally, the parser copies code chars between quotes, with or without '\' interpretation, into a string object. When the 'f' prefix is given, the string gets divided into substrings and replacement fields. The code part of each replacement field is separately parsed. There are two options: 1. parse the field code while looking for an endcode marker; 2. look ahead for an endcode marker and then parse the code. The current behavior is consistent with opotion 1 and the python policy of reporting the first error found and exiting, rather than trying to resynchronize to try to find more errors. ---------- nosy: +pablogsal, terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Fri Sep 3 22:27:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Sep 2021 02:27:46 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630722466.19.0.673707449452.issue45093@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: -1 The dict API is too important to be burdened with a mostly useless and rarely needed method. Besides we already have simple ways to do it, for example: assert list(d.items()) == list(e.items()) or: assert OrderedDict(d) == OrderedDict(e) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 22:27:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Sep 2021 02:27:55 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630722475.14.0.868799188319.issue45093@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- Removed message: https://bugs.python.org/msg401022 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 22:35:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 02:35:34 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630722934.67.0.300933719767.issue45093@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: -1 also for the reasons given. Michael, a question asking how would have made a good python-list post. So I posted the answers in "How to include insertion order in dict equality" ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Fri Sep 3 22:41:26 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sat, 04 Sep 2021 02:41:26 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it Message-ID: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> New submission from Chih-Hsuan Yen <yan12125 at gmail.com>: With Python 3.9.7, "DeprecationWarning: The loop argument is deprecated" may be reported when user code does not use it. Here is an example: import asyncio import warnings warnings.filterwarnings('error') def crash(): raise KeyboardInterrupt async def main(): asyncio.get_event_loop().call_soon(crash) await asyncio.sleep(5) try: asyncio.run(main()) except KeyboardInterrupt: pass On 3.9.6, no warning is reported, while results on 3.9.7 are Traceback (most recent call last): File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete self.run_forever() File "/usr/lib/python3.9/asyncio/base_events.py", line 596, in run_forever self._run_once() File "/usr/lib/python3.9/asyncio/base_events.py", line 1890, in _run_once handle._run() File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/home/yen/var/local/Computer/archlinux/community/python-anyio/trunk/cpython-3.9.7-regression.py", line 11, in crash raise KeyboardInterrupt KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/yen/var/local/Computer/archlinux/community/python-anyio/trunk/cpython-3.9.7-regression.py", line 18, in <module> asyncio.run(main()) File "/usr/lib/python3.9/asyncio/runners.py", line 47, in run _cancel_all_tasks(loop) File "/usr/lib/python3.9/asyncio/runners.py", line 64, in _cancel_all_tasks tasks.gather(*to_cancel, loop=loop, return_exceptions=True)) File "/usr/lib/python3.9/asyncio/tasks.py", line 755, in gather warnings.warn("The loop argument is deprecated since Python 3.8, " DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10. As indicated by the traceback, the loop argument is used inside the asyncio library, not from user code. It has been an issue for some time, and the issue is exposed after changes for issue44815. Credit: this example code is modified from an anyio test https://github.com/agronholm/anyio/blob/3.3.0/tests/test_taskgroups.py#L943. I noticed this issue when I was testing anyio against 3.9.7. ---------- components: asyncio messages: 401032 nosy: asvetlov, yan12125, yselivanov priority: normal severity: normal status: open title: "The loop argument is deprecated" reported when user code does not use it type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Fri Sep 3 22:42:34 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sat, 04 Sep 2021 02:42:34 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1630723354.55.0.67088667108.issue44815@roundup.psfhosted.org> Chih-Hsuan Yen <yan12125 at gmail.com> added the comment: A regression in 3.9.7 (issue45097) seems related to this issue. Could you have a look? ---------- nosy: +yan12125 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44815> _______________________________________ From report at bugs.python.org Fri Sep 3 22:58:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 04 Sep 2021 02:58:34 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630724314.48.0.216893353784.issue45086@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I don't think it really makes a difference, but here's some background: For f-strings, the parser itself does not break apart the f-string into (<text>, <expression>) parts. There's a custom parser (at https://github.com/python/cpython/blob/0b58e863df9970b290a4de90c67f9ac30c443817/Parser/string_parser.c#L837) which does that. Then the normal parser is used to parse the expression portion. I think the error shown here is not in the expression parser, but in the fstring parser in fstring_find_expr(), at https://github.com/python/cpython/blob/0b58e863df9970b290a4de90c67f9ac30c443817/Parser/string_parser.c#L665 As Terry says, it's not incorrect to print the error show in this bug report. To further diverge: There's been talk about using the normal parser to pull apart the entire f-string, instead of using the two-pass version I mention above. But we've never gotten past just talking about it. There are pros and cons for doing it with the normal parser, but that's a discussion for a different forum. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Sat Sep 4 00:12:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 04 Sep 2021 04:12:12 +0000 Subject: [issue41010] email.message.EmailMessage.get_body In-Reply-To: <1592410013.12.0.0160903099449.issue41010@roundup.psfhosted.org> Message-ID: <1630728732.0.0.103972105043.issue41010@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed type: crash -> behavior versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41010> _______________________________________ From report at bugs.python.org Sat Sep 4 01:24:13 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 04 Sep 2021 05:24:13 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630695420.71.0.301173157149.issue45093@roundup.psfhosted.org> Message-ID: <20210904052221.GA26999@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: > Another case is in round trip processing of JSON or YML. Sorry for my ignorance, but I don't see how or why an unordered comparison would help you with round-tripping JSON or YAML. The order of key:value pairs in JSON is not guaranteed to be preserved, so if you round-trip a dict to JSON back to a dict, and then use an ordered comparison, you might wrongly think that they are unequal. (I think that Python's JSON does preserve order, by default. But other JSON encoders might not.) > Other cases are where you would prefer an OrderedDict over a dict. Then use an OrderedDict. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Sat Sep 4 01:31:22 2021 From: report at bugs.python.org (Michael Rans) Date: Sat, 04 Sep 2021 05:31:22 +0000 Subject: [issue45093] Add method to compare dicts accounting for order In-Reply-To: <1630642392.86.0.263268758429.issue45093@roundup.psfhosted.org> Message-ID: <1630733482.99.0.634475431713.issue45093@roundup.psfhosted.org> Michael Rans <mcarans at yahoo.co.uk> added the comment: Thanks for all your help and advice. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ From report at bugs.python.org Sat Sep 4 02:55:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 06:55:47 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630738547.94.0.996794948373.issue20658@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: > For the very specific case of os.environ.clear(), the C function clearenv() could be used if available. It is bad in any way. The supposed example of using clear(): old_environ = dict(os.environ) os.environ.clear() os.environ.update(new_environ) ... os.environ.clear() os.environ.update(old_environ) Even if clear() passed, it will fail on attempt to restore the old environment, with the empty key. You can have the same issue in a corresponding C code. I think the only way is to report this as a bug in glibc and wait on their reaction. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20658> _______________________________________ From report at bugs.python.org Sat Sep 4 03:08:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 07:08:21 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630739301.71.0.322188774126.issue45053@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It will not work in all cases. For example if the stdio encoding is UTF-8 and the filesystem encoding is Latin1. Or the stdio encoding is CP1251 and the filesystem encoding is UTF-8. I am not also sure that it gives us the result which we want if it doesn't fail. It is a general and complex issue, and every program which writes file names to stdout is affected. For now I suggest just use TESTFN_ASCII instead of TESTFN. We will find better solution in future. I hesitate about merging PR 28060 because it can fail also on some non-Windows buildbots with uncommon locale settings. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45053> _______________________________________ From report at bugs.python.org Sat Sep 4 03:36:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 07:36:00 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630740960.31.0.0642406723423.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 04:11:21 2021 From: report at bugs.python.org (Christodoulos Tsoulloftas) Date: Sat, 04 Sep 2021 08:11:21 +0000 Subject: [issue44649] dataclasses slots with init=False field raises AttributeException In-Reply-To: <1626375963.06.0.364448585924.issue44649@roundup.psfhosted.org> Message-ID: <1630743081.29.0.0376512215173.issue44649@roundup.psfhosted.org> Christodoulos Tsoulloftas <chris at komposta.net> added the comment: Thanks for the update eric, yeah the new error messages are much more comprehensive and I am glad to hear the original issue will be addressed as well. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44649> _______________________________________ From report at bugs.python.org Sat Sep 4 04:29:58 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 04 Sep 2021 08:29:58 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1630744198.27.0.717669941163.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya <isidentical at gmail.com>: ---------- pull_requests: +26588 pull_request: https://github.com/python/cpython/pull/28150 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43950> _______________________________________ From report at bugs.python.org Sat Sep 4 05:18:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 09:18:28 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630747108.6.0.0756421640854.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 05:19:42 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 04 Sep 2021 09:19:42 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630717705.59.0.552743885416.issue45020@roundup.psfhosted.org> Message-ID: <226d97ff-889a-9575-7e8e-42ab3ee19af3@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: FWIW, I've not found the importer for frozen modules to be lacking features. When using frozen modules, you don't expect to see source code, so the whole part about finding source code is not really relevant for that use case. The only lacking part I found regarding frozen modules is support for these in pkgutil.py. But that's easy to add: --- /home/lemburg/egenix/projects/PyRun/Python-3.8.0/Lib/pkgutil.py 2019-10-14 1> +++ ./Lib/pkgutil.py 2019-11-17 11:36:38.404752218 +0100 @@ -315,20 +315,27 @@ return self.etc[2]==imp.PKG_DIRECTORY def get_code(self, fullname=None): + # eGenix PyRun needs pkgutil to also work for frozen modules, + # since pkgutil is used by the runpy module, which is needed + # to implement the -m command line switch. + if self.code is not None: + return self.code fullname = self._fix_name(fullname) - if self.code is None: - mod_type = self.etc[2] - if mod_type==imp.PY_SOURCE: - source = self.get_source(fullname) - self.code = compile(source, self.filename, 'exec') - elif mod_type==imp.PY_COMPILED: - self._reopen() - try: - self.code = read_code(self.file) - finally: - self.file.close() - elif mod_type==imp.PKG_DIRECTORY: - self.code = self._get_delegate().get_code() + mod_type = self.etc[2] + if mod_type == imp.PY_FROZEN: + self.code = imp.get_frozen_object(fullname) + return self.code + elif mod_type==imp.PY_SOURCE: + source = self.get_source(fullname) + self.code = compile(source, self.filename, 'exec') + elif mod_type==imp.PY_COMPILED: + self._reopen() + try: + self.code = read_code(self.file) + finally: + self.file.close() + elif mod_type==imp.PKG_DIRECTORY: + self.code = self._get_delegate().get_code() return self.code def get_source(self, fullname=None): ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 4 07:19:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 04 Sep 2021 11:19:31 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630754371.06.0.550484720021.issue20658@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: POSIX says: (1) "The setenv() function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character." https://pubs.opengroup.org/onlinepubs/009604499/functions/setenv.html (2) "The unsetenv() function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character." https://pubs.opengroup.org/onlinepubs/009695399/functions/unsetenv.html But POSIX doesn't specify which keys are invalid for putenv. It only specifies a single error: (3) "The putenv() function may fail if: [ENOMEM] Insufficient memory was available." https://pubs.opengroup.org/onlinepubs/009696899/functions/putenv.html The GNU libc respects POSIX. IMO setenv() and unsetenv() are fine. The problem comes from putenv() which is under specified and allows keys which are causing a lot of subtle issues, not only in Python. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20658> _______________________________________ From report at bugs.python.org Sat Sep 4 08:19:01 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 04 Sep 2021 12:19:01 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1630757941.56.0.828356681983.issue45034@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Sat Sep 4 08:29:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 04 Sep 2021 12:29:38 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630758578.87.0.874885063636.issue45086@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > But we've never gotten past just talking about it Stay tuned! :) https://github.com/we-like-parsers/cpython/tree/fstring-grammar ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Sat Sep 4 08:53:30 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 04 Sep 2021 12:53:30 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1630760010.66.0.507473277592.issue45034@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: I would like to work on this if nobody else has already started :) ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Sat Sep 4 09:04:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 13:04:47 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630760687.79.0.701281132209.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26589 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28153 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 09:09:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 13:09:27 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630760967.98.0.678162967952.issue45097@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: There are several calls of gather() and sleep() with the loop argument from the asyncio library. Since all deprecation warnings were silenced in tests it was unnoticed. PR 28153 fixes the asyncio library, enables deprecation warnings in tests, fixes tests producing warnings and add several new tests for uncovered code. New tests will be ported to master later. ---------- nosy: +lukasz.langa priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 09:17:43 2021 From: report at bugs.python.org (Sam Bull) Date: Sat, 04 Sep 2021 13:17:43 +0000 Subject: [issue45098] asyncio.CancelledError should contain more information on cancellations Message-ID: <1630761463.35.0.712522138496.issue45098@roundup.psfhosted.org> New submission from Sam Bull <m6f6g7 at sambull.org>: There are awkward edge cases caused by race conditions when cancelling tasks which make it impossible to reliably cancel a task. For example, in the async-timeout library there appears to be no way to avoid suppressing an explicit t.cancel() if that cancellation occurs immediately after the timeout. In the alternative case where a cancellation happens immediately before the timeout, the solutions feel dependant on the internal details of how asynico.Task works and could easily break if the behaviour is tweaked in some way. What we really need to know is how many times a task was cancelled as a cause of the CancelledError and ideally were the cancellations caused by us. The solution I'd like to propose is that the args on the exception contain all the messages of every cancel() call leading up to that exception, rather than just the first one. e.g. In these race conditions e.args would look like (None, SENTINEL), where SENTINEL was sent in our own cancellations. From this we can see that the task was cancelled twice and only one was caused by us, therefore we don't want to suppress the CancelledError. For more details to fully understand the problem: https://github.com/aio-libs/async-timeout/pull/230 https://github.com/aio-libs/async-timeout/issues/229#issuecomment-908502523 https://github.com/aio-libs/async-timeout/pull/237 ---------- components: asyncio messages: 401045 nosy: asvetlov, dreamsorcerer, yselivanov priority: normal severity: normal status: open title: asyncio.CancelledError should contain more information on cancellations type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45098> _______________________________________ From report at bugs.python.org Sat Sep 4 09:24:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 13:24:26 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630761866.56.0.827455548196.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26590 pull_request: https://github.com/python/cpython/pull/28154 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 10:20:01 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 04 Sep 2021 14:20:01 +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: <1630765201.34.0.523398841522.issue37596@roundup.psfhosted.org> Change by Brandt Bucher <brandtbucher at gmail.com>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37596> _______________________________________ From report at bugs.python.org Sat Sep 4 12:38:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 16:38:49 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630773529.62.0.448401754019.issue45086@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Thank you Eric. I can see now that the actual process is a somewhat complicated mix of the simple options 1 and 2 I imagined above. It is like option 2, except that everything between '{' and '}' is partially parsed enough to create a format object. This is required to ignore quoted braces >>> f'{"}"' SyntaxError: f-string: expecting '}' and detect valid '!' and ':' markers. In that partial parsing, unmatched fences are detected and reported, while other syntax errors are not. If my option 1 above were true, the first example below would instead report the 'a a' error. >>> f'{a a' SyntaxError: f-string: expecting '}' >>> f'{a a]' SyntaxError: f-string: unmatched ']' >>> f'{a a}' SyntaxError: f-string: invalid syntax. Perhaps you forgot a comma? The second plausibly could, but outside of the f-string context, the error is the same. >>> a a] SyntaxError: unmatched ']' Greg, the fuller answer to your question is that the interpreter is only *required* to report that there is an error and some indication of where. "SyntaxError: invalid syntax" is the default. It may have once been all that was ever reported. A lot of recent effort has gone into adding detail into what is wrong and what the fix might be. But both additions sometimes involve choices that may not meet a particular person's expectation. Another person, expecting linear rather than nested parsing, might look at the first example above and ask whether the interpreter should be complaining about the 'a a' syntax error instead of the following lack of '}' f-string error. And I would not call it a bug if it were to do so in the future. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Sat Sep 4 13:04:04 2021 From: report at bugs.python.org (jack1142) Date: Sat, 04 Sep 2021 17:04:04 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1630775044.58.0.722724941311.issue45099@roundup.psfhosted.org> Change by jack1142 <kuba.kuczys at gmail.com>: ---------- components: +asyncio nosy: +asvetlov, yselivanov _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45099> _______________________________________ From report at bugs.python.org Sat Sep 4 13:03:48 2021 From: report at bugs.python.org (jack1142) Date: Sat, 04 Sep 2021 17:03:48 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not Message-ID: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> New submission from jack1142 <kuba.kuczys at gmail.com>: The documentation here: https://docs.python.org/3.10/library/asyncio-task.html#asyncio.Task Says that `loop` parameter was removed but it's still part of the signature. It gets even more confusing when the deprecation right below it is saying that *not* passing it when there is no running event loop is deprecated :) I could make a PR removing this information but I'm not sure whether there should be also some information put about it being deprecated in 3.8 but not actually getting removed in 3.10? ---------- assignee: docs at python components: Documentation messages: 401047 nosy: docs at python, jack1142 priority: normal severity: normal status: open title: asyncio.Task's documentation says that loop arg is removed when it's not type: behavior versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45099> _______________________________________ From report at bugs.python.org Sat Sep 4 13:35:20 2021 From: report at bugs.python.org (Greg Kuhn) Date: Sat, 04 Sep 2021 17:35:20 +0000 Subject: [issue45086] f-string unmatched ']' In-Reply-To: <1630594520.19.0.424009972084.issue45086@roundup.psfhosted.org> Message-ID: <1630776920.55.0.6645959015.issue45086@roundup.psfhosted.org> Greg Kuhn <gregorykuhn at gmail.com> added the comment: I see, thank you all for the detailed investigation and explanation!! Agreed Terry, anyone who reads the error should be able to parse it themselves and see what the errors is. Pointing the user to the error site is the most important piece. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ From report at bugs.python.org Sat Sep 4 13:54:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 17:54:54 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630778094.44.0.417434451384.issue45097@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset c967bd523caabb05bf5988449487d7c1717f3ac6 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45097: Remove incorrect deprecation warnings in asyncio. (GH-28153) https://github.com/python/cpython/commit/c967bd523caabb05bf5988449487d7c1717f3ac6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 13:55:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 17:55:23 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630778123.91.0.931957781297.issue45097@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset c2970fdec52788b6d9ff419ab7e31f255d87433d by Serhiy Storchaka in branch 'main': bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) https://github.com/python/cpython/commit/c2970fdec52788b6d9ff419ab7e31f255d87433d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 13:55:53 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 17:55:53 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630778153.13.0.707502300073.issue45097@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26591 pull_request: https://github.com/python/cpython/pull/28159 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 14:02:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 18:02:33 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630778553.48.0.168024201061.issue45030@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 936f6a16b9ef85bd56b18a247b962801e954c30e by Serhiy Storchaka in branch 'main': bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000) https://github.com/python/cpython/commit/936f6a16b9ef85bd56b18a247b962801e954c30e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 14:02:28 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 18:02:28 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630778548.9.0.642663050092.issue45030@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26592 pull_request: https://github.com/python/cpython/pull/28160 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 14:02:33 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 18:02:33 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630778553.05.0.982244783525.issue45030@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26593 pull_request: https://github.com/python/cpython/pull/28161 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 14:03:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Sep 2021 18:03:28 +0000 Subject: [issue45100] Teach help about typing.overload() Message-ID: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> New submission from Raymond Hettinger <raymond.hettinger at gmail.com>: Python's help() function does not display overloaded function signatures. For example, this code: from typing import Union class Smudge(str): @overload def __getitem__(self, index: int) -> str: ... @overload def __getitem__(self, index: slice) -> 'Smudge': ... def __getitem__(self, index: Union[int, slice]) -> Union[str, 'Smudge']: 'Return a smudged character or characters.' if isinstance(index, slice): start, stop, step = index.indices(len(self)) values = [self[i] for i in range(start, stop, step)] return Smudge(''.join(values)) c = super().__getitem__(index) return chr(ord(c) ^ 1) Currently gives this help: __getitem__(self, index: Union[int, slice]) -> Union[str, ForwardRef('Smudge')] Return a smudged character or characters. What is desired is: __getitem__(self, index: int) -> str __getitem__(self, index: slice) -> ForwardRef('Smudge') Return a smudged character or characters. The overload() decorator is sufficient for informing a static type checker but insufficient for informing a user or editing tool. ---------- messages: 401052 nosy: rhettinger priority: normal severity: normal status: open title: Teach help about typing.overload() _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sat Sep 4 14:26:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 18:26:46 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1630780006.33.0.555785943344.issue45034@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Go ahead, with the understanding that there is no guaranteed acceptance of the change, even with a good patch. There may be reasons for the status quo that neither Steven nor I are aware of. I don't think that either of the listed experts, added as nosy, are very active. In any case, revised or new tests will be needed. ---------- nosy: +mark.dickinson, meador.inge _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Sat Sep 4 14:30:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 04 Sep 2021 18:30:08 +0000 Subject: [issue16731] [doc] xxlimited/xxmodule docstrings ambiguous In-Reply-To: <1355946646.69.0.259699636535.issue16731@psf.upfronthosting.co.za> Message-ID: <1630780208.82.0.418604225953.issue16731@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- title: xxlimited/xxmodule docstrings ambiguous -> [doc] xxlimited/xxmodule docstrings ambiguous versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue16731> _______________________________________ From report at bugs.python.org Sat Sep 4 14:32:12 2021 From: report at bugs.python.org (Kien Dang) Date: Sat, 04 Sep 2021 18:32:12 +0000 Subject: [issue45101] Small inconsistency in usage message between the python and shell script versions of python-config Message-ID: <1630780332.11.0.126671398839.issue45101@roundup.psfhosted.org> New submission from Kien Dang <mail at kien.ai>: `python-config` outputs a usage instruction message in case either the `--help` option or invalid arguments are provided. However there is a small different in the output I/O between the python and shell script versions of `python-config`. In the python version, the message always prints to `stderr`. https://github.com/python/cpython/blob/bc1c49fa94b2abf70e6937373bf1e6b5378035c5/Misc/python-config.in#L15-L18 def exit_with_usage(code=1): print("Usage: {0} [{1}]".format( sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr) sys.exit(code) while in the shell script version it always prints to `stdout`. https://github.com/python/cpython/blob/bc1c49fa94b2abf70e6937373bf1e6b5378035c5/Misc/python-config.sh.in#L5-L9 exit_with_usage () { echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed" exit $1 } This inconsistency does not affect most users of `python-config`, who runs the script interactively. However it might cause issues when run programmatically. ---------- components: Demos and Tools messages: 401054 nosy: kiendang priority: normal severity: normal status: open title: Small inconsistency in usage message between the python and shell script versions of python-config type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45101> _______________________________________ From report at bugs.python.org Sat Sep 4 14:37:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 04 Sep 2021 18:37:30 +0000 Subject: [issue24612] not operator expression raising a syntax error In-Reply-To: <1436628233.38.0.197597566636.issue24612@psf.upfronthosting.co.za> Message-ID: <1630780650.07.0.319591602488.issue24612@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11: >>> 0 + not 0 File "<stdin>", line 1 0 + not 0 ^^^ SyntaxError: invalid syntax >>> - not 0 File "<stdin>", line 1 - not 0 ^^^ SyntaxError: invalid syntax ---------- nosy: +iritkatriel, pablogsal versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24612> _______________________________________ From report at bugs.python.org Sat Sep 4 14:38:18 2021 From: report at bugs.python.org (Kien Dang) Date: Sat, 04 Sep 2021 18:38:18 +0000 Subject: [issue45101] Small inconsistency in usage message between the python and shell script versions of python-config In-Reply-To: <1630780332.11.0.126671398839.issue45101@roundup.psfhosted.org> Message-ID: <1630780698.72.0.866279703752.issue45101@roundup.psfhosted.org> Change by Kien Dang <mail at kien.ai>: ---------- keywords: +patch pull_requests: +26594 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28162 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45101> _______________________________________ From report at bugs.python.org Sat Sep 4 16:01:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:01:13 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup Message-ID: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: The proposed PR adds tests for skipping and errors in cleanup: after success, after failure, and in combination with the expectedFailure decorator. ---------- components: Library (Lib) messages: 401056 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: unittest: add tests for skipping and errors in cleanup versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sat Sep 4 16:03:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:03:06 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630785786.57.0.124310009538.issue45102@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26595 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28166 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sat Sep 4 16:18:30 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Sep 2021 20:18:30 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1630786710.27.0.831842772539.issue44571@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- keywords: +patch pull_requests: +26596 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28167 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44571> _______________________________________ From report at bugs.python.org Sat Sep 4 16:38:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:38:04 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630787884.92.0.969782732762.issue45097@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 2ad114ddffbeeef1d20f26571b85a66974295667 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) (GH-28159) https://github.com/python/cpython/commit/2ad114ddffbeeef1d20f26571b85a66974295667 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 16:38:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:38:44 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630787924.61.0.00551405061326.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sat Sep 4 16:39:37 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 20:39:37 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630787977.57.0.498047220245.issue45030@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset ed9f927527e100b6d1d5758fdd9fc20b313af226 by Miss Islington (bot) in branch '3.10': bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000) https://github.com/python/cpython/commit/ed9f927527e100b6d1d5758fdd9fc20b313af226 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 16:39:51 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 20:39:51 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630787991.31.0.165542387441.issue45030@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset fecd17fbcb68138c6535130dfca2173472d669cd by Miss Islington (bot) in branch '3.9': bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000) https://github.com/python/cpython/commit/fecd17fbcb68138c6535130dfca2173472d669cd ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 16:40:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:40:18 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630788018.88.0.624013665739.issue45030@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45030> _______________________________________ From report at bugs.python.org Sat Sep 4 16:42:46 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 20:42:46 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630788166.23.0.143881677631.issue45042@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26597 pull_request: https://github.com/python/cpython/pull/28168 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sat Sep 4 16:42:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:42:44 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630788164.13.0.58781844229.issue45042@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset dd7b816ac87e468e2fa65ce83c2a03fe1da8503e by Nikita Sobolev in branch 'main': bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060) https://github.com/python/cpython/commit/dd7b816ac87e468e2fa65ce83c2a03fe1da8503e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sat Sep 4 16:51:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Sep 2021 20:51:25 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630788685.26.0.581292372666.issue45042@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26598 pull_request: https://github.com/python/cpython/pull/28169 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sat Sep 4 17:04:51 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 04 Sep 2021 21:04:51 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630789491.52.0.535190716802.issue45042@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset e5976dd2e6e966183da59df99978ebcb4b3a32df by Miss Islington (bot) in branch '3.10': bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060) https://github.com/python/cpython/commit/e5976dd2e6e966183da59df99978ebcb4b3a32df ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sat Sep 4 17:16:59 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 21:16:59 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures Message-ID: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> New submission from Terry J. Reedy <tjreedy at udel.edu>: There were reports on a previous issue that attempting to display some characters from some linux fonts in some distributions resulted in crashing Python. The crash reports mentioned XWindows errors about particular characters being too complex or something. I did not open an issue for this because it seemed beyond the ability of tkinter/IDLE to predict and handle. https://stackoverflow.com/questions/68996159/idle-settings-window-wont-appear reported that requesting the IDLE settings window resulting in IDLE hanging. The user used my print debug suggestion to determine that the problem was in configdialog.py at self.fontpage = FontPage(note, self.highpage) The user first thought the issue was with a chess font, and then determined that the problem font was the phaistos font from https://ctan.org/pkg/phaistos?lang=en. The font has the symbols from the Cretan Linear A script on the Disk of Phaistos. This issue is about 1. Try to reproduce the issue by downloading and installing Phaistos.otf (right click on the file and click Install). 2. If successful, trace the problem to a specific line within the FontPage class. 3. Determine whether Python code can prevent the hang or if it is completely in other code. (Either way, perhaps report to tcl/tk.) ... To remove, "open Control Panel -> Fonts then locate and select Phaistos Regular font then proceed with clicking Delete button." I did not select 'test needed' because we cannot routinely install new fonts and I am not sure of how to do an automated test if we could. However, I would add a note as to how to do a manual test. font.otf = OpenTypeFont, used on Windows, Linux, macOS. https://fileinfo.com/extension/otf It might be good test on other systems after Windows. ---------- messages: 401062 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: make configdialog font page survive font failures type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Sat Sep 4 17:19:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 04 Sep 2021 21:19:01 +0000 Subject: [issue24612] not operator expression raising a syntax error In-Reply-To: <1436628233.38.0.197597566636.issue24612@psf.upfronthosting.co.za> Message-ID: <1630790341.49.0.427497767558.issue24612@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I think the best outcome here is to refine the syntax error. Making it behave a bit better is going to be quite a pain because of how unary "-" and "not" work on the priority level in the grammar. I also don't think that facilitating the concatenation of operators without parentheses is a good idea (for readability reasons). I will prepare a PR to improve the syntax error ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24612> _______________________________________ From report at bugs.python.org Sat Sep 4 17:33:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 04 Sep 2021 21:33:17 +0000 Subject: [issue24612] not operator expression raising a syntax error In-Reply-To: <1436628233.38.0.197597566636.issue24612@psf.upfronthosting.co.za> Message-ID: <1630791197.42.0.0307446835913.issue24612@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +26599 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28170 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24612> _______________________________________ From report at bugs.python.org Sat Sep 4 17:36:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Sep 2021 21:36:13 +0000 Subject: [issue24893] Tk occasionally mispositions Text() insert cursor on mouse click. In-Reply-To: <1439946374.86.0.179742145584.issue24893@psf.upfronthosting.co.za> Message-ID: <1630791373.05.0.33305277139.issue24893@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: https://stackoverflow.com/questions/69038343/mouse-pointer-misaligned-when-using-python-in-idle-on-mac reports same issue with 3.9.5. I have requested details to be posted here. ---------- status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24893> _______________________________________ From report at bugs.python.org Sat Sep 4 18:38:45 2021 From: report at bugs.python.org (Kevin Shweh) Date: Sat, 04 Sep 2021 22:38:45 +0000 Subject: [issue45104] Error in __new__ docs Message-ID: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> New submission from Kevin Shweh <kevin.shweh at gmail.com>: The data model docs for __new__ say "If __new__() is invoked during object construction and it returns an instance or subclass of cls, then the new instance?s __init__() method will be invoked..." "instance or subclass of cls" is incorrect - if for some reason __new__ returns a subclass of cls, __init__ will not be invoked, unless the subclass also happens to be an instance of cls (which can happen with metaclasses). This should probably say something like "instance of cls (including subclass instances)", or "instance of cls or of a subclass of cls", or just "instance of cls". ---------- assignee: docs at python components: Documentation messages: 401065 nosy: Kevin Shweh, docs at python priority: normal severity: normal status: open title: Error in __new__ docs versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Sat Sep 4 21:21:27 2021 From: report at bugs.python.org (Andre Roberge) Date: Sun, 05 Sep 2021 01:21:27 +0000 Subject: [issue24612] not operator expression raising a syntax error In-Reply-To: <1436628233.38.0.197597566636.issue24612@psf.upfronthosting.co.za> Message-ID: <1630804887.26.0.606263591224.issue24612@roundup.psfhosted.org> Change by Andre Roberge <andre.roberge at gmail.com>: ---------- nosy: +aroberge _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24612> _______________________________________ From report at bugs.python.org Sat Sep 4 22:15:29 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sun, 05 Sep 2021 02:15:29 +0000 Subject: [issue34093] Reproducible pyc: FLAG_REF is not stable. In-Reply-To: <1531305608.98.0.56676864532.issue34093@psf.upfronthosting.co.za> Message-ID: <1630808129.57.0.43701587014.issue34093@roundup.psfhosted.org> Change by Chih-Hsuan Yen <yan12125 at gmail.com>: ---------- nosy: +yan12125 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34093> _______________________________________ From report at bugs.python.org Sat Sep 4 22:16:59 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sun, 05 Sep 2021 02:16:59 +0000 Subject: [issue34722] Non-deterministic bytecode generation In-Reply-To: <1537278827.47.0.956365154283.issue34722@psf.upfronthosting.co.za> Message-ID: <1630808219.93.0.490332408563.issue34722@roundup.psfhosted.org> Chih-Hsuan Yen <yan12125 at gmail.com> added the comment: issue37596 merged a fix to enable deterministic frozensets. I think this issue can be closed? Regarding my last comment msg347820 - it seems similar to one of https://bugs.python.org/issue34033 or https://bugs.python.org/issue34093. I followed those tickets instead. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34722> _______________________________________ From report at bugs.python.org Sat Sep 4 22:36:01 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sun, 05 Sep 2021 02:36:01 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1630809361.06.0.0460692290336.issue45097@roundup.psfhosted.org> Chih-Hsuan Yen <yan12125 at gmail.com> added the comment: Many thanks for the fast and great fix! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Sun Sep 5 01:09:33 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 05 Sep 2021 05:09:33 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1630818573.23.0.391261510714.issue44571@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 91be41ad933e24bff26353a19f56447e17fb6367 by Raymond Hettinger in branch 'main': bpo-44571: Add itertool recipe for a variant of takewhile() (GH-28167) https://github.com/python/cpython/commit/91be41ad933e24bff26353a19f56447e17fb6367 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44571> _______________________________________ From report at bugs.python.org Sun Sep 5 01:09:45 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 05:09:45 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1630818585.05.0.0928297189322.issue44571@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26600 pull_request: https://github.com/python/cpython/pull/28173 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44571> _______________________________________ From report at bugs.python.org Sun Sep 5 01:10:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 05 Sep 2021 05:10:54 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1630818654.13.0.594078835537.issue44571@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44571> _______________________________________ From report at bugs.python.org Sun Sep 5 01:30:44 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 05:30:44 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1630819844.38.0.56874405138.issue44571@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 656b0bdfaae3a36d386afe3f7b991744528c3ff7 by Miss Islington (bot) in branch '3.10': bpo-44571: Add itertool recipe for a variant of takewhile() (GH-28167) https://github.com/python/cpython/commit/656b0bdfaae3a36d386afe3f7b991744528c3ff7 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44571> _______________________________________ From report at bugs.python.org Sun Sep 5 02:17:54 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Sun, 05 Sep 2021 06:17:54 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1630822674.76.0.631663357878.issue39298@roundup.psfhosted.org> Micha? G?rny <mgorny at gentoo.org> added the comment: Jack, are you still working on this? I was considering allocating the time to write the bindings for the C library myself but I've stumbled upon this bug and I suppose there's no point in duplicating work. I'd love to see it on pypi, so we could play with it a bit. ---------- nosy: +mgorny _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39298> _______________________________________ From report at bugs.python.org Sun Sep 5 02:19:14 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Sun, 05 Sep 2021 06:19:14 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1630822754.61.0.333394051567.issue40059@roundup.psfhosted.org> Micha? G?rny <mgorny at gentoo.org> added the comment: Is there any progress happening? FWIU the common "toml" module on pypi has been discontinued now, projects are switching to yet another one and this is exactly the kind of problem a built-in module would have avoided. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40059> _______________________________________ From report at bugs.python.org Sun Sep 5 02:41:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 06:41:40 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630824100.88.0.25944935955.issue45042@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset ab58269ab3b784bef33a613cd0a68914065a9134 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060) (GH-28169) https://github.com/python/cpython/commit/ab58269ab3b784bef33a613cd0a68914065a9134 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sun Sep 5 02:42:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 06:42:38 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630824158.63.0.366202341145.issue45042@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Sun Sep 5 03:34:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 07:34:23 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630827263.74.0.257408481971.issue45102@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 28264269de9ff88d9ee7110fc56ac2d2db275bec by Serhiy Storchaka in branch 'main': bpo-45102: unittest: add tests for skipping and errors in cleanup (GH-28166) https://github.com/python/cpython/commit/28264269de9ff88d9ee7110fc56ac2d2db275bec ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 03:34:25 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 07:34:25 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630827265.1.0.741443918047.issue45102@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26601 pull_request: https://github.com/python/cpython/pull/28174 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 03:34:29 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 07:34:29 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630827269.65.0.447154505632.issue45102@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26602 pull_request: https://github.com/python/cpython/pull/28175 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 03:45:09 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 05 Sep 2021 07:45:09 +0000 Subject: [issue45100] Teach help about typing.overload() In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630827909.25.0.426764895714.issue45100@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: I agree that this would be nice to have, but wonder how help() could access that information. The two @overload definitions will be overwritten by the non-overload one at runtime, and hence will ever been seen by help(). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 03:55:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 07:55:42 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630828542.63.0.0248514418215.issue45102@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 8342c526e9cf138a10668fa9e487d92ee1a3a42c by Miss Islington (bot) in branch '3.10': bpo-45102: unittest: add tests for skipping and errors in cleanup (GH-28166) https://github.com/python/cpython/commit/8342c526e9cf138a10668fa9e487d92ee1a3a42c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 03:56:27 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 05 Sep 2021 07:56:27 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630828587.63.0.877530525041.issue45102@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset f91d974ce61b2a9922391f723b388a623284fb0a by Miss Islington (bot) in branch '3.9': bpo-45102: unittest: add tests for skipping and errors in cleanup (GH-28166) https://github.com/python/cpython/commit/f91d974ce61b2a9922391f723b388a623284fb0a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 04:23:30 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 05 Sep 2021 08:23:30 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1630830210.7.0.970792681827.issue44863@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Guido, OP has kindly written a mini PEP for this. Do you think just updating PEP 589 is sufficient, or do we need a full PEP? (PS. Changed version to 3.11 since we've missed the train for 3.10 enhancements). ---------- versions: -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44863> _______________________________________ From report at bugs.python.org Sun Sep 5 04:29:08 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 05 Sep 2021 08:29:08 +0000 Subject: [issue45100] Teach help about typing.overload() In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630830548.35.0.807317350818.issue45100@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 06:19:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 10:19:42 +0000 Subject: [issue45102] unittest: add tests for skipping and errors in cleanup In-Reply-To: <1630785673.23.0.15068608045.issue45102@roundup.psfhosted.org> Message-ID: <1630837182.52.0.211147621399.issue45102@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45102> _______________________________________ From report at bugs.python.org Sun Sep 5 07:12:09 2021 From: report at bugs.python.org (Max Bachmann) Date: Sun, 05 Sep 2021 11:12:09 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 Message-ID: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> New submission from Max Bachmann <kontakt at maxbachmann.de>: I noticed that when using the Unicode character \U00010900 when inserting the character as character: Here is the result on the Python console both for 3.6 and 3.9: ``` >>> s = '0?00' >>> s '0?00' >>> ls = list(s) >>> ls ['0', '?', '0', '0'] >>> s[0] '0' >>> s[1] '?' >>> s[2] '0' >>> s[3] '0' >>> ls[0] '0' >>> ls[1] '?' >>> ls[2] '0' >>> ls[3] '0' ``` It appears that for some reason in this specific case the character is actually stored in a different position that shown when printing the complete string. Note that the string is already behaving strange when marking it in the console. When marking the special character it directly highlights the last 3 characters (probably because it already thinks this character is in the second position). The same behavior does not occur when directly using the unicode point ``` >>> s='000\U00010900' >>> s '000?' >>> s[0] '0' >>> s[1] '0' >>> s[2] '0' >>> s[3] '?' ``` This was tested using the following Python versions: ``` Python 3.6.0 (default, Dec 29 2020, 02:18:14) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux Python 3.9.6 (default, Jul 16 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux ``` on Fedora 34 ---------- components: Unicode messages: 401078 nosy: ezio.melotti, maxbachmann, vstinner priority: normal severity: normal status: open title: Incorrect handling of unicode character \U00010900 type: behavior versions: Python 3.6, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 07:18:39 2021 From: report at bugs.python.org (Max Bachmann) Date: Sun, 05 Sep 2021 11:18:39 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630840719.43.0.824201345283.issue45105@roundup.psfhosted.org> Max Bachmann <kontakt at maxbachmann.de> added the comment: This is the result of copy pasting example posted above on windows using ``` Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32 ``` which appears to run into similar problems: ``` >>> s = '0??00' >>> s '0?00' >>> ls = list(s) >>> ls ['0', '?', '0', '0'] >>> s[0] '0' >>> s[1] '?' ``` ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 07:39:08 2021 From: report at bugs.python.org (Alex Waygood) Date: Sun, 05 Sep 2021 11:39:08 +0000 Subject: [issue45100] Teach help about typing.overload() In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630841948.3.0.100101781855.issue45100@roundup.psfhosted.org> Alex Waygood <Alex.Waygood at Gmail.com> added the comment: There is a similar issue with `functools.singledispatch` ``` >>> from functools import singledispatch >>> @singledispatch ... def flip(x: str) -> int: ... """Signature when given a string""" ... return int(x) ... >>> @flip.register ... def _(x: int) -> str: ... """Signature when given an int""" ... return str(x) ... >>> flip(5) '5' >>> flip('5') 5 >>> help(flip) Help on function flip in module __main__: flip(x: str) -> int Signature when given a string ``` ---------- nosy: +AlexWaygood _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 08:38:03 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sun, 05 Sep 2021 12:38:03 +0000 Subject: [issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630845483.56.0.180545101792.issue44892@roundup.psfhosted.org> Diego Ramirez <dr01191115 at gmail.com> added the comment: Any commentaries about this issue? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sun Sep 5 08:39:03 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sun, 05 Sep 2021 12:39:03 +0000 Subject: [issue45100] Teach help about typing.overload() In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630845543.73.0.855138983454.issue45100@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- nosy: +DiddiLeija _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 08:39:39 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sun, 05 Sep 2021 12:39:39 +0000 Subject: [issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630845579.08.0.0297957898737.issue44892@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sun Sep 5 08:53:10 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 05 Sep 2021 12:53:10 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630846390.76.0.861212272304.issue45105@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: AFAICT, there is no bug here. It's just confusing how Unicode right-to-left characters in the repr() can modify how it's displayed in the console/terminal. Use the ascii() representation to avoid the problem. > The same behavior does not occur when directly using the unicode point > ``` > >>> s='000\U00010900' The original string has the Phoenician right-to-left character at index 1, not at index 3. The "0" number characters in the original have weak directionality when displayed. You can see the reversal with a numeric sequence that's separated by spaces. For example: s = '123\U00010900456' >>> print(*s, sep='\n') 1 2 3 ? 4 5 6 >>> print(*s) 1 2 3 ? 4 5 6 Latin letters have left-to-right directionality. For example: >>> s = '123\U00010900abc' >>> print(*s) 1 2 3 ? a b c You can check the bidirectional property [1] using the unicodedata module: >>> import unicodedata as ud >>> ud.bidirectional('\U00010900') 'R' >>> ud.bidirectional('0') 'EN' >>> ud.bidirectional('a') 'L' --- [1] https://en.wikipedia.org/wiki/Unicode_character_property#Bidirectional_writing ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 09:08:09 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 05 Sep 2021 13:08:09 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630847289.91.0.731347643307.issue45105@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: I'm afraid I cannot reproduce the problem. >>> s = '000?' # \U00010900 >>> s '000?' >>> s[0] '0' >>> s[1] '0' >>> s[2] '0' >>> s[3] '?' >>> list(s) ['0', '0', '0', '?'] That is using Python 3.9 in the xfce4-terminal. Which xterm are you using? I am very confident that it is a bug in some external software, possibly the xterm, possibly the browser or other application where you copied the PHOENICIAN LETTER ALF character from in the first place. It looks like it is related to mishandling of the Right-To-Left character: >>> unicodedata.bidirectional(s[3]) 'R' Using Firefox, when I attempt to select the text s = '000...' in Max's initial message with the mouse, the selection highlighting jumps around. See the screenshot attached. (selection.png) Depending on how I copy the text, sometimes I get '000 ALF' and sometimes '0 ALF 00' which hints that something is getting confused by the RTL character, possibly the browser, possible the copy/paste clipboard, possibly the terminal. But regardless, I cannot replicate the behaviour you show where list(s) is different from indexing the characters one by one. It is very common for applications to mishandle mixed RTL and LTR characters, and that can have all sorts of odd display and copy/paste issues. ---------- nosy: +steven.daprano Added file: https://bugs.python.org/file50260/selection.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 09:10:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 13:10:21 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630847421.23.0.0744352434651.issue45026@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26603 pull_request: https://github.com/python/cpython/pull/28176 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sun Sep 5 09:15:48 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 05 Sep 2021 13:15:48 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630847748.93.0.0515886498159.issue45105@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Eryk Sun said: > The original string has the Phoenician right-to-left character at index 1, not at index 3. I think you may be mistaken. In Max's original post, he has s = '000X' where the X is actually the Phoenician ALF character. At least that is how it is displayed in my browser. (But note that in the Windows terminal, Max has '0X00' instead.) Max's demonstration code shows a discrepancy between extracting the chars one by one using indexing, and with list. Simulating his error: s = '000X' # X is actually ALF list(s) # --> returns [0 0 0 X] [s[i] for i in range(4)] # indexing each char one at a time # --> returns [0 X 0 0] I have not yet been able to replicate that reported behaviour. I agree totally with Eryk Sun that this is probably not a Python bug. He thinks it is displaying the correct behaviour. I think it is probably a browser or xterm bug. But unless someone can replicate the mismatch between list and indexing, I doubt it is something we can do anything about. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 09:16:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 13:16:31 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630847791.67.0.616501494915.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: PR 28176 implements idea proposed by Dennis in msg400396. It keeps the current and stop values instead of the initial start, index and initial length. I do not have data yet, but it is expected that it's iteration may be faster (for large integers), but __lenght_hint__ should be slower. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sun Sep 5 09:56:38 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 05 Sep 2021 13:56:38 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630850198.37.0.897084267297.issue45105@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: > I think you may be mistaken. In Max's original post, he has > s = '000X' It displays that way for me under Firefox in Linux, but what's really there when I copy it from Firefox is '0\U0001090000', which matches the result Max gets for individual index operations such as s[1]. The "0" characters following the R-T-L character have weak directionality. So the string displays the same as "000\U00010900". If you print with spaces and use a number sequence, the substring starting with the R-T-L character should display reversed, i.e. print(*'123\U00010900456') should display the same as print(*'123654\U00010900'). But "abc" in print(*'123\U00010900abc') should not display reversed since it has L-T-R directionality. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 09:57:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 13:57:48 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630850268.74.0.30886345444.issue45105@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 10:48:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 05 Sep 2021 14:48:32 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1630830210.7.0.970792681827.issue44863@roundup.psfhosted.org> Message-ID: <CAP7+vJ+ecEYwUQnaibrRaTyBNFak93tZ6X=7fCatO916i5vb=w@mail.gmail.com> Guido van Rossum <guido at python.org> added the comment: Updating an existing (standards track) PEP significantly is not traditional. I recommend writing a new PEP. On Sun, Sep 5, 2021 at 01:24 Ken Jin <report at bugs.python.org> wrote: > > Ken Jin <kenjin4096 at gmail.com> added the comment: > > Guido, OP has kindly written a mini PEP for this. Do you think just > updating PEP 589 is sufficient, or do we need a full PEP? > > (PS. Changed version to 3.11 since we've missed the train for 3.10 > enhancements). > > ---------- > versions: -Python 3.10 > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue44863> > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44863> _______________________________________ From report at bugs.python.org Sun Sep 5 10:51:42 2021 From: report at bugs.python.org (Max Bachmann) Date: Sun, 05 Sep 2021 14:51:42 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630853502.43.0.702299323838.issue45105@roundup.psfhosted.org> Max Bachmann <kontakt at maxbachmann.de> added the comment: > That is using Python 3.9 in the xfce4-terminal. Which xterm are you using? This was in the default gnome terminal that is pre-installed on Fedora 34 and on windows I directly opened the Python Terminal. I just installed xfce4-terminal on my Fedora 34 machine which has exactly the same behavior for me that I had in the gnome terminal. > But regardless, I cannot replicate the behavior you show where list(s) is different from indexing the characters one by one. That is what surprised me the most. I just ran into this because this was somehow generated when fuzz testing my code using hypothesis (which uncovered an unrelated bug in my application). However I was quite confused by the character order when debugging it. My original case was: ``` s1='00????' s2='9010?000\x8d????222?' parts = [s2[max(0, i) : min(len(s2), i+len(s1))] for i in range(-len(s1), len(s2))] for part in parts: print(list(part)) ``` which produced ``` [] ['9'] ['9', '0'] ['9', '0', '1'] ['9', '0', '1', '0'] ['9', '0', '1', '0', '?'] ['9', '0', '1', '0', '?', '0'] ['0', '1', '0', '?', '0', '0'] ['1', '0', '?', '0', '0', '0'] ['0', '?', '0', '0', '0', '\x8d'] ['?', '0', '0', '0', '\x8d', '?'] ['0', '0', '0', '\x8d', '?', '?'] ['0', '0', '\x8d', '?', '?', '?'] ['0', '\x8d', '?', '?', '?', '?'] ['\x8d', '?', '?', '?', '?', '2'] ['?', '?', '?', '?', '2', '2'] ['?', '?', '?', '2', '2', '2'] ['?', '?', '2', '2', '2', '?'] ['?', '2', '2', '2', '?'] ['2', '2', '2', '?'] ['2', '2', '?'] ['2', '?'] ['??] ``` which has a missing single quote: - ['??] changing direction of characters including commas: - ['1', '0', '?', '0', '0', '0'] changing direction back: - ['?', '0', '0', '0', '\x8d', '?'] > AFAICT, there is no bug here. It's just confusing how Unicode right-to-left characters in the repr() can modify how it's displayed in the console/terminal. Yes it appears the same confusion occurs in other applications like Firefox and VS Code. Thanks at @eryksun and @steven.daprano for testing and telling me about Bidirectional writing in Unicode (The more I know about Unicode the more it scares me) ---------- status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 11:53:18 2021 From: report at bugs.python.org (Andrew Suttle) Date: Sun, 05 Sep 2021 15:53:18 +0000 Subject: [issue45106] Issue formating for log on Linux machines Message-ID: <1630857198.47.0.486193642329.issue45106@roundup.psfhosted.org> New submission from Andrew Suttle <andrewsuttle56 at gmail.com>: Using the format option for Python logging works fine on all windows machines: logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.DEBUG,format='%(asctime)s : %(message)s ') But error occurs on Linux mint 64 20.2 using Python 3.8 when the % symbol in the format causes a problem. Traceback (most recent call last): File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode exec(code, self.locals) File "/media/victor/B694-5211/python now git/prototype server3.py", line 14, in logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.DEBUG,format='%(asctime)s:%(message)s') File "/usr/lib/python3.8/logging/init.py", line 2009, in basicConfig raise ValueError('Unrecognised argument(s): %s' % keys) ValueError: Unrecognised argument(s): encoding ---------- files: program.txt messages: 401089 nosy: andrewsuttle56 priority: normal severity: normal status: open title: Issue formating for log on Linux machines type: compile error versions: Python 3.8 Added file: https://bugs.python.org/file50261/program.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45106> _______________________________________ From report at bugs.python.org Sun Sep 5 11:53:23 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 05 Sep 2021 15:53:23 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630850198.37.0.897084267297.issue45105@roundup.psfhosted.org> Message-ID: <20210905155119.GB30122@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: > what's really there when I copy it from Firefox is '0\U0001090000', > which matches the result Max gets for individual index operations such as s[1]. But *not* the result that Max got from calling list(). Can you reproduce that difference between indexing and list? Also you say "what's really there", but what is your reasoning for that? How do you know that Firefox is displaying the string wrongly, rather than displaying it correctly and copying it to the clipboard wrongly? When I look at the page source of the b.p.o page, I see: <pre>I noticed that when using the Unicode character \U00010900 when inserting the character as character: Here is the result on the Python console both for 3.6 and 3.9: ``` >>> s = '000X' again, with X standing in for the Phoenician ALF character. But when I copy and paste it into my terminal, I see >>> s = '0X00' ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 11:54:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 15:54:27 +0000 Subject: [issue41031] Inconsistency in C and python traceback printers In-Reply-To: <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org> Message-ID: <1630857267.39.0.947553992164.issue41031@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 9e31b3952f6101ef71ec029481b972169ab0e0f1 by Irit Katriel in branch 'main': bpo-41031: Match C and Python code formatting of unprintable exceptions and exceptions in the __main__ module. (GH-28139) https://github.com/python/cpython/commit/9e31b3952f6101ef71ec029481b972169ab0e0f1 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41031> _______________________________________ From report at bugs.python.org Sun Sep 5 12:01:40 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 05 Sep 2021 16:01:40 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630850198.37.0.897084267297.issue45105@roundup.psfhosted.org> Message-ID: <20210905155937.GC30122@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: Hmmm, digging deeper, I saved the page source code and opened it with hexdump. The relevant lines are: 00007780 60 60 0d 0a 26 67 74 3b 26 67 74 3b 26 67 74 3b |``..>>>| 00007790 20 73 20 3d 20 27 30 f0 90 a4 80 30 30 27 0d 0a | s = '0....00'..| which looks like Eryk Sun is correct, what is really there is '0X00' and Firefox just displays it in RTL order '000X'. Mystery solved :-) So now that only leaves the (unreproduced?) bug report of the difference in order between indexing and list(). Max, are you still certain that this difference exists? Can you replicate it with other strings, preferably with distinct characters? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 12:08:23 2021 From: report at bugs.python.org (Jack O'Connor) Date: Sun, 05 Sep 2021 16:08:23 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1630858103.64.0.133616408067.issue39298@roundup.psfhosted.org> Jack O'Connor <oconnor663 at gmail.com> added the comment: Hi Micha?, no I haven't done any more work on this since my comments back in April. If you wanted to get started on a PyPI implementation, I think that would be fantastic. I'd be happy to collaborate over email: oconnor663 at gmail.com. The branches I linked are still up, but I'm not sure my code will be very useful to someone who actually knows what they're doing :) Larry also had several ideas about how multithreading could fit in (which would be API changes in the Rust case, and forward-looking design work in the C case), and if I get permission from Larry I'll forward those emails. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39298> _______________________________________ From report at bugs.python.org Sun Sep 5 12:14:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 05 Sep 2021 16:14:44 +0000 Subject: [issue45100] Teach help about typing.overload() In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630858484.4.0.260515886029.issue45100@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > The two @overload definitions will be overwritten by > the non-overload one at runtime, and hence will ever > been seen by help(). We can fix this by adding an __overloads__ attribute. The overload decorator can accumulate the chain in an external namespace and function creation can move that accumulation into the new attribute. ----- Proof of concept ----- from typing import Union, _overload_dummy def create_function(func): namespace = func.__globals__ key = f'__overload__{func.__qualname__}__' func.__overloads__ = namespace.pop(key, []) return func def overload(func): namespace = func.__globals__ key = f'__overload__{func.__qualname__}__' namespace[key] = func.__overloads__ + [func.__annotations__] return _overload_dummy class Smudge(str): @overload @create_function def __getitem__(self, index: int) -> str: ... @overload @create_function def __getitem__(self, index: slice) -> 'Smudge': ... @create_function def __getitem__(self, index: Union[int, slice]) -> Union[str, 'Smudge']: 'Return a smudged character or characters.' if isinstance(index, slice): start, stop, step = index.indices(len(self)) values = [self[i] for i in range(start, stop, step)] return Smudge(''.join(values)) c = super().__getitem__(index) return chr(ord(c) ^ 1) @create_function def other_method(self, x:str) -> tuple: pass print(f'{Smudge.__getitem__.__annotations__=}') print(f'{Smudge.__getitem__.__overloads__=}') print(f'{Smudge.other_method.__annotations__=}') print(f'{Smudge.other_method.__overloads__=}') ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 12:16:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 05 Sep 2021 16:16:56 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630858616.29.0.836993269144.issue45100@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- title: Teach help about typing.overload() -> Improve help() by making typing.overload() information accessible at runtime versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 12:32:08 2021 From: report at bugs.python.org (Max Bachmann) Date: Sun, 05 Sep 2021 16:32:08 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630859528.58.0.150083497231.issue45105@roundup.psfhosted.org> Max Bachmann <kontakt at maxbachmann.de> added the comment: As far as a I understood this is caused by the same reason: ``` >>> s = '123\U00010900456' >>> s '123?456' >>> list(s) ['1', '2', '3', '?', '4', '5', '6'] # note that everything including the commas is mirrored until ] is reached >>> s[3] '?' >>> list(s)[3] '?' >>> ls = list(s) >>> ls[3] += 'a' >>> ls ['1', '2', '3', '?a', '4', '5', '6'] ``` Which as far as I understood is the expected behavior when a right-to-left character is encountered. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 5 12:39:16 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 05 Sep 2021 16:39:16 +0000 Subject: [issue45107] Improve LOAD_METHOD specialization Message-ID: <1630859956.74.0.360849757822.issue45107@roundup.psfhosted.org> New submission from Ken Jin <kenjin4096 at gmail.com>: I plan to do two improvements over the initial implementation: 1. General comments cleanup and optimize LOAD_METHOD_CLASS. 2. Implement LOAD_METHOD_SUPER, for super().meth() calls. See Issue44889 for the precursor. ---------- components: Interpreter Core messages: 401096 nosy: kj priority: normal severity: normal status: open title: Improve LOAD_METHOD specialization versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45107> _______________________________________ From report at bugs.python.org Sun Sep 5 12:39:33 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 05 Sep 2021 16:39:33 +0000 Subject: [issue45107] Improve LOAD_METHOD specialization In-Reply-To: <1630859956.74.0.360849757822.issue45107@roundup.psfhosted.org> Message-ID: <1630859973.21.0.436948482019.issue45107@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- keywords: +patch pull_requests: +26604 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28177 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45107> _______________________________________ From report at bugs.python.org Sun Sep 5 12:53:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 05 Sep 2021 16:53:27 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1630860807.88.0.101099630842.issue45100@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Note, I'm not proposing a create_function() decorator. That is just for the proof of concept. The actual logic would go into normal function creation, the same place that __annotations__ gets added. Also, there may be a better place than func.__globals__ to accumulate the overloads. For the proof-of-concept, it was just the easiest way to go. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45100> _______________________________________ From report at bugs.python.org Sun Sep 5 13:35:08 2021 From: report at bugs.python.org (Alex Hall) Date: Sun, 05 Sep 2021 17:35:08 +0000 Subject: [issue45108] frame.f_lasti points at DICT_MERGE instead of CALL_FUNCTION_EX in Windows only Message-ID: <1630863308.34.0.524127924669.issue45108@roundup.psfhosted.org> New submission from Alex Hall <alex.mojaki at gmail.com>: In this script: import inspect import dis def foo(**_): frame = inspect.currentframe().f_back print(frame.f_lasti) dis.dis(frame.f_code) d = {'a': 1, 'b': 2} foo(**d) dis shows these instructions for `foo(**d)`: 10 34 LOAD_NAME 2 (foo) 36 BUILD_TUPLE 0 38 BUILD_MAP 0 40 LOAD_NAME 3 (d) 42 DICT_MERGE 1 44 CALL_FUNCTION_EX 1 46 POP_TOP 48 LOAD_CONST 1 (None) 50 RETURN_VALUE On Linux/OSX, frame.f_lasti is 44, pointing to the CALL_FUNCTION_EX as I'd expect. But on Windows it's 42, which is the preceding instruction DICT_MERGE. The bytecode itself is identical on the different systems, it's just the frame offset that differs. This manifested as a test failure in a debugging tool here: https://github.com/samuelcolvin/python-devtools/pull/93 ---------- components: Interpreter Core, Windows messages: 401098 nosy: alexmojaki, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: frame.f_lasti points at DICT_MERGE instead of CALL_FUNCTION_EX in Windows only type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45108> _______________________________________ From report at bugs.python.org Sun Sep 5 13:36:04 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 05 Sep 2021 17:36:04 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1630863364.79.0.0337103645118.issue45034@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26605 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28178 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Sun Sep 5 13:45:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 17:45:39 +0000 Subject: [issue1705520] API for excluding methods from unittest stack traces Message-ID: <1630863939.88.0.0799780595915.issue1705520@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: What to do with comprehensions and classes? Corresponding code objects are not easily accessible and they do not have corresponding function. It would be difficult to use the locals of the frame with comprehensions. Maybe use per-module registries of qualnames? class MyAssertions: def assertComplexState(self, inputs): self.assertEqual('42', inputs[0], 'the input %s is not the right answer' % inputs) __unittests = {'MyAssertions.assertComplexState'} The frame is skipped if f_globals['__unittests'] contains co_qualname or any parents of co_qualname. We can even add a decorator: def assertion(func): mod = sys.modules[func.__module__] mod.__dict__.setdefault('__unittests', set()) mod.__setdefault.add(func.__qualname__) return func ---------- nosy: +serhiy.storchaka versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1705520> _______________________________________ From report at bugs.python.org Sun Sep 5 13:46:37 2021 From: report at bugs.python.org (Samuel Colvin) Date: Sun, 05 Sep 2021 17:46:37 +0000 Subject: [issue45108] frame.f_lasti points at DICT_MERGE instead of CALL_FUNCTION_EX in Windows only In-Reply-To: <1630863308.34.0.524127924669.issue45108@roundup.psfhosted.org> Message-ID: <1630863997.74.0.41537606514.issue45108@roundup.psfhosted.org> Samuel Colvin <samcolvin at gmail.com> added the comment: Perhaps worth adding that the tests don't fail on python 3.6, 3.7 or 3.8. ---------- nosy: +samuelcolvin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45108> _______________________________________ From report at bugs.python.org Sun Sep 5 13:56:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 17:56:47 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1630864607.72.0.641841986069.issue25894@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Any suggestions for the format of output? Currently PR 28082 formats lines for subtest skipping, failure or error with a 2-space identation. Lines for skipping, failure or error in tearDown() or functions registered with addCallback() do not differ from a line skipping, failure or error in the test method itself. I am not sure about backporting this change. On one hand, it fixes an old flaw in the unittest output. On other hand, the change affects not only subtests and can confuse programs which parse the unittest output because the test descriptions can occur multiple times. ---------- versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25894> _______________________________________ From report at bugs.python.org Sun Sep 5 14:42:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 18:42:37 +0000 Subject: [issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes In-Reply-To: <1499262996.04.0.921631870961.issue30856@psf.upfronthosting.co.za> Message-ID: <1630867357.44.0.940751692806.issue30856@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 4.0 -> 5.0 pull_requests: +26606 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28180 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30856> _______________________________________ From report at bugs.python.org Sun Sep 5 14:45:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 18:45:39 +0000 Subject: [issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes In-Reply-To: <1499262996.04.0.921631870961.issue30856@psf.upfronthosting.co.za> Message-ID: <1630867539.32.0.0593005557173.issue30856@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Before b3468f79efa45c8adaf86c0b9b797b9b3d4c12a2 the TestResult methods (addFailure, addError, addSkip, addExpectedFailure, addUnexpectedSuccess) were called immediately after running the test method. After that change all skips, failures and errors were accumulated separately and TestResult was updated only after the test cleanup. I do not know whether there were reasons for this or it is just an implementation artifact. The proposed PR makes addFailure, addError, addSkip and addSubTest be called immediately after raising an exception or finishing a subtest. addExpectedFailure, addUnexpectedSuccess and addSuccess still need to wait the end of the test cleanup. ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30856> _______________________________________ From report at bugs.python.org Sun Sep 5 14:54:59 2021 From: report at bugs.python.org (Richard Tollerton) Date: Sun, 05 Sep 2021 18:54:59 +0000 Subject: [issue45109] pipes seems designed for bytes but is str-only Message-ID: <1630868099.65.0.267189111199.issue45109@roundup.psfhosted.org> New submission from Richard Tollerton <rich.tollerton at ni.com>: 1. https://github.com/python/cpython/blob/3.9/Lib/pipes.py#L6 > Suppose you have some data that you want to convert to another format, > such as from GIF image format to PPM image format. 2. https://docs.python.org/3.9/library/pipes.html > Because the module uses /bin/sh command lines, a POSIX or compatible shell for os.system() and os.popen() is required. 3. https://docs.python.org/3.9/library/os.html#os.popen > The returned file object reads or writes text strings rather than bytes. (1) and (3) are AFAIK mutually contradictory: you can't reasonably expect to shove GIFs down a str file object. I'm guessing that pipes is an API that never got its bytes API fleshed out? My main interest in this is that I'm writing a large CSV to disk and wanted to pipe it through zstd first. And I wanted something like perl's open FILE, "|zstd -T0 -19 > out.txt.zst". But the CSV at present is all bytes. (Technically the content is all latin1 at the moment, so I may have a workaround, but I'm not 100% certain it will stay that way.) What I'd like to see is for pipes.Template.open() to accept 'b' in flags, and for that to be handled in the usual way. ---------- components: Library (Lib) messages: 401103 nosy: rtollert priority: normal severity: normal status: open title: pipes seems designed for bytes but is str-only versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45109> _______________________________________ From report at bugs.python.org Sun Sep 5 14:55:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 18:55:50 +0000 Subject: [issue35741] unittest.skipUnless(time._STRUCT_TM_ITEMS == 11, "needs tm_zone support") doesn't work In-Reply-To: <1547544727.75.0.967204925198.issue35741@roundup.psfhosted.org> Message-ID: <1630868150.5.0.448875139588.issue35741@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: _STRUCT_TM_ITEMS was always set to 11 since issue25283. On what platform test_localtime_timezone fails now? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35741> _______________________________________ From report at bugs.python.org Sun Sep 5 15:07:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Sep 2021 19:07:41 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1630868861.4.0.196732248344.issue36674@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: There are too many issues with TestResult.debug(). It does not call tearDown() and doCleanups() if the test is skipped, failed or raises other exception (including errors in cleanup). It does not support skipping decorators. It does not support the expectedFailure decorator. It does not work at all in IsolatedAsyncioTestCase. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sun Sep 5 15:54:49 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 05 Sep 2021 19:54:49 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1630871689.37.0.887021009671.issue44848@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: New changeset 5024dc1c6e08247693aea6ad6e225ec5dcaf0721 by Erlend Egeberg Aasland in branch 'main': bpo-44848: Update macOS installer to use SQLite 3.36.0 (GH-27621) https://github.com/python/cpython/commit/5024dc1c6e08247693aea6ad6e225ec5dcaf0721 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44848> _______________________________________ From report at bugs.python.org Sun Sep 5 18:27:20 2021 From: report at bugs.python.org (=?utf-8?q?Benjamin_Sz=C5=91ke?=) Date: Sun, 05 Sep 2021 22:27:20 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1630880840.43.0.230549282713.issue21302@roundup.psfhosted.org> Benjamin Sz?ke <egyszeregy at freemail.hu> added the comment: Can you review my final implementation? https://github.com/python/cpython/pull/28111 ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Sun Sep 5 22:13:43 2021 From: report at bugs.python.org (Keith) Date: Mon, 06 Sep 2021 02:13:43 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1629473225.32.0.832038745679.issue39355@roundup.psfhosted.org> Message-ID: <CAM_uak6FuO4ifNYz+pE+xbFtudQ19myarqc-QfJsBcMd42C9+Q@mail.gmail.com> Keith <keithtangtw at gmail.com> added the comment: the word "module" should be treated as a reserved keyword. Any use of "module" as an argument name should be changed to something else throughout the code base. On Fri, Aug 20, 2021 at 11:28 PM Hasan <report at bugs.python.org> wrote: > > Hasan <hasan.aleeyev at gmail.com> added the comment: > > We have tested with cxx-modules that issue. > module is just a specifier for export (only export is a compiler-based > keyword in >= C++20) > That's why we can use module as argument name and there's no need to > rename or delete *module arguments from header files. > > What do you recommend to do? > > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1103r3.pdf > > ---------- > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue39355> > _______________________________________ > ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39355> _______________________________________ From report at bugs.python.org Sun Sep 5 22:18:58 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 02:18:58 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars Message-ID: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> New submission from Forest <forestix at sonic.net>: When argparse actions have multiple option strings and at least one argument, the default formatter presents them like this: -t ARGUMENT, --task ARGUMENT Perform a task with the given argument. -p STRING, --print STRING Print the given string. By repeating the metavars, the formatter wastes horizontal space, making the following side-effects more likely: - The easy-to-read tabular format is undermined by overlapping text columns. - An action and its description are split apart, onto separate lines. - Fewer actions can fit on the screen at once. - The user is presented with extra noise (repeat text) to read through. I think the DRY principle is worth considering here. Help text would be cleaner, more compact, and easier to read if formatted like this: -t, --task ARGUMENT Perform a task with the given argument. -p, --print STRING Print the given string. Obviously, actions with especially long option strings or metavars could still trigger line breaks, but they would be much less common and still easier to read without the repeat text. I am aware of ArgumentParser's formatter_class option, but unfortunately, it is of little help here. Since the default formatter class reserves every stage of its work as a private implementation detail, I cannot safely subclass it to get the behavior I want. My choices are apparently to either re-implement an unreasonably large swath of its code in my own formatter class, or override the private _format_action_invocation() method in a subclass and risk future breakage (and still have to re-implement more code than is reasonable.) Would it make sense to give HelpFormatter a "don't repeat yourself" option? (For example, a boolean class attribute could be overridden by a subclass and would be a small change to the existing code.) Alternatively, if nobody is attached to the current behavior, would it make sense to simply change HelpFormatter such that it never repeats itself? ---------- components: Library (Lib) messages: 401110 nosy: forest priority: normal severity: normal status: open title: argparse repeats itself when formatting help metavars type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Sun Sep 5 22:49:15 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 06 Sep 2021 02:49:15 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630896555.08.0.262847362184.issue45110@roundup.psfhosted.org> Change by Karthikeyan Singaravelan <tir.karthi at gmail.com>: ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Sun Sep 5 23:11:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 03:11:16 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630897876.57.0.16019160412.issue45110@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: I don't agree this should be changed. The repetition helps improve understanding because not everyone would assume that a METAVAR shown once would automatically also apply to its long form. Also, showing the METAVAR more than one is a norm. For example, see this excerpt from "man grep": -B num, --before-context=num Print num lines of leading context before each match. See also the -A and -C options. -b, --byte-offset The offset in bytes of a matched pattern is displayed in front of the respective matched line. -C[num, --context=num] Print num lines of leading and trailing context surrounding each match. The default is 2 and is equivalent to -A 2 -B 2. Note: no whitespace may be given between the option and its argument. -c, --count Only a count of selected lines is written to standard output. --colour=[when, --color=[when]] Mark up the matching text with the expression stored in GREP_COLOR environment variable. The possible values of when can be `never', `always' or `auto'. -D action, --devices=action Specify the demanded action for devices, FIFOs and sockets. The default action is `read', which means, that they are read as if they were normal files. If the action is set to `skip', devices will be silently skipped. -d action, --directories=action Specify the demanded action for directories. It is `read' by default, which means that the directories are read in the same manner as normal files. Other possible values are `skip' to silently ignore the directories, and `recurse' to read them recursively, which has the same effect as the -R and -r option. ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Sun Sep 5 23:40:12 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 06 Sep 2021 03:40:12 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630899612.34.0.159271738589.issue45110@roundup.psfhosted.org> Jeremy Kloth <jeremy.kloth+python-tracker at gmail.com> added the comment: Except that the output in question is not for manpages but for the command-line. The analogous would be for `grep --help` (again an excerpt): Context control: -B, --before-context=NUM print NUM lines of leading context -A, --after-context=NUM print NUM lines of trailing context -C, --context=NUM print NUM lines of output context -NUM same as --context=NUM --color[=WHEN], --colour[=WHEN] use markers to highlight the matching strings; WHEN is 'always', 'never', or 'auto' [using grep (GNU grep) 3.1] ---------- nosy: +jkloth _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 00:04:19 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 04:04:19 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630897876.57.0.16019160412.issue45110@roundup.psfhosted.org> Message-ID: <8g4bjg1ipoeu64ce7ff096op4iboapg8av@4ax.com> Forest <forestix at sonic.net> added the comment: On Mon, 06 Sep 2021 03:11:16 +0000, Raymond Hettinger wrote: >The repetition helps improve understanding because not everyone would assume >that a METAVAR shown once would automatically also apply to its long form. I'm struggling to think of a real-world example that would lead someone to think otherwise. Is there a program with a short & long form option where only one of those accepts an argument? If such a thing does exist somewhere, the current behavior seems even worse in that case: it shows the METAVAR alongside both forms, despite only one form accepting an argument. >Also, showing the METAVAR more than one is a norm. For example, see this >excerpt from "man grep": I disagree about that being a norm. Counterexamples include: cp -t, --target-directory=DIRECTORY mv -S, --suffix=SUFFIX ls -T, --tabsize=COLS man -L, --locale=LOCALE And, as Jeremy pointed out, we are not discussing man pages here, but command line help text. Even grep does it the way I suggest: grep -e, --regexp=PATTERNS grep -f, --file=FILE grep -m, --max-count=NUM (etc.) More importantly, even if we do accept the current behavior as potentially useful, do we really want Python's standard library to prescribe it? Should the application developer not be given an easy way for her program to display cleaner, simpler, more space-efficient help text? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 00:08:48 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 04:08:48 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <8g4bjg1ipoeu64ce7ff096op4iboapg8av@4ax.com> Message-ID: <qt4bjg11em615i48ksbp68vvlh6bj9u7cs@4ax.com> Forest <forestix at sonic.net> added the comment: By the way, I would be happy to submit a patch, either to remove the repeat text or to make it optional via an easily overridden class attribute. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 00:58:38 2021 From: report at bugs.python.org (paul j3) Date: Mon, 06 Sep 2021 04:58:38 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630904318.83.0.19457001248.issue45110@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: This is has been requested various times on StackOverflow, and possibly here (I'd have to do a search). The closest thing to making a compact action_invocation is to set the metavar to '', and even thing we get a space, eg. -f , --foo Help text This repeat has been a part of argparse from the beginning, so I can't see changing the default behavior. But we could add a HelpFormatter subclass that changes one (or two methods) such as _format_action_invocation. Subclassing the formatter is the accepted way of adding help features. I, and possibly others, must have suggested such a change on SO. Of course people can use such a subclass without it being part of the standard module. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 01:13:21 2021 From: report at bugs.python.org (paul j3) Date: Mon, 06 Sep 2021 05:13:21 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630905201.97.0.662626318473.issue45110@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: https://bugs.python.org/issue42980 argparse: GNU-style help formatter https://bugs.python.org/issue33389 argparse redundant help string https://bugs.python.org/issue29626 Issue with spacing in argparse module while using help https://bugs.python.org/issue27303 [argparse] Unify options in help output https://stackoverflow.com/questions/23936145/python-argparse-help-message-disable-metavar-for-short-options https://stackoverflow.com/questions/18275023/dont-show-long-options-twice-in-print-help-from-argparse ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 01:17:55 2021 From: report at bugs.python.org (hai shi) Date: Mon, 06 Sep 2021 05:17:55 +0000 Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org> Message-ID: <1630905475.61.0.95837343287.issue40512@roundup.psfhosted.org> hai shi <shihai1991 at 126.com> added the comment: > PyStructSequence_InitType2() is not compatible with subinterpreters: it uses static types. Moreover, it allocates tp_members memory which is not released when the type is destroyed. But I'm not sure that the type is ever destroyed, since this API is designed for static types. IMO, I suggest to create a new function, PyStructSequence_FromModuleAndDesc(module, desc, flags) to create a heaptype and don't aloocates memory block for tp_members,something like 'PyType_FromModuleAndSpec()`. I don't know there have any block issue to do this converting operation. But I can take a look. @petr ping, Petr, do you have any better idea about this question :) ---------- nosy: +petr.viktorin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40512> _______________________________________ From report at bugs.python.org Mon Sep 6 01:49:31 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 05:49:31 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630904318.83.0.19457001248.issue45110@roundup.psfhosted.org> Message-ID: <qoabjg1man8p6fm4ukorgah9jcimv204qs@4ax.com> Forest <forestix at sonic.net> added the comment: On Mon, 06 Sep 2021 04:58:38 +0000, paul j3 wrote: >This repeat has been a part of argparse from the beginning, so I can't >see changing the default behavior. Yes, I guessed as much, which is why I first suggested making it optional. >But we could add a HelpFormatter subclass that changes one (or two methods) >such as _format_action_invocation. Subclassing the formatter is the accepted >way of adding help features. If it was done in a subclass, how would people be expected to get the new behavior *and* that of the other subclasses? For example, someone with pre-formatted description and epilog text is currently directed to use the RawDescriptionHelpFormatter subclass. If they also wanted to avoid repeat metavars, and that behavior was implemented in another subclass, would they be expected to write a third subclass inheriting from both module-defined subclasses? To me, multiclassing seems rather heavyweight for a simple behavior change like this one, but yes, I recognize that argparse's current code uses that approach. Pity, that. >Of course people can use such a subclass without it being part of the >standard module. Technically: sure. But practically: not so much. An application would have to subclass and override _format_action_invocation(), which (judging by the leading underscore) appears to be intended as private to the module. Even the module doc string says so: """ (Also note that HelpFormatter and RawDescriptionHelpFormatter are only considered public as object names -- the API of the formatter objects is still considered an implementation detail.) """ So, a subclass that isn't part of the standard module is implicity and explicitly discouraged by the module itself. If we're married to the module's current policy for formatter tweaks, I guess that leaves a module-defined subclass as the only option. Here is an example that works: class OneMetavarHelpFormatter(argparse.HelpFormatter): """A formatter that avoids repeating action argument metavars. """ def _format_action_invocation(self, action): "Format action help without repeating the argument metavar" if not action.option_strings or action.nargs == 0: return super()._format_action_invocation(action) default = self._get_default_metavar_for_optional(action) args_string = self._format_args(action, default) return ', '.join(action.option_strings) + ' ' + args_string ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 02:04:10 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 06:04:10 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <qoabjg1man8p6fm4ukorgah9jcimv204qs@4ax.com> Message-ID: <jnbbjgd58td03eh2ues55ktenupsd1mv75@4ax.com> Forest <forestix at sonic.net> added the comment: Here's another working example, allowing alternate separator strings (as requested in #33389) via subclassing: class OneMetavarHelpFormatter(argparse.HelpFormatter): """A formatter that avoids repeating action metavars. """ OPTION_SEPARATOR = ', ' METAVAR_SEPARATOR = ' ' def _format_action_invocation(self, action): """Format action help without repeating the argument metavar """ if not action.option_strings or action.nargs == 0: return super()._format_action_invocation(action) default = self._get_default_metavar_for_optional(action) args_string = self._format_args(action, default) options_string = self.OPTION_SEPARATOR.join(action.option_strings) return options_string + self.METAVAR_SEPARATOR + args_string ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 02:15:04 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 06:15:04 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <jnbbjgd58td03eh2ues55ktenupsd1mv75@4ax.com> Message-ID: <n8cbjghge1ttgj7r32ai00jg2443aoh412@4ax.com> Forest <forestix at sonic.net> added the comment: To be clear, I wrote those examples to be non-invasive, not patch proposals. A cleaner approach would be possible if patching argparse is an option. (I believe the patch in #42980 proposes such an approach.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 02:17:15 2021 From: report at bugs.python.org (paul j3) Date: Mon, 06 Sep 2021 06:17:15 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1630909035.27.0.127061638422.issue45110@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: The idea of combining help features by defining a subclass that inherits from other subclasses was endorsed by the original developer (we could dig up an old bug/issue to prove that). The provided subclasses all tweak a "private" method, often one that's buried deep in the calling stack. I can't quote any official policy, but my sense is that Python developers are ok with users subclassing and modifying "private" methods. Methods, functions and classes (and variables) with leading '_' aren't documented, or imported via `__all__`, but otherwise the boundary between what is part of the user API and what's "hidden" is loose in Python. Apparently some corporate policies prohibit use or modification of things that aren't in the public API, but I don't think that policy protects you from changes. 'argparse' changes at a glacial rate, with a lot of concern for backward compatibility. In fact it's that fear of unintended consequences that slows down the pace of change. Subclassing a help formatter is preferred because it minimizes the chance of hurting existing users. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 02:46:51 2021 From: report at bugs.python.org (Forest) Date: Mon, 06 Sep 2021 06:46:51 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630909035.27.0.127061638422.issue45110@roundup.psfhosted.org> Message-ID: <8hdbjghb2em61msfha00sujspc2ohfohtm@4ax.com> Forest <forestix at sonic.net> added the comment: >Subclassing a help formatter is preferred because it minimizes the chance of >hurting existing users. Fair enough. Whatever the approach, I hope argparse can be made to support this through a simple, documented interface. I had to grovel through standard library code to figure out what to override and what to duplicate in order to get the output I want. That seems like a needlessly high barrier for such a common (and apparently oft-requested) format. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Mon Sep 6 02:50:57 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 06 Sep 2021 06:50:57 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1630911057.85.0.949210619881.issue42238@roundup.psfhosted.org> Julien Palard <julien+python at palard.fr> added the comment: New changeset 37272f5800ee1e9fcb2da4a1766366519b9b3d94 by Julien Palard in branch 'main': bpo-42238: [doc] remove unused, and deduplicate, suspicious ignore rules. (GH-28137) https://github.com/python/cpython/commit/37272f5800ee1e9fcb2da4a1766366519b9b3d94 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42238> _______________________________________ From report at bugs.python.org Mon Sep 6 03:15:21 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 06 Sep 2021 07:15:21 +0000 Subject: [issue45106] Issue formating for log on Linux machines In-Reply-To: <1630857198.47.0.486193642329.issue45106@roundup.psfhosted.org> Message-ID: <1630912521.24.0.160401251339.issue45106@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: It is fixed in Python 3.9. * https://github.com/python/cpython/pull/14008 * https://bugs.python.org/issue37111 Python 3.8 is "security" status for now. Non-security issues won't be fixed. Please migrate to Python 3.9. ---------- nosy: +methane resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45106> _______________________________________ From report at bugs.python.org Mon Sep 6 04:13:51 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 06 Sep 2021 08:13:51 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1630916031.36.0.362339470546.issue45067@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: According to https://invisible-island.net/ncurses/NEWS.html#index-t20170401 the function extended_color_content was introduced in 2017, maybe the detection of support for this function doesn't work properly for some reason (although the preprocessor logic in Modules/_cursesmodule.c looks sane). That said, I don't have a CentOS VM at the moment so cannot debug this myself. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Mon Sep 6 05:26:37 2021 From: report at bugs.python.org (W Huang) Date: Mon, 06 Sep 2021 09:26:37 +0000 Subject: [issue45111] whole website translation error Message-ID: <1630920397.91.0.782714198576.issue45111@roundup.psfhosted.org> New submission from W Huang <m4jp62 at gmail.com>: Traditional Chinese is translated incorrectly into Simplified Chinese. But Taiwanese CAN NOT read Simplified Chinese fluently. In addition, there are many words called by different name between Chinese and Taiwanese. Sometimes Taiwanese CAN NOT understand what a word used in China means. ---------- messages: 401126 nosy: m4jp62 priority: normal severity: normal status: open title: whole website translation error _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45111> _______________________________________ From report at bugs.python.org Mon Sep 6 05:44:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 09:44:51 +0000 Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org> Message-ID: <1630921491.11.0.871067903017.issue40512@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Hai Shi: > IMO, I suggest to create a new function, PyStructSequence_FromModuleAndDesc() Please create a new issue. If possible, I would prefer to have a sub-issue for that, to keep this issue as a tracking issue for all issues related to subinterpreters. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40512> _______________________________________ From report at bugs.python.org Mon Sep 6 06:14:34 2021 From: report at bugs.python.org (Chen Zero) Date: Mon, 06 Sep 2021 10:14:34 +0000 Subject: [issue45112] Python exception object is different after pickle.loads and pickle.dumps Message-ID: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> New submission from Chen Zero <yonghengzero at gmail.com>: Hi, when I'm trying to serialize/deserialize python exception object through pickle, I found that deserialize result is not the same as the original object... My python version is 3.9.1, working os: macOS Big Sur 11.4 Here is minimum reproducing code example: import pickle class ExcA(Exception): def __init__(self, want): msg = "missing " msg += want super().__init__(msg) ExcA('bb') # this will output ExcA("missing bb"), which is good pickle.loads(pickle.dumps(ExcA('bb'))) # this will output ExcA("missing missing bb"), which is different from `ExcA('bb')` ---------- files: screenshot.png messages: 401128 nosy: yonghengzero priority: normal severity: normal status: open title: Python exception object is different after pickle.loads and pickle.dumps type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50262/screenshot.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 06:15:25 2021 From: report at bugs.python.org (Chen Zero) Date: Mon, 06 Sep 2021 10:15:25 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630923325.6.0.817131074233.issue45112@roundup.psfhosted.org> Change by Chen Zero <yonghengzero at gmail.com>: ---------- title: Python exception object is different after pickle.loads and pickle.dumps -> Python exception object is different after pickle.dumps and pickle.loads _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 06:58:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 10:58:00 +0000 Subject: [issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP' In-Reply-To: <1611002891.36.0.245706132459.issue42959@roundup.psfhosted.org> Message-ID: <1630925880.38.0.402637480474.issue42959@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- nosy: +iritkatriel nosy_count: 6.0 -> 7.0 pull_requests: +26608 pull_request: https://github.com/python/cpython/pull/23688 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42959> _______________________________________ From report at bugs.python.org Mon Sep 6 06:59:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 10:59:28 +0000 Subject: [issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP' In-Reply-To: <1611002891.36.0.245706132459.issue42959@roundup.psfhosted.org> Message-ID: <1630925968.67.0.681489477642.issue42959@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- pull_requests: -26608 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42959> _______________________________________ From report at bugs.python.org Mon Sep 6 07:10:48 2021 From: report at bugs.python.org (hai shi) Date: Mon, 06 Sep 2021 11:10:48 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. Message-ID: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> New submission from hai shi <shihai1991 at 126.com>: Copied from https://bugs.python.org/issue40512#msg399847: Victor: PyStructSequence_InitType2() is not compatible with subinterpreters: it uses static types. Moreover, it allocates tp_members memory which is not released when the type is destroyed. But I'm not sure that the type is ever destroyed, since this API is designed for static types. > PyStructSequence_InitType2() is not compatible with subinterpreters: it uses static types. Moreover, it allocates tp_members memory which is not released when the type is destroyed. But I'm not sure that the type is ever destroyed, since this API is designed for static types. IMO, I suggest to create a new function, PyStructSequence_FromModuleAndDesc(module, desc, flags) to create a heaptype and don't aloocates memory block for tp_members,something like 'PyType_FromModuleAndSpec()`. ---------- components: C API messages: 401129 nosy: petr.viktorin, shihai1991, vstinner priority: normal severity: normal status: open title: [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Mon Sep 6 07:13:18 2021 From: report at bugs.python.org (hai shi) Date: Mon, 06 Sep 2021 11:13:18 +0000 Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org> Message-ID: <1630926798.7.0.827138616368.issue40512@roundup.psfhosted.org> hai shi <shihai1991 at 126.com> added the comment: bpo-45113: [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40512> _______________________________________ From report at bugs.python.org Mon Sep 6 07:18:09 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 06 Sep 2021 11:18:09 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1630927089.71.0.284862508032.issue45113@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: I think you will run into issues with allocating tp_members, because there isn't a good mechanism to for type objects to manage C-level data. But I encourage you to try, so you get a better understanding of the problem :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Mon Sep 6 07:29:31 2021 From: report at bugs.python.org (Hai Shi) Date: Mon, 06 Sep 2021 11:29:31 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1630927771.92.0.712240785259.issue45113@roundup.psfhosted.org> Hai Shi <shihai1991 at 126.com> added the comment: > But I encourage you to try, so you get a better understanding of the problem :) OK, thanks, Petr. I try to add this C API to see what will happen :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Mon Sep 6 07:54:30 2021 From: report at bugs.python.org (Harri) Date: Mon, 06 Sep 2021 11:54:30 +0000 Subject: [issue45114] bad example for os.stat Message-ID: <1630929270.55.0.756722168935.issue45114@roundup.psfhosted.org> New submission from Harri <harri at afaics.de>: The example on https://docs.python.org/3/library/stat.html should be improved to avoid endless recursion, if there is a symlink loop. I would suggest to use os.lstat instead of os.stat. ---------- assignee: docs at python components: Documentation messages: 401133 nosy: docs at python, harridu priority: normal severity: normal status: open title: bad example for os.stat versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45114> _______________________________________ From report at bugs.python.org Mon Sep 6 08:18:14 2021 From: report at bugs.python.org (Samodya Abey) Date: Mon, 06 Sep 2021 12:18:14 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1630930694.41.0.701691323247.issue44863@roundup.psfhosted.org> Samodya Abey <isamodya at gmail.com> added the comment: My initial intention to create this ticket was to explore the idea that if we could side step from creating a PEP or updating PEP-589. IMO only contribution from a new PEP will be: 1. relaxing this line from PEP-589 and be explicit to include Generic: "A TypedDict cannot inherit from both a TypedDict type and a non-TypedDict base class." (IMO by thinking `Generic` as a mixin even this is not needed) 2. may be syntax for generic in the alternative syntax (side note: collecting typevars from the values is hard to implement because of forward refs) 3. Some explicit generic examples for good measure I believe PEP-589 is complete in covering all semantic details even with Generics. Even structural subtyping because it says: "Value types behave invariantly, since TypedDict objects are mutable." My understanding was that during initial implementation this was not done for the sake of implementation simplicity (days before PEP-560). All that said, a new PEP would be a good way to notify the type checkers of this capability. Is there a better place to have this conversation? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44863> _______________________________________ From report at bugs.python.org Mon Sep 6 09:08:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 13:08:03 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630933683.82.0.057014853624.issue45112@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The default __reduce__ method of Exception returns the arg you pass to the Exception constructor: >>> a = ExcA("a banana") >>> a.__reduce__() (<class '__main__.ExcA'>, ('missing a banana',)) >>> This is then pickled, and when unpickled the arg is passed to the ExcA constructor. If you want to change this, you can implement __reduce__ on ExcA o return just the part you want it to return. ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 09:45:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 13:45:28 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1630935928.07.0.238500267319.issue30637@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Adding Pablo, a.k.a The King of Errors. ---------- nosy: +iritkatriel, pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Mon Sep 6 10:28:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 14:28:21 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630938501.48.0.0192919171208.issue45112@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Pickling customized subclasses can be tricky. The essential details are here: https://docs.python.org/3/library/pickle.html#object.__reduce__ Here's some code to get you started. class ExcA(Exception): def __init__(self, want): msg = "missing " msg += want super().__init__(msg) def __reduce__(self): return (type(self), self.args, self.args) def __setstate__(self, state): self.args = stat ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 10:28:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 14:28:37 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630938517.7.0.498996726714.issue45112@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 10:49:30 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 14:49:30 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630939770.76.0.837045825131.issue45112@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 10:52:29 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 06 Sep 2021 14:52:29 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1630939949.73.0.232804205406.issue44863@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Since this primarily affects static type checkers such as mypy, Pyre and pyright, it?s best to discuss it on typing-sig. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44863> _______________________________________ From report at bugs.python.org Mon Sep 6 11:08:24 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 06 Sep 2021 15:08:24 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630940904.47.0.752141142885.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: FTR, the issue mentioned is issue42225. msg380227 still applies for me (with Tk 8.6.11), with segfaults when I try to preview the font. For some reason, however, the segfault appears to be when we're closing the options window: 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 faulthandler >>> faulthandler.enable() >>> import idlelib.idle Fatal Python error: Segmentation fault Current thread 0x00007f0ca44c7740 (most recent call first): File "/usr/lib/python3.9/tkinter/__init__.py", line 2580 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/tkinter/__init__.py", line 2579 in destroy File "/usr/lib/python3.9/idlelib/configdialog.py", line 199 in destroy File "/usr/lib/python3.9/idlelib/configdialog.py", line 177 in ok File "/usr/lib/python3.9/tkinter/__init__.py", line 1892 in __call__ File "/usr/lib/python3.9/tkinter/__init__.py", line 696 in wait_window File "/usr/lib/python3.9/idlelib/configdialog.py", line 94 in __init__ File "/usr/lib/python3.9/idlelib/editor.py", line 583 in config_dialog File "/usr/lib/python3.9/tkinter/__init__.py", line 1892 in __call__ File "/usr/lib/python3.9/tkinter/__init__.py", line 1858 in event_generate File "/usr/lib/python3.9/idlelib/editor.py", line 1185 in command File "/usr/lib/python3.9/tkinter/__init__.py", line 1892 in __call__ File "/usr/lib/python3.9/tkinter/__init__.py", line 1429 in mainloop File "/usr/lib/python3.9/idlelib/pyshell.py", line 1572 in main File "/usr/lib/python3.9/idlelib/idle.py", line 14 in <module> File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed File "<frozen importlib._bootstrap_external>", line 850 in exec_module File "<frozen importlib._bootstrap>", line 680 in _load_unlocked File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1007 in _find_and_load File "<stdin>", line 1 in <module> fish: Job 1, 'python' terminated by signal SIGSEGV (Address boundary error) I do not experience any problems loading the IDLE preferences page. I will look into whether I can reproduce the problem described on Windows. ---------- nosy: +epaine _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 11:18:22 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 06 Sep 2021 15:18:22 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630941502.13.0.687402156297.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: Apologies, my previous message was not clear. When the segfault occurs is not consistent and sometimes occurs when previewing the font (as reported in the linked message) but more often when clicking the "ok" button (for which the faulthandler details are included). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 11:21:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:21:42 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode Message-ID: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: The Visual Studio project of Python, PCBuild\ directory, disables compiler optimizations when Python is built in debug mode. It seems to be the default in Visual Studio. Disabling compiler optimizations cause two kinds of issues: * It increases the stack memory: tests using a deep call stack are more likely to crash (test_pickle, test_marshal, test_exceptions). * Running the Python test suite take 19 min 41 sec instead of 12 min 19 sec on Windows x64: 1.6x slower. Because of that, we cannot use a debug build in the GitHub Action pre-commit CI, and we miss bugs which are catched "too late", in Windows buildbots. See my latest attempt to use a debug build in GitHub Actions: https://github.com/python/cpython/pull/24914 Example of test_marshal: # The max stack depth should match the value in Python/marshal.c. # BUG: https://bugs.python.org/issue33720 # Windows always limits the maximum depth on release and debug builds #if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'): if os.name == 'nt': MAX_MARSHAL_STACK_DEPTH = 1000 else: MAX_MARSHAL_STACK_DEPTH = 2000 I propose to only change the compiler options for the pythoncore project which builds most important files for the Python "core". See attached PR. ---------- components: Windows messages: 401141 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Windows: enable compiler optimizations when building Python in debug mode versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 11:25:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:25:04 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630941904.32.0.208534982181.issue45115@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26609 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28181 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 11:26:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:26:42 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630942002.39.0.68515448388.issue45115@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This change is motivated by my PR 28128 which converts the Py_TYPE() macro to a static inline function. The problem is that by default, MSC disables inlining and test_exceptions does crash with a stack overflow, since my change increases the usage of the stack memory: see bpo-44348. By the problem is wider than just Py_TYPE(). See also bpo-45094: "Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 11:27:18 2021 From: report at bugs.python.org (neonene) Date: Mon, 06 Sep 2021 15:27:18 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows Message-ID: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> New submission from neonene <nicesalmon at gmail.com>: pyperformance on Windows shows some gap between 3.10a7 and 3.10b1. The following are the ratios compared with 3.10a7 (the higher the slower). ------------------------------------------------- Windows x64 | PGO release official-binary ----------------+-------------------------------- 20210405 | 3.10a7 | 1.00 1.24 1.00 (PGO?) 20210408-07:58 | b98eba5 | 0.98 20210408-10:22 | * PR25244 | 1.04 20210503 | 3.10b1 | 1.07 1.21 1.07 ------------------------------------------------- Windows x86 | PGO release official-binary ----------------+-------------------------------- 20210405 | 3.10a7 | 1.00 1.25 1.27 (release?) 20210408-07:58 | b98eba5bc | 1.00 20210408-10:22 | * PR25244 | 1.11 20210503 | 3.10b1 | 1.14 1.28 1.29 Since PR25244 (28d28e053db6b69d91c2dfd579207cd8ccbc39e7), _PyEval_EvalFrameDefault() in ceval.c has seemed to be unoptimized with PGO (msvc14.29.16.10). At least the functions below have become un-inlined there at all. (1) _Py_DECREF() (from Py_DECREF,Py_CLEAR,Py_SETREF) (2) _Py_XDECREF() (from Py_XDECREF,SETLOCAL) (3) _Py_IS_TYPE() (from PyXXX_CheckExact) (4) _Py_atomic_load_32bit_impl() (from CHECK_EVAL_BREAKER) I tried in vain other linker options like thread-safe-profiling, agressive-code-generation, /OPT:NOREF. 3.10a7 can inline them in the eval-loop even if profiling only test_array.py. I measured overheads of (1)~(4) on my own build whose eval-loop uses macros instead of them. ----------------------------------------------------------------- Windows x64 | PGO patched overhead in eval-loop ----------------+------------------------------------------------ 3.10a7 | 1.00 20210802 | 3.10rc1 | 1.09 1.05 4% (slow 43, fast 5, same 10) 20210831-20:42 | 863154c | 0.95 0.90 5% (slow 48, fast 3, same 7) (3.11a0+) | ----------------------------------------------------------------- Windows x86 | PGO patched overhead in eval-loop ----------------+------------------------------------------------ 3.10a7 | 1.00 20210802 | 3.10rc1 | 1.15 1.13 2% (slow 29, fast 14, same 15) 20210831-20:42 | 863154c | 1.05 1.02 3% (slow 44, fast 7, same 7) (3.11a0+) | ---------- components: C API, Interpreter Core, Windows files: 310rc1_confirm_overhead.patch keywords: patch messages: 401143 nosy: Mark.Shannon, neonene, pablogsal, paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Performance regression 3.10b1 and later on Windows type: performance versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50263/310rc1_confirm_overhead.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 11:29:03 2021 From: report at bugs.python.org (neonene) Date: Mon, 06 Sep 2021 15:29:03 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630942143.56.0.723173510598.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50264/ceval_310rc1_patched.c _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 11:31:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:31:14 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1630942274.16.0.74464390676.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Sadly, Py_ALWAYS_INLINE does *not* prevent test_exceptions to crash with my PR 28128 (convert Py_TYPE macro to a static inline function). Even if the Py_TYPE() static inline function is inlined, the stack memory still increases. MSC produces inefficient machine code. It allocates useless variables on the stack which requires more stack memory. I propose a different approach: bpo-45115 "Windows: enable compiler optimizations when building Python in debug mode". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Mon Sep 6 11:35:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:35:54 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630942554.53.0.783188042404.issue45115@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26610 pull_request: https://github.com/python/cpython/pull/28128 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 11:38:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 15:38:39 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630942719.37.0.770534119074.issue45115@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I recently documented the "Python debug build": https://docs.python.org/dev/using/configure.html#python-debug-build ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 11:49:50 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 06 Sep 2021 15:49:50 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630943390.28.0.632381301224.issue45052@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Ok, that's what I was able to find. Original BPO: https://bugs.python.org/issue35813 Original PRs (sources + tests): - https://github.com/python/cpython/pull/11664 it was a little bit "rushed" - https://github.com/python/cpython/pull/11816 follow up Related: https://bugs.python.org/issue38169 1. The test fails because `sms.size != sms2.size` 2. The `sms2` object is a pickle-unpickle copy of `sms` 3. The `__reduce__` method defined in `SharedMemory` returns `(name=self.name, create=False, size=self.size)` tuple 4. So, when `sms2` is constructed, `size` is ignored, because `create` is `False` Moreover, even when `size` is passed with `create=True` the docs say that the final amount of allocated memory is platform specific (no details on the exact platforms): it can be larger or equal. Link: https://github.com/python/cpython/blame/main/Doc/library/multiprocessing.shared_memory.rst#L61 So, this statement makes `self.assertEqual(sms.size, sms2.size)` potentially flaky. After reading all this my suggestion is: 1. Remove `self.assertEqual(sms.size, sms2.size)` line, since this behavior is not guaranteed to work 2. Add docs about how `pickle` works with `SharedMemory` / `ShareableList`. Right now it is not clear. This should be just an explanation of the current status-quo 3. Add more tests on unpickled `Shared*` objects. Including overflowing set memory limits on unpickled objects and other implemetation details I will start with `1.` right now, later I can work on `3.`. But, I feel like someone more knowledgeable should take `2.` (or at least guide me, since `SharedMemory` is not something I use everyday). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 11:51:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 15:51:54 +0000 Subject: [issue28451] pydoc.safeimport() raises ErrorDuringImport() if __builtin__.__import__ is monkey patched In-Reply-To: <1476548049.89.0.842528131727.issue28451@psf.upfronthosting.co.za> Message-ID: <1630943514.78.0.374003034876.issue28451@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: It is no longer using the traceback check: https://github.com/python/cpython/blob/37272f5800ee1e9fcb2da4a1766366519b9b3d94/Lib/pydoc.py#L445 ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28451> _______________________________________ From report at bugs.python.org Mon Sep 6 11:55:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 15:55:39 +0000 Subject: [issue30060] Crash with subinterpreters and Py_NewInterpreter() In-Reply-To: <1492020071.31.0.759008537591.issue30060@psf.upfronthosting.co.za> Message-ID: <1630943739.17.0.238478538072.issue30060@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there was no followup to Eric's question. Please create a new issue if you still see this problem on a version >= 3.9. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30060> _______________________________________ From report at bugs.python.org Mon Sep 6 12:01:18 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 06 Sep 2021 16:01:18 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630944078.16.0.366551823338.issue45052@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26611 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28182 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 12:07:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 06 Sep 2021 16:07:30 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630944450.22.0.89935632786.issue45116@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- nosy: -pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 12:11:44 2021 From: report at bugs.python.org (=?utf-8?q?=C8=98tefan_Istrate?=) Date: Mon, 06 Sep 2021 16:11:44 +0000 Subject: [issue45117] `dict` not subscriptable despite using `__future__` typing annotations Message-ID: <1630944704.92.0.838059763947.issue45117@roundup.psfhosted.org> New submission from ?tefan Istrate <stefan.istrate at gmail.com>: According to PEP 585 (https://www.python.org/dev/peps/pep-0585/#implementation), I expect that typing aliases could simply use `dict` instead of `typing.Dict`. This works without problems in Python 3.9, but in Python 3.8, despite using `from __future__ import annotations`, I get the following error: $ /usr/local/Cellar/python at 3.8/3.8.11/bin/python3.8 Python 3.8.11 (default, Jun 29 2021, 03:08:07) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from __future__ import annotations >>> from typing import Any >>> JsonDictType = dict[str, Any] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'type' object is not subscriptable However, `dict` is subscriptable when not used in an alias: $ /usr/local/Cellar/python at 3.8/3.8.11/bin/python3.8 Python 3.8.11 (default, Jun 29 2021, 03:08:07) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from __future__ import annotations >>> from typing import Any >>> def f(d: dict[str, Any]): ... print(d) ... >>> f({"abc": 1, "def": 2}) {'abc': 1, 'def': 2} ---------- messages: 401149 nosy: stefanistrate priority: normal severity: normal status: open title: `dict` not subscriptable despite using `__future__` typing annotations type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45117> _______________________________________ From report at bugs.python.org Mon Sep 6 12:13:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:13:24 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630944804.56.0.473498379724.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Another *working* approach to fix this issue: bpo-45115 "Windows: enable compiler optimizations when building Python in debug mode". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 12:19:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 16:19:32 +0000 Subject: [issue7391] [doc] restore the "Idioms and Anti-Idioms in Python" document In-Reply-To: <1259072363.61.0.346322429524.issue7391@psf.upfronthosting.co.za> Message-ID: <1630945172.18.0.101626629991.issue7391@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- title: Re-title the "Using Backslash to Continue Statements" anti-idiom -> [doc] restore the "Idioms and Anti-Idioms in Python" document versions: +Python 3.11 -Python 3.2, Python 3.3 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue7391> _______________________________________ From report at bugs.python.org Mon Sep 6 12:28:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:28:52 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary Message-ID: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: When running Python with test -w/--verbose2 command line option to re-run tests which failed, the failing tests are listed in the first summary, and they are not listed in the final summary. Example with Lib/test/test_x.py: --- import builtins import unittest class Tests(unittest.TestCase): def test_succeed(self): return def test_fail_once(self): if not hasattr(builtins, '_test_failed'): builtins._test_failed = True self.fail("bug") --- Current output when running test_sys (success) and test_x (failed once, then pass): --- $ ./python -m test test_sys test_x -w 0:00:00 load avg: 0.80 Run tests sequentially 0:00:00 load avg: 0.80 [1/2] test_sys 0:00:01 load avg: 0.80 [2/2] test_x test test_x failed -- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_x.py", line 11, in test_fail_once self.fail("bug") ^^^^^^^^^^^^^^^^ AssertionError: bug test_x failed (1 failure) == Tests result: FAILURE == 1 test OK. 1 test failed: test_x 1 re-run test: test_x 0:00:01 load avg: 0.80 0:00:01 load avg: 0.80 Re-running failed tests in verbose mode 0:00:01 load avg: 0.80 Re-running test_x in verbose mode (matching: test_fail_once) test_fail_once (test.test_x.Tests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.000s OK == Tests result: FAILURE then SUCCESS == All 2 tests OK. Total duration: 2.0 sec Tests result: FAILURE then SUCCESS --- "re-run tests" is missing in the last summary. ---------- components: Tests messages: 401151 nosy: vstinner priority: normal severity: normal status: open title: regrtest no longer lists "re-run tests" in the second summary versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Mon Sep 6 12:32:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:32:24 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1630945944.14.0.367283283695.issue45118@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26612 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28183 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Mon Sep 6 12:35:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:35:18 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630946118.23.0.871307485721.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Rather than defining again functions as macro, you should consider using __forceinline function attribute: see bpo-45094. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 12:39:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:39:29 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1630946369.47.0.996561221114.issue45113@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Mon Sep 6 12:40:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 16:40:21 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1630946421.44.0.37952903412.issue45105@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Mon Sep 6 12:40:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 16:40:31 +0000 Subject: [issue45112] Python exception object is different after pickle.dumps and pickle.loads In-Reply-To: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> Message-ID: <1630946431.48.0.244398360687.issue45112@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: It would be nice if exception pickling was more friendly to subclasses. Perhaps, the default should be to store and restore all state including args and a __dict__ if any. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ From report at bugs.python.org Mon Sep 6 12:43:19 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 16:43:19 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630946599.84.0.86925668079.issue45116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Perhaps these critical code sections should have been left as macros. It is difficult to assuring system wide inlining across modules. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 12:45:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 16:45:37 +0000 Subject: [issue18534] [doc] State clearly that open() 'file' param is "name" attr of the result In-Reply-To: <1374556018.34.0.468152457131.issue18534@psf.upfronthosting.co.za> Message-ID: <1630946737.21.0.794345638831.issue18534@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +easy title: State clearly that open() 'file' param is "name" attr of the result -> [doc] State clearly that open() 'file' param is "name" attr of the result versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue18534> _______________________________________ From report at bugs.python.org Mon Sep 6 12:46:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Sep 2021 16:46:43 +0000 Subject: [issue7391] [doc] restore the "Idioms and Anti-Idioms in Python" document In-Reply-To: <1259072363.61.0.346322429524.issue7391@psf.upfronthosting.co.za> Message-ID: <1630946803.57.0.205500757746.issue7391@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: The document out of date when it was removed and is now another dozen years older. Since then no one has expresses any interest with this and other tools have emerged to deal with code formatting. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue7391> _______________________________________ From report at bugs.python.org Mon Sep 6 12:48:45 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Sep 2021 16:48:45 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630946925.43.0.810404205074.issue45115@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I strongly disagree. If CI needs to be faster, please just change the CI configuration. If contributors have to wait a few minutes longer, they can wait - they'll save that time in local compilations. Local debugging absolutely relies on debug builds. You'd be destroying the workflow of most Windows-based developers with this change. It's not worth it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 12:55:41 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Sep 2021 16:55:41 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630947341.53.0.979047785779.issue45052@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset 19871fce3b74fc3f37e334a999e00d0ef65a8f1e by Nikita Sobolev in branch 'main': bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182) https://github.com/python/cpython/commit/19871fce3b74fc3f37e334a999e00d0ef65a8f1e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 12:55:53 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 06 Sep 2021 16:55:53 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630947353.12.0.746216119652.issue45052@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26613 pull_request: https://github.com/python/cpython/pull/28185 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 12:55:56 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Sep 2021 16:55:56 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630947356.32.0.537603906972.issue45052@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The test fix looks good to me. That resolves this issue, yes? The other work is going on elsewhere? ---------- nosy: -miss-islington _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 13:01:44 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 06 Sep 2021 17:01:44 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630947356.32.0.537603906972.issue45052@roundup.psfhosted.org> Message-ID: <CAO_bL1y1zAkvDo=jdYPEKAfcFFZxXY0s-pQu1Ccwq4m9YDM89A@mail.gmail.com> Nikita Sobolev <mail at sobolevn.me> added the comment: I think that adding extra tests and docs are two separate new tasks. I will open them today. Thanks a lot, everyone! ??, 6 ????. 2021 ?. ? 19:56, Steve Dower <report at bugs.python.org>: > > Steve Dower <steve.dower at python.org> added the comment: > > The test fix looks good to me. That resolves this issue, yes? The other > work is going on elsewhere? > > ---------- > nosy: -miss-islington > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue45052> > _______________________________________ > ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 13:02:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 17:02:24 +0000 Subject: [issue28978] a redundant right parentheses in the EBNF rules of parameter_list In-Reply-To: <1481803174.61.0.122563860327.issue28978@psf.upfronthosting.co.za> Message-ID: <1630947744.07.0.169768853739.issue28978@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: This doc has changed, and it's now like this: parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] | parameter_list_no_posonly parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]] | parameter_list_starargs parameter_list_starargs ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]] | "**" parameter [","] ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28978> _______________________________________ From report at bugs.python.org Mon Sep 6 13:08:31 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Sep 2021 17:08:31 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630948111.59.0.549508068766.issue44348@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: It should also be possible to reduce the stack size of each frame. We've done that before, because there were multiple temporary buffers allocated on the stack that were trivially moved into functions. I bet we can also reduce the number of indirections, as last time I had to investigate a native stack we seem to have bloated up to 6-7 C frames for each Python frame. Failing that, I'd rather have an option to build with higher stack size just for tests (or users who care that much - my experience is that people tend to care more about many Python processes rather than high recursion). That only affects python[w][_uwp].exe. We could also add a threading API to allow creating new threads with larger stack size. That would allow us to write tests that can do it, and also enable users who may run into it. I'd prefer Windows just be able to expand the stack better at runtime, but the reserved address space apparently wins the back-compat argument. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 13:10:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 17:10:56 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x Message-ID: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: AMD64 Fedora Rawhide 3.x: https://buildbot.python.org/all/#/builders/285/builds/685 It is likely test_itimer_virtual() of test_signal which failed. On the buildbot worker: $ rpm -q glibc glibc-2.34.9000-5.fc36.x86_64 $ uname -r 5.15.0-0.rc0.20210902git4ac6d90867a4.4.fc36.x86_64 test.pythoninfo: platform.libc_ver: glibc 2.34.9000 platform.platform: Linux-5.15.0-0.rc0.20210902git4ac6d90867a4.4.fc36.x86_64-x86_64-with-glibc2.34.9000 Logs: test test_signal crashed -- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/libregrtest/runtest.py", line 340, in _runtest_inner refleak = _runtest_inner2(ns, test_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/libregrtest/runtest.py", line 297, in _runtest_inner2 test_runner() ^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/libregrtest/runtest.py", line 261, in _test_module support.run_unittest(tests) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/support/__init__.py", line 1123, in run_unittest _run_suite(suite) ^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/support/__init__.py", line 998, in _run_suite result = runner.run(suite) ^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/runner.py", line 176, in run test(result) ^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 122, in run test(result) ^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 122, in run test(result) ^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/suite.py", line 122, in run test(result) ^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/case.py", line 652, in __call__ return self.run(*args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/case.py", line 569, in run result.startTest(self) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/support/testresult.py", line 41, in startTest super().startTest(test) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/runner.py", line 54, in startTest self.stream.write(self.getDescription(test)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/unittest/runner.py", line 44, in getDescription def getDescription(self, test): File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/test_signal.py", line 739, in sig_vtalrm raise signal.ItimerError("setitimer didn't disable ITIMER_VIRTUAL " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ signal.itimer_error: setitimer didn't disable ITIMER_VIRTUAL timer. Code of the test: def sig_vtalrm(self, *args): self.hndl_called = True if self.hndl_count > 3: # it shouldn't be here, because it should have been disabled. raise signal.ItimerError("setitimer didn't disable ITIMER_VIRTUAL " # <==== HERE "timer.") # <======================================================= HERE elif self.hndl_count == 3: # disable ITIMER_VIRTUAL, this function shouldn't be called anymore signal.setitimer(signal.ITIMER_VIRTUAL, 0) self.hndl_count += 1 # Issue 3864, unknown if this affects earlier versions of freebsd also @unittest.skipIf(sys.platform in ('netbsd5',), 'itimer not reliable (does not mix well with threading) on some BSDs.') def test_itimer_virtual(self): self.itimer = signal.ITIMER_VIRTUAL signal.signal(signal.SIGVTALRM, self.sig_vtalrm) signal.setitimer(self.itimer, 0.3, 0.2) start_time = time.monotonic() while time.monotonic() - start_time < 60.0: # use up some virtual time by doing real work _ = pow(12345, 67890, 10000019) if signal.getitimer(self.itimer) == (0.0, 0.0): break # sig_vtalrm handler stopped this itimer else: # Issue 8424 self.skipTest("timeout: likely cause: machine too slow or load too " "high") # virtual itimer should be (0.0, 0.0) now self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0)) # and the handler should have been called self.assertEqual(self.hndl_called, True) ---------- components: Tests messages: 401162 nosy: vstinner priority: normal severity: normal status: open title: test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 6 13:11:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 17:11:30 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1630948290.18.0.137781725528.issue45119@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +cstratak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 6 13:13:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 17:13:14 +0000 Subject: [issue25066] Better repr for multiprocessing.synchronize objects In-Reply-To: <1441945512.28.0.268911334925.issue25066@psf.upfronthosting.co.za> Message-ID: <1630948394.86.0.541923777458.issue25066@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The patch need to be converted to a GitHub PR. ---------- keywords: +easy -patch nosy: +iritkatriel stage: patch review -> needs patch versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25066> _______________________________________ From report at bugs.python.org Mon Sep 6 13:16:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 06 Sep 2021 17:16:51 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630948611.45.0.463742953438.issue45052@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 6b5aea2dc1bf7e117d40d6c9035d5c13124fd968 by Miss Islington (bot) in branch '3.10': bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182) https://github.com/python/cpython/commit/6b5aea2dc1bf7e117d40d6c9035d5c13124fd968 ---------- nosy: +miss-islington _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Mon Sep 6 13:26:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 17:26:57 +0000 Subject: [issue29232] Quiet Install In-Reply-To: <1484083752.73.0.652797539276.issue29232@psf.upfronthosting.co.za> Message-ID: <1630949217.15.0.99032756544.issue29232@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Earl, is there still an open problem to look into here or can this be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29232> _______________________________________ From report at bugs.python.org Mon Sep 6 13:33:20 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 06 Sep 2021 17:33:20 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1630949600.86.0.948188459355.issue41082@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch pull_requests: +26614 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28186 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Mon Sep 6 13:36:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 06 Sep 2021 17:36:46 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1630949806.05.0.787224871238.issue41082@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- versions: +Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Mon Sep 6 13:36:22 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 06 Sep 2021 17:36:22 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1630949782.79.0.187818084227.issue41082@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I looked a bit more into this, it's been fixed in 3.10, in this PR: https://github.com/python/cpython/pull/18841 It wasn't backported to 3.9. I'm not quite sure if it's best to backport to 3.9 or fix via docs for 3.9. Just in case I've put up a small PR for such a docfix. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Mon Sep 6 13:41:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 06 Sep 2021 17:41:03 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1630950063.05.0.843588893992.issue39899@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Note this change also fixes https://bugs.python.org/issue41082 . I'm guessing it's too much of an edge case to backport this fix to 3.9, so I've put up a possible fix via docs update on that issue. ---------- nosy: +andrei.avk, kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39899> _______________________________________ From report at bugs.python.org Mon Sep 6 13:52:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 06 Sep 2021 17:52:12 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1630950732.41.0.926991969588.issue39899@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: To be more precise, this change fixes https://bugs.python.org/issue41082 by raising RuntimeError instead of KeyError and also by documenting it, which means matplotlib can fix it by either using os.path.expanduser or catching RuntimeError, whichever might work better in their case. I will let them know once we sort this out. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39899> _______________________________________ From report at bugs.python.org Mon Sep 6 13:54:50 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 06 Sep 2021 17:54:50 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630950890.08.0.355239424721.issue34561@roundup.psfhosted.org> Tim Peters <tim at python.org> added the comment: New changeset 5cb4c672d855033592f0e05162f887def236c00a by Tim Peters in branch 'main': bpo-34561: Switch to Munro & Wild "powersort" merge strategy. (#28108) https://github.com/python/cpython/commit/5cb4c672d855033592f0e05162f887def236c00a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34561> _______________________________________ From report at bugs.python.org Mon Sep 6 13:58:25 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 06 Sep 2021 17:58:25 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630951105.55.0.370678820408.issue34561@roundup.psfhosted.org> Change by Tim Peters <tim at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34561> _______________________________________ From report at bugs.python.org Mon Sep 6 14:02:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 18:02:37 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1630951357.67.0.0856854879537.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I rewrote the test in C, see attached setitimer.c. On Fedora 34: --- $ rpm -q glibc glibc-2.33-20.fc34.x86_64 $ uname -r 5.13.8-200.fc34.x86_64 $ gcc setitimer.c -o setitimer && ./setitimer setitimer(<0.5, 0.5>) SIGVTALRM SIGVTALRM SIGVTALRM SIGVTALRM setitimer(<0, 0>) ok SIGVTALRM is disarmed wait 3 seconds setitimer(<0, 0>) ok exit --- On Fedora Rawhide: --- $ rpm -q glibc glibc-2.34.9000-5.fc36.x86_64 $ uname -r 5.15.0-0.rc0.20210902git4ac6d90867a4.4.fc36.x86_64 $ gcc setitimer.c -o setitimer && ./setitimer setitimer(<0.5, 0.5>) SIGVTALRM SIGVTALRM SIGVTALRM SIGVTALRM setitimer(<0, 0>) ok SIGVTALRM FATAL ERROR: SIGVTALRM timer not disarmed! Abandon (core dumped) --- ---------- Added file: https://bugs.python.org/file50265/setitimer.c _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 6 14:13:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 18:13:05 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1630951985.57.0.580830302835.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It seems like the kernel was just upgrade from 5.14 to 5.15.rc0: vstinner at python-builder-rawhide$ date lun. 06 sept. 2021 14:05:43 EDT vstinner at python-builder-rawhide$ grep kernel /var/log/dnf.log 2021-09-03T06:35:58-0400 DEBUG Installed: kernel-5.15.0-0.rc0.20210901git9e9fb7655ed5.2.fc36.x86_64 ... 2021-09-04T06:31:34-0400 DEBUG Installed: kernel-5.15.0-0.rc0.20210902git4ac6d90867a4.4.fc36.x86_64 ... vstinner at python-builder-rawhide$ rpm -q kernel kernel-5.14.0-0.rc5.20210813gitf8e6dfc64f61.46.fc36.x86_64 kernel-5.15.0-0.rc0.20210901git9e9fb7655ed5.2.fc36.x86_64 kernel-5.15.0-0.rc0.20210902git4ac6d90867a4.4.fc36.x86_64 vstinner at python-builder-rawhide$ uptime 14:06:00 up 3:14, 1 user, load average: 2,47, 2,58, 3,11 vstinner at python-builder-rawhide$ journalctl --list-boots -1 04d2796c1f374367add41a55f48c7dad Sat 2021-08-28 14:55:16 EDT?Mon 2021-09-06 10:50:57 EDT 0 1a10ace470bd4016ad19fd25d248fc57 Mon 2021-09-06 10:51:11 EDT?Mon 2021-09-06 14:12:36 EDT ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 6 14:18:38 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 06 Sep 2021 18:18:38 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1630952318.72.0.799528471339.issue30637@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: The doc section in question is https://docs.python.org/3/library/ast.html#ast.parse I confirmed that 'break', 'continue', 'yield', and 'return' still parse, with the results how having "type_ignores=[]" added. 'Module(body=[Expr(value=Yield())], type_ignores=[])' I do not understand Nick's comment about 'await' as 'await' is not a legal statement' The current initial paragraph says: "Parse the source into an AST node. Equivalent to compile(source, filename, mode, ast.PyCF_ONLY_AST)." I suggest following this with: "If the AST node is compiled to a code object, there are additional syntax checks that can raise errors. "For example, 'return' parses to a node, but is not legal outside of a def statement." Hrvoje's suggested adding something like "If source contains a null character ('\0'), ValueError is raised." I don't think that this is needed as ast.parse is explicitly noted as equivalent to a compile call, and the compile doc says "This function raises SyntaxError if the compiled source is invalid, and ValueError if the source contains null bytes." (Should not that be 'null characters' given that *source* is now unicode?) This statement need not be repeated here. ---------- versions: +Python 3.11 -Python 2.7, Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Mon Sep 6 14:23:16 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 06 Sep 2021 18:23:16 +0000 Subject: [issue45111] whole website translation error In-Reply-To: <1630920397.91.0.782714198576.issue45111@roundup.psfhosted.org> Message-ID: <1630952596.3.0.712937934282.issue45111@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45111> _______________________________________ From report at bugs.python.org Mon Sep 6 14:32:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 18:32:17 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1630953137.22.0.289837164423.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It may be a Linux kernel 5.15 regression. I'm now trying to report this issue to the Linux kernel. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 6 14:40:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 18:40:05 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1630953605.81.0.440022996868.issue30637@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Re null in source code, see issue20115. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Mon Sep 6 15:00:09 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Sep 2021 19:00:09 +0000 Subject: [issue29232] Quiet Install In-Reply-To: <1484083752.73.0.652797539276.issue29232@psf.upfronthosting.co.za> Message-ID: <1630954809.12.0.719576053657.issue29232@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The underlying issue is known and tracked by issue25166 ---------- resolution: -> out of date stage: -> resolved status: open -> closed superseder: -> Windows All Users installation places uninstaller in user profile _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29232> _______________________________________ From report at bugs.python.org Mon Sep 6 15:30:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 06 Sep 2021 19:30:41 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630956641.16.0.597088963603.issue45103@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Thank you for finding what I could not. Your previous message, referenced above, reporting a problem that remains in 8.6.11 on linux, was ... "For me, this is not limited to special characters. Trying to load anything in Tk using the 'JoyPixels' font crashes (sometimes it does load but all characters are very random - most are whitespace - and it crashes again after a call to `fc-cache`). IDLE crashes when trying to preview the font. I believe this is what is being experienced on https://askubuntu.com/questions/1236488/x-error-of-failed-request-badlength-poly-request-too-large-or-internal-xlib-le because they are not using any special characters yet are reporting the same problem." JoyPixels is an emoji font. There are emoji in the BMP, but not in IDLE's initial font sample. Did you add some, or did problems occur without displaying any emoji? --- I presume that the Phaistos 'font' has glyphs for the unicode phaistos block in the first astral plane, U+101D0..101FD. https://en.wikipedia.org/wiki/Phaistos_Disc_(Unicode_block) If they include one of those characters in the font name displayed in the font list (ugh), then a problem is understandable, and the fix would be to filter astral chars (and possibly more) out of font names. But I won't assume this. Please try the experiments I outlined if you are so inclined. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 15:32:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 06 Sep 2021 19:32:11 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630956731.77.0.0885392315242.issue45103@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: If nothing else, I should amend the doc note about font problems to include Windows if we verify the report. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 15:42:30 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Mon, 06 Sep 2021 19:42:30 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630957350.13.0.248094818467.issue34561@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment: Thanks for your work Tim, just adapted the changes to PyPy's Timsort, using bits of runstack.py! ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34561> _______________________________________ From report at bugs.python.org Mon Sep 6 15:48:49 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 06 Sep 2021 19:48:49 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630957729.11.0.957631434893.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: > did problems occur without displaying any emoji I was using an unmodified version of IDLE. > If they include one of those characters in the font name displayed in the font list This is not the case. It is listed simply as "Phaistos", when calling `tkinter.font.families()`. > if we verify the report Report verified. Behaviour is exactly as described, hanging when trying to load the "Configure IDLE" window. I will look into exactly which line is the problem soon. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 15:51:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 06 Sep 2021 19:51:01 +0000 Subject: [issue32750] lib2to3 log_error method behavior is inconsitent with documentation In-Reply-To: <1517596667.28.0.467229070634.issue32750@psf.upfronthosting.co.za> Message-ID: <1630957861.31.0.389406180088.issue32750@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32750> _______________________________________ From report at bugs.python.org Mon Sep 6 16:11:38 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 06 Sep 2021 20:11:38 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1630959098.15.0.983482191317.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: IDLE is hanging on Lib/idlelib/configdialog.py:94 (`self.wait_window()`). Commenting this does not solve the problem: I think it's in the Tk event loop somewhere, since my debugger shows the Python callback completing successfully. This still doesn't explain the behaviour, however, so I'll need to spend a bit more time tracking it down. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Mon Sep 6 16:30:12 2021 From: report at bugs.python.org (Rafael Belo) Date: Mon, 06 Sep 2021 20:30:12 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update Message-ID: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> New submission from Rafael Belo <rafaelblsilva at gmail.com>: There is a mismatch in specification and behavior in some windows encodings. Some older windows codepages specifications present "UNDEFINED" mapping, whereas in reality, they present another behavior which is updated in a section named "bestfit". For example CP1252 has a corresponding bestfit1525: CP1252: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT bestfit1525: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt >From which, in CP1252, bytes \x81 \x8d \x8f \x90 \x9d map to "UNDEFINED", whereas in bestfit1252, they map to \u0081 \u008d \u008f \u0090 \u009d respectively. In the Windows API, the function 'MultiByteToWideChar' exhibits the bestfit1252 behavior. This issue and PR proposes a correction for this behavior, updating the windows codepages where some code points where defined as "UNDEFINED" to the corresponding bestfit?mapping. Related issue: https://bugs.python.org/issue28712 ---------- components: Demos and Tools, Library (Lib), Unicode, Windows messages: 401181 nosy: ezio.melotti, lemburg, paul.moore, rafaelblsilva, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Windows cp encodings "UNDEFINED" entries update type: behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Mon Sep 6 16:47:12 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 06 Sep 2021 20:47:12 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1630961232.44.0.729906411995.issue45120@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- keywords: +patch nosy: +python-dev nosy_count: 8.0 -> 9.0 pull_requests: +26615 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28189 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Mon Sep 6 17:49:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 21:49:38 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630964978.41.0.318221464118.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Raymond: > Perhaps these critical code sections should have been left as macros. It is difficult to assuring system wide inlining across modules. These functions were not converted recently to static inline function. For example, Py_INCREF() was already a static inline function in Python 3.9. I don't think that any decision should be taken before performances have been analyzed in depth. I'm not convinced that there is really a performance regression. I'm not sure how benchmarks are run on Windows. neonene: > I measured overheads of (1)~(4) on my own build whose eval-loop uses macros instead of them. I don't understand how to read the table. Usually, I expect a comparison between a reference build and a patch build, but here you seem to use 3.10a7 as the reference to compare results. I'm not sure that geometric means can be compared this way. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 17:52:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 21:52:54 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1630965174.17.0.164145877102.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Since PR25244 (28d28e053db6b69d91c2dfd579207cd8ccbc39e7), _PyEval_EvalFrameDefault() in ceval.c has seemed to be unoptimized with PGO (msvc14.29.16.10). > At least the functions below have become un-inlined there at all. I'm not sure if PGO builds are reproducible, since there is a training step which requires to run a non-deterministic workload (the Python test suite which is somehow randomized by I/O timings and other stuffs). The compiler is free to inline or not depending on the pressure on registers and stack memory. I'm not sure that inlining always make the code faster, since inlining have many side effects. I don't know well MSC compiler. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 6 18:05:20 2021 From: report at bugs.python.org (Shantanu) Date: Mon, 06 Sep 2021 22:05:20 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol Message-ID: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> New submission from Shantanu <hauntsaninja at gmail.com>: Consider: ``` from typing import Protocol class P(Protocol): ... class C(P): def __init__(self): super().__init__() C() ``` This code passes without error on 3.9.6. With 3.9.7, we get: ``` Traceback (most recent call last): File "/Users/shantanu/dev/test.py", line 10, in <module> C() File "/Users/shantanu/dev/test.py", line 8, in __init__ super().__init__() File "/Users/shantanu/.pyenv/versions/3.9.7/lib/python3.9/typing.py", line 1083, in _no_init raise TypeError('Protocols cannot be instantiated') TypeError: Protocols cannot be instantiated ``` I bisected this to: bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) (GH-27559) Note there is also an interaction with the later commit: bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) (GH-28132) This later commit actually causes a RecursionError: ``` File "/Users/shantanu/dev/cpython/Lib/typing.py", line 1103, in _no_init_or_replace_init cls.__init__(self, *args, **kwargs) File "/Users/shantanu/dev/test.py", line 8, in __init__ super().__init__() File "/Users/shantanu/dev/cpython/Lib/typing.py", line 1103, in _no_init_or_replace_init cls.__init__(self, *args, **kwargs) File "/Users/shantanu/dev/test.py", line 8, in __init__ super().__init__() ``` Originally reported by @tyralla on Gitter. ---------- components: Library (Lib) messages: 401184 nosy: hauntsaninja priority: normal severity: normal status: open title: Regression in 3.9.7 with typing.Protocol versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Mon Sep 6 18:06:45 2021 From: report at bugs.python.org (Shantanu) Date: Mon, 06 Sep 2021 22:06:45 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1630966005.21.0.713491199433.issue45121@roundup.psfhosted.org> Change by Shantanu <hauntsaninja at gmail.com>: ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Mon Sep 6 18:21:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 22:21:55 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630966915.6.0.424274577381.issue44348@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26617 pull_request: https://github.com/python/cpython/pull/28190 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 18:34:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 22:34:24 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630967664.51.0.972433454505.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_recursion_in_except_handler() creates chained of exceptions. When an exception is deallocated, it calls the deallocator of another exception, etc. * recurse_in_except() sub-test creates chains of 11 nested deallocator calls * recurse_in_body_and_except() sub-test creates a chain of 8192 nested deallocator calls I'm not sure how recurse_in_body_and_except() can creates a chain which is so long, knowing that the test sets the recursion limit to 44 frames (default Python limit is 1000). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 18:35:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 06 Sep 2021 22:35:40 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1630967740.08.0.759459178585.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: In msg399939, item 2 lacks one more "reset path": > 2. at cursor exit, if there's an active statement Rewording this to: 2. when a statement is removed from a cursor; that is either at cursor dealloc, or when the current statement is replaced. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Mon Sep 6 18:41:33 2021 From: report at bugs.python.org (Fahim Faisal) Date: Mon, 06 Sep 2021 22:41:33 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1630968093.06.0.686774175531.issue44828@roundup.psfhosted.org> Fahim Faisal <sphincone at gmail.com> added the comment: Can also confirm this issue, tested on M1 and Intel Mac and both has the same error when using Monterey 12.0 Beta 21A5506j. On the same computer, using Big Sur, saves the file successfully and no error present. Seems like a Monterey issue, not dependent on specific hardware. (Intel/M1) Tested on fresh Python 3.9.6 (tk version 8.6) Installation on Big Sur and Monterey Beta (Build 21A5506j) on a M1 Macbook Pro and Early 2015 13" Macbook Pro. ---------- nosy: +i3p9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44828> _______________________________________ From report at bugs.python.org Mon Sep 6 18:44:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 06 Sep 2021 22:44:03 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs Message-ID: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> New submission from Guido van Rossum <guido at python.org>: This is up for grabs. For reference, the Steering Council approved getting rid of these two C APIs without honoring the customary two-release deprecation period required by PEP 387. For reference see https://github.com/python/steering-council/issues/75. This also has references to python-dev and python-committers discussions. ---------- messages: 401188 nosy: gvanrossum priority: normal severity: normal stage: needs patch status: open title: Remove PyCode_New and PyCode_NewWithPosOnlyArgs type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 18:45:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 06 Sep 2021 22:45:03 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630968303.09.0.378388883527.issue45122@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: PS. It would be nice to also update Cython, which is the only thing that uses these C APIs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 19:17:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 23:17:00 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630970220.41.0.0602262548365.issue45122@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: If possible, I suggest to do in in this order: * Fix Cython * Publish a Cython release including the fix * (Maybe wait a bit) * Remove the two functions Previously, we tried to first modified Python, and then update Cython: it went bad. Otherwise, the following 136 popular PyPI packages will fail to build on Python 3.11: https://mail.python.org/archives/list/python-dev at python.org/message/6RO2WFU5Q7UQDVL72IRMT4T6L4GEAKB6/ In Fedora, we start to integrate Python 3.11 since alpha 1. In the past, the broken Cython was really annoying: many important packages failed to build, and so everything was broken. Hopefully, we can now patch Cython, and we modified most recipes building Python packages to always regenerate Cython source, to avoid such problem. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 19:21:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 23:21:06 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630970466.52.0.868234875316.issue45122@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I understood that these function calls shoud be replaced with: * PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno) * code.replace() method: https://docs.python.org/dev/library/types.html#types.CodeType.replace ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 19:24:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 06 Sep 2021 23:24:35 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630970675.97.0.424131958679.issue45122@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: That sounds like a good plan (note that alpha 1 will go out around Oct 4). I left an issue for Cython: https://github.com/cython/cython/issues/4365 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 19:29:59 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 06 Sep 2021 23:29:59 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1630970999.39.0.699076087761.issue20115@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: The compile() doc currently says ""This function raises SyntaxError if the compiled source is invalid, and ValueError if the source contains null bytes." And indeed, in repository 3.9, 3.10, 3.11, >>> compile('\0','','exec') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: source code string cannot contain null bytes Ditto when run same in a file from IDLE or command line. The exception sometimes when the null is in a comment or string within the code. >>> '\0' '\x00' >>> #\0 >>> compile('#\0','','single', 0x200) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: source code string cannot contain null bytes >>> compile('"\0"','','single', 0x200) ValueError: source code string cannot contain null bytes I am puzzled because "\0" and #\0 in the IDLE shell are sent as strings containing the string or comment to compiled with the call above in codeop. There must be some difference in when \0 is interpreted. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20115> _______________________________________ From report at bugs.python.org Mon Sep 6 19:30:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 23:30:10 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630971010.17.0.332008257263.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: bench.py: pyperf benchmarks on BaseException_dealloc(). Benchmarks results on PR 28190 on Fedora 34 with LTO (I didn't use PGO nor CPU pinning). It says "faster" but it's likely noise in the build or in the benchmark (again, I didn't use CPU pinning, and I used my laptop while the benchmark was running. IMO it means that the trashcan overhead is not significant on this benchmark. $ python3 -m pyperf compare_to ref.json trashcan.json --table +----------------+---------+-----------------------+ | Benchmark | ref | trashcan | +================+=========+=======================+ | list 10_000 | 1.27 ms | 1.18 ms: 1.08x faster | +----------------+---------+-----------------------+ | chain 10_000 | 3.94 ms | 3.89 ms: 1.01x faster | +----------------+---------+-----------------------+ | Geometric mean | (ref) | 1.01x faster | +----------------+---------+-----------------------+ Benchmark hidden because not significant (6): list 10, list 100, list 1000, chain 10, chain 100, chain 1000 ---------- Added file: https://bugs.python.org/file50266/bench.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 19:31:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Sep 2021 23:31:23 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1630971083.58.0.426597898925.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Using trashcan, it's possible to create a long longer than 10 000 exceptions. But currently, Python does crash in this case, so I stopped the benchmark at 10 000. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Mon Sep 6 19:34:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 06 Sep 2021 23:34:52 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1630971292.41.0.931349690409.issue20115@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Which part puzzles you? I see that you tried >>> #\0 This does not contain a null byte, just three characters: a hash, a backslash, and a digit zero. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20115> _______________________________________ From report at bugs.python.org Mon Sep 6 20:41:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 00:41:05 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1630975265.77.0.965217801544.issue45121@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Possibly related to issue 45081, which ended up not having anything to do with dataclasses (despite the title). Can you check if that fix solves your problem? ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Mon Sep 6 21:14:18 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 07 Sep 2021 01:14:18 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1630977258.7.0.984926953722.issue45104@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: The first variant seems best to me. ---------- nosy: +veky _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Mon Sep 6 21:24:08 2021 From: report at bugs.python.org (Shantanu) Date: Tue, 07 Sep 2021 01:24:08 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1630977848.12.0.32324115901.issue45121@roundup.psfhosted.org> Shantanu <hauntsaninja at gmail.com> added the comment: As I mentioned in the post, bpo-45081 actually makes this issue worse, since we get a RecursionError. I think `TypeError: Protocols cannot be instantiated` is probably okay behaviour (as opposed to RecursionError), more just unfortunate that it seems to be an unanticipated breaking change. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Mon Sep 6 21:27:22 2021 From: report at bugs.python.org (Shantanu) Date: Tue, 07 Sep 2021 01:27:22 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1630978042.17.0.905463573325.issue45121@roundup.psfhosted.org> Shantanu <hauntsaninja at gmail.com> added the comment: Sorry if my message was confusing. Hopefully the following makes things clear: 3.9.6: snippet runs without error 3.9.7, with bpo-44806: (a probably reasonable) TypeError, but a breaking change main, with bpo-45081: RecursionError ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Mon Sep 6 21:28:55 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 07 Sep 2021 01:28:55 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630978135.76.0.0468201212855.issue45122@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 21:31:05 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 07 Sep 2021 01:31:05 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630978265.24.0.173618014869.issue45122@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: FYI, mypyc is using PyCode_New. mypyc should be fixed not to use PyCode_New :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 22:19:06 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 07 Sep 2021 02:19:06 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630981146.21.0.795664964231.issue45115@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: I sent the patch for this issue: https://github.com/python/mypy/pull/11067 ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 22:19:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 07 Sep 2021 02:19:21 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1630981161.38.0.456908271603.issue45115@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- Removed message: https://bugs.python.org/msg401202 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Mon Sep 6 22:19:33 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 07 Sep 2021 02:19:33 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630981173.91.0.978085101949.issue45122@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: I sent the patch for this issue: https://github.com/python/mypy/pull/11067 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Mon Sep 6 23:02:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 07 Sep 2021 03:02:20 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1630983740.92.0.574822018738.issue20115@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: What I missed before is that duplicating the effect of the first two interactive entries (no exception) requires escaping the backslash so that the source argument for the explicit compile does not have a null. compile("'\\0'", '', 'exec') <code object <module> at 0x00000214431CAA20, file "", line 1> compile("#\\0", '', 'exec') <code object <module> at 0x00000214431CAC30, file "", line 1> So I did not actually see an exception to the rule. --- *On Win 10*, I experimented with a version of Armin and Irit's example, without and with b'...' and 'wb'. s = '#\x00\na\nb\n' print(len(s)) # 7 with open("f:/Python/a/nulltest.py", 'w') as f: f.write(s) import nulltest When I ran a local repository build of 3.9, 3.10, or 3.11 with f:\dev\3x>python f:/Python/a/nulltest.py I got Irit's strange NameError instead of the proper ValueError. When I ran with installed 3.9 or 3.10 with py -3.10 -m a.nulltest I got the null-byte ValueError. When I ran from IDLE's editor running on either installed or repository python, the import gave the null-byte ValueError. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20115> _______________________________________ From report at bugs.python.org Mon Sep 6 23:48:23 2021 From: report at bugs.python.org (Nirawat Puechpian) Date: Tue, 07 Sep 2021 03:48:23 +0000 Subject: [issue44892] [configparser] Module configparser fails when the config file contains a0918076336 "100%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630986503.08.0.509828309738.issue44892@roundup.psfhosted.org> Change by Nirawat Puechpian <nirawat.pu at gmail.com>: ---------- assignee: -> terry.reedy components: +Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, SSL, Subinterpreters, Tests, Tkinter, Windows, XML, macOS -Library (Lib) nosy: +koobs, ned.deily, paul.moore, ronaldoussoren, steve.dower, terry.reedy, tim.golden, zach.ware -DiddiLeija, lukasz.langa, uranusjr title: [configparser] Module configparser fails when the config file contains a "%" inside a commentary -> [configparser] Module configparser fails when the config file contains a0918076336 "100%" inside a commentary type: behavior -> enhancement versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Tue Sep 7 00:48:42 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 07 Sep 2021 04:48:42 +0000 Subject: [issue45117] `dict` not subscriptable despite using `__future__` typing annotations In-Reply-To: <1630944704.92.0.838059763947.issue45117@roundup.psfhosted.org> Message-ID: <1630990122.16.0.340608608663.issue45117@roundup.psfhosted.org> Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment: Hi Stefan, `from __future__ import annotations` only affects annotations -- just the things after the colon. It makes it so that annotations are never evaluated, so things like this work: >>> from __future__ import annotations >>> x: nonsense()()()()[other_nonsense](1<2>3) The __future__ import is not a wholesale opt-in-to-all-new-typing-features, it's just an opt-in-to-not-evaluate-annotations. dict.__class_getitem__ (which is what gets called when you type dict[str, Any]) was not added at all until Python 3.9 (GH-18239), so if you want to *evaluate* such expressions, you have to upgrade to 3.9+. In 3.8, use typing.Dict instead -- 3.8 is no longer accepting new features. Thanks for the report, but I'm closing this for now. ---------- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45117> _______________________________________ From report at bugs.python.org Tue Sep 7 00:50:40 2021 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Sep 2021 04:50:40 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues Message-ID: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> New submission from Yury Selivanov <yselivanov at gmail.com>: Per discussion on python-dev (also see the linked email), PyAiter_Check should only check for `__anext__` existence (and not for `__aiter__`) to be consistent with `Py_IterCheck`. While there, I'd like to rename PyAiter_Check to PyAIter_Check and PyObject_GetAiter to PyObject_GetAIter (i -> I). First, we should apply CamelCase convention correctly, here "async" and "iter" are separate words; second, "Aiter" is marked as invalid spelling by spell checkers in IDEs which is annoying. See https://mail.python.org/archives/list/python-dev at python.org/message/BRHMOFPEKGQCCKEKEEKGSYDR6NOPMRCC/ for more details. ---------- components: Interpreter Core messages: 401206 nosy: pablogsal, yselivanov priority: release blocker severity: normal stage: patch review status: open title: PyAiter_Check & PyObject_GetAiter issues type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 00:55:48 2021 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Sep 2021 04:55:48 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues In-Reply-To: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> Message-ID: <1630990548.61.0.690978900236.issue45123@roundup.psfhosted.org> Change by Yury Selivanov <yselivanov at gmail.com>: ---------- keywords: +patch pull_requests: +26618 pull_request: https://github.com/python/cpython/pull/28194 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 01:08:34 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 07 Sep 2021 05:08:34 +0000 Subject: [issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630991314.75.0.301881740509.issue44892@roundup.psfhosted.org> Change by Kubilay Kocak <koobs.freebsd at gmail.com>: ---------- assignee: terry.reedy -> components: +Library (Lib) -Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, SSL, Subinterpreters, Tests, Tkinter, Windows, XML, macOS nosy: +lukasz.langa -koobs, ned.deily, paul.moore, ronaldoussoren, steve.dower, terry.reedy, tim.golden, zach.ware title: [configparser] Module configparser fails when the config file contains a0918076336 "100%" inside a commentary -> [configparser] Module configparser fails when the config file contains a "%" inside a commentary type: enhancement -> behavior versions: -Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Tue Sep 7 01:15:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 07 Sep 2021 05:15:36 +0000 Subject: [issue44892] Configparser fails when the file contains $ inside a comment In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630991736.91.0.721136039708.issue44892@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Diego, I repaired the defacement, which included removing you as nosy. Relevant doc: https://docs.python.org/3/library/configparser.html#configparser.BasicInterpolation To me, the following line implies that % may be used freely in comments. gain: 80%% # use a %% to escape the % sign (% is the only character ... However, IDLE uses .cfg files and configparser, and when I added #% to my C:/Users/Terry/.idlerc/config-main.cfg, IDLE startup fails with the following, confirming the behavior. Traceback (most recent call last): File "f:\dev\3x\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\runpy.py", line 86, in _run_code exec(code, run_globals) ^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\__main__.py", line 7, in <module> idlelib.pyshell.main() ^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\pyshell.py", line 1648, in main shell = flist.open_shell() ^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\pyshell.py", line 335, in open_shell self.pyshell = PyShell(self) ^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\pyshell.py", line 898, in __init__ OutputWindow.__init__(self, flist, None, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\outwin.py", line 79, in __init__ EditorWindow.__init__(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\editor.py", line 215, in __init__ text['font'] = idleConf.GetFont(self.root, 'main', 'EditorWindow') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\config.py", line 742, in GetFont bold = self.GetOption(configType, section, 'font-bold', default=0, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\config.py", line 229, in GetOption return self.userCfg[configType].Get(section, option, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\idlelib\config.py", line 61, in Get return self.getboolean(section, option) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 829, in getboolean return self._get_conv(section, option, self._convert_to_boolean, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 809, in _get_conv return self._get(section, conv, option, raw=raw, vars=vars, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 804, in _get return conv(self.get(section, option, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 800, in get return self._interpolation.before_get(self, section, option, value, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 395, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "f:\dev\3x\lib\configparser.py", line 442, in _interpolate_some raise InterpolationSyntaxError( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%' When changed one of the lines in my file see what a valid interpolation would do, font-size = 12 # for %(font)s I got "Warning: config.py - IdleConf.GetOption - invalid 'int' value for configuration option 'font-size' from section 'EditorWindow': '12 # for source code pro'" configparser interpreted the comment as part of the value, and started IDLE with the default size 10. The same happened when I used %%: the bad value was '12 # for %' And again with just '#'. Values read as string are also disabled by '#'. "name = Custom Dark # %(parenstyle)s" resulted in the default light theme. Conclusion: 1. Comments are currently worse than useless. 2. Test suite is deficient. Diego, good PRs are welcome. Please sign CLA first. For this, the problem is comments not being recognized and stripped. Fix that and % in comments will not be an issue. ---------- nosy: +DiddiLeija, terry.reedy, uranusjr, zach.ware stage: -> needs patch title: [configparser] Module configparser fails when the config file contains a "%" inside a commentary -> Configparser fails when the file contains $ inside a comment versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Tue Sep 7 01:32:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 07 Sep 2021 05:32:27 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1630992747.77.0.148740499781.issue20115@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Serhiy?s comment from 2014-01-04 gives the answer. It?s different reading from a file than from a string. And only ?python x.py? still reads from a file. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20115> _______________________________________ From report at bugs.python.org Tue Sep 7 01:41:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 07 Sep 2021 05:41:25 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains comments In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630993285.77.0.373210898877.issue44892@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Make PR branch from main, which I used for testing. I verified issue on 3.10 and 3.9, so we will backport. ---------- stage: needs patch -> test needed title: Configparser fails when the file contains $ inside a comment -> Configparser fails when the .cfg file contains comments versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Tue Sep 7 02:00:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 07 Sep 2021 06:00:42 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1630994442.57.0.972244751421.issue45104@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: I would be happy with just "instance of cls". Elsewhere in the docs, that phrasing almost always means "instance of a cls or instance of a subclass of cls". Also, it is consistent with the meaning of isinstance(inst, cls) unless overridden by ABC logic. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 02:01:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Sep 2021 06:01:03 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains comments In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1630994463.22.0.436674678111.issue44892@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: By default configparser does not support inline comments. "# percentage sign '%'" is a part of value. If you want to support inline comments you should pass the inline_comment_prefixes argument. But note that it can break parsing existing valid config files containing such prefixes. For example "background=#ffffff" or "path=C:\Python\bin;D:\Users\Me\bin" if use standard comment prefixes "#" and ";". This is why it is disabled by default. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Tue Sep 7 02:15:47 2021 From: report at bugs.python.org (da-woods) Date: Tue, 07 Sep 2021 06:15:47 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1630995347.92.0.11874316845.issue45122@roundup.psfhosted.org> da-woods <dw-git at d-woods.co.uk> added the comment: Nuitka (https://github.com/Nuitka/Nuitka/ - a third Python->C API compiler) also looks to use it so you might want to let them know too while you're doing the rounds on this. ---------- nosy: +da-woods _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Tue Sep 7 02:19:33 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 07 Sep 2021 06:19:33 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1630995573.73.0.901906324389.issue38644@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: This adds cost to our most critical code paths. For example, type_call() will now be slower for every single object instantiation. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38644> _______________________________________ From report at bugs.python.org Tue Sep 7 02:52:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Sep 2021 06:52:24 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1630997544.76.0.146148231789.issue45104@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I concur with Raymond. Originally it was "instance of cls". It was changed in issue15542 (6b16d938d6d1ccb443815e20e8812deed274dc09). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 04:40:33 2021 From: report at bugs.python.org (Keuin) Date: Tue, 07 Sep 2021 08:40:33 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1631004033.67.0.62095576568.issue42627@roundup.psfhosted.org> Keuin <keuinx at gmail.com> added the comment: The fix is available as a pull request on GitHub for months (https://github.com/python/cpython/pull/26307). However, it seems that this pull request needs an approval from one maintainer before running any test. Could anyone help this out? ---------- nosy: +keuin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42627> _______________________________________ From report at bugs.python.org Tue Sep 7 05:08:40 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 09:08:40 +0000 Subject: [issue45124] Remove deprecated bdist_msi command Message-ID: <1631005719.97.0.212991443867.issue45124@roundup.psfhosted.org> New submission from Hugo van Kemenade <hugovk+python at gmail.com>: The bdist_msi command was deprecated in Python 3.9 by bpo-39586 (commit 2d65fc940b897958e6e4470578be1c5df78e319a). It can be removed in Python 3.11. PR to follow. ---------- components: Distutils messages: 401216 nosy: dstufft, eric.araujo, hugovk priority: normal severity: normal status: open title: Remove deprecated bdist_msi command versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45124> _______________________________________ From report at bugs.python.org Tue Sep 7 05:11:37 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 09:11:37 +0000 Subject: [issue45124] Remove deprecated bdist_msi command In-Reply-To: <1631005719.97.0.212991443867.issue45124@roundup.psfhosted.org> Message-ID: <1631005897.88.0.636467712417.issue45124@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- keywords: +patch pull_requests: +26619 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28195 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45124> _______________________________________ From report at bugs.python.org Tue Sep 7 05:36:50 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 09:36:50 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631007410.14.0.732624478594.issue44860@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Marking as *potential* release blocker for 3.10. Pablo, without this change the newest pip (with [PR 10358]) will not work on Python 3.10 built --with-platlibdir. This configure option was added in 3.9 for distros that separate `/usr/lib` and `/usr/lib64`, which used downstream patches before. Things will be broken if: * this bug is not fixed in 3.10 * AND `pip` switches to _USE_SYSCONFIG in 3.10 (with merged [PR 10358]) * AND distros don't patch again. So, if this isn't merged in 3.10, either pip or downstreams will need to implement a workaround. (If pip doesn't hold off, downstreams that build --with-platlibdir will likely carry this exact patch.) On the other hand, we're very late in the release cycle. Note that there's a similar bug in bpo-45035 [PR 10358]: https://github.com/pypa/pip/pull/10358 ---------- nosy: +lukasz.langa, pablogsal, petr.viktorin priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 06:03:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 10:03:53 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631009033.84.0.245274657125.issue44860@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: IIUC we need to backport PR27655 to 3.10 no? Or do we need something else? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 06:17:52 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 07 Sep 2021 10:17:52 +0000 Subject: [issue45125] Improve tests and docs of how `pickle` works with `SharedMemory` obejcts Message-ID: <1631009872.94.0.369430162871.issue45125@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: As we've discussed in https://bugs.python.org/msg401146 we need to improve how `SharedMemory` is documented and tested. Right now docs do not cover `pickle` at all (https://github.com/python/cpython/blob/main/Doc/library/multiprocessing.shared_memory.rst). And this is an important aspect in multiprocessing. `SharedMemory` and `pickle` in `test_shared_memory_basics` (https://github.com/python/cpython/blob/a5c6bcf24479934fe9c5b859dd1cf72685a0003a/Lib/test/_test_multiprocessing.py#L3789-L3794): ``` sms.buf[0:6] = b'pickle' pickled_sms = pickle.dumps(sms) sms2 = pickle.loads(pickled_sms) self.assertEqual(sms.name, sms2.name) self.assertEqual(bytes(sms.buf[0:6]), bytes(sms2.buf[0:6]), b'pickle') ``` `ShareableList` has better coverage in this regard (https://github.com/python/cpython/blob/a5c6bcf24479934fe9c5b859dd1cf72685a0003a/Lib/test/_test_multiprocessing.py#L4121-L4144): ``` def test_shared_memory_ShareableList_pickling(self): sl = shared_memory.ShareableList(range(10)) self.addCleanup(sl.shm.unlink) serialized_sl = pickle.dumps(sl) deserialized_sl = pickle.loads(serialized_sl) self.assertTrue( isinstance(deserialized_sl, shared_memory.ShareableList) ) self.assertTrue(deserialized_sl[-1], 9) self.assertFalse(sl is deserialized_sl) deserialized_sl[4] = "changed" self.assertEqual(sl[4], "changed") # Verify data is not being put into the pickled representation. name = 'a' * len(sl.shm.name) larger_sl = shared_memory.ShareableList(range(400)) self.addCleanup(larger_sl.shm.unlink) serialized_larger_sl = pickle.dumps(larger_sl) self.assertTrue(len(serialized_sl) == len(serialized_larger_sl)) larger_sl.shm.close() deserialized_sl.shm.close() sl.shm.close() ``` So, my plan is: 1. Improve testing of `SharedMemory` after pickling/unpickling. I will create a separate test with all the `pickle`-related stuff there 2. Improve docs: user must understand what will have when `SharedMemory` / `SharableList` is pickled and unpickled. For example, the fact that it will still be shared can be a surprise to many. I am going to send a PR with both thing somewhere this week. I will glad to head any feedback before / after :) ---------- assignee: docs at python components: Documentation, Tests messages: 401219 nosy: docs at python, sobolevn priority: normal severity: normal status: open title: Improve tests and docs of how `pickle` works with `SharedMemory` obejcts type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45125> _______________________________________ From report at bugs.python.org Tue Sep 7 06:18:13 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 07 Sep 2021 10:18:13 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1631009893.02.0.218057368026.issue45052@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Closing and moving to https://bugs.python.org/issue45125 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Tue Sep 7 06:19:26 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 10:19:26 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631009966.44.0.431167915362.issue44860@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Possibly together with PR28011. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 06:27:58 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 10:27:58 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631010478.55.0.808969477768.issue45035@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26621 pull_request: https://github.com/python/cpython/pull/28196 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 06:28:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 10:28:21 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631010501.05.0.444098795681.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 4f88161f07538dfb24a43189fd59bf966cb40817 by Tzu-ping Chung in branch 'main': bpo-45035: Make sysconfig posix_home depend on platlibdir (GH-28011) https://github.com/python/cpython/commit/4f88161f07538dfb24a43189fd59bf966cb40817 ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 06:29:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 10:29:40 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631010580.84.0.340669760561.issue44860@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26622 pull_request: https://github.com/python/cpython/pull/28197 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 06:30:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 10:30:18 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1631010618.47.0.0178263493269.issue44963@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 533e725821b15e2df2cd4479a34597c1d8faf616 by Pablo Galindo Salgado in branch 'main': bpo-44963: Implement send() and throw() methods for anext_awaitable objects (GH-27955) https://github.com/python/cpython/commit/533e725821b15e2df2cd4479a34597c1d8faf616 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44963> _______________________________________ From report at bugs.python.org Tue Sep 7 06:30:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 10:30:23 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1631010623.27.0.376897059344.issue44963@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26623 pull_request: https://github.com/python/cpython/pull/28198 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44963> _______________________________________ From report at bugs.python.org Tue Sep 7 06:31:52 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 10:31:52 +0000 Subject: [issue39586] Deprecate bdist_msi: use bdist_wheel instead In-Reply-To: <1581174472.55.0.332465806553.issue39586@roundup.psfhosted.org> Message-ID: <1631010712.54.0.859959156583.issue39586@roundup.psfhosted.org> Hugo van Kemenade <hugovk+python at gmail.com> added the comment: Following this deprecation in Python 3.9, please see https://bugs.python.org/issue45124 / https://github.com/python/cpython/pull/28195 to remove the deprecation in Python 3.11. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39586> _______________________________________ From report at bugs.python.org Tue Sep 7 06:32:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 10:32:41 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1631010761.17.0.767734926134.issue38644@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Raymond: > This adds cost to our most critical code paths. For example, type_call() will now be slower for every single object instantiation. This issue is now closed. Please open a new issue if you consider that the code should be modified. It would also help to have a benchmark if it's a performance regression ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38644> _______________________________________ From report at bugs.python.org Tue Sep 7 06:34:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 10:34:30 +0000 Subject: [issue45124] Remove deprecated bdist_msi command In-Reply-To: <1631005719.97.0.212991443867.issue45124@roundup.psfhosted.org> Message-ID: <1631010870.95.0.791779755134.issue45124@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset eb254b43d2916ef8c0e9ca815fe047411d848aae by Hugo van Kemenade in branch 'main': bpo-45124: Remove the bdist_msi command (GH-28195) https://github.com/python/cpython/commit/eb254b43d2916ef8c0e9ca815fe047411d848aae ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45124> _______________________________________ From report at bugs.python.org Tue Sep 7 06:34:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 10:34:49 +0000 Subject: [issue45124] Remove deprecated bdist_msi command In-Reply-To: <1631005719.97.0.212991443867.issue45124@roundup.psfhosted.org> Message-ID: <1631010889.82.0.541943909391.issue45124@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Thanks, I merged your PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45124> _______________________________________ From report at bugs.python.org Tue Sep 7 06:35:18 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 10:35:18 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631010918.69.0.844525467591.issue45035@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Here, I'm not sure. What do people use --home for? I don't think we need to match the `/usr/` scheme here. For Python software that's not part of a distro, I think just `lib/` is fine. ---------- nosy: +petr.viktorin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 06:36:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Sep 2021 10:36:08 +0000 Subject: [issue45125] Improve tests and docs of how `pickle` works with `SharedMemory` obejcts In-Reply-To: <1631009872.94.0.369430162871.issue45125@roundup.psfhosted.org> Message-ID: <1631010968.45.0.567296376121.issue45125@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Go ahead. Fix also other issues in tests: * All pickling tests should test with all supported protocols, not just with the default one. * self.assertTrue( isinstance(deserialized_sl, shared_memory.ShareableList) ) assertIsinstance() can be used here. * self.assertTrue(deserialized_sl[-1], 9) What is this? If it tests that deserialized_sl[-1] is true, 9 should be removed. Should it be assertEqual() instead? * self.assertFalse(sl is deserialized_sl) assertIs() can be used here. * self.assertTrue(len(serialized_sl) == len(serialized_larger_sl)) assertEqual() can be used here. * All close() should either be called in the finally block, or registered with addCleanup(). Otherwise we will heave resource leaks if tests fail. There may be other issues in other tests. Seems these tests need a clean up. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45125> _______________________________________ From report at bugs.python.org Tue Sep 7 06:38:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 10:38:40 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631011120.65.0.0200238009398.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Hummmmm, I reviewed PR 38011 and the change made sense to me, but If you think we should reconsider PR 28011, please say so ASAP because the 3.10 backport is close to be merged ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 06:44:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 10:44:08 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1631011448.43.0.288132487708.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The regression seems to come from this recent Linux kernel change: https://github.com/torvalds/linux/commit/406dd42bd1ba0c01babf9cde169bb319e52f6147 If fixing the kernel takes too long, we can temporarily skip the test on Linux kernel 5.15 (or newer). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Tue Sep 7 06:52:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 10:52:40 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues In-Reply-To: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> Message-ID: <1631011960.16.0.36745375781.issue45123@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 2c3474a637949aa6f2f7e15f9764c2dfc49cdba1 by Yury Selivanov in branch 'main': bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) https://github.com/python/cpython/commit/2c3474a637949aa6f2f7e15f9764c2dfc49cdba1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 06:52:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 10:52:40 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues In-Reply-To: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> Message-ID: <1631011960.52.0.500493650772.issue45123@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26624 pull_request: https://github.com/python/cpython/pull/28199 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 06:52:57 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 10:52:57 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1631011977.79.0.316735121027.issue44963@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset adc80a58f9683468e0ba5a6eed72040f7f6ba405 by Miss Islington (bot) in branch '3.10': bpo-44963: Implement send() and throw() methods for anext_awaitable objects (GH-27955) https://github.com/python/cpython/commit/adc80a58f9683468e0ba5a6eed72040f7f6ba405 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44963> _______________________________________ From report at bugs.python.org Tue Sep 7 07:01:44 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 07 Sep 2021 11:01:44 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631012504.47.0.304457401477.issue45035@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: > I don't think we need to match the `/usr/` scheme here. For Python software that's not part of a distro, I think just `lib/` is fine. I agree. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:04:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:04:47 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631012687.01.0.180277452021.issue44964@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +26625 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28200 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 07:05:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 11:05:38 +0000 Subject: [issue27277] Test runner should try to increase stack size if it is too low In-Reply-To: <1465457335.09.0.330685258307.issue27277@psf.upfronthosting.co.za> Message-ID: <1631012738.91.0.847910519123.issue27277@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- components: -Interpreter Core nosy: +iritkatriel, serhiy.storchaka title: Fatal Python error: Segmentation fault in test_exceptions -> Test runner should try to increase stack size if it is too low type: crash -> enhancement versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27277> _______________________________________ From report at bugs.python.org Tue Sep 7 07:06:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:06:28 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631012788.06.0.305029087159.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Miro, Petr, do you think then that we should revert PR 28011 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:07:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:07:01 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1631012821.42.0.264799809177.issue44963@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44963> _______________________________________ From report at bugs.python.org Tue Sep 7 07:07:31 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 11:07:31 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631012851.74.0.727444808295.issue45035@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: The use case is a "personal stash of Python modules", described here: https://docs.python.org/3/install/#alternate-installation-the-home-scheme We don't need the lib/lib64 distinction here. I'd revert the 3.11 change and go with /lib/ only. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:10:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 11:10:23 +0000 Subject: [issue36550] Avoid creating AttributeError exceptions in the debugger In-Reply-To: <1554664547.38.0.626848411176.issue36550@roundup.psfhosted.org> Message-ID: <1631013023.23.0.580715891031.issue36550@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as the bug is not clear and the OP is not responding to requests on the PR to clarify it. Please create a new issue if you are still seeing a problem. ---------- nosy: +iritkatriel resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36550> _______________________________________ From report at bugs.python.org Tue Sep 7 07:17:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:17:16 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631013436.95.0.509902076391.issue45035@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26626 pull_request: https://github.com/python/cpython/pull/28201 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:17:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:17:56 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631013476.51.0.736588517698.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Ok, I am reverting PR 28011. Someone should check it again and decide what to do, but this won't enter 3.10 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:18:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:18:58 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631013538.42.0.950979618462.issue44964@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset fa2c0b85a8d5c9486661083afdf38cbaadb3432a by Pablo Galindo Salgado in branch 'main': bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects (GH-28200) https://github.com/python/cpython/commit/fa2c0b85a8d5c9486661083afdf38cbaadb3432a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 07:19:01 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 11:19:01 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631013541.7.0.892408571845.issue44964@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26627 pull_request: https://github.com/python/cpython/pull/28202 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 07:19:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:19:03 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631013543.78.0.053973146523.issue44964@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 07:19:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 11:19:11 +0000 Subject: [issue37997] Segfault when using pickle with exceptions and dynamic class inheritance In-Reply-To: <1567294757.43.0.590587702854.issue37997@roundup.psfhosted.org> Message-ID: <1631013551.83.0.380073766457.issue37997@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I am unable to reproduce the crash with either example on 3.9 or 3.11 on a Mac. Please create a new issue if you still see a problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37997> _______________________________________ From report at bugs.python.org Tue Sep 7 07:20:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:20:35 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631013635.73.0.461305777025.issue44860@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 608a6292366ebba20f33d93d8b52cbb928429e47 by Miss Islington (bot) in branch '3.10': bpo-44860: Make sysconfig posix_user not depend on platlibdir (GH-27655) (GH-28197) https://github.com/python/cpython/commit/608a6292366ebba20f33d93d8b52cbb928429e47 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 07:21:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:21:45 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631013705.72.0.672480327108.issue44860@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Petr, is something left to do for this release blocker? I am planning to start the release if everything is OK ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 07:36:59 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 11:36:59 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631014619.29.0.770097549157.issue44964@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset fc840736e54da0557616882012f362b809490165 by Miss Islington (bot) in branch '3.10': bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects (GH-28200) https://github.com/python/cpython/commit/fc840736e54da0557616882012f362b809490165 ---------- nosy: +miss-islington _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 07:43:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:43:36 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues In-Reply-To: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> Message-ID: <1631015016.7.0.387325412034.issue45123@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 53257cf19fc06fff446815b3278d4b80ec3e7ba3 by Miss Islington (bot) in branch '3.10': bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) (GH-28199) https://github.com/python/cpython/commit/53257cf19fc06fff446815b3278d4b80ec3e7ba3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 07:43:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 11:43:47 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1631015027.81.0.356241544457.issue42064@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: New changeset 0474d06008f8c9eba660ed20d336ffdc5c4db121 by Erlend Egeberg Aasland in branch 'main': bpo-44991: Normalise `sqlite3` callback naming (GH-28088) https://github.com/python/cpython/commit/0474d06008f8c9eba660ed20d336ffdc5c4db121 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42064> _______________________________________ From report at bugs.python.org Tue Sep 7 07:43:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 11:43:47 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1631015027.87.0.184658792962.issue44991@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: New changeset 0474d06008f8c9eba660ed20d336ffdc5c4db121 by Erlend Egeberg Aasland in branch 'main': bpo-44991: Normalise `sqlite3` callback naming (GH-28088) https://github.com/python/cpython/commit/0474d06008f8c9eba660ed20d336ffdc5c4db121 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44991> _______________________________________ From report at bugs.python.org Tue Sep 7 07:44:42 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 11:44:42 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1631015082.08.0.93728971756.issue44991@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: The remaining function_pinboard_* renames are part of PR-27940. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44991> _______________________________________ From report at bugs.python.org Tue Sep 7 07:46:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:46:12 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631015172.34.0.00468093483743.issue44860@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 07:46:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:46:00 +0000 Subject: [issue45123] PyAiter_Check & PyObject_GetAiter issues In-Reply-To: <1630990240.1.0.111200047499.issue45123@roundup.psfhosted.org> Message-ID: <1631015160.44.0.498349233225.issue45123@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45123> _______________________________________ From report at bugs.python.org Tue Sep 7 07:46:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 11:46:29 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631015189.17.0.778874548395.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 97b754d4b46ad9dd63f68906484f805931578c81 by Pablo Galindo Salgado in branch 'main': Revert "bpo-45035: Make sysconfig posix_home depend on platlibdir (GH-28011)" (GH-28201) https://github.com/python/cpython/commit/97b754d4b46ad9dd63f68906484f805931578c81 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 07:46:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 07 Sep 2021 11:46:02 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init Message-ID: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> New submission from Erlend E. Aasland <erlend.aasland at innova.no>: Quoting Petr Viktorin in PR 27940, https://github.com/python/cpython/pull/27940#discussion_r703424148: - db is not set to NULL if init fails. - This segfaults for me: import sqlite3 conn = sqlite3.connect(':memory:') conn.execute('CREATE TABLE foo (bar)') try: conn.__init__('/bad-file/') except sqlite3.OperationalError: pass conn.execute('INSERT INTO foo (bar) VALUES (1), (2), (3), (4)') Other issues: - reinitialisation is not handled gracefully - __init__ is messy; members are initialised here and there Suggested to reorder connection __init__ in logical groups to more easily handle errors: 1. handle reinit 2. open and configure database 3. create statement LRU cache and weak ref cursor list 4. initialise members in the order they're defined in connection.h 5. set isolation level, since it's a weird case anyway ---------- components: Extension Modules messages: 401248 nosy: erlendaasland, petr.viktorin priority: normal severity: normal status: open title: [sqlite3] cleanup and harden connection init versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Tue Sep 7 07:50:00 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 11:50:00 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631015400.74.0.352195419814.issue44860@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: I believe everything is in order now. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 08:18:50 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 07 Sep 2021 12:18:50 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1631017130.58.0.801006663561.issue45034@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: New changeset 8ca6b61e3fd7f1e2876126cee82da8d812c8462f by Nikita Sobolev in branch 'main': bpo-45034: Fix how upper limit is formatted for `struct.pack("H", ...)` (GH-28178) https://github.com/python/cpython/commit/8ca6b61e3fd7f1e2876126cee82da8d812c8462f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Tue Sep 7 08:21:35 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 12:21:35 +0000 Subject: [issue45111] whole website translation error In-Reply-To: <1630920397.91.0.782714198576.issue45111@roundup.psfhosted.org> Message-ID: <1631017295.97.0.813701913374.issue45111@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Per PEP 545, you should probably raise this on the doc-sig mailing list (https://mail.python.org/mailman/listinfo/doc-sig), and/or one of the repos https://github.com/python/python-docs-zh-cn or https://github.com/python/python-docs-zh-cn. I'm going to close this issue here, since there's no action item for core python. I'm going to call it a "third party" resolution, because that seems better than "not a bug", but I realize it doesn't really fit. ---------- nosy: +eric.smith resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45111> _______________________________________ From report at bugs.python.org Tue Sep 7 08:22:04 2021 From: report at bugs.python.org (daniel hahler) Date: Tue, 07 Sep 2021 12:22:04 +0000 Subject: [issue36550] Avoid creating AttributeError exceptions in the debugger In-Reply-To: <1554664547.38.0.626848411176.issue36550@roundup.psfhosted.org> Message-ID: <1631017324.88.0.543180250249.issue36550@roundup.psfhosted.org> daniel hahler <python-bugs at thequod.de> added the comment: Given code like the following the try/except handling of Pdb (via `Cmd.onecmd`, see https://github.com/python/cpython/pull/4666) will mess with `sys.exc_info()`, which could be avoided: ``` try: raise ValueError() except Exception as exc: e = exc __import__('pdb').set_trace() ``` ``` % ./python t_issue36550.py --Return-- > ?/t_issue36550.py(5)<module>()->None -> __import__('pdb').set_trace() (Pdb) import sys; sys.exc_info() (<class 'AttributeError'>, AttributeError("'Pdb' object has no attribute 'do_import'"), <traceback object at 0x7f92d2782500>) ``` The initial / better motivation was described in the original issue: with pdb++/pdbpp I want to display tracebacks/errors with errors that might occur via Pdb's prompt, where this then showed up as interfering with it. (Sorry for not responding on https://github.com/python/cpython/pull/4666 earlier, but I think it is only part of this issue, and therefore it should not get closed, and also creating a new one instead does not sound useful to me, so please consider to re-open it instead.) ---------- versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36550> _______________________________________ From report at bugs.python.org Tue Sep 7 08:25:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 07 Sep 2021 12:25:15 +0000 Subject: [issue45034] Improve struct.pack out of range error messages In-Reply-To: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> Message-ID: <1631017515.02.0.918227162384.issue45034@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: The out-of-range error messages for unsigned short and short have been fixed, thanks to Nikita Sobolev. They resulted from a rather odd use of the Py_STRINGIFY macro, which meant that not only were the messages obscure, but they differed from system to system: e.g., on my machine I get: "struct.error: ushort format requires 0 <= number <= (32767 *2 +1)", and "struct.error: short format requires (-32767 -1) <= number <= 32767", complete with the weird spacing. There's still room for normalising the other messages and/or converting the limits to hex if anyone wants to provide a PR. I'm unsure about using hex universally: while `0xffffffffffffffff` (or even better, `0xffff_ffff_ffff_ffff`) is definitely more useful than `18446744073709551615`, I think I'd still find `-128` more immediately readable than `-0x80`. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45034> _______________________________________ From report at bugs.python.org Tue Sep 7 08:37:40 2021 From: report at bugs.python.org (Eduardo Morales) Date: Tue, 07 Sep 2021 12:37:40 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1631018260.42.0.905861750195.issue44869@roundup.psfhosted.org> Eduardo Morales <edmorales.97 at gmail.com> added the comment: Not sure if this is helpful, but I am attaching the MacOS bug log that is auto-generated when Python fails. ---------- Added file: https://bugs.python.org/file50267/bug.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44869> _______________________________________ From report at bugs.python.org Tue Sep 7 08:41:24 2021 From: report at bugs.python.org (Eduardo Morales) Date: Tue, 07 Sep 2021 12:41:24 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1631018484.11.0.687178840124.issue44869@roundup.psfhosted.org> Eduardo Morales <edmorales.97 at gmail.com> added the comment: Also: (base) ? backend git:(development) ? PYTHONFAULTHANDLER=1 python3 server.py CONFIG_FILE=../config/development.json Python(27657,0x10839f600) malloc: *** error for object 0x7ffb4ac81d10: pointer being freed was not allocated Python(27657,0x10839f600) malloc: *** set a breakpoint in malloc_error_break to debug Fatal Python error: Aborted Current thread 0x000000010839f600 (most recent call first): File "/Users/edumoralesibm/fantasy-football-health-dashboard/backend/server.py", line 26 in <module> [1] 27657 abort PYTHONFAULTHANDLER=1 python3 server.py ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44869> _______________________________________ From report at bugs.python.org Tue Sep 7 08:42:02 2021 From: report at bugs.python.org (Eduardo Morales) Date: Tue, 07 Sep 2021 12:42:02 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1631018522.78.0.33907483522.issue44869@roundup.psfhosted.org> Change by Eduardo Morales <edmorales.97 at gmail.com>: ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44869> _______________________________________ From report at bugs.python.org Tue Sep 7 08:55:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 12:55:23 +0000 Subject: [issue17970] Mutlithread XML parsing cause segfault In-Reply-To: <1368453158.92.0.142296100122.issue17970@psf.upfronthosting.co.za> Message-ID: <1631019323.86.0.184419938167.issue17970@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I've reproduced the segfault on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17970> _______________________________________ From report at bugs.python.org Tue Sep 7 09:06:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:06:25 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1631019985.81.0.87903885428.issue42064@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: New changeset 979336de34e3d3f40cf6e666b72a618f6330f3c1 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Pass module state to trace, progress, and authorizer callbacks (GH-27940) https://github.com/python/cpython/commit/979336de34e3d3f40cf6e666b72a618f6330f3c1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42064> _______________________________________ From report at bugs.python.org Tue Sep 7 09:06:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 13:06:03 +0000 Subject: [issue21825] Embedding-Python example code from documentation crashes In-Reply-To: <1403451208.28.0.571545120594.issue21825@psf.upfronthosting.co.za> Message-ID: <1631019963.19.0.899980725148.issue21825@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: 3.4 is long out of maintenance, please create a new issue if you are seeing this problem on a current version (>= 3.9). You are more likely to receive a response if you include a precise and complete description of the problem. For example, instead of saying "The example on your website", put a link to this example. I'm not sure what the "multiply.py" script you mention is. The less detective work a core dev needs to do just to understand the issue, the more likely they are to want to look into it. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21825> _______________________________________ From report at bugs.python.org Tue Sep 7 09:06:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:06:38 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1631019998.5.0.902493701069.issue44991@roundup.psfhosted.org> Change by Petr Viktorin <encukou at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44991> _______________________________________ From report at bugs.python.org Tue Sep 7 09:07:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 13:07:17 +0000 Subject: [issue36550] Avoid creating AttributeError exceptions in the debugger In-Reply-To: <1554664547.38.0.626848411176.issue36550@roundup.psfhosted.org> Message-ID: <1631020037.51.0.577247782887.issue36550@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reopened. ---------- resolution: rejected -> status: closed -> open versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36550> _______________________________________ From report at bugs.python.org Tue Sep 7 09:16:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:16:54 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631020614.17.0.595616201499.issue45035@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26628 pull_request: https://github.com/python/cpython/pull/28204 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:19:02 2021 From: report at bugs.python.org (Vincent Michel) Date: Tue, 07 Sep 2021 13:19:02 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631020742.01.0.88548877413.issue44219@roundup.psfhosted.org> Vincent Michel <vxgmichel at gmail.com> added the comment: My team ran into this issue while developing a fuse application too. In an effort to help this issue move forward, I tried to list all occurrences of the `isatty` C function in the cpython code base. I found 14 of them. 9 of them are directly related to stdin/stdout/stderr, so it's probably not crucial to release the GIL for those occurrences: - `main.c:stdin_is_interactive` - `main.c:pymain_import_readline` - `readline.c:setup_readline` - `bltinmodule.c:builtin_input_impl` (x2) - `frozenmain.c:Py_FrozenMain` - `pylifecycle.c:Py_FdIsInteractive` (x2) - `fileobject.c:stdprinter_isatty` (GIL is actually released for this one) Out of the remaining 4, only 1 releases the GIL: - `fileio.c:_io_FileIO_isatty_impl`: used for `FileIO.isatty` Which gives 3 occurrences of non-stdstream specific usage of `isatty` that do not release the GIL: - `posixmodule.c:os_isatty_impl`: used by `os.isatty` - `fileutils.c:_Py_device_encoding`: used `TextIOWrapper.__init__` - `fileutils.c:_Py_write_impl`: windows specific, issue #11395 The first one is used by `os.isatty` which means this call can also deadlock. I did manage to reproduce it with a simple fuse loopback file system: https://github.com/fusepy/fusepy/blob/master/examples/loopback.py The second one is the one found by @smurfix and gets triggered when `io.open()` is used in text mode. The third one only triggers on windows when writing more than 32767 bytes to a file descriptor. A comment points to issue #11395 (https://bugs.python.org/issue11395). Also, it seems from the function signature that this function might be called with or without the GIL held, which might cause the fix to be a bit more complicated than the first two use cases. I hope this helps. ---------- nosy: +vxgmichel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Tue Sep 7 09:19:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 13:19:04 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1631020744.92.0.946866334861.issue45052@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: This seem to have caused several errors that have manifested on the release of 3.10.0rc2: test test_multiprocessing_fork failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/test/_test_multiprocessing.py", line 3818, in test_shared_memory_basics with unittest.mock.patch( File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1422, in __enter__ self.target = self.getter() File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1609, in <lambda> getter = lambda: _importer(target) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1252, in _importer thing = _dot_lookup(thing, comp, import_path) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1242, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' 0:09:11 load avg: 0.71 [231/427/1] test_multiprocessing_forkserver -- test_multiprocessing_fork failed (1 error) in 1 min 11 sec test test_multiprocessing_forkserver failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/test/_test_multiprocessing.py", line 3818, in test_shared_memory_basics with unittest.mock.patch( File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1422, in __enter__ self.target = self.getter() File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1609, in <lambda> getter = lambda: _importer(target) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1252, in _importer thing = _dot_lookup(thing, comp, import_path) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1242, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' 0:11:11 load avg: 0.93 [232/427/2] test_multiprocessing_main_handling -- test_multiprocessing_forkserver failed (1 error) in 2 min 0:11:18 load avg: 1.09 [233/427/2] test_multiprocessing_spawn test test_multiprocessing_spawn failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Tue Sep 7 09:19:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:19:04 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631020744.38.0.899808672194.issue45035@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also the email on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/5UU6V2B3KBS4Z7OG5T7D6YQZASFNSBJM/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:20:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:20:03 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631020803.77.0.31836528466.issue44860@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also the email on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/5UU6V2B3KBS4Z7OG5T7D6YQZASFNSBJM/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 09:22:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:22:50 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631020970.98.0.372351233498.issue45035@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I wrote the PR 28204 to change the unix_home used by the distutils install command. Previous code: if sys.version_info >= (3, 9) and key == "platlib": # platlibdir is available since 3.9: bpo-1294959 value = value.replace("/lib/", "/$platlibdir/") INSTALL_SCHEMES[main_key][key] = value This code was added by: commit 341e8a939aca6e9f59ffb0e6daee5888933694ed Author: Lum?r 'Frenzy' Balhar <frenzy.madness at gmail.com> Date: Wed Apr 14 17:12:34 2021 +0200 bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549) Modifying the unix_home was not the intended behavior. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:23:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:23:15 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631020995.4.0.475723245474.issue44860@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Let's continue the discussion for the unix_home scheme in bpo-45035. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Tue Sep 7 09:32:58 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 07 Sep 2021 13:32:58 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631021578.01.0.522396837342.issue38820@roundup.psfhosted.org> Change by Christian Heimes <lists at cheimes.de>: ---------- pull_requests: +26629 pull_request: https://github.com/python/cpython/pull/28205 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Tue Sep 7 09:35:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 13:35:59 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631021759.6.0.687890264486.issue45035@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I'm doing the release of 3.10.0rc2 as we speak. Please, review this ASAP or otherwise this PR will not be backported to 3.10.0 and will have to wait to 3.10.1 as per the devguide. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:41:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:41:37 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631022097.58.0.478450366345.issue45035@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: AFAICS: this is a bug, but in deprecated code. Not worth fixing in 3.11, and definitely not worth fixing in a RC, and . People should stop using distutils, and those who can't won't be happy with changes to it. Consider that existing distutils issues on bpo were already auto-closed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:42:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:42:19 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1631022139.55.0.394200535996.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset fb305092a5d7894b41f122c1a1117b3abf4c567e by Victor Stinner in branch 'main': bpo-44348: BaseException deallocator uses trashcan (GH-28190) https://github.com/python/cpython/commit/fb305092a5d7894b41f122c1a1117b3abf4c567e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Tue Sep 7 09:42:51 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:42:51 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631022171.86.0.00877440719585.issue45035@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: (Sorry for the extra `and`; I hit Submit too soon) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 09:43:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:43:45 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1631022225.06.0.0894437766624.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Even if Python 3.9 and 3.10 have the idea, I don't think that long exception chains are common enough to justify a backport. I prefer to leave the code as it it in stable branches, and see how things go with the change in the main branch. I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Tue Sep 7 09:45:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:45:12 +0000 Subject: [issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds In-Reply-To: <1630675600.0.0.104145127588.issue45094@roundup.psfhosted.org> Message-ID: <1631022312.97.0.359855368073.issue45094@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Using __forceinline didn't fix test_exceptions: see https://bugs.python.org/issue44348#msg401185 Since I created the issue to fix bpo-44348 and it doesn't work, I close the issue. Moreover, always inlining can have a negative impact on release builds. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45094> _______________________________________ From report at bugs.python.org Tue Sep 7 09:47:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:47:19 +0000 Subject: [issue45115] Windows: enable compiler optimizations when building Python in debug mode In-Reply-To: <1630941702.52.0.0278112507289.issue45115@roundup.psfhosted.org> Message-ID: <1631022439.17.0.068712664608.issue45115@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Steve: > I strongly disagree. If CI needs to be faster, please just change the CI configuration. If contributors have to wait a few minutes longer, they can wait - they'll save that time in local compilations. > Local debugging absolutely relies on debug builds. You'd be destroying the workflow of most Windows-based developers with this change. It's not worth it. Ok, I reject my issue. I found a portable way to fix bpo-44348: it doesn't depend on the OS, nor the compiler, nor compiler options. The fix is to use the trashcan mecanism in the BaseException deallocator: commit fb305092a5d7894b41f122c1a1117b3abf4c567e. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45115> _______________________________________ From report at bugs.python.org Tue Sep 7 09:48:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 13:48:01 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x: Linux kernel 5.15 regression In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1631022481.23.0.192966457191.issue45119@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x -> test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x: Linux kernel 5.15 regression _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Tue Sep 7 09:48:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 13:48:23 +0000 Subject: [issue34498] Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za> Message-ID: <1631022503.64.0.883632820675.issue34498@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11. I've changed type because crash typically refers to segfault rather than an exception being raised. ---------- nosy: +iritkatriel type: crash -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34498> _______________________________________ From report at bugs.python.org Tue Sep 7 09:48:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 13:48:55 +0000 Subject: [issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za> Message-ID: <1631022535.51.0.700751970946.issue34498@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- title: Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted -> Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34498> _______________________________________ From report at bugs.python.org Tue Sep 7 09:54:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 13:54:12 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1631022852.29.0.343656562525.issue45052@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I'm planning to revert PR 28185 because this is blocking the release ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Tue Sep 7 09:55:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 13:55:50 +0000 Subject: [issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently. In-Reply-To: <1469917189.39.0.985531249644.issue27658@psf.upfronthosting.co.za> Message-ID: <1631022950.42.0.818246436754.issue27658@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: 3.5 is long out of maintenance. I suggest we close this and look into it if the problem is reported for a newer version. ---------- nosy: +iritkatriel resolution: -> third party status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27658> _______________________________________ From report at bugs.python.org Tue Sep 7 09:57:18 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:57:18 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects Message-ID: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> New submission from Petr Viktorin <encukou at gmail.com>: The `replace` method of `code` allows setting e.g. * co_filename to a subclass of str * co_consts to an arbitrary tuple and possibly more weird cases. This makes code objects unmarshallable. One way to create such a code object is to call `compileall.compile_file` with a str subclass as path. See the attached reproducers. This hit pip, see: https://github.com/pypa/pip/pull/10358#issuecomment-914320728 ---------- files: reproducer_replace.py messages: 401277 nosy: petr.viktorin priority: normal severity: normal status: open title: Code objects can contain unmarshallable objects Added file: https://bugs.python.org/file50268/reproducer_replace.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 09:57:30 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 13:57:30 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631023050.48.0.199449280991.issue45127@roundup.psfhosted.org> Change by Petr Viktorin <encukou at gmail.com>: Added file: https://bugs.python.org/file50269/reproducer_compileall.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 10:01:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 14:01:23 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631023283.37.0.554928388357.issue45127@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: How to fix this? I guess: * co_filename should be converted to an actual str, or reject subclasses with an exception * for co_consts, the [marshal docs] could be updated to add code objects to "containers". The [code docs] already say co_consts "is a tuple containing the literals"; if someone's putting in non-literals they're voiding the warranty. And so on for all other fields of code objects. [marshal docs]: https://docs.python.org/3/library/marshal.html [code docs]: https://docs.python.org/3.9/reference/datamodel.html#index-55 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 10:07:50 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 07 Sep 2021 14:07:50 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1631023670.74.0.356230296491.issue45122@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Da-woods, can you take care of that? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Tue Sep 7 10:10:09 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 14:10:09 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects In-Reply-To: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> Message-ID: <1631023809.71.0.0465321548054.issue42839@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: I just filed the slightly more general bpo-45127. ---------- nosy: +petr.viktorin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42839> _______________________________________ From report at bugs.python.org Tue Sep 7 10:10:13 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 07 Sep 2021 14:10:13 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631023813.6.0.45014946216.issue45127@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: See also bpo-42839 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 10:11:23 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 07 Sep 2021 14:11:23 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1631023883.76.0.875836690901.issue45035@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- nosy: +DiddiLeija _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 7 10:13:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 14:13:55 +0000 Subject: [issue34262] Asyncio test fails under Win 7 In-Reply-To: <1532782721.54.0.56676864532.issue34262@psf.upfronthosting.co.za> Message-ID: <1631024035.32.0.522188729908.issue34262@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since the crash was fixed under issue23919. There remains (possibly) the failure of test_sendfile_close_peer_in_the_middle_of_receiving. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34262> _______________________________________ From report at bugs.python.org Tue Sep 7 10:15:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 07 Sep 2021 14:15:09 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631024109.06.0.715367456944.issue45089@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Quoting Petr from PR 28133: Without the ability to tell SQLite to abort on trace failure, I doubt we can do much better than the current behavior. Getting an exception and having the data inserted seems quite irregular. Closing this issue as won't fix. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Tue Sep 7 10:15:20 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 07 Sep 2021 14:15:20 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631024120.08.0.303130244969.issue45121@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +26630 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28206 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Tue Sep 7 10:18:02 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 14:18:02 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631024282.49.0.30221805854.issue45121@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Sorry I didn't notice your reference to issue 45081. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Tue Sep 7 10:24:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 14:24:40 +0000 Subject: [issue35270] Cmd.complete does not handle cmd=None In-Reply-To: <1542495961.77.0.788709270274.issue35270@psf.upfronthosting.co.za> Message-ID: <1631024680.61.0.223813935096.issue35270@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since crash is typically used for a segfault rather than an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35270> _______________________________________ From report at bugs.python.org Tue Sep 7 10:26:35 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 07 Sep 2021 14:26:35 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1631024795.86.0.106554782224.issue45042@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- pull_requests: +26631 pull_request: https://github.com/python/cpython/pull/28182 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Tue Sep 7 10:27:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 14:27:49 +0000 Subject: [issue34846] Runtime failure with Failed to import site module In-Reply-To: <1538273716.55.0.545547206417.issue34846@psf.upfronthosting.co.za> Message-ID: <1631024869.17.0.144739468829.issue34846@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: It doesn't look like there is enough information here to do anything about this, and there has been no response from the OP to follow-up questions. I think we need to close it. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34846> _______________________________________ From report at bugs.python.org Tue Sep 7 10:33:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 14:33:53 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts Message-ID: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: While testing the release artifacts I encountered this failure: test test_multiprocessing_fork failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/test/_test_multiprocessing.py", line 3818, in test_shared_memory_basics with unittest.mock.patch( File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1422, in __enter__ self.target = self.getter() File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1609, in <lambda> getter = lambda: _importer(target) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1252, in _importer thing = _dot_lookup(thing, comp, import_path) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1242, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' 0:09:11 load avg: 0.71 [231/427/1] test_multiprocessing_forkserver -- test_multiprocessing_fork failed (1 error) in 1 min 11 sec test test_multiprocessing_forkserver failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/test/_test_multiprocessing.py", line 3818, in test_shared_memory_basics with unittest.mock.patch( File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1422, in __enter__ self.target = self.getter() File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1609, in <lambda> getter = lambda: _importer(target) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1252, in _importer thing = _dot_lookup(thing, comp, import_path) File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1242, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' 0:11:11 load avg: 0.93 [232/427/2] test_multiprocessing_main_handling -- test_multiprocessing_forkserver failed (1 error) in 2 min 0:11:18 load avg: 1.09 [233/427/2] test_multiprocessing_spawn test test_multiprocessing_spawn failed -- Traceback (most recent call last): File "/tmp/tmpu30qfjpr/installation/lib/python3.10/unittest/mock.py", line 1239, in _dot_lookup return getattr(thing, comp) AttributeError: module 'multiprocessing' has no attribute 'shared_memory' I cannot reproduce it from installed Python or when testing directly on the repo, but the error seems to still happen from time to time. ---------- components: Tests messages: 401287 nosy: pablogsal priority: normal severity: normal status: open title: test_multiprocessing fails sporadically on the release artifacts versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Tue Sep 7 10:34:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 14:34:08 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1631025248.1.0.952807292533.issue45052@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Opened https://bugs.python.org/issue45128 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45052> _______________________________________ From report at bugs.python.org Tue Sep 7 10:34:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 14:34:38 +0000 Subject: [issue39570] Python 3.7.3 Crash on msilib actions In-Reply-To: <1581006397.33.0.114674633699.issue39570@roundup.psfhosted.org> Message-ID: <1631025278.44.0.811522538333.issue39570@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I personally don't feel like downloading a binary from b.p.o and opening it on my machine. Can you provide more information about the issue? For instance, what do you mean by crash? Do you have any stack trace or other output? What is the value in the registry table that it is trying to read and failing? ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39570> _______________________________________ From report at bugs.python.org Tue Sep 7 10:36:46 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 14:36:46 +0000 Subject: [issue45129] Remove deprecated reuse_address parameter from create_datagram_endpoint() Message-ID: <1631025406.86.0.884993515985.issue45129@roundup.psfhosted.org> New submission from Hugo van Kemenade <hugovk+python at gmail.com>: The reuse_address parameter was deprecated in Python 3.9 by bpo-37228. It can be removed in Python 3.11. PR to follow. ---------- components: asyncio messages: 401290 nosy: asvetlov, hugovk, yselivanov priority: normal severity: normal status: open title: Remove deprecated reuse_address parameter from create_datagram_endpoint() versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45129> _______________________________________ From report at bugs.python.org Tue Sep 7 10:37:24 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 07 Sep 2021 14:37:24 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631025444.35.0.280817079403.issue45128@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Related issues: - https://bugs.python.org/issue45042 - https://bugs.python.org/issue45052 ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Tue Sep 7 10:40:08 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 14:40:08 +0000 Subject: [issue45129] Remove deprecated reuse_address parameter from create_datagram_endpoint() In-Reply-To: <1631025406.86.0.884993515985.issue45129@roundup.psfhosted.org> Message-ID: <1631025608.74.0.517361833882.issue45129@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- keywords: +patch pull_requests: +26632 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28207 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45129> _______________________________________ From report at bugs.python.org Tue Sep 7 10:47:36 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 07 Sep 2021 14:47:36 +0000 Subject: [issue27658] python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently. In-Reply-To: <1469917189.39.0.985531249644.issue27658@psf.upfronthosting.co.za> Message-ID: <1631026056.27.0.505977150466.issue27658@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27658> _______________________________________ From report at bugs.python.org Tue Sep 7 11:07:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Sep 2021 15:07:33 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631027253.53.0.373015933892.issue44964@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26633 pull_request: https://github.com/python/cpython/pull/28208 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Tue Sep 7 11:09:36 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 07 Sep 2021 15:09:36 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1631027376.02.0.679706858637.issue44869@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: The crash report you provide shows a crash in libstdc++ which is normally not called directly by the Python interpreter or standard library modules on macOS but appears to be being called by libopenblas as provided by the copy of numpy in use. Suggest you follow up with the numpy, openblas, or homebrew projects, if that's where you obtained numpy and friends. Keep in mind that the problem might still be related to the pre-release status of macOS Monterey. Good luck! ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44869> _______________________________________ From report at bugs.python.org Tue Sep 7 11:11:21 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 07 Sep 2021 15:11:21 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631027481.9.0.481618810325.issue45127@roundup.psfhosted.org> Change by Filipe La?ns <lains at riseup.net>: ---------- nosy: +FFY00 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 11:12:41 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 07 Sep 2021 15:12:41 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631027561.66.0.476189992307.issue45127@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- nosy: +DiddiLeija _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 11:26:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 07 Sep 2021 15:26:17 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1631028377.3.0.251508921796.issue44991@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26634 pull_request: https://github.com/python/cpython/pull/28209 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44991> _______________________________________ From report at bugs.python.org Tue Sep 7 11:34:06 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 07 Sep 2021 15:34:06 +0000 Subject: [issue25963] strptime not parsing some timezones In-Reply-To: <1451291533.28.0.979317956785.issue25963@psf.upfronthosting.co.za> Message-ID: <1631028846.32.0.819217156204.issue25963@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I'm closing this as fixed, the note in datetime docs is here: https://docs.python.org/3.9/library/datetime.html (search for 'only accepts', - note 6) ---------- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.9 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25963> _______________________________________ From report at bugs.python.org Tue Sep 7 11:34:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 07 Sep 2021 15:34:38 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631028878.23.0.681695682567.issue45104@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- keywords: +patch pull_requests: +26635 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28210 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 11:48:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 15:48:05 +0000 Subject: [issue25769] Crash due to using weakref referent without acquiring a strong reference In-Reply-To: <1448860564.76.0.866220529061.issue25769@psf.upfronthosting.co.za> Message-ID: <1631029685.34.0.246514229755.issue25769@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> proxy_contains (weakref.proxy) can access an object with 0 refcount _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25769> _______________________________________ From report at bugs.python.org Tue Sep 7 11:53:11 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 07 Sep 2021 15:53:11 +0000 Subject: [issue45121] Regression in 3.9.7 with typing.Protocol In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631029991.25.0.0940733006288.issue45121@roundup.psfhosted.org> Change by Jelle Zijlstra <jelle.zijlstra at gmail.com>: ---------- nosy: +Jelle Zijlstra, kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Tue Sep 7 12:00:22 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 07 Sep 2021 16:00:22 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631030422.35.0.274279613112.issue45121@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- priority: normal -> critical title: Regression in 3.9.7 with typing.Protocol -> Calling super().__init__ in subclasses of typing.Protocol raises RecursionError versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Tue Sep 7 12:04:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:04:43 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631030683.37.0.453384520758.issue45104@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset fa15df77f02ba4a66ba0b71989381a426038be01 by Raymond Hettinger in branch 'main': bpo-45104: Clarify when __init__ is called (GH-28210) https://github.com/python/cpython/commit/fa15df77f02ba4a66ba0b71989381a426038be01 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:04:57 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:04:57 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631030697.81.0.648730464598.issue45104@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26638 pull_request: https://github.com/python/cpython/pull/28213 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:04:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 16:04:51 +0000 Subject: [issue41489] HTMLParser : HTMLParser.error creating multiple errors. In-Reply-To: <1596657865.41.0.326756245182.issue41489@roundup.psfhosted.org> Message-ID: <1631030691.39.0.99981403293.issue41489@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type because crash typically refers to segfault rather than an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41489> _______________________________________ From report at bugs.python.org Tue Sep 7 12:04:53 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:04:53 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631030693.04.0.374512229444.issue45104@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26637 pull_request: https://github.com/python/cpython/pull/28212 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:04:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:04:48 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631030688.67.0.110416971144.issue45104@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26636 pull_request: https://github.com/python/cpython/pull/28211 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:06:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 16:06:37 +0000 Subject: [issue41489] HTMLParser : HTMLParser.error creating multiple errors. In-Reply-To: <1596657865.41.0.326756245182.issue41489@roundup.psfhosted.org> Message-ID: <1631030797.62.0.765804843149.issue41489@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The code was changed and now instead of calling self.error() it raises an exception: raise AssertionError( 'unknown status keyword %r in marked section' % rawdata[i+3:j]) So match not being initialised is no longer a problem. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41489> _______________________________________ From report at bugs.python.org Tue Sep 7 12:21:08 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:21:08 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631031668.19.0.389929185832.issue45118@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26639 pull_request: https://github.com/python/cpython/pull/28214 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Tue Sep 7 12:21:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:21:07 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631031667.45.0.0328465038585.issue45118@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset c4ea45d7d2c02674db2fdb96c7eee89324d2dc64 by Victor Stinner in branch 'main': bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) https://github.com/python/cpython/commit/c4ea45d7d2c02674db2fdb96c7eee89324d2dc64 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Tue Sep 7 12:21:12 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:21:12 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631031672.48.0.517441565579.issue45118@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26640 pull_request: https://github.com/python/cpython/pull/28215 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Tue Sep 7 12:21:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:21:27 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631031687.47.0.497225844792.issue45104@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 5a42a49477cd601d67d81483f9589258dccb14b1 by Miss Islington (bot) in branch '3.8': bpo-45104: Clarify when __init__ is called (GH-28210) (GH-28213) https://github.com/python/cpython/commit/5a42a49477cd601d67d81483f9589258dccb14b1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:26:42 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 16:26:42 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631032002.64.0.940464493849.issue45104@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset ef704137770b2e98da7880c828aaf921f0b45337 by Miss Islington (bot) in branch '3.10': bpo-45104: Clarify when __init__ is called (GH-28210) https://github.com/python/cpython/commit/ef704137770b2e98da7880c828aaf921f0b45337 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:27:33 2021 From: report at bugs.python.org (Richard) Date: Tue, 07 Sep 2021 16:27:33 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects Message-ID: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> New submission from Richard <nyuszika7h at gmail.com>: When one of the items in the iterable passed to shlex.join() is a pathlib.Path object, it throws an exception saying it must be str or bytes. I believe it should accept Path objects just like other parts of the standard library such as subprocess.run() already do. Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shlex >>> from pathlib import Path >>> shlex.join(['foo', Path('bar baz')]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.9/shlex.py", line 320, in join return ' '.join(quote(arg) for arg in split_command) File "/usr/lib/python3.9/shlex.py", line 320, in <genexpr> return ' '.join(quote(arg) for arg in split_command) File "/usr/lib/python3.9/shlex.py", line 329, in quote if _find_unsafe(s) is None: TypeError: expected string or bytes-like object >>> shlex.join(['foo', str(Path('bar baz'))]) "foo 'bar baz'" Python 3.11.0a0 (heads/main:fa15df77f0, Sep 7 2021, 18:22:35) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shlex >>> from pathlib import Path >>> shlex.join(['foo', Path('bar baz')]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/nyuszika7h/.pyenv/versions/3.11-dev/lib/python3.11/shlex.py", line 320, in join return ' '.join(quote(arg) for arg in split_command) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nyuszika7h/.pyenv/versions/3.11-dev/lib/python3.11/shlex.py", line 320, in <genexpr> return ' '.join(quote(arg) for arg in split_command) ^^^^^^^^^^ File "/home/nyuszika7h/.pyenv/versions/3.11-dev/lib/python3.11/shlex.py", line 329, in quote if _find_unsafe(s) is None: ^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'PosixPath' >>> shlex.join(['foo', str(Path('bar baz'))]) "foo 'bar baz'" ---------- components: Library (Lib) messages: 401301 nosy: nyuszika7h priority: normal severity: normal status: open title: shlex.join() does not accept pathlib.Path objects type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 12:27:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:27:31 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631032051.64.0.47795896563.issue45104@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b1f2fe777e1fe133d33cd1e714b8aa0f81fed1cc by Miss Islington (bot) in branch '3.9': bpo-45104: Clarify when __init__ is called (GH-28210) (GH-28212) https://github.com/python/cpython/commit/b1f2fe777e1fe133d33cd1e714b8aa0f81fed1cc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:27:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:27:51 +0000 Subject: [issue45104] Error in __new__ docs In-Reply-To: <1630795125.96.0.304265394784.issue45104@roundup.psfhosted.org> Message-ID: <1631032071.24.0.17206929285.issue45104@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the patch, Raymond! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45104> _______________________________________ From report at bugs.python.org Tue Sep 7 12:30:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 16:30:05 +0000 Subject: [issue25240] Stack overflow in reprlib causes a core dump In-Reply-To: <1443286078.54.0.18490843262.issue25240@psf.upfronthosting.co.za> Message-ID: <1631032205.8.0.987978364211.issue25240@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: There was work on recursion in newer versions and several similar issues have been confirmed to be fixed. Since you didn't include a complete reproduction script, it's hard to know whether your case was fixed as well. I am therefore closing this, and request that you create a new issue with full reproduction information if you are still seeing this in a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25240> _______________________________________ From report at bugs.python.org Tue Sep 7 12:39:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 16:39:23 +0000 Subject: [issue34262] Asyncio test fails under Win 7 In-Reply-To: <1532782721.54.0.56676864532.issue34262@psf.upfronthosting.co.za> Message-ID: <1631032763.54.0.286908613749.issue34262@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_sendfile_close_peer_in_the_middle_of_receiving() failure is tracked by bpo-41682. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34262> _______________________________________ From report at bugs.python.org Tue Sep 7 12:40:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 16:40:43 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1631032843.11.0.330108165245.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I rejected my two other ideas to fix this issue: * bpo-45094: Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds * bpo-45115: Windows: enable compiler optimizations when building Python in debug mode ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Tue Sep 7 12:41:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 16:41:26 +0000 Subject: [issue34262] Asyncio test fails under Win 7 In-Reply-To: <1532782721.54.0.56676864532.issue34262@psf.upfronthosting.co.za> Message-ID: <1631032886.17.0.571879969284.issue34262@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34262> _______________________________________ From report at bugs.python.org Tue Sep 7 12:45:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 16:45:07 +0000 Subject: [issue27277] Test runner should try to increase stack size if it is too low In-Reply-To: <1465457335.09.0.330685258307.issue27277@psf.upfronthosting.co.za> Message-ID: <1631033107.3.0.520979357483.issue27277@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I just pushed a change to reduce the stack memory usage when deleting a chain of exceptions in bpo-44348. I consider that this issue is a duplicate. If it's not the case, please reopen the issue. commit fb305092a5d7894b41f122c1a1117b3abf4c567e (upstream/main, main) Author: Victor Stinner <vstinner at python.org> Date: Tue Sep 7 15:42:11 2021 +0200 bpo-44348: BaseException deallocator uses trashcan (GH-28190) The deallocator function of the BaseException type now uses the trashcan mecanism to prevent stack overflow. For example, when a RecursionError instance is raised, it can be linked to another RecursionError through the __context__ attribute or the __traceback__ attribute, and then a chain of exceptions is created. When the chain is destroyed, nested deallocator function calls can crash with a stack overflow if the chain is too long compared to the available stack memory. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27277> _______________________________________ From report at bugs.python.org Tue Sep 7 12:45:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 16:45:25 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1631033125.01.0.860369339347.issue44348@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I marked bpo-27277 as a duplicate of this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44348> _______________________________________ From report at bugs.python.org Tue Sep 7 12:52:45 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Sep 2021 16:52:45 +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: <1631033565.07.0.577173187861.issue43468@roundup.psfhosted.org> Antoine Pitrou <pitrou at free.fr> added the comment: In addition to _NOT_FOUND and _EXCEPTION_RAISED, you could have an additional sentinel value _CONCURRENTLY_COMPUTING. Then you don't need to maintain a separate self.updater mapping. ---------- nosy: +pitrou _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43468> _______________________________________ From report at bugs.python.org Tue Sep 7 12:56:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 16:56:06 +0000 Subject: [issue32881] pycapsule:PyObject * is NULL pointer In-Reply-To: <1519102092.04.0.467229070634.issue32881@psf.upfronthosting.co.za> Message-ID: <1631033766.66.0.808969547433.issue32881@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 2.7 is no longer maintained. If you are seeing this problem on a new version (>= 3.9), please create a new issue with full instructions how to reproduce it. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32881> _______________________________________ From report at bugs.python.org Tue Sep 7 12:58:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 16:58:35 +0000 Subject: [issue45129] Remove deprecated reuse_address parameter from create_datagram_endpoint() In-Reply-To: <1631025406.86.0.884993515985.issue45129@roundup.psfhosted.org> Message-ID: <1631033915.05.0.991455695665.issue45129@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: To clarify, the option was entirely disabled in 3.9.0, 3.8.1, 3.7.6, and 3.6.10 due to security concerns. If `True` was passed, it raised a ValueError. If `False` was passed, it raised a DeprecationWarning. This was implemented in GH-17311 and What's New was updated in GH-17595. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45129> _______________________________________ From report at bugs.python.org Tue Sep 7 13:05:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 17:05:03 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631034303.48.0.333160878748.issue38820@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset cc7c6801945c6a7373553b78bd899ce09681ec0a by Christian Heimes in branch 'main': bpo-38820: Test with OpenSSL 3.0.0 final (GH-28205) https://github.com/python/cpython/commit/cc7c6801945c6a7373553b78bd899ce09681ec0a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Tue Sep 7 13:05:04 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 17:05:04 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631034304.78.0.944586654529.issue38820@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26641 pull_request: https://github.com/python/cpython/pull/28216 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Tue Sep 7 13:09:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 17:09:31 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631034571.36.0.00529541934597.issue38820@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26642 pull_request: https://github.com/python/cpython/pull/28217 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Tue Sep 7 13:11:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 17:11:52 +0000 Subject: [issue32955] IDLE crashes when trying to save a file In-Reply-To: <1519654711.02.0.467229070634.issue32955@psf.upfronthosting.co.za> Message-ID: <1631034712.56.0.466014119563.issue32955@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there isn't enough information and there has been no response from the OP to the follow-up questions. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32955> _______________________________________ From report at bugs.python.org Tue Sep 7 13:15:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 17:15:57 +0000 Subject: [issue35084] binascii.Error: Incorrect padding In-Reply-To: <1540684195.55.0.788709270274.issue35084@psf.upfronthosting.co.za> Message-ID: <1631034957.6.0.974881313222.issue35084@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35084> _______________________________________ From report at bugs.python.org Tue Sep 7 13:20:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 17:20:05 +0000 Subject: [issue31419] Can not install python3.6.2 due to Error 0x80070643: Failed to install MSI package In-Reply-To: <1505137249.23.0.24915016523.issue31419@psf.upfronthosting.co.za> Message-ID: <1631035205.37.0.567133241217.issue31419@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Versions 3.5 and 3.6 are no longer being maintained. Are you seeing this problem with a newer version (>= 3.9)? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31419> _______________________________________ From report at bugs.python.org Tue Sep 7 13:21:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 17:21:26 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631035286.36.0.537120081641.issue45118@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 04c13c97eecdb66365782dbbf5e93ff5de267a61 by Miss Islington (bot) in branch '3.9': bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28215) https://github.com/python/cpython/commit/04c13c97eecdb66365782dbbf5e93ff5de267a61 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Tue Sep 7 13:23:45 2021 From: report at bugs.python.org (Hai Shi) Date: Tue, 07 Sep 2021 17:23:45 +0000 Subject: [issue45127] Code objects can contain unmarshallable objects In-Reply-To: <1631023038.1.0.991246928913.issue45127@roundup.psfhosted.org> Message-ID: <1631035425.44.0.312618937397.issue45127@roundup.psfhosted.org> Change by Hai Shi <shihai1991 at 126.com>: ---------- nosy: +shihai1991 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45127> _______________________________________ From report at bugs.python.org Tue Sep 7 13:26:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 07 Sep 2021 17:26:35 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1631035595.18.0.852035682473.issue45024@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- keywords: +patch pull_requests: +26643 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28218 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Tue Sep 7 13:26:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 07 Sep 2021 17:26:35 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1631035595.33.0.774994193025.issue23864@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- keywords: +patch nosy: +rhettinger nosy_count: 11.0 -> 12.0 pull_requests: +26644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28218 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Tue Sep 7 13:31:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 17:31:21 +0000 Subject: [issue35901] json.dumps infinite recurssion In-Reply-To: <1549385438.15.0.743086795547.issue35901@roundup.psfhosted.org> Message-ID: <1631035881.2.0.121837363444.issue35901@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35901> _______________________________________ From report at bugs.python.org Tue Sep 7 13:39:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 17:39:52 +0000 Subject: [issue30089] Automatic Unload of Dynamic Library Cause Segfault In-Reply-To: <1492438695.51.0.289749789728.issue30089@psf.upfronthosting.co.za> Message-ID: <1631036392.09.0.334255113778.issue30089@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 2.7 is no longer being maintained. If you are still seeing this problem on a current version (>= 3.9), please create a new issue. Ideally, please provide instructions how to reproduce the bug. It is hard to debug just from a description (particularly when it involves third party components). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30089> _______________________________________ From report at bugs.python.org Tue Sep 7 13:50:52 2021 From: report at bugs.python.org (da-woods) Date: Tue, 07 Sep 2021 17:50:52 +0000 Subject: [issue45122] Remove PyCode_New and PyCode_NewWithPosOnlyArgs In-Reply-To: <1630968243.03.0.371650813101.issue45122@roundup.psfhosted.org> Message-ID: <1631037052.96.0.00562072217828.issue45122@roundup.psfhosted.org> da-woods <dw-git at d-woods.co.uk> added the comment: Done: https://github.com/Nuitka/Nuitka/issues/1203 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45122> _______________________________________ From report at bugs.python.org Tue Sep 7 13:55:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 17:55:28 +0000 Subject: [issue45012] DirEntry.stat method should release GIL In-Reply-To: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> Message-ID: <1631037328.91.0.761220691748.issue45012@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 9dc363ee7cf2eb6ff374fbf7bbeb0b333f4afb8f by Stanis?aw Skonieczny in branch 'main': bpo-45012: Release GIL around stat in os.scandir (GH-28085) https://github.com/python/cpython/commit/9dc363ee7cf2eb6ff374fbf7bbeb0b333f4afb8f ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45012> _______________________________________ From report at bugs.python.org Tue Sep 7 13:57:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 17:57:48 +0000 Subject: [issue45012] DirEntry.stat method should release GIL In-Reply-To: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> Message-ID: <1631037468.22.0.315940986383.issue45012@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Dzi?ki za zg?oszenie i poprawk?, Stanis?aw! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: behavior -> performance versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45012> _______________________________________ From report at bugs.python.org Tue Sep 7 14:02:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 18:02:57 +0000 Subject: [issue19346] Build fails when there are no shared extensions to be built In-Reply-To: <1382442448.32.0.170952369524.issue19346@psf.upfronthosting.co.za> Message-ID: <1631037777.58.0.788686163508.issue19346@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: remind -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Python?s setup.py raises a ValueError when self.extensions is empty _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue19346> _______________________________________ From report at bugs.python.org Tue Sep 7 14:13:04 2021 From: report at bugs.python.org (neonene) Date: Tue, 07 Sep 2021 18:13:04 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631038384.95.0.122782466984.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: @vstinner: __forceinline suggestion Since PR25244 (mentioned above), it seems link.exe has got to get stuck on python310.dll. Before the PR, it took 10x~ longer to link than without __forceinline function. I can confirm with _Py_DECREF() and _Py_XDECREF() and one training-job (the more fucntions forced/jobs used, the slower to link). Have you tried __forceinline on PGO ? > I don't understand how to read the table. Overhead field is the output of pyperf command, not subtraction (the answers are the same just luckily). ex) 3.10rc1x86 PGO: PGO : pyperf compare_to 3.10a7 left patched : pyperf compare_to 3.10a7 right overhead : pyperf compare_to right left are 1.15x slower (slower 52, faster 4, not significant 2) 1.13x slower (slower 50, faster 4, not significant 4) 1.02x slower (slower 29, faster 14, not significant 15) > I'm not sure if PGO builds are reproducible, MSVC does not produce the same code. Inlining (all or nothing) might be a quite special case in the hottest section. I suspect the profiler doesn't work well only for _PyEval_EvalFrameDefault(), including branch/align optimization. So my posted macro or inlining is just for a mesureing, not the solution. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 7 14:15:21 2021 From: report at bugs.python.org (Sean Kelly) Date: Tue, 07 Sep 2021 18:15:21 +0000 Subject: =?utf-8?b?W2lzc3VlNDUxMzFdIGB2ZW52YCDihpIgYGVuc3VyZXBpcGAgbWF5IHJlYWQg?= =?utf-8?q?local_=60setup=2Ecfg=60_and_fail_mysteriously?= Message-ID: <1631038521.89.0.222056793507.issue45131@roundup.psfhosted.org> New submission from Sean Kelly <kelly at seankelly.biz>: Creating a new virtual environment with the `venv` module reads any local `setup.cfg` file that may be found; if such a file has garbage, the `venv` fails with a mysterious message. Reproduce: ``` $ date -u Tue Sep 7 18:12:27 UTC 2021 $ mkdir /tmp/demo $ cd /tmp/demo $ echo 'a < b' >setup.cfg $ python3 -V Python 3.9.5 $ python3 -m venv venv Error: Command '['/tmp/demo/venv/bin/python3.9', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. ``` (Took me a little while to figure out I had some garbage in a `setup.cfg` file in $CWD that was causing it.) Implications: Potential implications are that a specially crafted `setup.cfg` might cause a security-compromised virtual environment to be created maybe? I don't know. ---------- messages: 401320 nosy: nutjob4life priority: normal severity: normal status: open title: `venv` ? `ensurepip` may read local `setup.cfg` and fail mysteriously type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45131> _______________________________________ From report at bugs.python.org Tue Sep 7 14:16:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 18:16:55 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631038615.43.0.830775506732.issue24888@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 19a304ba990481f0381a5316096b6b3cf2dff381 by DonnaDia in branch 'main': bpo-24888: Clarify subprocess.check_call propagates exceptions if unable to start process (GH-28018) https://github.com/python/cpython/commit/19a304ba990481f0381a5316096b6b3cf2dff381 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:16:58 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 18:16:58 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631038618.99.0.75444578497.issue24888@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26645 pull_request: https://github.com/python/cpython/pull/28223 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:17:03 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 18:17:03 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631038623.5.0.509391276812.issue24888@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26646 pull_request: https://github.com/python/cpython/pull/28224 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:35:35 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 18:35:35 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods Message-ID: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> New submission from Hugo van Kemenade <hugovk+python at gmail.com>: The __getitem__ methods of xml.dom.pulldom.DOMEventStream, wsgiref.util.FileWrapper and were deprecated in Python 3.8 by bpo-9372 / GH-8609. They can be removed in Python 3.11. ---------- components: Library (Lib) messages: 401322 nosy: hugovk priority: normal severity: normal status: open title: Remove deprecated __getitem__ methods versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Tue Sep 7 14:39:22 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 07 Sep 2021 18:39:22 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods In-Reply-To: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> Message-ID: <1631039962.3.0.720430780826.issue45132@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- keywords: +patch pull_requests: +26647 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28225 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Tue Sep 7 14:43:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 18:43:51 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631040231.36.0.423558229275.issue24888@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 2363910662cda4dcf574da68b4633b55e5fc0f9c by Miss Islington (bot) in branch '3.9': bpo-24888: Clarify subprocess.check_call propagates exceptions if unable to start process (GH-28018) (GH-28223) https://github.com/python/cpython/commit/2363910662cda4dcf574da68b4633b55e5fc0f9c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:44:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 07 Sep 2021 18:44:25 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631040265.6.0.00524393840502.issue24888@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 31be544721670516fa9700e088c022ff38b0c5fe by Miss Islington (bot) in branch '3.10': bpo-24888: Clarify subprocess.check_call propagates exceptions if unable to start process (GH-28018) https://github.com/python/cpython/commit/31be544721670516fa9700e088c022ff38b0c5fe ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:45:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 07 Sep 2021 18:45:06 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1631040306.14.0.460591513106.issue24888@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the patch, DonnaDia! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24888> _______________________________________ From report at bugs.python.org Tue Sep 7 14:55:59 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 07 Sep 2021 18:55:59 +0000 Subject: [issue32955] IDLE crashes when trying to save a file In-Reply-To: <1519654711.02.0.467229070634.issue32955@psf.upfronthosting.co.za> Message-ID: <1631040959.26.0.709816229677.issue32955@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Thank you Irit. For any users who stumble on this issue: Drop down clicks in the dialog are handled by tk. Hence, this was not an IDLE issue, unlikely to be a tkinter issue, and most likely a bad tcl/tk version issue. Hence my first post. My response and the web are out of date. We have fixed the version issue by including in each installer what seems to be the best available tcl/tk build. ---------- resolution: works for me -> out of date _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32955> _______________________________________ From report at bugs.python.org Tue Sep 7 14:56:53 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 18:56:53 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects In-Reply-To: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> Message-ID: <1631041013.17.0.852184066363.issue45130@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I disagree. In my mind, there's no more reason for shlex.join() to take Path objects than there is for str.join() to take them, or for shlex.join() to convert int's to str's. I'd rather shlex.join() continue to raise an exception if passed something that's not a str or bytes. You should probably discuss this on the python-ideas mailing list if you want a broader audience. ---------- nosy: +eric.smith type: behavior -> enhancement versions: -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 15:03:03 2021 From: report at bugs.python.org (Richard) Date: Tue, 07 Sep 2021 19:03:03 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects In-Reply-To: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> Message-ID: <1631041383.45.0.588644109955.issue45130@roundup.psfhosted.org> Richard <nyuszika7h at gmail.com> added the comment: While it may be primarily intended to combine output from shlex.split() again, IMO it's useful for manually constructed command lines as well, for example displaying instructions to a user where a path may contain spaces and special characters and needs to be properly escaped. As for converting int to str, since subprocess.run() does not do that, shlex.split() does not need to do so either. I never mentioned that, and while I could see that being useful as well, that would have to be a separate discussion. There's more of a case for automatic conversion for Path objects, which are supposed to work seamlessly in most places where strings are accepted. But such quirks of certain functions not accepting them and being forced to convert to str manually makes pathlib a little annoying to use compared to os.path. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 15:15:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 19:15:36 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631042136.29.0.204412750815.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I don't understand if adding __forceinline on the mentioned static inline functions has an impact on the performance of a PGO build on Windows. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 7 15:18:40 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 07 Sep 2021 19:18:40 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1631042320.12.0.663412657918.issue45022@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset 4dc4300c686f543d504ab6fa9fe600eaf11bb695 by giovanniwijaya in branch 'main': bpo-45022: Fix libffi DLL name in Windows installer sources (GH-28203) https://github.com/python/cpython/commit/4dc4300c686f543d504ab6fa9fe600eaf11bb695 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Tue Sep 7 15:20:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:20:32 +0000 Subject: [issue43187] Dict creation in recursive function cause interpreter crashes. In-Reply-To: <1612948775.51.0.474463250225.issue43187@roundup.psfhosted.org> Message-ID: <1631042432.35.0.753191020744.issue43187@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: On 3.9 I reproduce the segfault. On 3.11 on a mac I get RecursionError: maximum recursion depth exceeded while calling a Python object So it has been fixed in the meantime. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43187> _______________________________________ From report at bugs.python.org Tue Sep 7 15:21:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:21:55 +0000 Subject: [issue38852] test_recursion_limit in test_threading crashes with SIGSEGV on android In-Reply-To: <1574193737.03.0.937540674169.issue38852@roundup.psfhosted.org> Message-ID: <1631042515.55.0.0230605419757.issue38852@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38852> _______________________________________ From report at bugs.python.org Tue Sep 7 15:22:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 19:22:15 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631042535.9.0.0530854212032.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I guess that the test was previously skipped, and bpo-45042 enabled again the test: commit e5976dd2e6e966183da59df99978ebcb4b3a32df Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Sat Sep 4 14:04:44 2021 -0700 bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060) Co-authored-by: Serhiy Storchaka <storchaka at gmail.com> (cherry picked from commit dd7b816ac87e468e2fa65ce83c2a03fe1da8503e) Co-authored-by: Nikita Sobolev <mail at sobolevn.me> ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Tue Sep 7 15:25:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 19:25:37 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631042737.52.0.646534325927.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not sure if unittest.mock code to import the module is reliable: see bpo-39551. It imports "multiprocessing", use getattr() to get multiprocessing.shared_memory. If getattr() fails with AttributeError, it tries to import "mulitprocessing.shared_memory", and then tries again the same getattr() on the previously imported "multiprocessing" module. I'm curious if this change works around the issue: diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index c6067151de..1e3a8277ca 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1238,7 +1238,7 @@ def _dot_lookup(thing, comp, import_path): try: return getattr(thing, comp) except AttributeError: - __import__(import_path) + thing = __import__(import_path) return getattr(thing, comp) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Tue Sep 7 15:26:31 2021 From: report at bugs.python.org (David Mertz) Date: Tue, 07 Sep 2021 19:26:31 +0000 Subject: [issue45133] Open functions in dbm submodule should support path-like objects Message-ID: <1631042791.04.0.276454650964.issue45133@roundup.psfhosted.org> New submission from David Mertz <david.mertz at gmail.com>: Evan Greenup via Python-ideas Currently, in Python 3.9, `dbm.open()`, `dbm.gnu.open()` and `dbm.ndbm.open()` doesn't support path-like object, class defined in `pathlib`. It would be nice to add support with it. ---------- components: Library (Lib), Tests messages: 401334 nosy: DavidMertz priority: normal severity: normal status: open title: Open functions in dbm submodule should support path-like objects type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45133> _______________________________________ From report at bugs.python.org Tue Sep 7 15:27:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:27:25 +0000 Subject: [issue38936] fatal error during installation 0x80070643 during python installation In-Reply-To: <1574961093.76.0.301097731298.issue38936@roundup.psfhosted.org> Message-ID: <1631042845.31.0.836218502679.issue38936@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there isn't enough information to do anything about this and there was not response from the OP to followup questions. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38936> _______________________________________ From report at bugs.python.org Tue Sep 7 15:30:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:30:04 +0000 Subject: [issue41501] 0x80070643, can't install any version In-Reply-To: <1596804877.84.0.108317920754.issue41501@roundup.psfhosted.org> Message-ID: <1631043004.35.0.295618036949.issue41501@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there isn't enough information to do anything about this and there was not response from the OP to followup questions. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41501> _______________________________________ From report at bugs.python.org Tue Sep 7 15:30:58 2021 From: report at bugs.python.org (David Mertz) Date: Tue, 07 Sep 2021 19:30:58 +0000 Subject: [issue45133] Open functions in dbm submodule should support path-like objects In-Reply-To: <1631042791.04.0.276454650964.issue45133@roundup.psfhosted.org> Message-ID: <1631043058.47.0.66738468493.issue45133@roundup.psfhosted.org> David Mertz <david.mertz at gmail.com> added the comment: Oops... I missed prior closely related or identical issue at: https://bugs.python.org/issue40563 ---------- resolution: -> duplicate _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45133> _______________________________________ From report at bugs.python.org Tue Sep 7 15:35:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:35:35 +0000 Subject: [issue44259] lib2to3 does not accept "exec" as name In-Reply-To: <1622197167.25.0.926188011866.issue44259@roundup.psfhosted.org> Message-ID: <1631043335.14.0.441427894069.issue44259@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type as crash typically refers to segfault and not an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44259> _______________________________________ From report at bugs.python.org Tue Sep 7 15:38:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:38:22 +0000 Subject: [issue39751] multiprocessing breaks when payload fails to unpickle In-Reply-To: <1582648620.1.0.266788942102.issue39751@roundup.psfhosted.org> Message-ID: <1631043502.55.0.739168618911.issue39751@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since crash typically means segfault and not an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39751> _______________________________________ From report at bugs.python.org Tue Sep 7 15:41:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 07 Sep 2021 19:41:21 +0000 Subject: [issue42547] argparse: add_argument(... nargs='+', metavar=<tuple>) does not work with positional arguments In-Reply-To: <1606943750.61.0.237402460323.issue42547@roundup.psfhosted.org> Message-ID: <1631043681.76.0.79670920864.issue42547@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since crash typically means segfault and not an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42547> _______________________________________ From report at bugs.python.org Tue Sep 7 15:52:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 19:52:26 +0000 Subject: [issue43075] CVE-2021-3733: ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1631044346.87.0.0866694604353.issue43075@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: ReDoS in urllib.request -> CVE-2021-3733: ReDoS in urllib.request _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43075> _______________________________________ From report at bugs.python.org Tue Sep 7 16:12:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 20:12:23 +0000 Subject: [issue43075] CVE-2021-3733: ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1631045543.27.0.81274081604.issue43075@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created https://python-security.readthedocs.io/vuln/urllib-basic-auth-regex2.html to track this vulnerability. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43075> _______________________________________ From report at bugs.python.org Tue Sep 7 16:13:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 20:13:31 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631045611.92.0.183105026449.issue44987@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Well, someone should write a PR for it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Tue Sep 7 16:14:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Sep 2021 20:14:54 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1631045694.08.0.619420332621.issue39562@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39562> _______________________________________ From report at bugs.python.org Tue Sep 7 16:44:24 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 20:44:24 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects In-Reply-To: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> Message-ID: <1631047464.43.0.368490499855.issue45130@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: My point is that shlex.join() shouldn?t convert any arguments to strings, no matter their type. Just like str.join() doesn?t, and for the same reason. Within the last few years there was a discussion on making str.join() auto-convert it?s arguments to str, and we decided not to, because it would mask too many bugs. I believe the same argument applies to shlex.join(). Path objects aren?t special enough to make an exception. There?s a proposal somewhere to also call str() on Path arguments to subprocess.run(). I?m opposed to that for the same reasons. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 16:47:37 2021 From: report at bugs.python.org (Richard) Date: Tue, 07 Sep 2021 20:47:37 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects In-Reply-To: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> Message-ID: <1631047657.56.0.372761320828.issue45130@roundup.psfhosted.org> Richard <nyuszika7h at gmail.com> added the comment: IMO comparing shlex.join() to str.join() is a mistake. Comparing it to subprocess.run() is more appropriate. What do you mean by "proposal"? subprocess.run() already converts Path arguments to str since Python 3.6 (though IIRC this was broken on Windows until 3.7 or so). It indeed does not convert int arguments, but like I said that's irrelevant here, you're the one who brought it up. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 17:04:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 07 Sep 2021 21:04:04 +0000 Subject: [issue45130] shlex.join() does not accept pathlib.Path objects In-Reply-To: <1631032053.23.0.444664437221.issue45130@roundup.psfhosted.org> Message-ID: <1631048644.89.0.843170300346.issue45130@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I was using str.join() as an analogy. I apologize if that was confusing. I'll state this as clearly as I can: I don't think shlex.join() should automatically convert any arguments to str, not even those that are Path's. Nothing is going to be solved by having a discussion on the bug tracker. A discussion on python-ideas would be the appropriate place to take this. If a consensus is reached there to add this feature, then this feature request can be used for its implementation. It's entirely possible people there might agree with the feature request, but I'd argue against it. One thing going for your proposal is subprocess.run(). I was thinking issue 38670 applied there, but I guess not. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45130> _______________________________________ From report at bugs.python.org Tue Sep 7 17:21:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 07 Sep 2021 21:21:45 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631049705.95.0.929016881911.issue45126@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- keywords: +patch pull_requests: +26648 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28227 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Tue Sep 7 17:57:07 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 07 Sep 2021 21:57:07 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631051827.01.0.327723924982.issue45116@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > I'm not sure if PGO builds are reproducible, since there is a training step which requires to run a non-deterministic workload (the Python test suite which is somehow randomized by I/O timings and other stuffs). I'm 99% sure it's a tracing PGO rather than sampling, so provided everything runs in the same order and follows the same codepaths, wall-clock timings shouldn't have a significant effect. Without looking at the generated code, it may be more effective to try and force the functions called from the macro to never be inlined. The optimiser may be missing that the calls are uncommon, and trying to inline them first, then deciding that the whole merged function is too big to inline in places where it would be useful. There's also no particular reason we need to use these tests as the profile, it's just that nobody has taken the time to come up with anything better. I'd rather see us invest time in generating a good profile rather than trying to hand-optimise inlining. (Though the test suite is good in many ways, because it makes sure all the extension modules are covered. We definitely want as close to full code coverage as we can get, at least for happy paths, but may need more eval loop in the profile if that's what needs help.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 7 18:10:30 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 07 Sep 2021 22:10:30 +0000 Subject: [issue39570] Python 3.7.3 Crash on msilib actions In-Reply-To: <1581006397.33.0.114674633699.issue39570@roundup.psfhosted.org> Message-ID: <1631052630.61.0.204813484392.issue39570@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Yep, this is malware. Don't download the file. If this is a CPython issue that you want fixed, please provide a script to generate the MSI. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39570> _______________________________________ From report at bugs.python.org Tue Sep 7 18:46:53 2021 From: report at bugs.python.org (Gene Wood) Date: Tue, 07 Sep 2021 22:46:53 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631054813.21.0.564617980278.issue40563@roundup.psfhosted.org> Gene Wood <bugs.python.org at ewood.users.cementhorizon.com> added the comment: @DahlitzFlorian it looks like a PR was submitted August of last year : https://github.com/python/cpython/pull/21849 ---------- nosy: +gene_wood _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Tue Sep 7 19:52:45 2021 From: report at bugs.python.org (Mark) Date: Tue, 07 Sep 2021 23:52:45 +0000 Subject: [issue45134] Protocol dealloc not called if Server is closed Message-ID: <1631058765.71.0.794565950389.issue45134@roundup.psfhosted.org> New submission from Mark <markreed99 at gmail.com>: If I create_server server_coro = loop.create_server( lambda: self._protocol_factory(self), sock=sock, ssl=ssl) server = loop.run_until_complete(server_coro) Then connect and disconnect a client the protocol connection lost and dealloc are called. If however I close the server with existing connections then protocol dealloc is never called and I leak memory due to a malloc in my protocol.c init. server.close() loop.run_until_complete(server.wait_closed()) ---------- components: asyncio messages: 401349 nosy: MarkReedZ, asvetlov, yselivanov priority: normal severity: normal status: open title: Protocol dealloc not called if Server is closed type: resource usage versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45134> _______________________________________ From report at bugs.python.org Tue Sep 7 20:49:22 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 08 Sep 2021 00:49:22 +0000 Subject: [issue40506] add support for os.Pathlike filenames in zipfile.ZipFile.writestr In-Reply-To: <1588644723.41.0.516863649113.issue40506@roundup.psfhosted.org> Message-ID: <1631062162.39.0.418346147516.issue40506@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40506> _______________________________________ From report at bugs.python.org Tue Sep 7 20:49:54 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 08 Sep 2021 00:49:54 +0000 Subject: [issue32562] Support fspath protocol in AF_UNIX sockaddr resolution In-Reply-To: <1516069397.77.0.467229070634.issue32562@psf.upfronthosting.co.za> Message-ID: <1631062194.76.0.879567470183.issue32562@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32562> _______________________________________ From report at bugs.python.org Tue Sep 7 20:54:18 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 08 Sep 2021 00:54:18 +0000 Subject: [issue41026] mailbox does not support new Path object In-Reply-To: <1592498748.35.0.391421735484.issue41026@roundup.psfhosted.org> Message-ID: <1631062458.24.0.0663328876959.issue41026@roundup.psfhosted.org> Ethan Furman <ethan at stoneleaf.us> added the comment: The problem with using `str()` on a path argument is that the argument may not be a str, nor a pathlib object, but `str()` will still create a string out of it, leading to difficult bugs. The documentation for pathlib also predates the addition of `os.fspath()`. ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41026> _______________________________________ From report at bugs.python.org Tue Sep 7 20:54:47 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 08 Sep 2021 00:54:47 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631062487.11.0.460796425541.issue40563@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Tue Sep 7 20:55:10 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 08 Sep 2021 00:55:10 +0000 Subject: [issue45133] Open functions in dbm submodule should support path-like objects In-Reply-To: <1631042791.04.0.276454650964.issue45133@roundup.psfhosted.org> Message-ID: <1631062510.08.0.0484420700147.issue45133@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45133> _______________________________________ From report at bugs.python.org Wed Sep 8 01:14:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 08 Sep 2021 05:14:08 +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: <1631078048.93.0.903041248927.issue44340@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- pull_requests: +26649 pull_request: https://github.com/python/cpython/pull/28229 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44340> _______________________________________ From report at bugs.python.org Wed Sep 8 02:29:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 08 Sep 2021 06:29:14 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631082554.67.0.862082221464.issue20499@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- nosy: +rhettinger nosy_count: 4.0 -> 5.0 pull_requests: +26650 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28230 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Wed Sep 8 03:41:18 2021 From: report at bugs.python.org (uosiu) Date: Wed, 08 Sep 2021 07:41:18 +0000 Subject: [issue45012] DirEntry.stat method should release GIL In-Reply-To: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> Message-ID: <1631086878.7.0.0340702515281.issue45012@roundup.psfhosted.org> uosiu <stanislaw.skonieczny at gmail.com> added the comment: Bardzo prosz? :) This fix is quite important for us. We would like to start using this fix in our product. Is there something I could do to backport it to 3.9? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45012> _______________________________________ From report at bugs.python.org Wed Sep 8 03:45:28 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Sep 2021 07:45:28 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631087128.44.0.496513503658.issue45126@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: This is a minefield. If anyone has a use case for it, I'd *love* to hear it, but to me it seems that proper reinit support will be a lot of work (now and in future maintenance) for no gain. You can always create a new connection object. Consider instead deprecating reinitialization, documenting it as unpredictable & removing it in Python 3.13. Here's another thing to test: ```python import sqlite3 conn = sqlite3.connect(':memory:') cursor = conn.execute('CREATE TABLE foo (bar)') try: conn.__init__('/bad-file/') except sqlite3.OperationalError: pass cursor.execute('INSERT INTO foo (bar) VALUES (1), (2), (3), (4)') ``` And here's the kind of behavior that should be specified (and tested), and might even change to make more sense: ```python import sqlite3 conn = sqlite3.connect(':memory:') conn.text_factory=bytes conn.row_factory = sqlite3.Row cursor = conn.execute('CREATE TABLE foo (bar)') cursor.execute('INSERT INTO foo (bar) VALUES ("1"), ("2"), ("3"), ("4")') cursor.execute('SELECT bar FROM foo') for row in cursor: print(row, list(row)) break conn.__init__(':memory:') conn.execute('CREATE TABLE foo (bar)') conn.execute('INSERT INTO foo (bar) VALUES ("a"), ("b"), ("c"), ("d")') # Currently this uses the old database, old row_factory, but new text_factory" for row in cursor: print(row, list(row)) ``` We should also do a review of all places `connection` is used from Cursor, Statement, etc. to ensure everything continue to work with a different `db`. This can be done (and maybe you already did), but I'm also worried how well future maintainers can keep reinitialization in mind. And all this will also need to be done for Cursor. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 03:56:00 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Sep 2021 07:56:00 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631087760.33.0.612494666933.issue45089@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: It *would* be possible to improve the documentation, though. Say that it is only meant for debugging, document that exceptions are not propagated, and mention enable_callback_tracebacks. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, petr.viktorin status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 8 04:16:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 08:16:50 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631089010.59.0.412224823015.issue45089@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > It *would* be possible to improve the documentation, though. +1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 8 04:26:14 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 08 Sep 2021 08:26:14 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631089574.02.0.982377869396.issue38820@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 2fe15dbaad651707fb198c3477b7db77ab89ade0 by Miss Islington (bot) in branch '3.10': bpo-38820: Test with OpenSSL 3.0.0 final (GH-28205) https://github.com/python/cpython/commit/2fe15dbaad651707fb198c3477b7db77ab89ade0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Wed Sep 8 04:29:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 08:29:45 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631089785.77.0.463794086086.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: I modified your second example slightly: ``` import sqlite3 conn = sqlite3.connect(":memory:") conn.text_factory=bytes conn.row_factory = sqlite3.Row cursor = conn.execute("CREATE TABLE foo (bar)") numbers = range(4) cursor.executemany("INSERT INTO foo (bar) VALUES (?)", ((str(v),) for v in numbers)) cursor.execute("SELECT bar FROM foo") print("first fetch") for row in cursor.fetchmany(2): print(type(row[0])) conn.__init__(":memory:") conn.execute("CREATE TABLE foo (bar)") letters = "a", "b", "c", "d" conn.executemany("INSERT INTO foo (bar) VALUES (?)", ((v,) for v in letters)) # Currently this uses the old database, old row_factory, but new text_factory" print("second fetch") for row in cursor.fetchall(): print(type(row[0])) ``` Here's the output: first fetch <class 'bytes'> <class 'bytes'> second fetch <class 'str'> <class 'str'> ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 04:33:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 08:33:48 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631090028.01.0.639048997876.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Note: I ran that with PR 28227. OTOH: I do agree that there's a lot of pitfalls here, especially in the future. In the long run, it is probably best to deprecate reinit, and disable it in Python 3.13. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 04:36:07 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 08:36:07 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631090167.12.0.640952049988.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Modifying the loops to also print the values: first fetch b'0' <class 'bytes'> b'1' <class 'bytes'> second fetch 2 <class 'str'> 3 <class 'str'> ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 05:06:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 09:06:15 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631091975.99.0.224773104995.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: FYI, I've expanded the reinit tests and added a deprecation warning to the PR. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 05:18:41 2021 From: report at bugs.python.org (Thomas Fischbacher) Date: Wed, 08 Sep 2021 09:18:41 +0000 Subject: [issue45135] dataclasses.asdict() incorrectly calls __deepcopy__() on values. Message-ID: <1631092721.82.0.0802849147398.issue45135@roundup.psfhosted.org> New submission from Thomas Fischbacher <tfish at google.com>: This problem may also be the issue underlying some other dataclasses.asdict() bugs: https://bugs.python.org/issue?%40columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus%2Ctype&%40sort=-activity&%40filter=status&%40action=searchid&ignore=file%3Acontent&%40search_text=dataclasses.asdict&submit=search&status=-1%2C1%2C2%2C3 The documentation of dataclasses.asdict() states: https://docs.python.org/3/library/dataclasses.html#dataclasses.asdict === Converts the dataclass instance to a dict (by using the factory function dict_factory). Each dataclass is converted to a dict of its fields, as name: value pairs. dataclasses, dicts, lists, and tuples are recursed into. For example: (...) === Given this documentation, the expectation about behavior is roughly: def _dataclasses_asdict_equivalent_helper(obj, dict_factory=dict): rec = lambda x: ( _dataclasses_asdict_equivalent_helper(x, dict_factory=dict_factory)) if isinstance(obj, (list, tuple)): return type(obj)(rec(x) for x in obj) elif isinstance(obj, dict): return type(obj)((k, rec(v) for k, v in obj.items()) # Otherwise, we are looking at a dataclass-instance. for field in type(obj).__dataclass_fields__: val = obj.__getattribute__[field] if (hasattr(type(obj), '__dataclass_fields__')): # ^ approx check for "is this a dataclass instance"? # Not 100% correct. For illustration only. ret[field] = rec(val) ret[field] = val return ret def dataclasses_asdict_equivalent(x, dict_factory=dict): if not hasattr(type(x), '__dataclass_fields__'): raise ValueError(f'Not a dataclass: {x!r}') return _dataclasses_asdict_equivalent(x, dict_factory=dict_factory) In particular, field-values that are neither dict, list, tuple, or dataclass-instances are expected to be used identically. What actually happens however is that .asdict() DOES call __deepcopy__ on field values it has no business inspecting: === import dataclasses @dataclasses.dataclass class Demo: field_a: object class Obj: def __init__(self, x): self._x = x def __deepcopy__(self, *args): raise ValueError('BOOM!') ### d1 = Demo(field_a=Obj([1,2,3])) dd = dataclasses.asdict(d1) # ...Execution does run into a "BOOM!" ValueError. === Apart from this: It would be very useful if dataclasses.asdict() came with a recurse={boolish} parameter with which one can turn off recursive translation of value-objects. ---------- components: Library (Lib) messages: 401360 nosy: tfish2 priority: normal severity: normal status: open title: dataclasses.asdict() incorrectly calls __deepcopy__() on values. type: behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45135> _______________________________________ From report at bugs.python.org Wed Sep 8 05:24:50 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 08 Sep 2021 09:24:50 +0000 Subject: [issue45135] dataclasses.asdict() incorrectly calls __deepcopy__() on values. In-Reply-To: <1631092721.82.0.0802849147398.issue45135@roundup.psfhosted.org> Message-ID: <1631093090.33.0.985699041612.issue45135@roundup.psfhosted.org> Change by Karthikeyan Singaravelan <tir.karthi at gmail.com>: ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45135> _______________________________________ From report at bugs.python.org Wed Sep 8 05:26:17 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Sep 2021 09:26:17 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631093177.53.0.308908084331.issue45126@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: I think a deprecation should be discussed a bit more widely than on bpo, so I opened a thread here: https://discuss.python.org/t/deprecating-sqlite-object-reinitialization/10503 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 05:26:52 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 09:26:52 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631093212.24.0.531923373555.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Great, thanks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 05:31:56 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Sep 2021 09:31:56 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631093516.11.0.760625445939.issue45126@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: As for the effort to fix this: If we deprecate this, there should be no new users of it in 3.11+. If we deprecate and also fix this, and we happen to introduce bugs or behavior changes, then people that use it now will need to: 1) adapt to the new behavior 2) find a different way to do things (before 3.13) If we deprecate but keep the buggy behavior it as it is, (1) is not needed. Less work for both us and the users. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 05:48:24 2021 From: report at bugs.python.org (Ma Lin) Date: Wed, 08 Sep 2021 09:48:24 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631094504.96.0.36359356118.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: This article briefly introduces the inlining decisions in MSVC. https://devblogs.microsoft.com/cppblog/inlining-decisions-in-visual-studio/ ---------- nosy: +malin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 8 05:59:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 09:59:21 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631095161.09.0.582722148152.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset cb15afcccffc6c42cbfb7456ce8db89cd2f77512 by Victor Stinner in branch 'main': bpo-39573: Py_TYPE becomes a static inline function (GH-28128) https://github.com/python/cpython/commit/cb15afcccffc6c42cbfb7456ce8db89cd2f77512 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 06:00:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 10:00:53 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631095253.17.0.726435692023.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > If we deprecate but keep the buggy behavior it as it is, (1) is not needed. Less work for both us and the users. Indeed. There's still a ref leak I'd like to take care of, though: if the first audit fails, database_obj leaks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 06:07:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Sep 2021 10:07:47 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods In-Reply-To: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> Message-ID: <1631095667.55.0.632104530891.issue45132@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset d003a5bd2505a7fa04f50504b68ba8fca67349cd by Hugo van Kemenade in branch 'main': bpo-45132 Remove deprecated __getitem__ methods (GH-28225) https://github.com/python/cpython/commit/d003a5bd2505a7fa04f50504b68ba8fca67349cd ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Wed Sep 8 06:12:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Sep 2021 10:12:32 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods In-Reply-To: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> Message-ID: <1631095952.16.0.689477338719.issue45132@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you for your contribution Hugo. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Wed Sep 8 06:20:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 10:20:06 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631096406.62.0.747894904333.issue45126@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26651 pull_request: https://github.com/python/cpython/pull/28231 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 06:25:28 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 08 Sep 2021 10:25:28 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631096728.12.0.472598993509.issue45121@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: New changeset c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f by Yurii Karabas in branch 'main': bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) https://github.com/python/cpython/commit/c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 06:25:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 08 Sep 2021 10:25:32 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631096732.49.0.997105510651.issue45121@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26652 pull_request: https://github.com/python/cpython/pull/28232 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 06:33:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 10:33:11 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631097191.33.0.0980498036944.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > boost https://bugzilla.redhat.com/show_bug.cgi?id=1896382 Fixed by: https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 06:35:56 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 08 Sep 2021 10:35:56 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631097356.79.0.0905381239108.issue45121@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- pull_requests: +26653 pull_request: https://github.com/python/cpython/pull/28233 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 06:38:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 10:38:46 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631097526.18.0.389870715165.issue45126@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26654 pull_request: https://github.com/python/cpython/pull/28234 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 06:42:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 10:42:49 +0000 Subject: [issue45126] [sqlite3] cleanup and harden connection init In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631097769.2.0.277769161925.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: I'll save the cleanup till Python 3.13 dev is started. I've opened a PR for fixing the ref leak (should be backported), and a draft PR for deprecating Connection and Cursor reinitialisation. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Wed Sep 8 06:46:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 10:46:29 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' Message-ID: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: When Python is configured to use 'lib64' for sys.platlibdir, test_sysconfig fails: $ ./configure --with-platlibdir=lib64 $ make $ ./python -m test -v test_sysconfig ====================================================================== FAIL: test_user_similar (test.test_sysconfig.TestSysConfig) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_sysconfig.py", line 299, in test_user_similar self.assertEqual(user_path, global_path.replace(base, user, 1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/home/vstinner/.local/lib/python3.11/site-packages' != '/home/vstinner/.local/lib64/python3.11/site-packages' - /home/vstinner/.local/lib/python3.11/site-packages + /home/vstinner/.local/lib64/python3.11/site-packages ? ++ ---------- components: Tests messages: 401372 nosy: vstinner priority: normal severity: normal status: open title: test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Wed Sep 8 06:48:10 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 08 Sep 2021 10:48:10 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631098090.34.0.845750143946.issue45136@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: This was introduced in issue44860. ---------- nosy: +dstufft, eric.araujo, frenzy, hroncok, lukasz.langa, miss-islington, pablogsal, petr.viktorin, uranusjr _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Wed Sep 8 06:47:32 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 08 Sep 2021 10:47:32 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631098052.32.0.397398694258.issue44860@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: There seem to be a regression in test_user_similar: https://bugs.python.org/issue45136 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Wed Sep 8 06:54:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 10:54:39 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631098479.76.0.739159067395.issue45136@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > This was introduced in issue44860. Right. Reverting the commit 608a6292366ebba20f33d93d8b52cbb928429e47 (bpo-44860) fix the test. The test should be updated. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Wed Sep 8 06:57:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 10:57:00 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631098620.34.0.314825183364.issue45136@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I mark this issue as a release blocker: it would be *nice* to fix it before Python 3.10.0 final ;-) ---------- priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Wed Sep 8 07:02:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 11:02:22 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631098942.33.0.289968956613.issue44860@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26655 pull_request: https://github.com/python/cpython/pull/28235 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Wed Sep 8 07:22:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 11:22:01 +0000 Subject: [issue34557] When sending binary file to a Microsoft FTP server over FTP TLS, the SSL unwind method hangs In-Reply-To: <1535738453.08.0.56676864532.issue34557@psf.upfronthosting.co.za> Message-ID: <1631100121.93.0.150219237067.issue34557@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- nosy: +christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34557> _______________________________________ From report at bugs.python.org Wed Sep 8 07:22:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Sep 2021 11:22:11 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1631100131.21.0.372764738321.issue45097@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26656 pull_request: https://github.com/python/cpython/pull/28236 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Wed Sep 8 07:27:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 11:27:21 +0000 Subject: [issue38371] Tkinter: deprecate the split() method In-Reply-To: <1570203221.73.0.664458057352.issue38371@roundup.psfhosted.org> Message-ID: <1631100441.43.0.864764920961.issue38371@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- nosy: +erlendaasland nosy_count: 1.0 -> 2.0 pull_requests: +26657 pull_request: https://github.com/python/cpython/pull/28237 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38371> _______________________________________ From report at bugs.python.org Wed Sep 8 07:44:26 2021 From: report at bugs.python.org (Victor Vorobev) Date: Wed, 08 Sep 2021 11:44:26 +0000 Subject: [issue45137] Fix for bpo-37788 was not backported to Python3.8 Message-ID: <1631101466.05.0.472114996344.issue45137@roundup.psfhosted.org> New submission from Victor Vorobev <vikeyer at gmail.com>: There is a [fix](https://github.com/python/cpython/pull/26103) for [bpo-37788](https://bugs.python.org/issue37788), but automatic backport to 3.8 branch [have failed](https://github.com/python/cpython/pull/26103#issuecomment-841460885), and it looks like no one have backported it manually. ---------- components: Library (Lib) messages: 401377 nosy: victorvorobev priority: normal severity: normal status: open title: Fix for bpo-37788 was not backported to Python3.8 type: resource usage versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45137> _______________________________________ From report at bugs.python.org Wed Sep 8 07:48:52 2021 From: report at bugs.python.org (Victor Vorobev) Date: Wed, 08 Sep 2021 11:48:52 +0000 Subject: [issue45137] Fix for bpo-37788 was not backported to Python3.8 In-Reply-To: <1631101466.05.0.472114996344.issue45137@roundup.psfhosted.org> Message-ID: <1631101732.81.0.628871624389.issue45137@roundup.psfhosted.org> Change by Victor Vorobev <vikeyer at gmail.com>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45137> _______________________________________ From report at bugs.python.org Wed Sep 8 08:01:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 12:01:09 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631102469.65.0.0737868672558.issue45089@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26658 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/28238 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 8 08:12:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 12:12:35 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631103155.42.0.107267532442.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I checked again the list of broken projects listed previously. Fixed: * Cython: https://github.com/cython/cython/commit/d8e93b332fe7d15459433ea74cd29178c03186bd * immutables: https://github.com/MagicStack/immutables/pull/52 * numpy: * https://github.com/numpy/numpy/commit/a96b18e3d4d11be31a321999cda4b795ea9eccaa * https://github.com/numpy/numpy/commit/f1671076c80bd972421751f2d48186ee9ac808aa * pycurl: https://github.com/pycurl/pycurl/commit/e633f9a1ac4df5e249e78c218d5fbbd848219042 * bitarray: https://github.com/ilanschnell/bitarray/pull/109 * mercurial: https://bz.mercurial-scm.org/show_bug.cgi?id=6451 * boost: https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484 * pyside2: https://bugreports.qt.io/browse/PYSIDE-1436 * breezy: https://bugs.launchpad.net/brz/+bug/1904868 * duplicity: https://git.launchpad.net/duplicity/commit/duplicity/_librsyncmodule.c?id=bbaae91b5ac6ef7e295968e508522884609fbf84 * gobject-introspection: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/243 Fix proposed: * pybluez: https://github.com/pybluez/pybluez/pull/410 Broken: * PyPAM * pygobject3 * pylibacl * rdiff-backup ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 08:30:51 2021 From: report at bugs.python.org (Victor Vorobev) Date: Wed, 08 Sep 2021 12:30:51 +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: <1631104251.05.0.356474858841.issue37788@roundup.psfhosted.org> Change by Victor Vorobev <vikeyer at gmail.com>: ---------- nosy: +victorvorobev nosy_count: 15.0 -> 16.0 pull_requests: +26659 pull_request: https://github.com/python/cpython/pull/28239 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37788> _______________________________________ From report at bugs.python.org Wed Sep 8 08:43:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 12:43:07 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1631104987.89.0.271221504479.issue44959@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 2396fa6537d79554ac694dbd2b0b30eeb3476c80 by Florin Sp?tar in branch 'main': bpo-44959: Add fallback to extension modules with '.sl' suffix on HP-UX (GH-27857) https://github.com/python/cpython/commit/2396fa6537d79554ac694dbd2b0b30eeb3476c80 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44959> _______________________________________ From report at bugs.python.org Wed Sep 8 08:43:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 12:43:39 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1631105019.13.0.433725258005.issue44959@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44959> _______________________________________ From report at bugs.python.org Wed Sep 8 08:47:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 12:47:26 +0000 Subject: [issue30849] test_stress_delivery_dependent() of test_signal randomly fails on AMD64 Debian root 3.6/3.x In-Reply-To: <1499181411.1.0.541300647507.issue30849@psf.upfronthosting.co.za> Message-ID: <1631105246.39.0.813034743118.issue30849@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: We also got this error randomly on an internal s390x Red Hat build server: ====================================================================== FAIL: test_stress_delivery_simultaneous (test.test_signal.StressTest) This test uses simultaneous signal handlers. ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib64/python3.9/test/test_signal.py", line 1245, in test_stress_delivery_simultaneous self.assertEqual(len(sigs), N, "Some signals were lost") AssertionError: 5936 != 10000 : Some signals were lost ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30849> _______________________________________ From report at bugs.python.org Wed Sep 8 09:21:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 13:21:00 +0000 Subject: [issue30570] issubclass segfaults on objects with weird __getattr__ In-Reply-To: <1496622334.44.0.71686890535.issue30570@psf.upfronthosting.co.za> Message-ID: <1631107260.13.0.536257465889.issue30570@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30570> _______________________________________ From report at bugs.python.org Wed Sep 8 09:31:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 13:31:22 +0000 Subject: [issue12872] --with-tsc crashes on ppc64 In-Reply-To: <1314827484.72.0.601008700485.issue12872@psf.upfronthosting.co.za> Message-ID: <1631107882.07.0.129359656677.issue12872@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I don't see anything like the code of the patch in ceval.c now. I will close this soon unless given a reason not to. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue12872> _______________________________________ From report at bugs.python.org Wed Sep 8 10:05:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 14:05:15 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements if possible Message-ID: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> New submission from Erlend E. Aasland <erlend.aasland at innova.no>: For SQLite 3.14.0 and newer, we're using the v2 trace API. This means that the trace callback receives a pointer to the sqlite3_stmt object. We can use the sqlite3_stmt pointer to retrieve expanded SQL string. The following statement...: cur.executemany("insert into t values(?)", ((v,) for v in range(3))) ...will produce the following traces: insert into t values(0) insert into t values(1) insert into t values(2) ...instead of: insert into t values(?) insert into t values(?) insert into t values(?) ---------- assignee: erlendaasland components: Extension Modules messages: 401383 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] expand bound values in traced statements if possible type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45138> _______________________________________ From report at bugs.python.org Wed Sep 8 10:19:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 14:19:47 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements if possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1631110787.55.0.482593653235.issue45138@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- keywords: +patch pull_requests: +26660 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28240 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45138> _______________________________________ From report at bugs.python.org Wed Sep 8 11:02:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:02:00 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631113320.54.0.659540993015.issue45121@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 99506dcbbe9fb56ceabe55f0a4333e5981b72095 by Ken Jin in branch '3.9': [3.9] bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) (GH-28233) https://github.com/python/cpython/commit/99506dcbbe9fb56ceabe55f0a4333e5981b72095 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 11:05:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:05:31 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631113531.34.0.125623314704.issue45121@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset c081649e6df55203178a44d16bc4c96f9fa2c6a4 by Miss Islington (bot) in branch '3.10': bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) (GH-28232) https://github.com/python/cpython/commit/c081649e6df55203178a44d16bc4c96f9fa2c6a4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 11:06:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:06:58 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1631113618.07.0.0521483480858.issue45121@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Pablo, marking as release blocker. PR GH-28232 is merged to 3.10. It should be cherry-picked for 3.10.0 inclusion. ---------- nosy: +pablogsal priority: critical -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Wed Sep 8 11:09:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:09:06 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1631113746.84.0.12349858253.issue25130@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 462c1f0403324efc27c11435da12b8d16f5387de by Serhiy Storchaka in branch '3.10': [3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) (GH-28027) https://github.com/python/cpython/commit/462c1f0403324efc27c11435da12b8d16f5387de ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25130> _______________________________________ From report at bugs.python.org Wed Sep 8 11:10:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:10:23 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631113823.8.0.878578166219.issue45118@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Victor! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Wed Sep 8 11:09:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:09:59 +0000 Subject: [issue45118] regrtest no longer lists "re-run tests" in the second summary In-Reply-To: <1630945732.21.0.656532683711.issue45118@roundup.psfhosted.org> Message-ID: <1631113799.1.0.948490350065.issue45118@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 7538fe34d730fe08cbbecc17606bc0f5f69ff416 by Miss Islington (bot) in branch '3.10': bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28214) https://github.com/python/cpython/commit/7538fe34d730fe08cbbecc17606bc0f5f69ff416 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45118> _______________________________________ From report at bugs.python.org Wed Sep 8 11:11:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 15:11:03 +0000 Subject: [issue41031] Inconsistency in C and python traceback printers In-Reply-To: <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org> Message-ID: <1631113863.97.0.0764797531293.issue41031@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41031> _______________________________________ From report at bugs.python.org Wed Sep 8 11:13:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:13:01 +0000 Subject: [issue45012] DirEntry.stat method should release GIL In-Reply-To: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> Message-ID: <1631113981.72.0.42440594376.issue45012@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Sadly, we can't backport this to 3.9 as it's only accepting bugfixes and this is a performance improvement. 3.10 is out of scope for this too as 3.10.0rc2 shipped last night. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45012> _______________________________________ From report at bugs.python.org Wed Sep 8 11:28:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:28:41 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1631114921.62.0.13338440091.issue19113@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a5610057615779ca6fc75d9e006d2fae644a94d3 by andrei kulakov in branch 'main': bpo-19113: Remove unused test_errors from ctypes tests (GH-28008) https://github.com/python/cpython/commit/a5610057615779ca6fc75d9e006d2fae644a94d3 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue19113> _______________________________________ From report at bugs.python.org Wed Sep 8 11:32:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:32:29 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1631115149.75.0.487736546777.issue19113@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Change made in Python 3.11: duplicate test removed. Closing. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue19113> _______________________________________ From report at bugs.python.org Wed Sep 8 11:47:13 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 08 Sep 2021 15:47:13 +0000 Subject: [issue45135] dataclasses.asdict() incorrectly calls __deepcopy__() on values. In-Reply-To: <1631092721.82.0.0802849147398.issue45135@roundup.psfhosted.org> Message-ID: <1631116033.24.0.043810857359.issue45135@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: The intent was that asdict() returns something that, if mutated, doesn't affect the original object tree. I'd sort of like to just deprecate it, it's got a lot of corner cases that are poorly handled. It probably needs the same kind of controls that attrs.asdict() does. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45135> _______________________________________ From report at bugs.python.org Wed Sep 8 11:59:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 15:59:50 +0000 Subject: [issue45097] "The loop argument is deprecated" reported when user code does not use it In-Reply-To: <1630723286.0.0.706652277145.issue45097@roundup.psfhosted.org> Message-ID: <1631116790.83.0.719753568122.issue45097@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a328a13b70ea0b0bec8b9d1b0067628369cabea9 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45097: Fix deprecation warnings in test_asyncio (GH-28236) https://github.com/python/cpython/commit/a328a13b70ea0b0bec8b9d1b0067628369cabea9 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45097> _______________________________________ From report at bugs.python.org Wed Sep 8 12:06:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 16:06:14 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631117174.7.0.849754008645.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: At commit cb15afcccffc6c42cbfb7456ce8db89cd2f77512, I am able to rename PyObject members (to make sure that the structure is not accessed directly), I only had to modify header files: * Py_REFCNT(), Py_SET_REFCNT() * Py_INCREF(), Py_DECREF() * Py_TYPE(), Py_SET_TYPE() * Py_IS_TYPE() And just two more C files which corner cases: * 1 line in Python/specialize.c * 1 line in Modules/_testcapimodule.c: check_pyobject_forbidden_bytes_is_freed() -- I did the same with PyVarObject, rename the ob_size member. I had to modify header files: * Py_SIZE(), Py_SET_SIZE() But I had to modify the following function of the array module: static int array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags) { ... if ((flags & PyBUF_ND)==PyBUF_ND) { view->shape = &((PyVarObject*)self)->ob_size; } ... return 0; } I'm not sure how to patch this function. -- This experience doesn't check usage of sizeof(PyObject) and sizeof(PyVarObject) which would break if these structures become opaque. sizeof() issues are listed in previous comments. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 12:14:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 16:14:01 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631117641.32.0.478239809727.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Oh and obviously, it's not possible possible to define structures which *include* PyObject or PyVarObject if PyObject and PyVarObject become opaque. Example: typedef struct { PyObject ob_base; Py_ssize_t ob_size; /* Number of items in variable part */ } PyVarObject; This C code requires the PyObject structure to be fully defined (not being opaque). A new C API and ABI where structures *don't* include PyObject or PyVarObject should be designed to allocate their members "before" the PyObject* pointer value. Something like the current PyGC_Head structure which is excluded from PyObject and stored *before* the "PyObject*" pointer. Simplified code which allocates memory for an object implementin the GC protocol: static PyObject * _PyObject_GC_Malloc(size_t basicsize) { ... size_t size = sizeof(PyGC_Head) + basicsize; ... PyGC_Head *g = (PyGC_Head *)PyObject_Malloc(size); ... PyObject *op = (PyObject *)(g + 1); return op; } ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 12:25:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:25:17 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1631118317.84.0.945592631933.issue45056@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d41abe8970453716dbc6a3a898ac8fb01cbf6c6f by ?ukasz Langa in branch '3.10': [3.10] bpo-45056: Remove trailing unused constants from co_consts (GH-28109) (GH-28125) https://github.com/python/cpython/commit/d41abe8970453716dbc6a3a898ac8fb01cbf6c6f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 8 12:26:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:26:11 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1631118371.93.0.34683698398.issue45056@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: It goes to 3.10.1 then. Fixed! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45056> _______________________________________ From report at bugs.python.org Wed Sep 8 12:32:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:32:26 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631118746.24.0.0780566779656.issue45083@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 6b996d61c96222d959d043b9424e8125c0efbb27 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) (GH-28134) https://github.com/python/cpython/commit/6b996d61c96222d959d043b9424e8125c0efbb27 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 8 12:32:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 16:32:15 +0000 Subject: [issue39573] [C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1631118735.88.0.532274653046.issue39573@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I changed the issue title to restrict its scope: "[C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type". Making PyObject and PyVarObject structures opaque is a broader topic which should be splited into sub-issues. "Py_TYPE(obj)=type;" is now disallowed. I consider that the work of this issue is now completed and I close the issue. Thanks everyone who help to fix these tedious issues! You can continue to use this issue if you need my help to adapt your C extensions to Py_SET_TYPE()/Py_SET_SIZE(). See also the upgrade_pythoncapi.py script of the pythoncapi_compat project which helps to port your C extensions without losing support for old Python versions: https://github.com/pythoncapi/pythoncapi_compat See also the Py_TYPE() change announcement on the capi-sig list: https://mail.python.org/archives/list/capi-sig at python.org/thread/WGRLTHTHC32DQTACPPX36TPR2GLJAFRB/ ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: [C API] Make PyObject an opaque structure in the limited C API -> [C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39573> _______________________________________ From report at bugs.python.org Wed Sep 8 12:33:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:33:01 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631118781.1.0.195164507437.issue45083@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Irit! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 8 12:33:15 2021 From: report at bugs.python.org (Vincent Michel) Date: Wed, 08 Sep 2021 16:33:15 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631118795.42.0.803558620084.issue44219@roundup.psfhosted.org> Vincent Michel <vxgmichel at gmail.com> added the comment: Here's a possible patch that fixes the 3 unprotected calls to `isatty` mentioned above. It successfully passes the test suite. I can submit a PR with this patch if necessary. ---------- keywords: +patch Added file: https://bugs.python.org/file50270/bpo-44219.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Wed Sep 8 12:34:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Sep 2021 16:34:22 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631118862.23.0.88450954822.issue45083@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > New changeset 6b996d61c96222d959d043b9424e8125c0efbb27 by Miss Islington (bot) in branch '3.10': Pablo wrote that new changes in the 3.10 branch will only land in 3.10.1. It means that Python 3.10.0 and 3.10.1 will produce different exception messages. It is going to be an issue, no? You should either ask for an exception to Pablo, or revert the change. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 8 12:58:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:58:14 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1631120294.52.0.816170788039.issue41082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Using `os.path.expanduser` is a functional change so it wasn't backported at the time to 3.9 and sure shouldn't be backported now. Going with a doc update is the right approach. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Wed Sep 8 12:58:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:58:50 +0000 Subject: [issue45129] Remove deprecated reuse_address parameter from create_datagram_endpoint() In-Reply-To: <1631025406.86.0.884993515985.issue45129@roundup.psfhosted.org> Message-ID: <1631120330.79.0.987140603206.issue45129@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 59ea704df7a2fae4559e1e04f7a59d6c40f63657 by Hugo van Kemenade in branch 'main': bpo-45129 Remove deprecated reuse_address (GH-28207) https://github.com/python/cpython/commit/59ea704df7a2fae4559e1e04f7a59d6c40f63657 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45129> _______________________________________ From report at bugs.python.org Wed Sep 8 12:59:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 16:59:44 +0000 Subject: [issue45129] Remove deprecated reuse_address parameter from create_datagram_endpoint() In-Reply-To: <1631025406.86.0.884993515985.issue45129@roundup.psfhosted.org> Message-ID: <1631120384.67.0.690682162111.issue45129@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Hugo! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45129> _______________________________________ From report at bugs.python.org Wed Sep 8 13:01:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:01:38 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631120498.22.0.988667352378.issue38820@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 7a6178a7cd8514911e9480f826838dc789fb8655 by ?ukasz Langa in branch '3.9': [3.9] bpo-38820: Test with OpenSSL 3.0.0 final (GH-28205) (GH-28217) https://github.com/python/cpython/commit/7a6178a7cd8514911e9480f826838dc789fb8655 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Wed Sep 8 13:03:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:03:22 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631120602.22.0.375659251782.issue38820@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Christian, Python is now tested with 3.0.0 final in 3.9, 3.10, and 3.11. Looks like we can close this! Thank you for this big body of work ? ? ? ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Wed Sep 8 13:05:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:05:14 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1631120714.51.0.764335926536.issue38820@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: (I'll let you close this yourself when you determine that the two remaining open dependencies can be closed as well.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38820> _______________________________________ From report at bugs.python.org Wed Sep 8 13:17:47 2021 From: report at bugs.python.org (Jean Abou Samra) Date: Wed, 08 Sep 2021 17:17:47 +0000 Subject: [issue45139] Simplify source links in documentation? Message-ID: <1631121467.16.0.546303933319.issue45139@roundup.psfhosted.org> New submission from Jean Abou Samra <jean at abou-samra.fr>: Currently, links to source code in the documentation look like this: **Source code:** :source:`Lib/abc.py` For documentation translators, this means that every module contains a boilerplate string to translate. A small burden perhaps, but avoidable. I propose to refactor the links in a directive, like so: .. source:: Lib/abc.py Then just the text "Source code:" gets translated (in sphinx.po) and the rest is automatic. This could also benefit the presentation in the future, if anyone wants to change the styling of these links. Open question is how to handle the handful of links that contain several source files (async I/O modules in particular). To make it language-agnostic, perhaps the markup .. source:: Lib/asyncio/futures.py, Lib/asyncio/base_futures.py could be rendered as if it were **Source code:** :source:`Lib/asyncio/futures.py` | :source:`Lib/asyncio/base_futures.py` Thoughts? ---------- assignee: docs at python components: Documentation messages: 401410 nosy: Jean_Abou_Samra, docs at python, mdk priority: normal severity: normal status: open title: Simplify source links in documentation? _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45139> _______________________________________ From report at bugs.python.org Wed Sep 8 13:23:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:23:18 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1631121798.56.0.131956947974.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: I like Dennis' idea and Serhiy's implementation in GH-28176. It's a bit of a larger change compared to GH-27986 but I think it's worth it: I expect iteration speed is more important than `len()` speed for range objects. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Wed Sep 8 13:24:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:24:17 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1631121857.9.0.174801629405.issue41082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset dc2e11ed5a5a8083db1d8b5e2396c9238999568c by andrei kulakov in branch '3.9': [3.9] bpo-41082: Add note on errors that may be raised by home() and expanduser() (GH-28186) https://github.com/python/cpython/commit/dc2e11ed5a5a8083db1d8b5e2396c9238999568c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Wed Sep 8 13:28:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 17:28:19 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631122099.12.0.150674164192.issue45083@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Pablo wanted to wait for 3.10.1, see https://github.com/python/cpython/pull/28134#issuecomment-912679271 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 8 13:28:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:28:49 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1631122129.9.0.542974774467.issue41082@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Behavior is fixed in Python 3.10+. For Python 3.9 the docs are updated to list possible exceptions. Since this was reported with 3.9 in mind, I'm marking this one as wontfix. Thanks for picking this up, Andrei! ? ? ? ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41082> _______________________________________ From report at bugs.python.org Wed Sep 8 13:29:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 08 Sep 2021 17:29:40 +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: <1631122180.24.0.463535355642.issue44340@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 84ca5fcd31541929f0031e974a434b95d8e78aab by Dong-hee Na in branch 'main': bpo-44340: Update whatsnews for ThinLTO (GH-28229) https://github.com/python/cpython/commit/84ca5fcd31541929f0031e974a434b95d8e78aab ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44340> _______________________________________ From report at bugs.python.org Wed Sep 8 13:33:33 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 08 Sep 2021 17:33:33 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631122413.03.0.169401806636.issue45136@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: Fix was proposed in https://github.com/python/cpython/pull/28235 but references the original bpi number. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Wed Sep 8 13:36:10 2021 From: report at bugs.python.org (Rebecca Wallander) Date: Wed, 08 Sep 2021 17:36:10 +0000 Subject: [issue45140] strict_timestamps for PyZipFile Message-ID: <1631122570.36.0.100472687583.issue45140@roundup.psfhosted.org> New submission from Rebecca Wallander <sakcheen at gmail.com>: https://github.com/python/cpython/pull/8270 Above fix solved the problem with pre-1980 files for regular ZipFile, but I still have issues when using PyZipFile object. https://docs.python.org/3.11/library/zipfile.html#pyzipfile-objects I would be glad if `strict_timestamps` was added to PyZipFile as well. The documentation of PyZipFile also states that PyZipFile has the same parameters as ZipFile with the addition of one extra. If this issue can't be fixed in code, at least the documentation should be updated to reflect this is not longer true. ---------- components: Library (Lib) messages: 401417 nosy: sakcheen priority: normal severity: normal status: open title: strict_timestamps for PyZipFile versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45140> _______________________________________ From report at bugs.python.org Wed Sep 8 13:39:37 2021 From: report at bugs.python.org (Thomas Fischbacher) Date: Wed, 08 Sep 2021 17:39:37 +0000 Subject: [issue45135] dataclasses.asdict() incorrectly calls __deepcopy__() on values. In-Reply-To: <1631092721.82.0.0802849147398.issue45135@roundup.psfhosted.org> Message-ID: <1631122777.04.0.339094752246.issue45135@roundup.psfhosted.org> Thomas Fischbacher <tfish at google.com> added the comment: The current behavior deviates from the documentation in a way that might evade tests and hence has the potential to cause production outages. Is there a way to fix the documentation so that it correctly describes current behavior - without having to wait for a new release? Eliminating the risk in such a way would be highly appreciated. In the longer run, there may be some value in having a differently named method (perhaps .as_dict()?) that basically returns {k: v for k, v in self.__dict__.items()}, but without going through reflection? The current approach to recurse looks as if it were based on quite a few doubtful assumptions. (Context: some style guides, such as Google's Python style guide, limit the use of reflection in order to keep some overall undesirable processes in check: https://google.github.io/styleguide/pyguide.html#2191-definition) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45135> _______________________________________ From report at bugs.python.org Wed Sep 8 14:32:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Sep 2021 18:32:17 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1631125937.49.0.177588276489.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I have not benchmarked PR 28176 yet and do not know whether it have advantages over PR 27986 and how large. Slower __lenght_hint__ can make list(range(...)) slower for small ranges, but I do not know how small. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Wed Sep 8 14:41:53 2021 From: report at bugs.python.org (pacien) Date: Wed, 08 Sep 2021 18:41:53 +0000 Subject: [issue45141] mailcap.getcaps() from given file(s) Message-ID: <1631126513.06.0.552308747638.issue45141@roundup.psfhosted.org> New submission from pacien <vpmfty.pythonbugs at pacien.net>: Currently, `mailcap.getcaps()` can only be used to load mailcap dictionaries from files located at some specific hard-coded paths. It is however also desirable to use the mailcap parser to load files located elsewhere. An optional parameter could be added to this function to explicitly specify the mailcap file(s) to read. ---------- components: email messages: 401420 nosy: barry, pacien, r.david.murray priority: normal severity: normal status: open title: mailcap.getcaps() from given file(s) type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45141> _______________________________________ From report at bugs.python.org Wed Sep 8 15:33:19 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 08 Sep 2021 19:33:19 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1631129599.24.0.6471075043.issue40059@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: No progress as I've been swamped with higher-priority things and the bigger discussion about how we want to manage the stdlib going forward has not started yet (once again, not had the time to start that). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40059> _______________________________________ From report at bugs.python.org Wed Sep 8 16:02:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Sep 2021 20:02:26 +0000 Subject: [issue38371] Tkinter: deprecate the split() method In-Reply-To: <1570203221.73.0.664458057352.issue38371@roundup.psfhosted.org> Message-ID: <1631131346.92.0.0490545490571.issue38371@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset f235dd0784b92824565c4a4e72adc70fa3eab68f by Erlend Egeberg Aasland in branch 'main': bpo-38371: Remove deprecated `tkinter` split() method (GH-28237) https://github.com/python/cpython/commit/f235dd0784b92824565c4a4e72adc70fa3eab68f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38371> _______________________________________ From report at bugs.python.org Wed Sep 8 16:40:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 20:40:27 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1631133627.71.0.260417815965.issue45138@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- title: [sqlite3] expand bound values in traced statements if possible -> [sqlite3] expand bound values in traced statements when possible _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45138> _______________________________________ From report at bugs.python.org Wed Sep 8 16:49:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 20:49:37 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1631134177.65.0.259513372613.issue42064@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: I did some experiments using the connection object as a "backref" in the callback context, but it seems that the GC does not play well with such ref circles; I ended up with a lot of ref leaks (yes, I modified the traverse and clear slots to visit and clear the backref). Using the module object as a "backref", however, worked swell. It ends up being a much larger PR, though. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42064> _______________________________________ From report at bugs.python.org Wed Sep 8 16:59:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 08 Sep 2021 20:59:19 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1631134759.56.0.900739020167.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26661 pull_request: https://github.com/python/cpython/pull/28242 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42064> _______________________________________ From report at bugs.python.org Wed Sep 8 17:20:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 08 Sep 2021 21:20:05 +0000 Subject: [issue37529] Mimetype module duplicates In-Reply-To: <1562680761.15.0.288138014947.issue37529@roundup.psfhosted.org> Message-ID: <1631136005.35.0.878381628647.issue37529@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch pull_requests: +26662 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28243 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37529> _______________________________________ From report at bugs.python.org Wed Sep 8 17:27:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 08 Sep 2021 21:27:43 +0000 Subject: [issue45139] Simplify source links in documentation? In-Reply-To: <1631121467.16.0.546303933319.issue45139@roundup.psfhosted.org> Message-ID: <1631136463.15.0.380737923945.issue45139@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: ISTM that translating this fixed pattern is possibly one of the simplest things a translator will be asked to do, so there is very little payoff to making the change. For a person writing the docs, it is best to leave it as-is so that the wording and presentation is easily customized for a situation unique to a particular module. This becomes a much more difficult task if we have to override logic in a PO file. Thanks for the suggestion, but I am -1 on this change. Let's not take something simple and introduce hard-to-override implicit behavior. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45139> _______________________________________ From report at bugs.python.org Wed Sep 8 17:28:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 08 Sep 2021 21:28:34 +0000 Subject: [issue37529] Mimetype module duplicates In-Reply-To: <1562680761.15.0.288138014947.issue37529@roundup.psfhosted.org> Message-ID: <1631136514.36.0.388889000494.issue37529@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- pull_requests: +26663 pull_request: https://github.com/python/cpython/pull/28244 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37529> _______________________________________ From report at bugs.python.org Wed Sep 8 17:29:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 08 Sep 2021 21:29:40 +0000 Subject: [issue45139] Docs: More surrounding text into the "source" directive In-Reply-To: <1631121467.16.0.546303933319.issue45139@roundup.psfhosted.org> Message-ID: <1631136580.22.0.174082901987.issue45139@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- title: Simplify source links in documentation? -> Docs: More surrounding text into the "source" directive versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45139> _______________________________________ From report at bugs.python.org Wed Sep 8 17:51:31 2021 From: report at bugs.python.org (pacien) Date: Wed, 08 Sep 2021 21:51:31 +0000 Subject: [issue45141] mailcap.getcaps() from given file(s) In-Reply-To: <1631126513.06.0.552308747638.issue45141@roundup.psfhosted.org> Message-ID: <1631137891.31.0.503009982732.issue45141@roundup.psfhosted.org> Change by pacien <vpmfty.pythonbugs at pacien.net>: ---------- keywords: +patch pull_requests: +26664 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28245 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45141> _______________________________________ From report at bugs.python.org Wed Sep 8 18:19:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 08 Sep 2021 22:19:48 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631139588.19.0.0303499970579.issue45017@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26666 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28246 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Wed Sep 8 19:00:24 2021 From: report at bugs.python.org (Joshua) Date: Wed, 08 Sep 2021 23:00:24 +0000 Subject: [issue45142] Import error for Iterable in collections Message-ID: <1631142024.27.0.823096064512.issue45142@roundup.psfhosted.org> New submission from Joshua <joshua at himmens.com>: Traceback: Traceback (most recent call last): File "/Users/user/PycharmProjects/phys2/main.py", line 5, in <module> from collections import Iterable ImportError: cannot import name 'Iterable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py) Done using a venv based on python 3.10.0rc1 running on Darwin/MacOS. I am new to adding bugs so I don't quite know what information I can provide that could be of use other than that this issue persists in REPL. ---------- components: Library (Lib) messages: 401425 nosy: Joshuah143 priority: normal severity: normal status: open title: Import error for Iterable in collections versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45142> _______________________________________ From report at bugs.python.org Wed Sep 8 19:02:31 2021 From: report at bugs.python.org (Hanu) Date: Wed, 08 Sep 2021 23:02:31 +0000 Subject: [issue45143] ipaddress multicast v6 RFC documentation correction Message-ID: <1631142151.61.0.977852423445.issue45143@roundup.psfhosted.org> New submission from Hanu <hanu.cholleti at gmail.com>: In the ipaddress library documentation related to multicast. https://docs.python.org/3/library/ipaddress.html#ip-addresses the is_multicast, refers to the v6 multicast RFC as 2373: "is_multicast True if the address is reserved for multicast use. See RFC 3171 (for IPv4) or RFC 2373 (for IPv6)." Should that be referred to as RFC 2375 (for IPv6)? - RFC 2373 is "IP Version 6 Addressing Architecture" - RFC 2375 is "IPv6 Multicast Address Assignments" Also for IPv4, the multicast is referred to RFC 3171, which is obsoleted by RFC 5771 (IPv4 Multicast Address Assignments) ---------- messages: 401426 nosy: hanugit priority: normal severity: normal status: open title: ipaddress multicast v6 RFC documentation correction versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45143> _______________________________________ From report at bugs.python.org Wed Sep 8 19:08:42 2021 From: report at bugs.python.org (Joshua) Date: Wed, 08 Sep 2021 23:08:42 +0000 Subject: [issue45142] Import error for Iterable in collections In-Reply-To: <1631142024.27.0.823096064512.issue45142@roundup.psfhosted.org> Message-ID: <1631142522.16.0.565150386994.issue45142@roundup.psfhosted.org> Joshua <joshua at himmens.com> added the comment: Update: I'm just dumb, should have used "from collections.abc import Iterable" ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45142> _______________________________________ From report at bugs.python.org Wed Sep 8 20:11:09 2021 From: report at bugs.python.org (Diego Ramirez) Date: Thu, 09 Sep 2021 00:11:09 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1631146269.33.0.511664279492.issue42064@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- nosy: +DiddiLeija _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42064> _______________________________________ From report at bugs.python.org Wed Sep 8 20:19:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 00:19:04 +0000 Subject: [issue45144] Use subtests in test_peepholer Message-ID: <1631146744.41.0.0401812311167.issue45144@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: test_peepholer has many tests that loop over test cases. Identifying them as subtests will make them easier to work with when something breaks. ---------- components: Tests messages: 401428 nosy: iritkatriel priority: normal severity: normal status: open title: Use subtests in test_peepholer type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45144> _______________________________________ From report at bugs.python.org Wed Sep 8 20:21:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 00:21:17 +0000 Subject: [issue45144] Use subtests in test_peepholer In-Reply-To: <1631146744.41.0.0401812311167.issue45144@roundup.psfhosted.org> Message-ID: <1631146877.31.0.245843001346.issue45144@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26667 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28247 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45144> _______________________________________ From report at bugs.python.org Wed Sep 8 20:39:40 2021 From: report at bugs.python.org (=?utf-8?b?RS4gTS4gUC4gSMO2bGxlcg==?=) Date: Thu, 09 Sep 2021 00:39:40 +0000 Subject: [issue45145] Case of headers in urllib.request.Request Message-ID: <1631147980.88.0.915702969887.issue45145@roundup.psfhosted.org> New submission from E. M. P. H?ller <paul.hoeller at web.de>: urllib.request.Request internally .capitalize()s header names before adding them, as can be seen here: https://github.com/python/cpython/blob/3.9/Lib/urllib/request.py#L399 Since HTTP headers are case-insensitive, but dicts are not, this ensures that add_header and add_unredirected_header overwrite an existing header (as documented) even if they were passed in different cases. However, this also carries two problems with it: 1. has_header, get_header, and remove_header do not apply this normalisation to their header_name parameter, causing them to fail unexpectedly when the header is passed in the wrong case. 2. Some servers do not comply with the standard and check some headers case-sensitively. If the case they expect is different from the result of .capitalize(), those headers effectively cannot be passed to them via urllib. These problems have already been discussed quite some time ago, and yet they still are present: https://bugs.python.org/issue2275 https://bugs.python.org/issue12455 Or did I overlook something and there is a good reason why things are this way? If not, I suggest that add_header and add_unredirected_header store the headers in the case they were passed (while preserving the case-insensitive overwriting behaviour) and that has_header, get_header, and remove_header find headers independent of case. Here is a possible implementation: # Helper outside class # Stops after the first hit since there should be at most one of each header in the dict def _find_key_insensitive(d, key): key = key.lower() for key2 in d: if key2.lower() == key: return key2 return None # Unnecessary, but explicit is better than implicit ;-) # Methods of Request def add_header(self, key, val): # useful for something like authentication existing_key = _find_key_insensitive(self.headers, key) if existing_key: self.headers.pop(existing_key) self.headers[key] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request existing_key = _find_key_insensitive(self.unredirected_hdrs, key) if existing_key: self.unredirected_hdrs.pop(existing_key) self.unredirected_hdrs[key] = val def has_header(self, header_name): return bool(_find_key_insensitive(self.headers, header_name) or _find_key_insensitive(self.unredirected_hdrs, header_name)) def get_header(self, header_name, default=None): key = _find_key_insensitive(self.headers, header_name) if key: return self.headers[key] key = _find_key_insensitive(self.unredirected_hdrs, header_name) if key: return self.unredirected_hdrs[key] return default def remove_header(self, header_name): key = _find_key_insensitive(self.headers, header_name) if key: self.headers.pop(key) key = _find_key_insensitive(self.unredirected_hdrs, header_name) if key: self.unredirected_hdrs.pop(key) I?m sorry if it is frowned upon to post code suggestions here like that; I didn?t have the confidence to create a pull request right away. ---------- components: Library (Lib) messages: 401429 nosy: emphoeller priority: normal severity: normal status: open title: Case of headers in urllib.request.Request type: behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45145> _______________________________________ From report at bugs.python.org Wed Sep 8 20:41:00 2021 From: report at bugs.python.org (=?utf-8?q?Hakan_=C3=87elik?=) Date: Thu, 09 Sep 2021 00:41:00 +0000 Subject: [issue45133] Open functions in dbm submodule should support path-like objects In-Reply-To: <1631042791.04.0.276454650964.issue45133@roundup.psfhosted.org> Message-ID: <1631148060.04.0.513065449418.issue45133@roundup.psfhosted.org> Change by Hakan ?elik <hakancelik96 at outlook.com>: ---------- nosy: +hakancelik nosy_count: 1.0 -> 2.0 pull_requests: +26668 pull_request: https://github.com/python/cpython/pull/20274 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45133> _______________________________________ From report at bugs.python.org Wed Sep 8 20:42:28 2021 From: report at bugs.python.org (David Mertz) Date: Thu, 09 Sep 2021 00:42:28 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631148148.78.0.548733775292.issue40563@roundup.psfhosted.org> David Mertz <david.mertz at gmail.com> added the comment: I've made the few additional changes to those in this PR. When I work out the issues, I'll make a new PR. I took out an attempt with `path_t`. However, here is why I think argument clinic (or something else?!) is actually intercepting the attempted call: With my temporary debugging, I have this function in `Modules/_gdbmmodule.c`: ```c [clinic start generated code]*/ static PyObject * dbmopen_impl(PyObject *module, PyObject *filename, const char *flags, int mode) /*[clinic end generated code: output=9527750f5df90764 input=812b7d74399ceb0e]*/ { PyObject_Print(filename, stdout, 0); printf(" from _gdbmmodule.c (XXX)\n"); /* ... rest of function ...*/ ``` And I have a very simplified test script: ```python import _gdbm import sys from pathlib import Path print(sys.version) path = '/tmp/tmp.db' db = _gdbm.open(path, 'c') print("Opened with string path") db.close() db = _gdbm.open(Path(path), 'c') print("Opened with path-like") db.close() ``` The output of running this is: ``` 3.11.0a0 (heads/[bpo-45133](https://bugs.python.org/issue45133)-dirty:0376feb030, Sep 8 2021, 00:39:39) [GCC 10.3.0] '/tmp/tmp.db' from _gdbmmodule.c (XXX) Opened with string path Traceback (most recent call last): File "/home/dmertz/tmp/pathlike-dbm.py", line 12, in <module> db = _gdbm.open(Path(path), 'c') ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: open() argument 1 must be str, not PosixPath ``` So before I get to the first line of the _gdbm.open() function, the TypeError is already occurring when passed a PosixPath. ---------- nosy: +DavidMertz type: -> enhancement versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Wed Sep 8 20:48:58 2021 From: report at bugs.python.org (David Mertz) Date: Thu, 09 Sep 2021 00:48:58 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631148538.78.0.453178456882.issue40563@roundup.psfhosted.org> David Mertz <david.mertz at gmail.com> added the comment: If anyone wants to look at my not-yet-complete changes (see other comment), it's https://github.com/DavidMertz/cpython/tree/bpo-45133. It has a different bpo because I filed a duplicate before realizing. I can change the branch name before a PR, but making it work is the more important issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Wed Sep 8 23:00:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 03:00:24 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631156423.99.0.422103131139.issue20499@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 4a5cccb02bb2254634c0fbb2cbb14e2e7f45e2d5 by Raymond Hettinger in branch 'main': bpo-20499: Rounding error in statistics.pvariance (GH-28230) https://github.com/python/cpython/commit/4a5cccb02bb2254634c0fbb2cbb14e2e7f45e2d5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Wed Sep 8 23:06:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 03:06:34 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631156794.18.0.413187188077.issue20499@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Wed Sep 8 23:16:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 03:16:52 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631157412.57.0.481366581273.issue20499@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- pull_requests: +26669 pull_request: https://github.com/python/cpython/pull/28248 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Wed Sep 8 23:42:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 03:42:38 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631158958.66.0.303750374666.issue20499@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 3c30805b58421a1e2aa613052b6d45899f9b1b5d by Raymond Hettinger in branch '3.10': [3.10] bpo-20499: Rounding error in statistics.pvariance (GH-28230) (GH-28248) https://github.com/python/cpython/commit/3c30805b58421a1e2aa613052b6d45899f9b1b5d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Wed Sep 8 23:44:10 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 03:44:10 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631159050.82.0.096351507279.issue20499@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- assignee: steven.daprano -> rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Thu Sep 9 00:46:16 2021 From: report at bugs.python.org (Mykola Mokhnach) Date: Thu, 09 Sep 2021 04:46:16 +0000 Subject: [issue45146] Add a possibility for asyncio.Condition to determine the count of currently waiting consumers Message-ID: <1631162776.4.0.536124821312.issue45146@roundup.psfhosted.org> New submission from Mykola Mokhnach <mokhnach at gmail.com>: Currently the asyncio.Condition class does not provide any properties that would allow to determine how many (if) consumers are waiting for the current condition. My scenario is the following: ``` ... FILE_STATS_CONDITIONS: Dict[str, asyncio.Condition] = {} FILE_STATS_CACHE: Dict[str, Union[FileStat, Exception]] = {} ... async def _fetch_file_stat(self: T, file_id: str) -> FileStat: """ The idea behind this caching is to avoid sending multiple info requests for the same file id to the server and thus to avoid throttling. This is safe, because stored files are immutable. """ try: file_stat: FileStat if file_id in FILE_STATS_CONDITIONS: self.log.debug(f'Reusing the previously cached stat request for the file {file_id}') async with FILE_STATS_CONDITIONS[file_id]: await FILE_STATS_CONDITIONS[file_id].wait() cached_result = FILE_STATS_CACHE[file_id] if isinstance(cached_result, FileStat): file_stat = cached_result else: raise cached_result else: FILE_STATS_CONDITIONS[file_id] = asyncio.Condition() cancellation_exception: Optional[asyncio.CancelledError] = None async with FILE_STATS_CONDITIONS[file_id]: file_stat_task = asyncio.create_task(self.storage_client.get_file_stat(file_id)) try: try: file_stat = await asyncio.shield(file_stat_task) except asyncio.CancelledError as e: if len(getattr(FILE_STATS_CONDITIONS[file_id], '_waiters', (None,))) == 0: # it is safe to cancel now if there are no consumers in the waiting queue file_stat_task.cancel() raise # we don't want currently waiting consumers to fail because of the task cancellation file_stat = await file_stat_task cancellation_exception = e FILE_STATS_CACHE[file_id] = file_stat except Exception as e: FILE_STATS_CACHE[file_id] = e raise finally: FILE_STATS_CONDITIONS[file_id].notify_all() if cancellation_exception is not None: raise cancellation_exception # noinspection PyUnboundLocalVariable self.log.info(f'File stat: {file_stat}') return file_stat except ObjectNotFoundError: self.log.info(f'The file identified by "{file_id}" either does not exist or has expired') raise file_not_found_error(file_id) finally: if file_id in FILE_STATS_CONDITIONS and not FILE_STATS_CONDITIONS[file_id].locked(): del FILE_STATS_CONDITIONS[file_id] if file_id in FILE_STATS_CACHE: del FILE_STATS_CACHE[file_id] ``` Basically I need to use `getattr(FILE_STATS_CONDITIONS[file_id], '_waiters', (None,))` to workaround this limitation in order to figure out whether to cancel my producer now or later. It would be nice to have a public property on the Condition class, which would basically return the value of `len(condition._waiters)`. ---------- components: asyncio messages: 401434 nosy: asvetlov, mykola-mokhnach, yselivanov priority: normal severity: normal status: open title: Add a possibility for asyncio.Condition to determine the count of currently waiting consumers type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45146> _______________________________________ From report at bugs.python.org Thu Sep 9 02:19:01 2021 From: report at bugs.python.org (Ming Hua) Date: Thu, 09 Sep 2021 06:19:01 +0000 Subject: [issue45147] Type in "What's New In Python 3.10" documentation Message-ID: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> New submission from Ming Hua <plateauwolf at qq.com>: It's just a small typo, but since the documentation recommends reporting to bug tracker, here it is. After downloading the 64-bit Windows Installer for 3.10.0 rc2 and successfully installing on my Windows 10, the "Python 3.10 Manuals" in start menu opens a (presumably) .chm documentation in Windows HTML Helper. There in the "What's New in Python" > "What's New In Python 3.10" > "Deprecated" section, first paragraph, last line, is: If future releases it will be changed... It should be "IN future releases" instead. ---------- assignee: docs at python components: Documentation messages: 401435 nosy: docs at python, minghua priority: normal severity: normal status: open title: Type in "What's New In Python 3.10" documentation versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 02:28:08 2021 From: report at bugs.python.org (Ming Hua) Date: Thu, 09 Sep 2021 06:28:08 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631168888.85.0.426380903401.issue45147@roundup.psfhosted.org> Change by Ming Hua <plateauwolf at qq.com>: ---------- title: Type in "What's New In Python 3.10" documentation -> Typo in "What's New In Python 3.10" documentation _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 03:09:50 2021 From: report at bugs.python.org (baterflyrity) Date: Thu, 09 Sep 2021 07:09:50 +0000 Subject: [issue45148] ensurepip upgrade fails Message-ID: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> New submission from baterflyrity <baterflyrity at yandex.ru>: Upgrading pip via ensurepip unfortunately doesn't do anything wealthy. ```bash user at host MINGW64 ~ $ pip list | grep pip pip 21.2.3 WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available. You should consider upgrading via the 'C:\Python39\python.exe -m pip install --upgrade pip' command. user at host MINGW64 ~ $ py -m ensurepip --upgrade Looking in links: c:\Users\BATERF~1\AppData\Local\Temp\tmpuv4go5fy Requirement already satisfied: setuptools in c:\python39\lib\site-packages (57.4.0) Requirement already satisfied: pip in c:\python39\lib\site-packages (21.2.3) user at host MINGW64 ~ $ pip list | grep pip pip 21.2.3 WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available. You should consider upgrading via the 'C:\Python39\python.exe -m pip install --upgrade pip' command. ``` ---------- components: Windows messages: 401436 nosy: baterflyrity, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ensurepip upgrade fails versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 03:10:36 2021 From: report at bugs.python.org (baterflyrity) Date: Thu, 09 Sep 2021 07:10:36 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631171436.19.0.48476969087.issue45148@roundup.psfhosted.org> baterflyrity <baterflyrity at yandex.ru> added the comment: See also: https://github.com/pypa/pip/issues/10453 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 03:23:50 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 09 Sep 2021 07:23:50 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631172230.0.0.105431963818.issue45148@roundup.psfhosted.org> Paul Moore <p.f.moore at gmail.com> added the comment: >From the documentation: > upgrade indicates whether or not to upgrade an existing installation of an earlier version of pip to the bundled version. Note the comment "to the bundled version". This command will not access the internet (also noted in the documentation) and so will not get a later version than the bundled one. To get the latest version of pip, you need to use /path/to/your/python -m pip install --upgrade pip Note: 1. You must *not* use the pip executable, you must use `python -m pip`, as the command will be upgrading the pip executable and Windows won't let you upgrade an executable you are using. 2. You should use the full path to your Python, or ensure by other means that you are running the correct copy of Python. This command only upgrades the copy of pip associated with the Python interpreter you use to run the upgrade command. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 03:24:11 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 09 Sep 2021 07:24:11 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631172251.84.0.4884030031.issue45148@roundup.psfhosted.org> Change by Paul Moore <p.f.moore at gmail.com>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 03:28:48 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 09 Sep 2021 07:28:48 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1631172528.58.0.0100403305335.issue44344@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: @Erik: Do you have a moment to look at the PR (GH-27853) and see if the proposed changes work for you? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44344> _______________________________________ From report at bugs.python.org Thu Sep 9 03:45:42 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Sep 2021 07:45:42 +0000 Subject: [issue45149] Cover directory and zipfile execution in __main__ module docs Message-ID: <1631173542.48.0.638794162329.issue45149@roundup.psfhosted.org> New submission from Nick Coghlan <ncoghlan at gmail.com>: bpo-39452 covered significant improvements to the __main__ module documentation at https://docs.python.org/dev/library/__main__.html, making it a better complement to the CPython CLI documentation at https://docs.python.org/dev/using/cmdline.html#command-line This follow up ticket covers the `__main__` variant that the previous ticket didn't cover: directory and zipfile execution (which underlies the utility of the `zipapp` stdlib module: https://docs.python.org/dev/library/zipapp.html) The relevant info is present in the CLI and runpy.run_path documentation, so this ticket just covers adding that info to the `__main__` module docs. ---------- messages: 401440 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Cover directory and zipfile execution in __main__ module docs type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45149> _______________________________________ From report at bugs.python.org Thu Sep 9 03:48:17 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Sep 2021 07:48:17 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1631173697.04.0.175481118759.issue39452@roundup.psfhosted.org> Nick Coghlan <ncoghlan at gmail.com> added the comment: These changes are excellent - thanks for the patch! Something even the updated version doesn't cover yet is directory and zipfile execution, so I filed bpo-45149 as a follow up ticket for that (the info does exist elsewhere in the documentation, so it's mostly just a matter of adding it to the newly expanded page, and deciding what new cross-references, if any, would be appropriate) ---------- nosy: +ncoghlan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39452> _______________________________________ From report at bugs.python.org Thu Sep 9 03:52:25 2021 From: report at bugs.python.org (baterflyrity) Date: Thu, 09 Sep 2021 07:52:25 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631173945.74.0.830003033551.issue45148@roundup.psfhosted.org> baterflyrity <baterflyrity at yandex.ru> added the comment: > Note the comment "to the bundled version". Thanks. Have not knew. > 1. You must *not* use the pip executable, you must use `python -m pip`, as the command will be upgrading the pip executable and Windows won't let you upgrade an executable you are using. You are wrong. Windows lets me update pip via pip. Also must notice that ensurepip also deletes the current pip before installing it's own. So in case of "Permission denied" error it just deletes pip (see https://github.com/pypa/pip/issues/9527). Should i create new issue for this? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 04:01:06 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 09 Sep 2021 08:01:06 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631174466.64.0.897303230025.issue45148@roundup.psfhosted.org> Paul Moore <p.f.moore at gmail.com> added the comment: > You are wrong. Windows lets me update pip via pip. You have misinterpreted what you are seeing. > Should i create new issue for this? No, you should follow the correct process and use `python -m pip`, and not use pip directly. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 04:13:52 2021 From: report at bugs.python.org (Mykola Mokhnach) Date: Thu, 09 Sep 2021 08:13:52 +0000 Subject: [issue45146] Add a possibility for asyncio.Condition to determine the count of currently waiting consumers In-Reply-To: <1631162776.4.0.536124821312.issue45146@roundup.psfhosted.org> Message-ID: <1631175232.39.0.459611475248.issue45146@roundup.psfhosted.org> Mykola Mokhnach <mokhnach at gmail.com> added the comment: This improvement request is also applicable to other asyncio synchronization primitives that contain a waiting queue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45146> _______________________________________ From report at bugs.python.org Thu Sep 9 04:39:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Sep 2021 08:39:49 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631176789.19.0.450608065772.issue45017@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: What is wrong with this? Is such logic used in the dis module or any other module outside modulefinder? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 04:40:38 2021 From: report at bugs.python.org (Vincent Michel) Date: Thu, 09 Sep 2021 08:40:38 +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: <1631176838.97.0.976537918695.issue44129@roundup.psfhosted.org> Change by Vincent Michel <vxgmichel at gmail.com>: ---------- nosy: +vxgmichel nosy_count: 2.0 -> 3.0 pull_requests: +26670 pull_request: https://github.com/python/cpython/pull/28250 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44129> _______________________________________ From report at bugs.python.org Thu Sep 9 04:41:47 2021 From: report at bugs.python.org (Vincent Michel) Date: Thu, 09 Sep 2021 08:41:47 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631176907.48.0.662519345737.issue44219@roundup.psfhosted.org> Change by Vincent Michel <vxgmichel at gmail.com>: ---------- pull_requests: +26671 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28250 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 04:44:42 2021 From: report at bugs.python.org (Vincent Michel) Date: Thu, 09 Sep 2021 08:44:42 +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: <1631177082.62.0.254588106684.issue44129@roundup.psfhosted.org> Change by Vincent Michel <vxgmichel at gmail.com>: ---------- pull_requests: -26670 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44129> _______________________________________ From report at bugs.python.org Thu Sep 9 04:55:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 08:55:07 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631177706.99.0.670863700434.issue45017@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The modulefinder module shouldn?t know what sequence of opcodes the compiler emits for import. For example, if the compiler changes you get a fairly high level test failure that you need to debug. After this refactor the test failure is more obviously pointing to what changed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 05:01:06 2021 From: report at bugs.python.org (baterflyrity) Date: Thu, 09 Sep 2021 09:01:06 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631178066.88.0.388093070992.issue45148@roundup.psfhosted.org> baterflyrity <baterflyrity at yandex.ru> added the comment: >> You are wrong. Windows lets me update pip via pip. > >You have misinterpreted what you are seeing. I don't know technical details but i can successfully use this command: `pip install --upgrade pip`. >No, you should follow the correct process and use `python -m pip`, and not use pip directly. On pip's issues tracker i was suggested to use `ensurepip --upgrade`. Therefore it deletes global system's pip when is ran without sudo or admin rights (when the current version of pip is lower then bundled). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 05:02:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 09:02:58 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631178178.54.0.966234482122.issue44860@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 49acac00c08838d8080ce00d02c05284b94f8fb2 by Victor Stinner in branch 'main': bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235) https://github.com/python/cpython/commit/49acac00c08838d8080ce00d02c05284b94f8fb2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Thu Sep 9 05:05:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 09:05:40 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631178340.54.0.878849274794.issue44860@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26672 pull_request: https://github.com/python/cpython/pull/28251 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Thu Sep 9 05:12:31 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 09 Sep 2021 09:12:31 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x: Linux kernel 5.15 regression In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1631178751.94.0.0977306991047.issue45119@roundup.psfhosted.org> Change by Miro Hron?ok <miro at hroncok.cz>: ---------- nosy: +hroncok _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Thu Sep 9 05:13:10 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 09 Sep 2021 09:13:10 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631178790.46.0.458595772274.issue45136@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: The 3.10 backport is in https://github.com/python/cpython/pull/28251 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Thu Sep 9 05:18:04 2021 From: report at bugs.python.org (Matthias Urlichs) Date: Thu, 09 Sep 2021 09:18:04 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631179084.35.0.984664179988.issue44219@roundup.psfhosted.org> Matthias Urlichs <matthias at urlichs.de> added the comment: Please do. However, I do think that changing the stdstream related ioctl calls also is a good idea, if only for code regularity/completeness sake. (Besides, nothing prevents somebody from starting a FUSE file system and then redirecting stdout to it ?) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 05:28:52 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 09 Sep 2021 09:28:52 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631179732.81.0.750262678412.issue45148@roundup.psfhosted.org> Paul Moore <p.f.moore at gmail.com> added the comment: > I don't know technical details but i can successfully use this command: `pip install --upgrade pip`. On Windows (and not under something like cygwin or msys, which have their own rules)? Anyway, it's not that important, the recommended approach is `python -m pip`, so whether using the non-recommended approach works or not doesn't really matter. > On pip's issues tracker i was suggested to use `ensurepip --upgrade`. Let's take that question back to the pip tracker. If you want the latest version of pip (as opposed to the bundled version) ensurepip isn't the right approach. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 05:36:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 09:36:01 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631180161.02.0.124895599787.issue44860@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 11103eb1f2199cacd8c2e29e3db0d19199885b45 by Miss Islington (bot) in branch '3.10': bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235) (GH-28251) https://github.com/python/cpython/commit/11103eb1f2199cacd8c2e29e3db0d19199885b45 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Thu Sep 9 05:45:35 2021 From: report at bugs.python.org (baterflyrity) Date: Thu, 09 Sep 2021 09:45:35 +0000 Subject: [issue45148] ensurepip upgrade fails In-Reply-To: <1631171390.16.0.990723185381.issue45148@roundup.psfhosted.org> Message-ID: <1631180735.69.0.129583125381.issue45148@roundup.psfhosted.org> baterflyrity <baterflyrity at yandex.ru> added the comment: OK, ive caught the salt of ensurepip. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45148> _______________________________________ From report at bugs.python.org Thu Sep 9 05:54:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 09:54:06 +0000 Subject: [issue45136] test_sysconfig: test_user_similar() fails if sys.platlibdir is 'lib64' In-Reply-To: <1631097989.84.0.629517715324.issue45136@roundup.psfhosted.org> Message-ID: <1631181246.0.0.265813406259.issue45136@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I mark this issue as a duplicate of bpo-44860. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> sysconfig's posix_user scheme has different platlib value to distutils's unix_user _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45136> _______________________________________ From report at bugs.python.org Thu Sep 9 05:54:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 09:54:22 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1631181262.46.0.678827958555.issue44860@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I marked bpo-45136 as a duplicate of this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44860> _______________________________________ From report at bugs.python.org Thu Sep 9 06:00:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 10:00:08 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631181608.53.0.834256864437.issue45083@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I reopen the issue. I'm not comfortable with the backport. For me, this change is not a bugfix, but a new feature. It can break applications which rely on the exact error message in their test suite. I'm not sure why it was backported to Python 3.9. Moreover, I'm not comfortable to backport it to 3.10.1 and not 3.10.0. I would prefer to only change the behavior in Python 3.11. If you want to get it in 3.10, I suggest to convince Pablo to get in 3.10.0. Otherwise, I suggest to revert it in 3.9 and 3.10. Well, the qualified name is usually the same than the short name, so only few applications should be impacted. But it's annoying when the Python behavior changes in a minor version (3.x.y). ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Thu Sep 9 06:03:17 2021 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Thu, 09 Sep 2021 10:03:17 +0000 Subject: [issue45150] Add a file_digest() function in hashlib Message-ID: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> New submission from Tarek Ziad? <tarek at ziade.org>: I am proposing the addition of a very simple helper to return the hash of a file. ---------- assignee: tarek components: Library (Lib) messages: 401457 nosy: tarek priority: normal severity: normal status: open title: Add a file_digest() function in hashlib _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45150> _______________________________________ From report at bugs.python.org Thu Sep 9 06:04:49 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 09 Sep 2021 10:04:49 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1631181889.68.0.0915008741899.issue45150@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26673 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28252 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45150> _______________________________________ From report at bugs.python.org Thu Sep 9 06:05:25 2021 From: report at bugs.python.org (Vincent Michel) Date: Thu, 09 Sep 2021 10:05:25 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631181925.4.0.456089899673.issue44219@roundup.psfhosted.org> Vincent Michel <vxgmichel at gmail.com> added the comment: There are a couple of reasons why I did not make changes to the stdstream related functions. The first one is that a PR with many changes is less likely to get reviewed and merged than a PR with fewer changes. The second one is that it's hard for me to make sure that those functions are always called with the GIL already held. Maybe some of them never hold the GIL in the first place, and I'm not familiar enough with the code base to tell. So in the end it will probably be up to the coredev reviewing the PR, but better start small. > Besides, nothing prevents somebody from starting a FUSE file system and then redirecting stdout to it ? I ran some checks and `python -c 'input()' < my-fuse-mountpoint/data_in` does indeed trigger an ioctl call to the corresponding fuse file system. But how would `my-fuse-mountpoint/data_in` be the stdin for the process that itself starts the fuse filesystem? I don't see how to generate this deadlock, apart from setting up interprocess communication between the fuse process and the `my-fuse-mountpoint/data_in`-as-stdin process. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 06:12:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Sep 2021 10:12:42 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631182362.41.0.795601896184.issue45083@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: "{__module__}.{__name__}" is just incorrect reference if __name__ != __qualname__. Error messages should always use "{__module__}.{__qualname__}" or just "{__name__}". I see this as a bug. Fortunately very few code is affected. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Thu Sep 9 06:16:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Sep 2021 10:16:36 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1631182596.33.0.574164856937.issue45150@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +christian.heimes, gregory.p.smith type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45150> _______________________________________ From report at bugs.python.org Thu Sep 9 06:30:50 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 09 Sep 2021 10:30:50 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631183450.27.0.974648958226.issue45017@roundup.psfhosted.org> Batuhan Taskaya <isidentical at gmail.com> added the comment: Does find_imports/find_store_names have to be public? I think the relocation is fine, but making them public without any use case from outside can be avoided at least for now. ---------- nosy: +BTaskaya _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 06:48:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 09 Sep 2021 10:48:47 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1631184527.72.0.575812256156.issue45150@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Hey Tarek, long time no see! * the _sha256 module is optional, can be disabled and is not available in some distributions. * I also don't like to use sha256 has default. It's slow, even slower than sha512. Any default makes it also harder to upgrade to a better, more secure default in the future. * like hmac.new() a file_digest() should accept PEP 452-compatible arguments and hash name as digstmod argument, not just a callable. * a filename argument prevents users from passing in file-like objects like BytesIO. * 4096 bytes chunk size is very conservative. The call overhead for read() and update() may dominate the performance of the function. * The hex argument feels weird. In a perfect world, the hash and hmac objects should get an "update_file" method. The OpenSSL-based hashes could even release the GIL and utilize OpenSSL's BIO layer to avoid any Python overhead. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45150> _______________________________________ From report at bugs.python.org Thu Sep 9 06:56:27 2021 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Thu, 09 Sep 2021 10:56:27 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1631184987.88.0.570804518489.issue45150@roundup.psfhosted.org> Tarek Ziad? <tarek at ziade.org> added the comment: Hey Christian, I hope things are well for you! Thanks for all the precious feedback, I'll rework the patch accordingly ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45150> _______________________________________ From report at bugs.python.org Thu Sep 9 07:03:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 11:03:32 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631185412.61.0.615019908977.issue45017@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I agree, I?ll make them private. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 07:48:17 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 09 Sep 2021 11:48:17 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631188097.04.0.289098660123.issue20499@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: > rhettinger requested a review from stevendaprano yesterday This is not a complaint Raymond, but you're too quick for me! Your changes look good to me, thank you. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Thu Sep 9 08:02:18 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 09 Sep 2021 12:02:18 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1631188938.67.0.732171228397.issue20499@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Regarding the call to sorted that you removed. I just realised that this was buggy! In my testing, I found that there was a consistent speed-up by summing fractions in order of increasing denominators (small denominators first): >>> from fractions import Fraction >>> from timeit import Timer >>> from random import shuffle >>> >>> d1 = [Fraction(1, d) for d in range(1, 1000)] >>> d2 = d1[:] >>> shuffle(d2) >>> >>> t1 = Timer('sum(d)', setup='from __main__ import d1 as d') >>> t2 = Timer('sum(d)', setup='from __main__ import d2 as d') >>> >>> min(t1.repeat(number=100, repeat=7)) # small dens first 1.048042511974927 >>> min(t1.repeat(number=100, repeat=7)) 1.0449080819962546 >>> >>> min(t2.repeat(number=100, repeat=7)) # random order 1.2761094039888121 >>> min(t2.repeat(number=100, repeat=7)) 1.2763739289948717 Summing larger denominators before smaller denominators is even slower: >>> d3 = list(reversed(d1)) >>> t3 = Timer('sum(d)', setup='from __main__ import d3 as d') >>> >>> min(t3.repeat(number=100, repeat=7)) # large dens first 1.6581684999982826 >>> min(t3.repeat(number=100, repeat=7)) 1.6580656860023737 But then I screwed up by sorting the *tuples* (num, den) which would have the effect of summing small *numerators* first, not denominators. Thanks for catching that they way I had written it, the sort would have had at best no real performance benefit. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20499> _______________________________________ From report at bugs.python.org Thu Sep 9 08:09:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 12:09:41 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631189381.36.0.026034321885.issue45147@roundup.psfhosted.org> Change by Eric V. Smith <eric at trueblade.com>: ---------- keywords: +easy, newcomer friendly _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 08:16:48 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 12:16:48 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631189808.29.0.176418476532.issue45147@roundup.psfhosted.org> Change by Eric V. Smith <eric at trueblade.com>: ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 08:48:04 2021 From: report at bugs.python.org (Saurabh Jaiswal) Date: Thu, 09 Sep 2021 12:48:04 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631191684.22.0.894495581177.issue45147@roundup.psfhosted.org> Saurabh Jaiswal <saurabh.jaiswal37 at gmail.com> added the comment: i want to take this change, i just want to know the steps how to push this changes and raise PR for the same ---------- nosy: +saurabh37 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 08:56:30 2021 From: report at bugs.python.org (Ross Martin) Date: Thu, 09 Sep 2021 12:56:30 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631192190.13.0.190754847878.issue45147@roundup.psfhosted.org> Ross Martin <rossmartin97 at outlook.com> added the comment: I would like to fix this, if it hasnt been assigned already. ---------- nosy: +MrRBM97 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:00:16 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 13:00:16 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631192416.32.0.771220040009.issue45147@roundup.psfhosted.org> D.Lintin <diantolintin3 at gmail.com> added the comment: Already create a pull request, thanks. ---------- nosy: +dlintin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:04:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 13:04:20 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631192660.17.0.54195196013.issue45017@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: New changeset 04676b69466d2e6d2903f1c6879d2cb292721455 by Irit Katriel in branch 'main': bpo-45017: move opcode-related logic from modulefinder to dis (GH-28246) https://github.com/python/cpython/commit/04676b69466d2e6d2903f1c6879d2cb292721455 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 09:05:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 13:05:31 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1631192731.93.0.521756935596.issue45017@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45017> _______________________________________ From report at bugs.python.org Thu Sep 9 09:12:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 13:12:08 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631193128.22.0.99404530182.issue44219@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 06148b1870fceb1a21738761b8e1ac3bf654319b by Vincent Michel in branch 'main': bpo-44219: Release the GIL during isatty syscalls (GH-28250) https://github.com/python/cpython/commit/06148b1870fceb1a21738761b8e1ac3bf654319b ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 09:12:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 13:12:13 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631193133.37.0.142670161932.issue44219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26674 pull_request: https://github.com/python/cpython/pull/28255 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 09:12:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 13:12:17 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631193137.7.0.0350910982083.issue44219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26675 pull_request: https://github.com/python/cpython/pull/28256 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 09:13:22 2021 From: report at bugs.python.org (Nitish Sharma) Date: Thu, 09 Sep 2021 13:13:22 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631193202.26.0.969037932653.issue45147@roundup.psfhosted.org> Nitish Sharma <nitss007 at gmail.com> added the comment: Yeah, are you talking about this PR? https://github.com/python/cpython/pull/28254 ---------- nosy: +nitss007 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:18:44 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 13:18:44 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631193524.11.0.113698828472.issue45147@roundup.psfhosted.org> D.Lintin <diantolintin3 at gmail.com> added the comment: no, this one: https://github.com/python/cpython/pull/28253 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:19:27 2021 From: report at bugs.python.org (Phil Thompson) Date: Thu, 09 Sep 2021 13:19:27 +0000 Subject: [issue44492] Building a C extension on Big Sur and SDK v10.15 fails In-Reply-To: <1624409568.36.0.590312520398.issue44492@roundup.psfhosted.org> Message-ID: <1631193567.36.0.796521338502.issue44492@roundup.psfhosted.org> Phil Thompson <phil at riverbankcomputing.com> added the comment: Is this likely to be fixed for v3.10? At the very least a wheel should have the correct platform tag. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44492> _______________________________________ From report at bugs.python.org Thu Sep 9 09:34:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 13:34:29 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631194469.09.0.175717024813.issue45147@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Please see the dev guide https://devguide.python.org/ for setting the description of the PR. If it's set correctly, the PR will be attached to this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:37:02 2021 From: report at bugs.python.org (Saurabh Jaiswal) Date: Thu, 09 Sep 2021 13:37:02 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631191684.22.0.894495581177.issue45147@roundup.psfhosted.org> Message-ID: <CADxWvF=op_RR4MuFpXD3hGfUFiE-iJ1xSnnzijQopQ58v+innw@mail.gmail.com> Saurabh Jaiswal <saurabh.jaiswal37 at gmail.com> added the comment: PR raised for the same https://github.com/python/cpython/pull/28257 On Thu, 9 Sept 2021 at 18:19, Saurabh Jaiswal <report at bugs.python.org> wrote: > > Saurabh Jaiswal <saurabh.jaiswal37 at gmail.com> added the comment: > > i want to take this change, i just want to know the steps how to push this > changes and raise PR for the same > > ---------- > nosy: +saurabh37 > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue45147> > _______________________________________ > -- *Thanks & Regards* Saurabh Jaiswal *www.saurabhjaiswal.com <http://www.saurabhjaiswal.com>* *+91-7032917377* ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:37:05 2021 From: report at bugs.python.org (Saurabh Jaiswal) Date: Thu, 09 Sep 2021 13:37:05 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631194625.6.0.435993052508.issue45147@roundup.psfhosted.org> Saurabh Jaiswal <saurabh.jaiswal37 at gmail.com> added the comment: Fix done on the latest Branch as suggested ---------- keywords: +patch message_count: 8.0 -> 9.0 pull_requests: +26676 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28257 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:38:47 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 13:38:47 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631194727.7.0.93572548567.issue45147@roundup.psfhosted.org> Change by D.Lintin <diantolintin3 at gmail.com>: ---------- pull_requests: +26677 pull_request: https://github.com/python/cpython/pull/28253 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:40:18 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 13:40:18 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631194818.3.0.904930137698.issue45147@roundup.psfhosted.org> D.Lintin <diantolintin3 at gmail.com> added the comment: Just updated the description to attach to the issues, thanks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:40:50 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 13:40:50 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631194850.9.0.838544834333.issue44219@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 5c65834d801d6b4313eef0684a30e12c22ccfedd by Miss Islington (bot) in branch '3.9': bpo-44219: Release the GIL during isatty syscalls (GH-28250) https://github.com/python/cpython/commit/5c65834d801d6b4313eef0684a30e12c22ccfedd ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 09:40:56 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 09 Sep 2021 13:40:56 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631194856.6.0.637289151145.issue45067@roundup.psfhosted.org> Senthil Kumaran <senthil at python.org> added the comment: A change like this will be required since these funcs were introduced only recently and nurses shipped with centos was older. % git diff diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 61aaf85522..6fb6c490e6 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -135,7 +135,7 @@ typedef chtype attr_t; /* No attr_t type is available */ #define STRICT_SYSV_CURSES #endif -#if NCURSES_EXT_COLORS+0 && NCURSES_EXT_FUNCS+0 +#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20170401) && (defined(NCURSES_EXT_COLORS) && NCURSES_EXT_COLORS >= 20170401) #define _NCURSES_EXTENDED_COLOR_FUNCS 1 #else #define _NCURSES_EXTENDED_COLOR_FUNCS 0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 09:45:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 13:45:09 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631195109.63.0.0282576390085.issue45147@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Thanks to both of you. Unfortunately, I have to pick one PR to use, and since dlintin had the earlier one, I'll use it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:46:02 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 13:46:02 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631195162.82.0.526417464358.issue45147@roundup.psfhosted.org> D.Lintin <diantolintin3 at gmail.com> added the comment: Thankyou! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 09:47:28 2021 From: report at bugs.python.org (Brian Hunt) Date: Thu, 09 Sep 2021 13:47:28 +0000 Subject: [issue45151] Logger library with task scheduler Message-ID: <1631195248.81.0.804167801454.issue45151@roundup.psfhosted.org> New submission from Brian Hunt <btjehunt at gmail.com>: Version: Python 3.9.3 Package: Logger + Windows 10 Task Scheduler Error Msg: None Behavior: I built a logging process to use with a python script that will be scheduled with Windows 10 task scheduler (this could be a bug in task scheduler too, but starting here). I noticed it wasn?t working and started trying to trace the root of the issue. If I created a new file called scratch.py and ran some code, the logs showed up. However, the exact same code in the exact same folder (titled: run_xyz.py) didn?t log those same messages. It appears that something in either the task scheduler or logger library doesn?t like the fact that my file name contains an underscore because as soon as I pointed my task scheduler task that didn?t log to my other file, it worked again. Also, when I finally removed the underscores it started working. I believe it is Logger library related because the task with underscores does in fact run the python code and generate the script output. Code in both files: -----------------a_b_c.py code----------- import os import pathlib import sys pl_path = pathlib.Path(__file__).parents[1].resolve() sys.path.append(str(pl_path)) from src.Core.Logging import get_logger # logger = get_logger(__name__, False) logger.info("TESTING_USing taskScheduler") -------src.Core.Logging.py get_logger code-------- import logging import datetime import time import os # from logging.handlers import SMTPHandler from config import build_stage, log_config from Pipelines.Databases import sqlAlchemy_logging_con class DBHandler(logging.Handler): def __init__(self, name): """ :param name: Deprecated """ logging.StreamHandler.__init__(self) self.con = sqlAlchemy_logging_con() self.sql = """insert into Logs (LogMessage, Datetime, FullPathNM, LogLevelNM, ErrorLine) values ('{message}', '{dbtime}', '{pathname}', '{level}', '{errLn}')""" self.name = name def formatDBTime(self, record): record.dbtime = datetime.strftime("#%Y/%m/%d#", datetime.localtime(record.created)) def emit(self, record): creation_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(record.created)) try: self.format(record) if record.exc_info: record.exc_text = logging._defaultFormatter.formatException(record.exc_info) else: record.exc_text = "" sql = self.sql.format(message=record.message , dbtime=creation_time , pathname=record.pathname , level=record.levelname , errLn=record.lineno) self.con.execute(sql) except: pass def get_logger(name, use_local_logging=False): """ Returns a logger based on a name given. Name should be __name__ variable or unique for each call. Never call more than one time in a given file as it clears the logger. Use config.log_config to define configuration of the logger and its handlers. :param name: :return: logger """ logger = logging.getLogger(name) logger.handlers.clear() # used to send logs to local file location. Level set to that of logger if use_local_logging: handler = logging.FileHandler("Data\\Output\\log_" + build_stage + str(datetime.date.today()).replace("-","") + ".log") handler.setLevel(log_config['logger_level']) logger.addHandler(handler) dbhandler = DBHandler(name) dbhandler.setLevel(log_config['db_handler_level']) logger.addHandler(dbhandler) logger.setLevel(log_config['logger_level']) return logger ---------- components: IO, Library (Lib), Windows messages: 401482 nosy: btjehunt, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Logger library with task scheduler type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45151> _______________________________________ From report at bugs.python.org Thu Sep 9 09:52:43 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 13:52:43 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631195563.16.0.377905310066.issue45147@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: @pablogsal: You might want to merge this back to 3.10.0, once it's merged to 3.10. I'll merge it shortly, once the tests have run. ---------- keywords: -patch nosy: +pablogsal stage: patch review -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 10:08:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 14:08:41 +0000 Subject: [issue45151] Logger library with task scheduler In-Reply-To: <1631195248.81.0.804167801454.issue45151@roundup.psfhosted.org> Message-ID: <1631196521.66.0.603133312223.issue45151@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Can you simplify this to not use any external libraries? ---------- components: -IO, Windows nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45151> _______________________________________ From report at bugs.python.org Thu Sep 9 10:09:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 14:09:24 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes Message-ID: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: This issue is to prepare the code for splitting LOAD_CONST to several opcodes. There are a number of places in the code where an opcode is compared to LOAD_CONST (such as dis, the compiler, and the peephole optimizer). These need to be refactored to make the query "is this a hasconst opcode", and the value calculation needs to be refactored into a single place, which can later be updated to get the value from places other than co_consts. ---------- assignee: iritkatriel components: Interpreter Core, Library (Lib) messages: 401485 nosy: iritkatriel priority: normal severity: normal status: open title: Prepare for splitting LOAD_CONST into several opcodes type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 10:10:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 14:10:32 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631196632.69.0.931369004341.issue45152@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 10:20:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 14:20:10 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631197210.92.0.0329418080277.issue45152@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26678 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28258 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 10:35:50 2021 From: report at bugs.python.org (Shlomi) Date: Thu, 09 Sep 2021 14:35:50 +0000 Subject: [issue45153] Except multiple types of exceptions with OR keyword is not working Message-ID: <1631198150.11.0.821790716144.issue45153@roundup.psfhosted.org> New submission from Shlomi <vgtvgy1 at gmail.com>: When I want to catch multiple types of exceptions naturally 'OR' keyword is used. But it doesn't work. The interpreter doesn't show any error for the syntax, so developer may think it would work. Small example: try: myfunc() except ConnectionResetError or ConnectionAbortedError: print("foo") except Exception as e: print("bar") When myfunc() throws 'ConnectionAbortedError' the interpreter enters "bar" block, and not "foo" block. ---------- components: Interpreter Core messages: 401486 nosy: ShlomiRex priority: normal severity: normal status: open title: Except multiple types of exceptions with OR keyword is not working type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45153> _______________________________________ From report at bugs.python.org Thu Sep 9 10:36:38 2021 From: report at bugs.python.org (Sanmitha) Date: Thu, 09 Sep 2021 14:36:38 +0000 Subject: [issue45154] Enumerate() function or class? Message-ID: <1631198198.04.0.262463411165.issue45154@roundup.psfhosted.org> New submission from Sanmitha <sanmithasadhishkumar at gmail.com>: I was learning about enumerate(). While learning, when I used, >>>help(enumerate) Help on class enumerate in module builtins: class enumerate(object) | enumerate(iterable, start=0) | | Return an enumerate object. | | iterable | an object supporting iteration | | The enumerate object yields pairs containing a count (from start, which | defaults to zero) and a value yielded by the iterable argument. | | enumerate is useful for obtaining an indexed list: | (0, seq[0]), (1, seq[1]), (2, seq[2]), ? | | Methods defined here: | | getattribute(self, name, /) | Return getattr(self, name). | | iter(self, /) | Implement iter(self). | | next(self, /) | Implement next(self). | | reduce(?) | Return state information for pickling. Static methods defined here: new(*args, **kwargs) from builtins.type Create and return a new object. See help(type) for accurate signature. Even when I gave as, >>>enumerate <class ?enumerate?> But, when I checked the documentation in the official website of python, www.python.org for enumerate() Here : https://docs.python.org/3/library/functions.html#enumerate It showed that enumerate() is a function which violated the information shown by help(). I couldn?t get whether enumerate() is a class or a function. Anyone please help me out of this please? By the way, I had python 3.8.3. I even checked in python 3.6 and 3.7.10. ---------- assignee: docs at python components: Documentation messages: 401487 nosy: Sanmitha Sadhishkumar, docs at python priority: normal severity: normal status: open title: Enumerate() function or class? type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45154> _______________________________________ From report at bugs.python.org Thu Sep 9 10:56:22 2021 From: report at bugs.python.org (D.Lintin) Date: Thu, 09 Sep 2021 14:56:22 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631199382.86.0.389755171566.issue45147@roundup.psfhosted.org> D.Lintin <diantolintin3 at gmail.com> added the comment: 1 failing checks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 10:57:08 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 09 Sep 2021 14:57:08 +0000 Subject: [issue36424] Pickle fails on frozen dataclass that has slots In-Reply-To: <1553527088.82.0.636469633332.issue36424@roundup.psfhosted.org> Message-ID: <1631199428.42.0.209839515695.issue36424@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: This actually can't be closed yet as the fix was not backported to 3.9 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36424> _______________________________________ From report at bugs.python.org Thu Sep 9 11:27:03 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 09 Sep 2021 15:27:03 +0000 Subject: [issue45139] Docs: add source directive for minor translation simplification In-Reply-To: <1631121467.16.0.546303933319.issue45139@roundup.psfhosted.org> Message-ID: <1631201223.75.0.116063894706.issue45139@roundup.psfhosted.org> Zachary Ware <zachary.ware at gmail.com> added the comment: Note that this is suggesting to introduce a `.. source` directive, not adjust the existing `:source:` role. There's nothing preventing the use of the existing pattern in special cases, while using the new directive in the common cases. I don't have context for how much effort this would actually save translators (perhaps we could get representatives from various languages/workflows could chime in?) so it might not be worth it on other grounds, but I don't think this should be shot down just for "but sometimes" :) ---------- nosy: +zach.ware title: Docs: More surrounding text into the "source" directive -> Docs: add source directive for minor translation simplification type: -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45139> _______________________________________ From report at bugs.python.org Thu Sep 9 12:03:48 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 16:03:48 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631203428.32.0.962784152389.issue45147@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- keywords: +patch nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26679 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28259 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 12:10:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Sep 2021 16:10:33 +0000 Subject: [issue45153] Except multiple types of exceptions with OR keyword is not working In-Reply-To: <1631198150.11.0.821790716144.issue45153@roundup.psfhosted.org> Message-ID: <1631203833.17.0.903177332234.issue45153@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Expression `A or B` gets you A if A is true. If you want to catch several types of exception by one "except", use except with a tuple: except (ConnectionResetError, ConnectionAbortedError): ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45153> _______________________________________ From report at bugs.python.org Thu Sep 9 12:11:53 2021 From: report at bugs.python.org (E. Paine) Date: Thu, 09 Sep 2021 16:11:53 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1631203913.59.0.561525061712.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: It turns out the problem is a combination of the font and IDLE preview content. With the phaistos font installed, inserting the content of the "Devanagari, Tamil" or "East Asian" sections into a Tk text widget causes it to freeze. For example, the following will fail: pack [text .t] .t insert end \u0966 The reason for this still confuses me, since Tk would never default (I believe) to trying to use phaistos font (and therefore it's installation should not affect this). I will report it to the Tk team. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Thu Sep 9 12:17:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 16:17:16 +0000 Subject: [issue45139] Docs: add source directive for minor translation simplification In-Reply-To: <1631121467.16.0.546303933319.issue45139@roundup.psfhosted.org> Message-ID: <1631204236.99.0.386108249992.issue45139@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New directives introduce complexity. They should be saved for pervasive and non-trivial problems. The motivation for this change is dubious (that a translator can't easily handle a simple fixed string pattern). The OP grants that this is a "only small burden". In general, translation is a large, difficult and time consuming task. Adding this directive would not change that noticeably (changing the source text is among the easiest and most trivial subtasks). It may even make translators job more difficult because it entails knowing how to edit the directive as opposed to use basic knowledge to make a simple in-line text substitution. OTOH, there are costs. Every new directive takes time to learn and remember. This is especially problematic when the directives are specific to one project; otherwise, the documentation skills don't translate across projects. Generally, it is best to use dirt simple, standard Sphinx markup, especially for trivial tasks like this one. I do a lot of documentation work and am constantly wrestling will sphinx, many times unsuccessfully. Even among core developers, very few people already know all the directives that we already have. Making the list longer doesn't make our lives easier unless a directive is solves a challenging problem and is commonly used. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45139> _______________________________________ From report at bugs.python.org Thu Sep 9 12:31:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 16:31:34 +0000 Subject: [issue45154] Enumerate() function or class? In-Reply-To: <1631198198.04.0.262463411165.issue45154@roundup.psfhosted.org> Message-ID: <1631205094.18.0.81565394215.issue45154@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: In pure python, generators are implemented as functions. In CPython, the only way to implement them is as a class. From a user's point of view, enumerate(), map(), zip(), and filter() are used like a functions (they doesn't have non-dunder methods). Accordingly, they don't have class markup in the docs even though technically they are classes. The docs are mostly consistent in this regard and have opted for the presentation that tends to be the most helpful to users. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45154> _______________________________________ From report at bugs.python.org Thu Sep 9 12:35:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 09 Sep 2021 16:35:53 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631205353.05.0.549862460188.issue44219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 23c46778d65870784cb6d4de30f43aac62d71e73 by Miss Islington (bot) in branch '3.10': bpo-44219: Release the GIL during isatty syscalls (GH-28250) (GH-28255) https://github.com/python/cpython/commit/23c46778d65870784cb6d4de30f43aac62d71e73 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 12:37:37 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 09 Sep 2021 16:37:37 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631205457.9.0.914904204173.issue45067@roundup.psfhosted.org> Change by Senthil Kumaran <senthil at python.org>: ---------- keywords: +patch pull_requests: +26680 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28260 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 12:38:36 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 09 Sep 2021 16:38:36 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631205516.35.0.867759447225.issue45067@roundup.psfhosted.org> Senthil Kumaran <senthil at python.org> added the comment: I have created a pull request - https://github.com/python/cpython/pull/28260 Please review this. ---------- assignee: -> orsenthil versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 12:42:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 16:42:10 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631205730.38.0.38811567476.issue44219@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > In my case, the file in question is implemented as a FUSE mount which is served by the same process (different thread of course). Thus holding the GIL at this point causes a rather interesting deadlock. Since the change fixes a deadlock, I agree to backport it to 3.9 and 3.10. Thanks for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 12:44:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 09 Sep 2021 16:44:27 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631205867.41.0.77312410165.issue44219@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26681 pull_request: https://github.com/python/cpython/pull/28261 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Thu Sep 9 12:54:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 09 Sep 2021 16:54:25 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631206465.86.0.544781056177.issue45083@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: I agree with Serhiy, I consider this a bugfix. Let's raise it to "release blocker" to let Pablo decide if this should wait for 3.10.1 or get bumped up to 3.10.0. ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Thu Sep 9 13:13:07 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Sep 2021 17:13:07 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631207587.86.0.823181037809.issue45147@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Changes merged to master and 3.10. Thanks, everyone! @pablogsal: You can merge this to 3.10.0 if you see fit, but I'm going to close this issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Thu Sep 9 13:22:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 17:22:40 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1631208160.91.0.39538355155.issue44344@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: The pow() docs could use substantial updating. All of the logic for pow() is implemented in base.__pow__(exp, [mod]). Technically, it isn't restricted to numeric types, that is just a norm. The relationship between "pow(a,b)" and "a**b" is that both make the same call, a.__pow__(b). The discussion of coercion rules dates back to Python 2 where used to have a coerce() builtin. Now, the cross-type logic is buried in either in type(a).__pow__ or in type(b).__rpow__. The equivalence of pow(a, b, c) to a more efficient form of "a ** b % c" is a norm but not a requirement and is only supported by ints or third-party types. My suggestions 1st paragraphs: Stay at a high level, covering only the most common use case and simple understanding of how most people use pow(): Return *base* to the power *exp* giving the same result as ``base**exp``. If *mod* is present and all the arguments are integers, return *base* to the power *exp*, modulo *mod*. This gives the same result as ``base ** exp % mod`` but is computed much more efficiently. 2nd paragraph: Be precise about what pow() actually does, differentiating the typical case from what is actually required: The :func:`pow` function calls the base's meth:`__pow__` method falling back to the exp's meth:`__rpow__` if needed. The logic and semantics of those methods varies depending on the type. Typically, the arguments have numeric types but this is not required. For types that support the three-argument form, the usual semantics are that ``pow(b, e, m)`` is equivalent to ``a ** b % c`` but this is not required. 3rd paragraph: Cover behaviors common to int, float, and complex. 4th paragraph and later: Cover type specific behaviors (i.e. only int supports the three argument form and the other arguments must be ints as well). ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44344> _______________________________________ From report at bugs.python.org Thu Sep 9 13:24:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 17:24:26 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631208266.48.0.637442652196.issue45152@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- pull_requests: +26682 pull_request: https://github.com/python/cpython/pull/28262 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 13:34:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 17:34:07 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631208847.82.0.0475275704512.issue45152@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: I didn't know this was in the works. Can you point me to the relevant discussion about why LOAD_CONST would be split? ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 13:36:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 17:36:43 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631209003.45.0.741887296627.issue45152@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: It's related to this work: https://github.com/faster-cpython/ideas/issues/65 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 13:48:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 17:48:46 +0000 Subject: [issue39955] argparse print_help breaks when help is blank space In-Reply-To: <1584105778.75.0.565516989827.issue39955@roundup.psfhosted.org> Message-ID: <1631209726.57.0.815400431082.issue39955@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> In argparse empty choices cannot be printed in the help type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39955> _______________________________________ From report at bugs.python.org Thu Sep 9 13:53:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 17:53:38 +0000 Subject: [issue36463] python37.dll crashing 0xc000041d In-Reply-To: <1553801566.37.0.489496504409.issue36463@roundup.psfhosted.org> Message-ID: <1631210018.76.0.918446072475.issue36463@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there isn't enough information here for us to do anything about this. Also, Python 3.7 is no longer in maintenance. If you are still having this problem with a current version (>= 3.9) please create a new issue with information on how we can reproduce the problem. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36463> _______________________________________ From report at bugs.python.org Thu Sep 9 13:56:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 17:56:39 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631210199.51.0.115413580212.issue45083@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: If the change is considered as a bugfix, it can wait for the next 3.9.x and 3.10.x release. If it's considered as a feature (which is backward incompatible), it should only land in 3.10 if it's in 3.10.0, but be reverted in the 3.9 branch. Honestly, I don't care about which option is taken, I'm just worried about the consistency of branches. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Thu Sep 9 14:00:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:00:10 +0000 Subject: [issue38596] simple example give a Linux core dumped with atk-bridge In-Reply-To: <1572079504.05.0.0514921170938.issue38596@roundup.psfhosted.org> Message-ID: <1631210410.15.0.563674617646.issue38596@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 3.7 is no longer maintained. If you are still seeing crashes in a current version (>= 3.9) then please create a new issue. However, note that a bug report is more likely to get attention if it shows a bug in python, rather than just reporting that a complicated a system built on top of python is crashing. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38596> _______________________________________ From report at bugs.python.org Thu Sep 9 14:07:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:07:17 +0000 Subject: [issue38573] Not Implemented Error in stdLib HTMLParser In-Reply-To: <1571902199.4.0.291984198853.issue38573@roundup.psfhosted.org> Message-ID: <1631210837.76.0.965110957413.issue38573@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since this is an exception and not a crash. I get a different error now: >>> parser.feed(bytearray.fromhex('3c215b63612121').decode('ascii')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 110, in feed self.goahead(0) ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 178, in goahead k = self.parse_html_declaration(i) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 263, in parse_html_declaration return self.parse_marked_section(i) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 154, in parse_marked_section raise AssertionError( ^^^^^^^^^^^^^^^^^^^^^ AssertionError: unknown status keyword 'ca' in marked section ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38573> _______________________________________ From report at bugs.python.org Thu Sep 9 14:08:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:08:59 +0000 Subject: [issue32876] HTMLParser raises exception on some inputs In-Reply-To: <1519069936.36.0.467229070634.issue32876@psf.upfronthosting.co.za> Message-ID: <1631210939.98.0.159923319868.issue32876@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I get a different error now: >>> import html.parser >>> html.parser.HTMLParser().feed("<![\n") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 110, in feed self.goahead(0) ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 178, in goahead k = self.parse_html_declaration(i) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 263, in parse_html_declaration return self.parse_marked_section(i) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 144, in parse_marked_section sectName, j = self._scan_name( i+3, i ) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 390, in _scan_name raise AssertionError( ^^^^^^^^^^^^^^^^^^^^^ AssertionError: expected name token at '<![\n' ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32876> _______________________________________ From report at bugs.python.org Thu Sep 9 14:31:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:31:46 +0000 Subject: [issue24544] Race condition and crash when embedding multi-thread script In-Reply-To: <1435755929.77.0.966691943035.issue24544@psf.upfronthosting.co.za> Message-ID: <1631212306.53.0.328157862924.issue24544@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 2.7 is no longer maintained. Please create a new issue if you are having problems with this in a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24544> _______________________________________ From report at bugs.python.org Thu Sep 9 14:32:19 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 09 Sep 2021 18:32:19 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631212339.38.0.137558996379.issue45067@roundup.psfhosted.org> Senthil Kumaran <senthil at python.org> added the comment: New changeset 794430700defb913512f871b701a888aa730de81 by Senthil Kumaran in branch 'main': bpo-45067 - Verify the version of ncurses for extended color support feature usage. (GH-28260) https://github.com/python/cpython/commit/794430700defb913512f871b701a888aa730de81 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 14:32:47 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 18:32:47 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631212367.87.0.592499134466.issue45067@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26683 pull_request: https://github.com/python/cpython/pull/28263 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 14:40:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:40:24 +0000 Subject: [issue23249] test_win32 fails on aarch64 In-Reply-To: <1421401283.38.0.406623425658.issue23249@psf.upfronthosting.co.za> Message-ID: <1631212824.0.0.110633455893.issue23249@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I believe we are on libffi 3.3 now - the code on that branch looks very different from this patch. Can we close this issue? ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23249> _______________________________________ From report at bugs.python.org Thu Sep 9 14:41:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:41:49 +0000 Subject: [issue23249] test_win32 fails on aarch64 In-Reply-To: <1421401283.38.0.406623425658.issue23249@psf.upfronthosting.co.za> Message-ID: <1631212909.98.0.653460791029.issue23249@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- status: closed -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23249> _______________________________________ From report at bugs.python.org Thu Sep 9 14:51:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 18:51:30 +0000 Subject: [issue44841] ZipInfo crashes on filemode In-Reply-To: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org> Message-ID: <1631213490.97.0.457387260514.issue44841@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Crash typically means segfault or the like, not an exception. Can you provide code to create the file "test-one-dir.zip" so that we can reproduce the issue? ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44841> _______________________________________ From report at bugs.python.org Thu Sep 9 15:15:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 19:15:09 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631214909.77.0.433788913461.issue45152@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Thanks for the link. This is a worthwhile experiment. However, the potential gains will be hard to come by. The workload of LOAD_CONST is very small. After paying for the usual dispatch logic overhead, all it does is an index into a struct member and an incref. Both the co_consts table and the popular constant objects are already likely to be in the L1 data cache. ##DEBUG_LABEL: TARGET_LOAD_CONST movslq %r15d, %rax ## OpArg fetch, typically a zero code register rename movq -368(%rbp), %rcx ## 8-byte Reload to access co_consts movq 24(%rcx,%rax,8), %rax ## The actual indexing operation (3 cycles) incq (%rax) ## The incref A specialized opcode for a specific constant like None can 1) eliminate the oparg fetch (likely saving nothing), and 2) eliminate the two sequentially dependent memory access (this is a win): ##DEBUG_LABEL: TARGET_LOAD_NONE ? movq __Py_NoneStruct at GOTPCREL(%rip), rax incq (%rax) ## The incref Any more general opcode for loading small ints would still need the oparg fetch and the incref. To win, it would need to convert the oparg into an int more efficiently than the two movq steps. If the small int table is in a fixed location (not per-subinterpreter), then you can save 2 cycles with the simpler address computation: ##DEBUG_LABEL: TARGET_SMALLINT movslq %r15d, %rax ## OpArg fetch, typically a zero code register rename movq __Py_SmallInt at GOTPCREL(%rip), %rcx ## Find an array of ints movq (%rcx,%rax,8), %rax ## Cheaper address computation takes 1 cycle incq (%rax) ## The incref The 2 cycle win (intel-only) will be partially offset by the additional pressure on the L1 data cache. Right now, the co_consts is almost certainly in cache, holding only the constants that actually get used (at a rate of 8 per cache line). Accesses into a small_int array will push other data out of L1. IIRC, Serhiy already experimented with a LOAD_NONE opcode and couldn't get a measurable win. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 15:20:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 19:20:06 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631215206.0.0.355240904204.issue45152@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I?m not sure we?re hoping this to be faster, just reduce the code object size and not be slower. (Smaller code object could be faster to unmarshal). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 15:31:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Sep 2021 19:31:51 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631215911.87.0.84395499561.issue45152@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Idea for improving unmarshalling speed: Since reading PYCs is I/O bound, it may be worthwhile to compress them. When the idea came up previously, Antoine suggested choosing an algorithm with the fastest possible decompression speed (iirc, it was lzma4 at the time). This should be an easy optimization that doesn't require changing the rest of the runtime. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 15:39:15 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 09 Sep 2021 19:39:15 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631216355.94.0.908258347236.issue45067@roundup.psfhosted.org> Change by Senthil Kumaran <senthil at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 15:39:02 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 09 Sep 2021 19:39:02 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 In-Reply-To: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> Message-ID: <1631216342.33.0.0804137865367.issue45067@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset b86437bb15fbaba55f9e56661598b4d5a3db86bb by Miss Islington (bot) in branch '3.10': bpo-45067 - Verify the version of ncurses for extended color support feature usage. (GH-28260) https://github.com/python/cpython/commit/b86437bb15fbaba55f9e56661598b4d5a3db86bb ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45067> _______________________________________ From report at bugs.python.org Thu Sep 9 16:19:46 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 09 Sep 2021 20:19:46 +0000 Subject: [issue44492] Building a C extension on Big Sur and SDK v10.15 fails In-Reply-To: <1624409568.36.0.590312520398.issue44492@roundup.psfhosted.org> Message-ID: <1631218786.02.0.811055040917.issue44492@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- assignee: -> ned.deily _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44492> _______________________________________ From report at bugs.python.org Thu Sep 9 16:31:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Sep 2021 20:31:48 +0000 Subject: [issue45144] Use subtests in test_peepholer In-Reply-To: <1631146744.41.0.0401812311167.issue45144@roundup.psfhosted.org> Message-ID: <1631219508.24.0.892015249729.issue45144@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I am currently working on a feature which can be better in these cases that subTest(). It will allow to reduce the indentation level instead of increasing it. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45144> _______________________________________ From report at bugs.python.org Thu Sep 9 16:52:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 20:52:12 +0000 Subject: [issue11255] 2to3 throws AttributeError during distutils installation with -O In-Reply-To: <1298197687.53.0.332108526066.issue11255@psf.upfronthosting.co.za> Message-ID: <1631220732.19.0.306663620662.issue11255@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 3.2 is out of date, and distutils and 2to3 are both deprecated. ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue11255> _______________________________________ From report at bugs.python.org Thu Sep 9 17:03:07 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 09 Sep 2021 21:03:07 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1631221387.98.0.591780110309.issue45022@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Going to just decide that we won't backport the update. If a big enough security issue is found we can consider it, but it would have to justify the potential-but-unlikely breaking change for users who are relying on the name of the DLL. ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Thu Sep 9 17:09:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 21:09:38 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631221778.48.0.110883878281.issue9811@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch nosy: +iritkatriel nosy_count: 8.0 -> 9.0 pull_requests: +26684 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28264 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Thu Sep 9 17:10:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 21:10:23 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631221823.29.0.408887037383.issue9811@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: This issue was created 11 years ago today. Let's celebrate its anniversary by resolving it! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Thu Sep 9 17:14:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 21:14:12 +0000 Subject: [issue23249] test_win32 fails on aarch64 In-Reply-To: <1421401283.38.0.406623425658.issue23249@psf.upfronthosting.co.za> Message-ID: <1631222052.37.0.438170436728.issue23249@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Original bug report at https://bugzilla.redhat.com/show_bug.cgi?id=1174037 The bug was reported on Fedora (Linux). We do now have a multiple AArch64 buildbots running Fedora and the whole test suite now pass there. Example with "aarch64 Fedora Stable 3.x": https://buildbot.python.org/all/#/builders/125/builds/612 "0:00:03 load avg: 4.20 [ 62/427] test_ctypes passed" So yes, this issue can now be fixed ;-) FYI Python is built with --with-system-ffi on Fedora, but buildbots don't use this flag. I'm working on using --with-system-ffi on buildbots, see: https://github.com/python/buildmaster-config/pull/264 ---------- status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23249> _______________________________________ From report at bugs.python.org Thu Sep 9 17:14:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 21:14:19 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631222059.72.0.35912577607.issue9811@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Thu Sep 9 17:16:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 21:16:14 +0000 Subject: [issue23249] test_win32 fails on aarch64 In-Reply-To: <1421401283.38.0.406623425658.issue23249@psf.upfronthosting.co.za> Message-ID: <1631222174.81.0.369901722917.issue23249@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23249> _______________________________________ From report at bugs.python.org Thu Sep 9 17:20:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 21:20:35 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide: Linux kernel 5.15 regression In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1631222435.66.0.978273335626.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Python 3.10 is also affected. Example with aarch64 Fedora Rawhide 3.10: https://buildbot.python.org/all/#builders/636/builds/286 ---------- title: test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x: Linux kernel 5.15 regression -> test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide: Linux kernel 5.15 regression versions: +Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Thu Sep 9 17:29:07 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 09 Sep 2021 21:29:07 +0000 Subject: [issue39447] imaplib documentation claims that commands return a string, but they return bytes In-Reply-To: <1579897476.32.0.1859965096.issue39447@roundup.psfhosted.org> Message-ID: <1631222947.44.0.669539887029.issue39447@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: This issue was fixed in https://github.com/python/cpython/commit/c75330605d4 -- closing. ---------- nosy: +andrei.avk, kj resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39447> _______________________________________ From report at bugs.python.org Thu Sep 9 17:59:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 21:59:07 +0000 Subject: [issue10501] make_buildinfo regression with unquoted path In-Reply-To: <1290420103.87.0.191839202946.issue10501@psf.upfronthosting.co.za> Message-ID: <1631224747.9.0.600012462654.issue10501@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: There is no longer a make_buildinfo.c ---------- nosy: +iritkatriel resolution: accepted -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue10501> _______________________________________ From report at bugs.python.org Thu Sep 9 18:00:31 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 09 Sep 2021 22:00:31 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() Message-ID: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> New submission from Barry A. Warsaw <barry at python.org>: In the PEP 467 discussion, I proposed being able to use >>> (65).to_bytes() b'A' IOW, adding default arguments for the `length` and `byteorder` arguments to `int.to_bytes()` https://mail.python.org/archives/list/python-dev at python.org/message/PUR7UCOITMMH6TZVVJA5LKRCBYS4RBMR/ It occurs to me that this is (1) useful on its own merits; (2) easy to do. So I've done it. Creating this bug so I can link a PR against it. ---------- components: Interpreter Core messages: 401524 nosy: barry priority: normal severity: normal stage: patch review status: open title: Add default arguments for int.to_bytes() versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 18:09:24 2021 From: report at bugs.python.org (David Mandelberg) Date: Thu, 09 Sep 2021 22:09:24 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes Message-ID: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> New submission from David Mandelberg <david at mandelberg.org>: The code below seems to have infinite recursion in the mock.seal call with python 3.9.2. from unittest import mock class Foo: foo = 0 foo = mock.create_autospec(Foo) mock.seal(foo) ---------- components: Library (Lib) messages: 401525 nosy: dseomn priority: normal severity: normal status: open title: mock.seal has infinite recursion with int class attributes type: crash versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Thu Sep 9 18:28:13 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 09 Sep 2021 22:28:13 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631226493.91.0.546349455868.issue45155@roundup.psfhosted.org> Change by Barry A. Warsaw <barry at python.org>: ---------- keywords: +patch pull_requests: +26685 pull_request: https://github.com/python/cpython/pull/28265 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 18:37:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 22:37:07 +0000 Subject: =?utf-8?q?=5Bissue45157=5D_DTrace_on_RHEL7=2C_generated_Include/pydtrace?= =?utf-8?q?=5Fprobes=2Eh_fails_to_build=3A_error=3A_impossible_constraint_?= =?utf-8?b?aW4g4oCYYXNt4oCZ?= Message-ID: <1631227027.9.0.449949319255.issue45157@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: I modified RHEL7 configuration to build Python using --with-dtrace: argv: [b'./configure', b'--prefix', b'$(PWD)/target', b'--with-pydebug', b'--with-platlibdir=lib64', b'--enable-ipv6', b'--enable-shared', b'--with-computed-gotos=yes', b'--with-dbmliborder=gdbm:ndbm:bdb', b'--enable-loadable-sqlite-extensions', b'--with-dtrace', b'--with-lto', b'--with-ssl-default-suites=openssl', b'--without-static-libpython', b'--with-valgrind'] Problem: the generated Include/pydtrace_probes.h failed to build :-( --- /usr/bin/dtrace -o Include/pydtrace_probes.h -h -s Include/pydtrace.d sed 's/PYTHON_/PyDTrace_/' Include/pydtrace_probes.h > Include/pydtrace_probes.h.tmp mv Include/pydtrace_probes.h.tmp Include/pydtrace_probes.h (...) In file included from ./Include/pydtrace_probes.h:10:0, from ./Include/pydtrace.h:11, from Modules/gcmodule.c:33: Modules/gcmodule.c: In function ?gc_collect_main?: ./Include/pydtrace_probes.h:98:1: error: impossible constraint in ?asm? DTRACE_PROBE1 (python, gc__start, arg1) ^ ./Include/pydtrace_probes.h:109:1: error: impossible constraint in ?asm? DTRACE_PROBE1 (python, gc__done, arg1) ^ --- Full logs of AMD64 RHEL7 3.x: https://buildbot.python.org/all/#/builders/15/builds/761 In the meantime, I disabled --with-dtrace since other buildbot workers failed when dtrace was no installed. See: https://github.com/python/buildmaster-config/pull/264 Maybe it's a problem on RHEL7. Maybe the problem is that Python is built with LTO? ---------- components: Build messages: 401526 nosy: cstratak, hroncok, vstinner priority: normal severity: normal status: open title: DTrace on RHEL7, generated Include/pydtrace_probes.h fails to build: error: impossible constraint in ?asm? versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45157> _______________________________________ From report at bugs.python.org Thu Sep 9 18:37:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Sep 2021 22:37:56 +0000 Subject: =?utf-8?q?=5Bissue45157=5D_DTrace_on_RHEL7=2C_generated_Include/pydtrace?= =?utf-8?q?=5Fprobes=2Eh_fails_to_build=3A_error=3A_impossible_constraint_?= =?utf-8?b?aW4g4oCYYXNt4oCZ?= In-Reply-To: <1631227027.9.0.449949319255.issue45157@roundup.psfhosted.org> Message-ID: <1631227076.24.0.0724216364755.issue45157@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Similar error with Python 3.10, AMD64 RHEL7 3.10 logs: https://buildbot.python.org/all/#/builders/666/builds/344 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45157> _______________________________________ From report at bugs.python.org Thu Sep 9 18:41:24 2021 From: report at bugs.python.org (Anton Abrosimov) Date: Thu, 09 Sep 2021 22:41:24 +0000 Subject: [issue45158] Refactor traceback.py to make TracebackException more extensible. Message-ID: <1631227284.21.0.317045625732.issue45158@roundup.psfhosted.org> New submission from Anton Abrosimov <abrosimov.a.a at gmail.com>: 1. Move internal dependencies (`FrameSummary`, `StackSummary`) to class attributes. Reduce coupling. 2. Separate receiving, processing and presenting traceback information. How to replace `repr` with `pformat` in `FrameSummary`? def __init__(...): ... self.locals = {k: repr(v) for k, v in locals.items()} if locals else None ... 3. Move formatting templates to class attributes. 4. ... Motivation: 1. For the sake of small changes to the view, you have to rewrite the entire `TracebackException` hierarchy. Or use string parsing. 2.1. During development, I want to see as much information as possible. 2.2. During production, displaying unnecessary information can lead to security problems. 2.3. In large projects, it is more convenient to use JSON for further processing in the system environment. I have not found any PEPs describing `traceback.py`. I can make a prototype of the changes if anyone is interested. ---------- components: Library (Lib) messages: 401528 nosy: abrosimov.a.a priority: normal severity: normal status: open title: Refactor traceback.py to make TracebackException more extensible. type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45158> _______________________________________ From report at bugs.python.org Thu Sep 9 19:05:39 2021 From: report at bugs.python.org (Anton Abrosimov) Date: Thu, 09 Sep 2021 23:05:39 +0000 Subject: [issue45158] Refactor traceback.py to make TracebackException more extensible. In-Reply-To: <1631227284.21.0.317045625732.issue45158@roundup.psfhosted.org> Message-ID: <1631228739.76.0.585776900555.issue45158@roundup.psfhosted.org> Anton Abrosimov <abrosimov.a.a at gmail.com> added the comment: I think now is a good time for such a change. `FrameSummary`,` StackSummary` and `TracebackException` can be left backward compatible. And PEP 657 already breaks backward compatibility of output parsers. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45158> _______________________________________ From report at bugs.python.org Thu Sep 9 19:07:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:07:43 +0000 Subject: [issue35301] python.exe crashes - lzma? In-Reply-To: <1542982873.09.0.788709270274.issue35301@psf.upfronthosting.co.za> Message-ID: <1631228863.33.0.376130195923.issue35301@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: This sounds like it may very well be memory corruption by BOINC. In any case, Python 3.6.3 is no longer maintained. ---------- nosy: +iritkatriel resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35301> _______________________________________ From report at bugs.python.org Thu Sep 9 19:11:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:11:14 +0000 Subject: [issue33085] *** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 *** In-Reply-To: <1521183590.06.0.467229070634.issue33085@psf.upfronthosting.co.za> Message-ID: <1631229074.88.0.0353011025334.issue33085@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: There isn't enough information here for us to do anything about this, and in any case Python 3.6 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9) and can provide more information about how to reproduce it. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33085> _______________________________________ From report at bugs.python.org Thu Sep 9 19:19:21 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 09 Sep 2021 23:19:21 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631229561.07.0.380106501239.issue45155@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 19:19:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:19:45 +0000 Subject: [issue30991] test_ctypes , test_dbm and test_ssl fail on arm64 (aarch64) architecture In-Reply-To: <1500733945.72.0.618200195446.issue30991@psf.upfronthosting.co.za> Message-ID: <1631229585.48.0.834591166753.issue30991@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 3.6 is no longer maintained. Please create a new issue if you are having problems with this on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30991> _______________________________________ From report at bugs.python.org Thu Sep 9 19:20:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:20:43 +0000 Subject: [issue30991] test_ctypes , test_dbm and test_ssl fail on arm64 (aarch64) architecture In-Reply-To: <1500733945.72.0.618200195446.issue30991@psf.upfronthosting.co.za> Message-ID: <1631229643.54.0.152025898432.issue30991@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Changing type since test failures are not crash. ---------- type: crash -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30991> _______________________________________ From report at bugs.python.org Thu Sep 9 19:25:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:25:16 +0000 Subject: [issue31100] unable to open python on Windows In-Reply-To: <1501636029.03.0.741480027722.issue31100@psf.upfronthosting.co.za> Message-ID: <1631229916.02.0.431367308012.issue31100@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Is there anything more we can do on this or can we close it? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31100> _______________________________________ From report at bugs.python.org Thu Sep 9 19:29:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 09 Sep 2021 23:29:04 +0000 Subject: [issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130 In-Reply-To: <1330434369.23.0.116359457055.issue14150@psf.upfronthosting.co.za> Message-ID: <1631230144.72.0.628436223069.issue14150@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 2.7 is no longer maintained and the current configure files no longer have the lines that the patch modifies. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue14150> _______________________________________ From report at bugs.python.org Thu Sep 9 19:33:28 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 09 Sep 2021 23:33:28 +0000 Subject: [issue45151] Logger library with task scheduler In-Reply-To: <1631195248.81.0.804167801454.issue45151@roundup.psfhosted.org> Message-ID: <1631230408.6.0.688921679387.issue45151@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Also, can you include your full task definition? There are a lot of options there which could cause it to launch in a different working directory (which will mess with your relative paths) or as a different user (which could mess with whether you can import your libraries). I think it's possible to export the task definition as XML. Copy/pasting that here will be fine (not as an attachment, please, we just need to read it). It's also difficult to collect standard output, so you may want to try adding something like "sys.stdout = sys.stderr = open(r'C:\Users\Public\Public Documents\log.txt', 'w')" to try and collect any output that you may be missing. The full path to the file is important, and it will need to be somewhere that most accounts can write. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45151> _______________________________________ From report at bugs.python.org Thu Sep 9 19:37:29 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 09 Sep 2021 23:37:29 +0000 Subject: [issue31100] unable to open python on Windows In-Reply-To: <1501636029.03.0.741480027722.issue31100@psf.upfronthosting.co.za> Message-ID: <1631230649.62.0.181473258571.issue31100@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: At this point, this isn't a helpful bug report anymore. ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue31100> _______________________________________ From report at bugs.python.org Thu Sep 9 20:29:47 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Sep 2021 00:29:47 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631233787.84.0.115851240602.issue45155@roundup.psfhosted.org> Nick Coghlan <ncoghlan at gmail.com> added the comment: Rather than defaulting to sys.byteorder, could the byte order default to None and only be optional when not needed? (input value fits in a single byte, output is a single byte) Otherwise the difference in defaults between this method and the struct module (network byte order rather than host byte order) could be very confusing. ---------- nosy: +ncoghlan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 20:34:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 10 Sep 2021 00:34:35 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631234075.05.0.156723266131.issue45152@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Raymond, I am super grateful that you are showing us the assembly language. That's the kind of thing we need to do more of if we want to be successful. (In this case I'm not surprised by the outcome, but I have never studied x86 assembly and this was a nice explanation.) Regarding speeding up marshal, I am not at all convinced that this is still I/O bound. Raymond, do you have data about this? In my own informal experiments I believe the main cost I found was (a) stat() operations, and (b) the allocation and initialization of a large number of objects. In my (limited) understanding, "freezing" modules (like in bpo-45020) is mostly a win because it avoids stat() operations (and listdir(), too). But it would be nice to do a detailed experiment to get real facts here. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Thu Sep 9 20:35:40 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Sep 2021 00:35:40 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631234140.47.0.054662020846.issue45155@roundup.psfhosted.org> Nick Coghlan <ncoghlan at gmail.com> added the comment: Never mind, I've forced network byte order in struct strings for so long I had forgotten that native byte order was also the default there. Hence I withdraw that objection. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 20:57:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 00:57:42 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631235462.8.0.779462239516.issue45155@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: So (128).to_bytes() will raise an error, right? I afraid also that it will lead to some programs working correctly only on platforms with the most common byte order, just because authors are not aware of byte ordering. Currently the interface forces programmers to read something about byte ordering. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 21:01:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 01:01:53 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631235713.74.0.829670006549.issue45155@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Ah, signed=False by default, so (128).to_bytes() will work. But I still worry that it can provoke writing more errorprone code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 21:06:07 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 10 Sep 2021 01:06:07 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631235713.74.0.829670006549.issue45155@roundup.psfhosted.org> Message-ID: <3A38BBED-556D-42A1-A4EA-72A88D367976@python.org> Barry A. Warsaw <barry at python.org> added the comment: > Ah, signed=False by default, so (128).to_bytes() will work. But I still worry that it can provoke writing more errorprone code. Can you elaborate on that? Obviously no existing code will change behavior. I really don?t expect people to write `(128).to_bytes(signed=True)` by accident. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 21:12:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 01:12:01 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631236321.94.0.928303992545.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Perhaps instead of the system byte ordering, choose one for the default so that default encoding/decoding will work cross platform. I think "little" is the most common (intel and arm). ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 21:15:17 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 10 Sep 2021 01:15:17 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631236321.94.0.928303992545.issue45155@roundup.psfhosted.org> Message-ID: <7FA8BDBE-B6B7-48ED-AC8C-3D429B03CF8C@python.org> Barry A. Warsaw <barry at python.org> added the comment: For the common case where you?re using all defaults, it won?t matter. byteorder doesn?t matter when length=1. > On Sep 9, 2021, at 18:12, Raymond Hettinger <report at bugs.python.org> wrote: > > > Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > > Perhaps instead of the system byte ordering, choose one for the default so that default encoding/decoding will work cross platform. I think "little" is the most common (intel and arm). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 9 22:42:22 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 10 Sep 2021 02:42:22 +0000 Subject: [issue45154] Enumerate() function or class? In-Reply-To: <1631198198.04.0.262463411165.issue45154@roundup.psfhosted.org> Message-ID: <1631241742.82.0.669353640852.issue45154@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Thank you Raymond for the explanation. I didn't realise that there was a technical reason why built-in generators had to be implemented as classes in CPython. Sanmitha's question was already discussed answered here: https://discuss.python.org/t/enumerate-function-or-class/10504/1 ---------- nosy: +steven.daprano _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45154> _______________________________________ From report at bugs.python.org Thu Sep 9 22:51:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 02:51:15 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1631242275.31.0.538490363275.issue45024@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in branch 'main': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) https://github.com/python/cpython/commit/62fa613f6a6e872723505ee9d56242c31a654a9d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Thu Sep 9 22:51:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 02:51:15 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1631242275.45.0.656285547664.issue23864@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in branch 'main': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) https://github.com/python/cpython/commit/62fa613f6a6e872723505ee9d56242c31a654a9d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Thu Sep 9 22:52:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 02:52:01 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1631242321.23.0.648129253293.issue45024@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26686 pull_request: https://github.com/python/cpython/pull/28266 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Thu Sep 9 22:52:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 02:52:01 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1631242321.39.0.647666894987.issue23864@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +26687 pull_request: https://github.com/python/cpython/pull/28266 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Thu Sep 9 23:24:42 2021 From: report at bugs.python.org (Dave Tapley) Date: Fri, 10 Sep 2021 03:24:42 +0000 Subject: [issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type In-Reply-To: <1579866520.75.0.652812484582.issue39442@roundup.psfhosted.org> Message-ID: <1631244282.48.0.830710634967.issue39442@roundup.psfhosted.org> Dave Tapley <dave at tapley.com> added the comment: I don't know if it helps, but I just ran in to this when I followed the advice at (1) because I wanted to type hint a method with the type of the enclosing class. This broke a package I'm working on in parallel (2) because it uses dataclasses.fields internally. I'm not sure what the advice would be here, should my package detect if the caller has `from __future__ import annotations` and do something? (1) https://stackoverflow.com/questions/33533148/how-do-i-type-hint-a-method-with-the-type-of-the-enclosing-class/33533514#33533514 (2) https://pypi.org/project/dataclasses-configobj/ ---------- nosy: +davetapley _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39442> _______________________________________ From report at bugs.python.org Thu Sep 9 23:58:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 03:58:55 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1631246335.89.0.0978619213711.issue45024@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) in branch '3.10': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) (GH-28266) https://github.com/python/cpython/commit/89edd18779e382c5fa7f57722b0b897a907ed2c4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Thu Sep 9 23:58:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 03:58:56 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1631246336.11.0.0826593431759.issue23864@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) in branch '3.10': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) (GH-28266) https://github.com/python/cpython/commit/89edd18779e382c5fa7f57722b0b897a907ed2c4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Thu Sep 9 23:59:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 03:59:35 +0000 Subject: [issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs. In-Reply-To: <1428145067.47.0.0726533343331.issue23864@psf.upfronthosting.co.za> Message-ID: <1631246375.03.0.123956017626.issue23864@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- assignee: docs at python -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23864> _______________________________________ From report at bugs.python.org Fri Sep 10 00:00:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 04:00:18 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1631246418.18.0.275031465923.issue45024@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- assignee: docs at python -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45024> _______________________________________ From report at bugs.python.org Fri Sep 10 00:04:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Sep 2021 04:04:15 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631246655.52.0.530354993395.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Serhiy is likely thinking of other the other cases. Prior to this discussion, the principal use for to_bytes and from_bytes was for integers larger than a single byte. If we're going to add a *byteorder* default, it needs to make sense for those cases as well. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 00:23:52 2021 From: report at bugs.python.org (Christopher Brichford) Date: Fri, 10 Sep 2021 04:23:52 +0000 Subject: [issue45159] data_received called on protocol after call to pause_reading on ssl transport Message-ID: <1631247832.37.0.646410094935.issue45159@roundup.psfhosted.org> New submission from Christopher Brichford <chrisb at farmersbusinessnetwork.com>: An SSL connection created with loop.create_connection may have data_received called on its protocol after pause_reading has been called on the transport. If an application has a protocol whose data_received method calls pause_reading on the transport then there is a chance that the data_received method will be called again before the application calls resume_reading on the transport. That existing implementation of pause_reading at: https://github.com/python/cpython/blob/62fa613f6a6e872723505ee9d56242c31a654a9d/Lib/asyncio/sslproto.py#L335 calls pause_reading on the underlying socket transport, which is correct. However, there is a loop in the SSLProtocol's data_received method: https://github.com/python/cpython/blob/62fa613f6a6e872723505ee9d56242c31a654a9d/Lib/asyncio/sslproto.py#L335 If the loop referenced above has more than one iteration then there is a chance that the application protocol's data_received method could call pause_reading on the transport. If that happens on any iteration of the loop other than the last iteration, then the SSLProtocol's data_received method will call the application protocol's data_received method when it should not. Stealing uvloop's asyncio ssl implementation would resolve this bug: https://bugs.python.org/issue44011 ---------- components: asyncio messages: 401553 nosy: asvetlov, chrisb2, yselivanov priority: normal severity: normal status: open title: data_received called on protocol after call to pause_reading on ssl transport type: behavior versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45159> _______________________________________ From report at bugs.python.org Fri Sep 10 00:42:35 2021 From: report at bugs.python.org (paul j3) Date: Fri, 10 Sep 2021 04:42:35 +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: <1631248955.73.0.30170549308.issue41255@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: In https://stackoverflow.com/questions/69108632/unable-to-catch-exception-error-for-argparse we found that `exit_on_error` does not work when the error occurs in a subparser. Unless someone wants to take time to get this right, I think this feature should be removed. It's too buggy. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41255> _______________________________________ From report at bugs.python.org Fri Sep 10 01:35:02 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 10 Sep 2021 05:35:02 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631252102.17.0.388912202676.issue45155@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: > choose one for the default so that default encoding/decoding will work cross platform. I think "little" is the most common (intel and arm). Raymond, please don't do this. We already have a "sensible default" in a network context, and it is big endian. Having another "sensible default" opposite to the previous one is really no way to ensure interoperability. (https://xkcd.com/927/ only becomes more ridiculous when the number in question is 2.:) I don't want to think about whether the way machines A and B exchange data can be called "a network" or not. Of course, having the byteorder optional when there's only one (unsigned) byte is good. ---------- nosy: +veky _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 03:03:59 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 10 Sep 2021 07:03:59 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631257439.99.0.904568595094.issue45155@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: I'd also really like to avoid a system-dependent default. The danger is that code of the form some_externally_supplied_integer.to_bytes(length=4) can be written and thoroughly tested, only to fail unexpectedly some time later when that code happens to meet a big-endian machine. In most real-world cases with input length >= 1, it's unlikely that the system byteorder is the right thing, especially for from_bytes: what you need to know is what endianness the integer was encoded with, and that's not likely to be well correlated with the endianness that the machine you're running on right now happens to be using. (The choice of default obviously doesn't matter in cases where you're encoding and decoding on the same system, but there are going to be plenty of cases where that's not true.) This is essentially the same issue that PEP 597 starts to address with `open(filename)` with no encoding specified. That system-specific default encoding has caused us real issues in production code. ---------- nosy: +mark.dickinson _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 03:13:00 2021 From: report at bugs.python.org (fhdrsdg) Date: Fri, 10 Sep 2021 07:13:00 +0000 Subject: [issue45160] ttk.OptionMenu radiobuttons change variable value twice Message-ID: <1631257980.33.0.506661911605.issue45160@roundup.psfhosted.org> New submission from fhdrsdg <n00rbert at gmail.com>: Found when trying to answer this SO question: https://stackoverflow.com/questions/53171384/tkinter-function-repeats-itself-twice-when-ttk-widgets-are-engaged The ttk.OptionMenu uses radiobuttons for the dropdown menu, whereas the tkinter.OptionMenu uses commands. Both of them use `_setit` as command, presumably first used for tkinter and then copied to the ttk implementation. The `_setit` does two things: changing the associated `variable` and calling the associated callback function. This is needed for the tkinter.OptionMenu since commands don't support changing a `variable`. However, for the ttk.OptionMenu an additional reference to the variable was added to the radiobutton following this issue: https://bugs.python.org/issue25684. This was needed to group radiobuttons, but now leads to the variable being changed twice: once by the radiobutton and once through `_setit`. When tracing the variable this leads to the tracing callback being called twice on only one change of the OptionMenu. The solution is to not use `_setit` for the radiobutton command but instead just use `command=self._callback` ---------- components: Tkinter messages: 401557 nosy: fhdrsdg priority: normal severity: normal status: open title: ttk.OptionMenu radiobuttons change variable value twice type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45160> _______________________________________ From report at bugs.python.org Fri Sep 10 03:34:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 10 Sep 2021 07:34:18 +0000 Subject: [issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type In-Reply-To: <1579866520.75.0.652812484582.issue39442@roundup.psfhosted.org> Message-ID: <1631259258.24.0.270958956121.issue39442@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: I think pydantic approach is the best practice. See https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ ---------- nosy: +methane _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39442> _______________________________________ From report at bugs.python.org Fri Sep 10 03:45:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 07:45:36 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631259936.62.0.967959135692.issue45152@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: >From my experience, the largest cost in importing module (after I/O) is for creating classes, especially classes with complex creation code: enums and dataclasses (and namedtuples in past, but they were significanly optimized since). For I/O, would using zipimport or any other container help? It should reduce the number of stats and opens and allow to use compression. As for increasing performance of demarshallization, it is already very fast (all is read from memory buffers, all repeated objects are cached). Switching to "wordcode" (32- or 64- bit instructions) and aligning all objects at the boundary of 4-8 bytes can marginally increase decoding speed, but it needs testing. Also more optimal using of references (like pickletools.optimize()) can reduce unmarshalling time at the cost of increasing marshalling time and memory consumption. It can also help with deterministic marshalling. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Fri Sep 10 03:48:20 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 10 Sep 2021 07:48:20 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631260100.52.0.00481104567541.issue45155@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Exactly, a platform-dependent default is a bad idea. A default allows using the function without the code author & reviewer even being *aware* that there is a choice, and that is dangerous. ---------- nosy: +petr.viktorin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 04:08:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 10 Sep 2021 08:08:43 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631261323.0.0.455254093006.issue45126@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Updated title to include sqlite3.Cursor as well, since cursors and connections are very much entwined. ---------- title: [sqlite3] cleanup and harden connection init -> [sqlite3] cleanup and harden Connection and Cursor __init__ _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Fri Sep 10 04:13:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 08:13:48 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631261628.01.0.0174685999083.issue45152@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: > (b) the allocation and initialization of a large number of objects Yes, when I profiled import GC showed up as 20-30%. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Fri Sep 10 04:38:22 2021 From: report at bugs.python.org (Sylvain Marie) Date: Fri, 10 Sep 2021 08:38:22 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1631263102.08.0.316162947386.issue44452@roundup.psfhosted.org> Sylvain Marie <sylvain.marie at schneider-electric.com> added the comment: +1 on this, I am totally in line with the original post. The / operator semantics should not imply any notion of drive or of "cd" command on a shell. It should simply stick to "concatenate", i.e. "create child path" (and actually this is what the doc states https://docs.python.org/3/library/pathlib.html#operators ) Thanks Zbyszek for putting this on the table ! ---------- nosy: +smarie _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44452> _______________________________________ From report at bugs.python.org Fri Sep 10 04:40:03 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 10 Sep 2021 08:40:03 +0000 Subject: [issue45161] _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build Message-ID: <1631263203.32.0.990187656459.issue45161@roundup.psfhosted.org> New submission from Ronald Oussoren <ronaldoussoren at mac.com>: The symbol _Py_DecodeUTF8_surrogateescape is not exported from Python.framework on macOS in Python 3.10. The symbol was exported in earlier versions of 3.x. I'm not sure if this was intentional, so far I haven't been able to find when this was changed. This change breaks py2app which uses _Py_DecodeUTF8_surrogateescape to convert the C argv array to an array of 'wchar_t*' for use with Python's C API. ---------- components: C API, macOS messages: 401564 nosy: ned.deily, ronaldoussoren priority: normal severity: normal status: open title: _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45161> _______________________________________ From report at bugs.python.org Fri Sep 10 04:55:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 10 Sep 2021 08:55:22 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1631264122.02.0.915063635941.issue43853@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Serhiy, I believe I've addressed your review remarks on PR 27642. Would you mind taking a look at it again if you have time? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43853> _______________________________________ From report at bugs.python.org Fri Sep 10 05:28:11 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 10 Sep 2021 09:28:11 +0000 Subject: [issue45161] _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build In-Reply-To: <1631263203.32.0.990187656459.issue45161@roundup.psfhosted.org> Message-ID: <1631266091.31.0.912313338491.issue45161@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: I've switched py2app to Py_DecodeLocale, which is a public API introduced in 3.5 to accomplish the same task. I'm leaving the issue open in case hiding the symbol is unintentional. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45161> _______________________________________ From report at bugs.python.org Fri Sep 10 06:08:50 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 10 Sep 2021 10:08:50 +0000 Subject: [issue45160] ttk.OptionMenu radiobuttons change variable value twice In-Reply-To: <1631257980.33.0.506661911605.issue45160@roundup.psfhosted.org> Message-ID: <1631268530.71.0.142665441299.issue45160@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: Thank you for reporting this issue (and doing your research!). I don't think we could use `command=self._callback` since this wouldn't pass the new value, but something like `command=lambda val=val: self._callback(val)` would work perfectly. Would you like to open a pull request for this (with accompanying news entry and test), or would you rather I did it? ---------- nosy: +epaine, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45160> _______________________________________ From report at bugs.python.org Fri Sep 10 06:15:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 10:15:06 +0000 Subject: [issue45162] Remove old deprecated unittest features Message-ID: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: The proposed PR removes the following unittest features: * "fail*" and "assert*" aliases of TestCase methods. * Broken from start TestCase method assertDictContainsSubset(). * Ignored TestLoader.loadTestsFromModule() parameter use_load_tests. * Old alias _TextTestResult of TextTestResult. Most features were deprecated in 3.2, "fail*" methods in 3.1, assertNotRegexpMatches in 3.5. They were kept mostly for compatibility with 2.7 (although some of them were new in Python 3 and not compatible with 2.7). Using deprecated assertEquals instead of assertEqual is a common error which we need to fix regularly, so removing deprecated features will not only make the current code clearer, but save as from future errors. ---------- components: Library (Lib) messages: 401568 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Remove old deprecated unittest features type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45162> _______________________________________ From report at bugs.python.org Fri Sep 10 06:17:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 10:17:22 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1631269042.18.0.0406219350476.issue45162@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45162> _______________________________________ From report at bugs.python.org Fri Sep 10 06:23:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 10:23:10 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1631269390.28.0.683741575631.issue45162@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26688 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28268 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45162> _______________________________________ From report at bugs.python.org Fri Sep 10 06:45:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 10:45:55 +0000 Subject: [issue16591] RUNSHARED wrong for OSX no framework In-Reply-To: <1354390993.26.0.328076404417.issue16591@psf.upfronthosting.co.za> Message-ID: <1631270755.04.0.202801167595.issue16591@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> many distutils tests fail when run from the installed location _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue16591> _______________________________________ From report at bugs.python.org Fri Sep 10 06:50:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 10:50:49 +0000 Subject: [issue21658] __m128, can't build 3.4.1 with intel 14.0.0 In-Reply-To: <1401874255.53.0.168864202018.issue21658@psf.upfronthosting.co.za> Message-ID: <1631271049.77.0.414025741166.issue21658@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate superseder: -> Intel icc 9.1 does not support __int128_t used by ctypes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21658> _______________________________________ From report at bugs.python.org Fri Sep 10 07:02:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Sep 2021 11:02:21 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1631271741.28.0.742015271083.issue43592@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: FYI the test is still failing with the same error on the billenstein-macos builder worker, x86-64 macOS 3.10: https://buildbot.python.org/all/#/builders/681/builds/370 "OSError: [Errno 24] Too many open files" ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43592> _______________________________________ From report at bugs.python.org Fri Sep 10 07:06:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Sep 2021 11:06:54 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631272014.58.0.175676511772.issue45155@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I dislike the idea of adding a default length to int.to_bytes(). The length changes the meaning of the output: >>> (1).to_bytes(2, 'big') b'\x00\x01' >>> (1).to_bytes(1, 'big') b'\x01' If the intent is to "magically cast an integer to a byte strings", having a fixed length of 1 doesn't help: >>> (1000).to_bytes(1, "big") OverflowError: int too big to convert If the intent is to create a bytes string of length 1, I'm not sure that "re-using" this existing API for that is a good idea. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 07:30:29 2021 From: report at bugs.python.org (David CARLIER) Date: Fri, 10 Sep 2021 11:30:29 +0000 Subject: [issue45163] Haiku build fix Message-ID: <1631273429.49.0.723757834418.issue45163@roundup.psfhosted.org> Change by David CARLIER <devnexen at gmail.com>: ---------- components: Library (Lib) nosy: devnexen priority: normal pull_requests: 26689 severity: normal status: open title: Haiku build fix type: compile error versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45163> _______________________________________ From report at bugs.python.org Fri Sep 10 07:45:38 2021 From: report at bugs.python.org (daniel capelle) Date: Fri, 10 Sep 2021 11:45:38 +0000 Subject: [issue45164] int.to_bytes() Message-ID: <1631274338.6.0.95342526397.issue45164@roundup.psfhosted.org> New submission from daniel capelle <daniel at etrics.de>: for example check: (6500).to_bytes(2, 'big') result is: b'\x19d' but was expected to be: b'\x1964' since ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up. ---------- messages: 401571 nosy: hypnoticum priority: normal severity: normal status: open title: int.to_bytes() type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45164> _______________________________________ From report at bugs.python.org Fri Sep 10 07:53:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 11:53:14 +0000 Subject: [issue45164] int.to_bytes() In-Reply-To: <1631274338.6.0.95342526397.issue45164@roundup.psfhosted.org> Message-ID: <1631274794.22.0.366116015254.issue45164@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: b'\x1964' is a 3-bytes bytes object. >>> b = b'\x1964' >>> len(b) 3 >>> b[0], b[1], b[2] (25, 54, 52) What you what to get is b'\x19\x64'. And it is a different writing of b'\x19d', because b'\x64' is the same as b'd'. >>> b'\x19\x64' b'\x19d' ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45164> _______________________________________ From report at bugs.python.org Fri Sep 10 07:59:01 2021 From: report at bugs.python.org (daniel capelle) Date: Fri, 10 Sep 2021 11:59:01 +0000 Subject: [issue45164] int.to_bytes() In-Reply-To: <1631274338.6.0.95342526397.issue45164@roundup.psfhosted.org> Message-ID: <1631275141.9.0.987052537141.issue45164@roundup.psfhosted.org> daniel capelle <daniel at etrics.de> added the comment: for example check: (6500).to_bytes(2, 'big') result is: b'\x19d' but was expected to be: b'\x19\x64' since ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45164> _______________________________________ From report at bugs.python.org Fri Sep 10 08:15:49 2021 From: report at bugs.python.org (daniel capelle) Date: Fri, 10 Sep 2021 12:15:49 +0000 Subject: [issue45164] int.to_bytes() In-Reply-To: <1631274338.6.0.95342526397.issue45164@roundup.psfhosted.org> Message-ID: <1631276149.05.0.819859005302.issue45164@roundup.psfhosted.org> daniel capelle <daniel at etrics.de> added the comment: An ASCII representation is shown instead of the hexadecimal value, if there is any. I was not aware this is an intended behaviour. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45164> _______________________________________ From report at bugs.python.org Fri Sep 10 08:23:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 12:23:24 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods In-Reply-To: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> Message-ID: <1631276604.01.0.762024188834.issue45132@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26690 pull_request: https://github.com/python/cpython/pull/28270 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Fri Sep 10 08:26:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 12:26:22 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631276782.34.0.44686861028.issue40563@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 707137b8637feef37b2e06a851fdca9d1b945861 by Henry-Joseph Aud?oud in branch 'main': bpo-40563: Support pathlike objects on dbm/shelve (GH-21849) https://github.com/python/cpython/commit/707137b8637feef37b2e06a851fdca9d1b945861 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Fri Sep 10 08:38:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 12:38:18 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1631277498.32.0.113302110067.issue40563@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you for your contribution, Hakan, Henry-Joseph. Sorry, David, there was already a PR, and it was not dead, it just waited for a coredev review. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40563> _______________________________________ From report at bugs.python.org Fri Sep 10 08:40:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Sep 2021 12:40:15 +0000 Subject: [issue45132] Remove deprecated __getitem__ methods In-Reply-To: <1631039735.38.0.446517893584.issue45132@roundup.psfhosted.org> Message-ID: <1631277615.42.0.00270046489336.issue45132@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 17a1b3e63a5db4e581c0ef52751df2314f7249fa by Serhiy Storchaka in branch 'main': bpo-45132: Fix the reStructuredText markup error. (GH-28270) https://github.com/python/cpython/commit/17a1b3e63a5db4e581c0ef52751df2314f7249fa ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45132> _______________________________________ From report at bugs.python.org Fri Sep 10 08:55:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 12:55:25 +0000 Subject: [issue21658] __m128, can't build 3.4.1 with intel 14.0.0 In-Reply-To: <1401874255.53.0.168864202018.issue21658@psf.upfronthosting.co.za> Message-ID: <1631278525.83.0.292987624793.issue21658@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21658> _______________________________________ From report at bugs.python.org Fri Sep 10 09:45:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 13:45:35 +0000 Subject: [issue23575] MIPS64 needs ffi's n32.S In-Reply-To: <1425400037.86.0.872792301422.issue23575@psf.upfronthosting.co.za> Message-ID: <1631281535.34.0.613945429977.issue23575@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The code has changed since this issue was created - I can't find the file that the patch modifies nor the code it contains (I searched for ffi_platforms and MIPS_LINUX). Please create a new issue if you are seeing issues like this on a current python version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23575> _______________________________________ From report at bugs.python.org Fri Sep 10 10:11:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 14:11:10 +0000 Subject: [issue27491] Errors when building with UNICODE character set In-Reply-To: <1468301219.72.0.359104811522.issue27491@psf.upfronthosting.co.za> Message-ID: <1631283070.84.0.743578363356.issue27491@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I compared the patch with the current codebase and most of it is out of date. Minmin, are you still seeing these problems on a current version (>= 3.9)? If so, please report: 1. Exactly what you did, and which system/compiler you are using 2. What the output was 3. If you can, the patch to fix the issue ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27491> _______________________________________ From report at bugs.python.org Fri Sep 10 10:33:57 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 10 Sep 2021 14:33:57 +0000 Subject: [issue25625] "chdir" Contex manager for pathlib In-Reply-To: <1447523143.32.0.921942004004.issue25625@psf.upfronthosting.co.za> Message-ID: <1631284437.12.0.845390638669.issue25625@roundup.psfhosted.org> Change by Filipe La?ns <lains at riseup.net>: ---------- pull_requests: +26691 pull_request: https://github.com/python/cpython/pull/28271 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25625> _______________________________________ From report at bugs.python.org Fri Sep 10 10:43:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 14:43:09 +0000 Subject: [issue27509] Some tests breaks PGO build on Windows In-Reply-To: <1468478211.0.0.475693084569.issue27509@psf.upfronthosting.co.za> Message-ID: <1631284989.85.0.744551584263.issue27509@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 3.5 is no longer in maintenance. Please create a new issue if you are still seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27509> _______________________________________ From report at bugs.python.org Fri Sep 10 10:54:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 14:54:34 +0000 Subject: [issue877121] configure detects incorrect compiler optimization Message-ID: <1631285674.59.0.400269775758.issue877121@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue877121> _______________________________________ From report at bugs.python.org Fri Sep 10 10:59:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 14:59:27 +0000 Subject: [issue33347] zlibmodule undefined reference In-Reply-To: <1524567960.98.0.682650639539.issue33347@psf.upfronthosting.co.za> Message-ID: <1631285967.15.0.287800465425.issue33347@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The report only shows output for 2.7. Is this issue really relevant to 3.x? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33347> _______________________________________ From report at bugs.python.org Fri Sep 10 11:05:22 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 10 Sep 2021 15:05:22 +0000 Subject: [issue42119] Error when debugging logging.FileHandler subclass __init__ method In-Reply-To: <1603384667.68.0.88562918356.issue42119@roundup.psfhosted.org> Message-ID: <1631286322.82.0.504723081989.issue42119@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- nosy: +kj resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42119> _______________________________________ From report at bugs.python.org Fri Sep 10 11:10:56 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 10 Sep 2021 15:10:56 +0000 Subject: [issue45165] alighment format for nullable values Message-ID: <1631286656.15.0.899331692277.issue45165@roundup.psfhosted.org> New submission from Anthony Sottile <asottile at umich.edu>: currently this works correctly: ``` >>> '%8s %8s' % (None, 1) ' None 1' ``` but conversion to f-string fails: ``` >>> f'{None:>8} {1:>8}' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported format string passed to NoneType.__format__ ``` my proposal is to implement alignment `__format__` for `None` following the same as for `str` for alignment specifiers ---------- components: Interpreter Core messages: 401582 nosy: Anthony Sottile priority: normal severity: normal status: open title: alighment format for nullable values type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45165> _______________________________________ From report at bugs.python.org Fri Sep 10 11:39:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 10 Sep 2021 15:39:04 +0000 Subject: [issue45165] alighment format for nullable values In-Reply-To: <1631286656.15.0.899331692277.issue45165@roundup.psfhosted.org> Message-ID: <1631288344.32.0.828535789445.issue45165@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Why would you only want alignment, and not all string formatting options? And if that's the case, just convert it to a string: >>> f'{None!s:>8} {1:>8}' ' None 1' ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45165> _______________________________________ From report at bugs.python.org Fri Sep 10 11:39:24 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 10 Sep 2021 15:39:24 +0000 Subject: [issue45165] alighment format for nullable values In-Reply-To: <1631286656.15.0.899331692277.issue45165@roundup.psfhosted.org> Message-ID: <1631288364.14.0.842802004326.issue45165@roundup.psfhosted.org> Change by Eric V. Smith <eric at trueblade.com>: ---------- type: behavior -> enhancement versions: -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45165> _______________________________________ From report at bugs.python.org Fri Sep 10 11:51:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 15:51:53 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631289113.24.0.419353501705.issue44219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 296b7100705ef52aece3378b0ae42c33a58526e1 by ?ukasz Langa in branch 'main': bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261) https://github.com/python/cpython/commit/296b7100705ef52aece3378b0ae42c33a58526e1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Fri Sep 10 11:51:55 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 15:51:55 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631289115.21.0.788957099182.issue44219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26693 pull_request: https://github.com/python/cpython/pull/28275 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Fri Sep 10 11:51:50 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 15:51:50 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631289110.98.0.44485013647.issue44219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26692 pull_request: https://github.com/python/cpython/pull/28274 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Fri Sep 10 11:53:50 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 15:53:50 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631289230.03.0.107206987076.issue44964@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26694 pull_request: https://github.com/python/cpython/pull/28276 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Fri Sep 10 11:53:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 15:53:45 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631289225.94.0.635785402576.issue44964@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ab327f2929589407595a3de95727c8ab34ddd4af by Pablo Galindo Salgado in branch 'main': bpo-44964: Correct the note about the f_lasti field (GH-28208) https://github.com/python/cpython/commit/ab327f2929589407595a3de95727c8ab34ddd4af ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Fri Sep 10 11:55:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 15:55:08 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1631289308.64.0.48828637086.issue25894@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f0f29f328d8b4568e8c0d4c55c7d120d96f80911 by Serhiy Storchaka in branch 'main': bpo-25894: Always report skipped and failed subtests separately (GH-28082) https://github.com/python/cpython/commit/f0f29f328d8b4568e8c0d4c55c7d120d96f80911 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25894> _______________________________________ From report at bugs.python.org Fri Sep 10 12:00:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:00:39 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1631289639.89.0.217811593923.issue25894@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: > Any suggestions for the format of output? Currently PR 28082 formats lines for subtest skipping, failure or error with a 2-space identation. Lines for skipping, failure or error in tearDown() or functions registered with addCallback() do not differ from a line skipping, failure or error in the test method itself. I'm fine with that. Ultimately I don't think differentiating subtest status from method status is that important. > I am not sure about backporting this change. Since we're too late for 3.10.0 and it isn't a trivially small change that changes test output, I think we shouldn't be backporting it. There are tools that parse this output in editors. I'm afraid that it's too risky since we haven't given the community enough time to test for output difference. I'm marking this as resolved. Thanks for your patch, Serhiy! If you feel strongly about backporting, we'd have to reopen and mark this as release blocker. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25894> _______________________________________ From report at bugs.python.org Fri Sep 10 12:11:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:11:48 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631290308.51.0.488278557246.issue44219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 60ddf499e14cc7daba3804e5a3460e4224dacc5c by Miss Islington (bot) in branch '3.10': bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261) (GH-28274) https://github.com/python/cpython/commit/60ddf499e14cc7daba3804e5a3460e4224dacc5c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Fri Sep 10 12:17:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:17:00 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1631290620.11.0.45969410274.issue44964@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b045174a6dbf1060f092265853f0c78f0704a21a by Miss Islington (bot) in branch '3.10': bpo-44964: Correct the note about the f_lasti field (GH-28208) (GH-28276) https://github.com/python/cpython/commit/b045174a6dbf1060f092265853f0c78f0704a21a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44964> _______________________________________ From report at bugs.python.org Fri Sep 10 12:19:49 2021 From: report at bugs.python.org (Timothee Mazzucotelli) Date: Fri, 10 Sep 2021 16:19:49 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError Message-ID: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> New submission from Timothee Mazzucotelli <pawamoy at pm.me>: This is my first issue on bugs.python.org, let me know if I can improve it in any way. --- Originally reported and investigated here: https://github.com/mkdocstrings/mkdocstrings/issues/314 ``` # final.py from __future__ import annotations from typing import Final, get_type_hints name: Final[str] = "final" class Class: value: Final = 3000 get_type_hints(Class) ``` Run `python final.py`, and you'll get this traceback: ``` Traceback (most recent call last): File "final.py", line 11, in <module> get_type_hints(Class) File "/.../lib/python3.8/typing.py", line 1232, in get_type_hints value = _eval_type(value, base_globals, localns) File "/.../lib/python3.8/typing.py", line 270, in _eval_type return t._evaluate(globalns, localns) File "/.../lib/python3.8/typing.py", line 517, in _evaluate self.__forward_value__ = _type_check( File "/.../lib/python3.8/typing.py", line 145, in _type_check raise TypeError(f"Plain {arg} is not valid as type argument") TypeError: Plain typing.Final is not valid as type argument ``` Now comment the `get_type_hints` call, launch a Python interpreter, and enter these commands: >>> import final >>> from typing import get_type_hints >>> get_type_hints(final) And you'll get this traceback: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/.../lib/python3.9/typing.py", line 1449, in get_type_hints value = _eval_type(value, globalns, localns) File "/.../lib/python3.9/typing.py", line 283, in _eval_type return t._evaluate(globalns, localns, recursive_guard) File "/.../lib/python3.9/typing.py", line 538, in _evaluate type_ =_type_check( File "/.../lib/python3.9/typing.py", line 149, in _type_check raise TypeError(f"{arg} is not valid as type argument") TypeError: typing.Final[str] is not valid as type argument ``` I was able to replicate in 3.8, 3.9 and 3.10. The annotations future is not available in 3.7 or lower. Didn't try on 3.11. ---------- messages: 401590 nosy: pawamoy priority: normal severity: normal status: open title: get_type_hints + Final + future annotations = TypeError type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Fri Sep 10 12:22:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:22:31 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" In-Reply-To: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> Message-ID: <1631290951.57.0.94106952746.issue44219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 314de5326f8b687a3fa7b19ea8faaa449f59b8fe by Miss Islington (bot) in branch '3.9': bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261) (GH-28275) https://github.com/python/cpython/commit/314de5326f8b687a3fa7b19ea8faaa449f59b8fe ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44219> _______________________________________ From report at bugs.python.org Fri Sep 10 12:26:34 2021 From: report at bugs.python.org (Timothee Mazzucotelli) Date: Fri, 10 Sep 2021 16:26:34 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1631291194.12.0.555510791866.issue45166@roundup.psfhosted.org> Timothee Mazzucotelli <pawamoy at pm.me> added the comment: Just tried on 3.11-dev, it's affected as well. This issue seems related to https://bugs.python.org/issue41249. ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Fri Sep 10 12:27:10 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 16:27:10 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631291230.65.0.603050836501.issue9811@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26696 pull_request: https://github.com/python/cpython/pull/28278 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 12:27:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:27:04 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631291224.38.0.584732969826.issue9811@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e86bcfa58080f152f242c756f625f4015671f168 by Irit Katriel in branch 'main': bpo-9811: [doc] strftime handling of unsupported format specifiers is platform dependent (GH-28264) https://github.com/python/cpython/commit/e86bcfa58080f152f242c756f625f4015671f168 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 12:27:06 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 10 Sep 2021 16:27:06 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631291226.8.0.646684819966.issue9811@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +26695 pull_request: https://github.com/python/cpython/pull/28277 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 12:28:20 2021 From: report at bugs.python.org (Timothee Mazzucotelli) Date: Fri, 10 Sep 2021 16:28:20 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1631291300.67.0.4646420806.issue45166@roundup.psfhosted.org> Timothee Mazzucotelli <pawamoy at pm.me> added the comment: Oh, I see now that there is a python/typing/ repository on GitHub. Let me know if I should open there instead. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Fri Sep 10 12:29:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:29:24 +0000 Subject: [issue45144] Use subtests in test_peepholer In-Reply-To: <1631146744.41.0.0401812311167.issue45144@roundup.psfhosted.org> Message-ID: <1631291364.88.0.240869648656.issue45144@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f8d624d6a571d6e773f53ad80aa93face7e8395b by Irit Katriel in branch 'main': bpo-45144: use subTests in test_peepholer (GH-28247) https://github.com/python/cpython/commit/f8d624d6a571d6e773f53ad80aa93face7e8395b ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45144> _______________________________________ From report at bugs.python.org Fri Sep 10 12:30:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 16:30:52 +0000 Subject: [issue45144] Use subtests in test_peepholer In-Reply-To: <1631146744.41.0.0401812311167.issue45144@roundup.psfhosted.org> Message-ID: <1631291452.7.0.121290125476.issue45144@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: We can refactor the tests to your new functionality once it's ready, Serhiy. In the mean time, this is fixed! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45144> _______________________________________ From report at bugs.python.org Fri Sep 10 12:31:22 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 10 Sep 2021 16:31:22 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631260100.52.0.00481104567541.issue45155@roundup.psfhosted.org> Message-ID: <B7883D92-A407-4A4B-940C-840FD19695A2@python.org> Barry A. Warsaw <barry at python.org> added the comment: Just to point out, struct module also uses ?native? (i.e. system) byte order by default. Any choice other than that for to_bytes() seems both arbitrary and inconsistent. > On Sep 10, 2021, at 00:48, Petr Viktorin <report at bugs.python.org> wrote: > > Exactly, a platform-dependent default is a bad idea. A default allows using the function without the code author & reviewer even being *aware* that there is a choice, and that is dangerous. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 12:33:48 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 10 Sep 2021 16:33:48 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631272014.58.0.175676511772.issue45155@roundup.psfhosted.org> Message-ID: <1D242501-09D0-48CD-89C8-E3C8D4F91DD2@python.org> Barry A. Warsaw <barry at python.org> added the comment: On Sep 10, 2021, at 04:06, STINNER Victor <report at bugs.python.org> wrote: > > If the intent is to create a bytes string of length 1, I'm not sure that "re-using" this existing API for that is a good idea. Why not? It seems an obvious and simple convenience. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 12:37:09 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 10 Sep 2021 16:37:09 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631260100.52.0.00481104567541.issue45155@roundup.psfhosted.org> Message-ID: <C3A125A8-A101-4ADB-A396-CD139544A289@python.org> Barry A. Warsaw <barry at python.org> added the comment: Petr Viktorin <encukou at gmail.com> added the comment: > > Exactly, a platform-dependent default is a bad idea. A default allows using the function without the code author & reviewer even being *aware* that there is a choice, and that is dangerous. I?m not convinced. I?m more concerned with the obscurity of the API. If I saw its use in some code I was reviewing, I?d look it up, and then I?d know exactly what it was doing. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 12:45:08 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 10 Sep 2021 16:45:08 +0000 Subject: [issue45165] alighment format for nullable values In-Reply-To: <1631286656.15.0.899331692277.issue45165@roundup.psfhosted.org> Message-ID: <1631292308.95.0.698852928489.issue45165@roundup.psfhosted.org> Anthony Sottile <asottile at umich.edu> added the comment: alignment was the only one I found which was applicable and didn't work `!s` "works" but it's kind of a hack (of course I want string formatting, I'm making a string!) -- then I would want to write `!s` everywhere which is cumbersome and ugly ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45165> _______________________________________ From report at bugs.python.org Fri Sep 10 13:09:52 2021 From: report at bugs.python.org (Jacob Hayes) Date: Fri, 10 Sep 2021 17:09:52 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken Message-ID: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> New submission from Jacob Hayes <jacob.r.hayes at gmail.com>: When deepcopying a parametrized types.GenericAlias (eg: a dict subclass) that has a __deepcopy__ method, the copy module doesn't detect the GenericAlias as a type and instead tries to call cls.__deepcopy__, passing `memo` inplace of self. This doesn't seem to happen with `typing.Generic` however. Example: ``` from copy import deepcopy class X(dict): def __deepcopy__(self, memo): return self print(deepcopy(X())) print(deepcopy(X)) print(type(X[str, int])) print(deepcopy(X[str, int]())) print(deepcopy(X[str, int])) ``` shows ``` {} <class '__main__.X'> <class 'types.GenericAlias'> {} Traceback (most recent call last): File "/tmp/demo.py", line 14, in <module> print(deepcopy(X[str, int])) File "/Users/jacobhayes/.pyenv/versions/3.9.6/lib/python3.9/copy.py", line 153, in deepcopy y = copier(memo) TypeError: __deepcopy__() missing 1 required positional argument: 'memo' ``` I don't know if it's better to update `copy.deepcopy` here or perhaps narrow the `__getattr__` for `types.GenericAlias` (as `typing. _BaseGenericAlias` seems to). ---------- components: Library (Lib) messages: 401601 nosy: JacobHayes priority: normal severity: normal status: open title: deepcopy of GenericAlias with __deepcopy__ method is broken type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Fri Sep 10 13:43:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 17:43:02 +0000 Subject: [issue17913] stat.filemode returns "-" for sockets and unknown types In-Reply-To: <1367831480.84.0.461149512803.issue17913@psf.upfronthosting.co.za> Message-ID: <1631295782.47.0.888059756718.issue17913@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I think this is fixed now >>> s = os.stat('/var/run/vpncontrol.sock') >>> stat.filemode(s.st_mode) 'srw-------' iritkatriel at Irits-MBP cpython % ls -l /var/run/vpncontrol.sock srw------- 1 root daemon 0 19 Aug 11:15 /var/run/vpncontrol.sock ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17913> _______________________________________ From report at bugs.python.org Fri Sep 10 13:48:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 17:48:54 +0000 Subject: [issue18712] Pure Python operator.index doesn't match the C version. In-Reply-To: <1376316578.03.0.462256957334.issue18712@psf.upfronthosting.co.za> Message-ID: <1631296134.08.0.799856907761.issue18712@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue18712> _______________________________________ From report at bugs.python.org Fri Sep 10 13:51:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 17:51:48 +0000 Subject: [issue18715] Tests fail when run with coverage In-Reply-To: <1376334932.92.0.162234474623.issue18715@psf.upfronthosting.co.za> Message-ID: <1631296308.3.0.569870302565.issue18715@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: This is about 8 years old, so closing. Let's open new issues for current failures when we see them. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue18715> _______________________________________ From report at bugs.python.org Fri Sep 10 14:01:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 18:01:26 +0000 Subject: [issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect In-Reply-To: <1387514294.66.0.0650917642902.issue20028@psf.upfronthosting.co.za> Message-ID: <1631296886.38.0.0439449044452.issue20028@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The patch needs to be converted to a GitHub PR. Reproduced on 3.11: >>> import _csv >>> import csv >>> _csv.Dialect(quotechar=b'+') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: "quotechar" must be string, not bytes >>> _csv.Dialect(quotechar=None) <_csv.Dialect object at 0x105acfe40> >>> _csv.Dialect(quotechar="cutecat") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: "quotechar" must be a 1-character string >>> _csv.Dialect(quotechar="", quoting=csv.QUOTE_NONE) <_csv.Dialect object at 0x105948c80> ---------- keywords: +easy -patch nosy: +iritkatriel title: Confusing error message when giving invalid quotechar in initializing csv dialect -> csv: Confusing error message when giving invalid quotechar in initializing dialect versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20028> _______________________________________ From report at bugs.python.org Fri Sep 10 14:14:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 18:14:27 +0000 Subject: [issue20524] format error messages should provide context information In-Reply-To: <1391642595.93.0.722493013717.issue20524@psf.upfronthosting.co.za> Message-ID: <1631297667.74.0.855538428907.issue20524@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11: >>> dd = {'length': 12, 'id': 4, 'title': "t", 'run_time': datetime.time()} >>> '{run_time:%H:%M:%S}, ,COM,DA{id},"{title:.43}",{id},{length:%M:%S}'.format(**dd) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Invalid format specifier ---------- nosy: +iritkatriel versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20524> _______________________________________ From report at bugs.python.org Fri Sep 10 14:19:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 18:19:07 +0000 Subject: [issue19463] assertGdbRepr depends on hash randomization / endianess In-Reply-To: <1383245602.59.0.0634998131847.issue19463@psf.upfronthosting.co.za> Message-ID: <1631297947.02.0.447321247464.issue19463@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue19463> _______________________________________ From report at bugs.python.org Fri Sep 10 14:25:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 18:25:50 +0000 Subject: [issue22886] TestProgram leaves defaultTestLoader.errors dirty In-Reply-To: <1416184473.93.0.181686669268.issue22886@psf.upfronthosting.co.za> Message-ID: <1631298350.87.0.957578840277.issue22886@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22886> _______________________________________ From report at bugs.python.org Fri Sep 10 14:28:11 2021 From: report at bugs.python.org (=?utf-8?q?Miha_=C5=A0etina?=) Date: Fri, 10 Sep 2021 18:28:11 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1631298491.68.0.969646295753.issue23041@roundup.psfhosted.org> Miha ?etina <miha.setina at in516ht.com> added the comment: The MS Synapse has a CSV support in its COPY command that would benefit from the proposed csv.QUOTE_NOTNULL as it can be used when preparing data for import. As they reference the same RFC the CSV modul should support, both the proposed modifications would extend the RFC functionality with support for NULL/None values in the data. The csv.QUOTE_STRINGS would enable a smaller file size. Our case is that we are moving data into Synapse and have to resort to risk prone string replace functionality to provide the MS Synapse COPY a proper support for empty string and NULL ---------- nosy: +msetina versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23041> _______________________________________ From report at bugs.python.org Fri Sep 10 14:29:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 18:29:51 +0000 Subject: [issue22843] doc error: 6.2.4. Match Objects In-Reply-To: <1415669163.97.0.11938367664.issue22843@psf.upfronthosting.co.za> Message-ID: <1631298591.97.0.688253556235.issue22843@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22843> _______________________________________ From report at bugs.python.org Fri Sep 10 14:35:17 2021 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 10 Sep 2021 18:35:17 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1631298917.96.0.156194582275.issue23041@roundup.psfhosted.org> Skip Montanaro <skip.montanaro at gmail.com> added the comment: Update version - too late for anything older than 3.11. ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23041> _______________________________________ From report at bugs.python.org Fri Sep 10 14:36:43 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 10 Sep 2021 18:36:43 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1631299003.28.0.829755212218.issue45166@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch nosy: +sobolevn nosy_count: 1.0 -> 2.0 pull_requests: +26697 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28279 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Fri Sep 10 15:48:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 10 Sep 2021 19:48:32 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631303312.32.0.904414842148.issue45152@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: We're not (yet) trying to optimize the code being executed (we should perhaps add an issue about class creation to https://github.com/faster-cpython/ideas). I agree that marshal is very fast already; I doubt the extra cost of wordcode would pay off since it would increase the size. This could be tested but it would be a big experiment. I'm not sure that compression will really help, since a typical decompressor delivers its output in some memory buffer. But this needs to be tested, and it might be a simpler experiment. I'm pretty sure zipimport will improve things -- the main problem with it (as always) is that not all tooling understands it, since resource loading is different. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Fri Sep 10 15:53:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 19:53:16 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631303596.19.0.761131165797.issue9811@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 897e5aae748180acf8d546d14aeacaf02600fff9 by Miss Islington (bot) in branch '3.10': bpo-9811: [doc] strftime handling of unsupported format specifiers is platform dependent (GH-28264) (GH-28277) https://github.com/python/cpython/commit/897e5aae748180acf8d546d14aeacaf02600fff9 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 15:53:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 19:53:37 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631303617.77.0.952749921344.issue9811@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset baeaaecb8a97033bc2d07d51442cc8b1f89d410d by Miss Islington (bot) in branch '3.9': bpo-9811: [doc] strftime handling of unsupported format specifiers is platform dependent (GH-28264) (GH-28278) https://github.com/python/cpython/commit/baeaaecb8a97033bc2d07d51442cc8b1f89d410d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 15:53:48 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 10 Sep 2021 19:53:48 +0000 Subject: [issue45101] Small inconsistency in usage message between the python and shell script versions of python-config In-Reply-To: <1630780332.11.0.126671398839.issue45101@roundup.psfhosted.org> Message-ID: <1631303628.05.0.944584046929.issue45101@roundup.psfhosted.org> ?ric Araujo <merwok at netwok.org> added the comment: I think python-config is modelled after pkg-config: what does the latter do? Also, I?m not sure it would be appropriate to change behaviour in existing releases. ---------- nosy: +eric.araujo versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45101> _______________________________________ From report at bugs.python.org Fri Sep 10 15:54:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 19:54:31 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631303671.66.0.809201412966.issue9811@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 16:27:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 20:27:49 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631305669.12.0.857380025415.issue9811@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Is there anything else you wanted to do here, Irit? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 16:29:03 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 10 Sep 2021 20:29:03 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1631305743.62.0.0752849789924.issue44359@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: This failure in required Ubuntu test is blocking me from merging a totally unrelated change in IDLE. PR-28228. Please disable the phony failing test. ---------- nosy: +lukasz.langa, terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44359> _______________________________________ From report at bugs.python.org Fri Sep 10 16:38:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 10 Sep 2021 20:38:46 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1631306326.1.0.997199046971.issue34602@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26698 pull_request: https://github.com/python/cpython/pull/28280 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34602> _______________________________________ From report at bugs.python.org Fri Sep 10 16:47:46 2021 From: report at bugs.python.org (Giovanni Wijaya) Date: Fri, 10 Sep 2021 20:47:46 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1631306866.09.0.133931479409.issue44359@roundup.psfhosted.org> Change by Giovanni Wijaya <giovanniwijaya_pgc at yahoo.co.id>: ---------- nosy: +giovanniwijaya nosy_count: 7.0 -> 8.0 pull_requests: +26699 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28228 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44359> _______________________________________ From report at bugs.python.org Fri Sep 10 16:58:46 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 10 Sep 2021 20:58:46 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631307526.68.0.599706668693.issue45152@roundup.psfhosted.org> Change by Brandt Bucher <brandtbucher at gmail.com>: ---------- nosy: +brandtbucher _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Fri Sep 10 16:59:10 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 10 Sep 2021 20:59:10 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631307550.32.0.125163397328.issue45155@roundup.psfhosted.org> Change by Brandt Bucher <brandtbucher at gmail.com>: ---------- nosy: +brandtbucher _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 17:11:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 21:11:44 +0000 Subject: [issue9811] strftime strips '%' from unknown format codes on OS X In-Reply-To: <1284026345.38.0.190320909092.issue9811@psf.upfronthosting.co.za> Message-ID: <1631308304.73.0.962765751427.issue9811@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: No, I think we're good. Thanks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue9811> _______________________________________ From report at bugs.python.org Fri Sep 10 18:26:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 22:26:42 +0000 Subject: [issue22147] PosixPath() constructor should not accept strings with embedded NUL bytes In-Reply-To: <1407267848.45.0.809324931091.issue22147@psf.upfronthosting.co.za> Message-ID: <1631312802.03.0.791668550029.issue22147@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: If we do this then there are tests tha break, for instance test_is_symlink has this: self.assertIs((P / 'fileA\x00').is_file(), False) ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.4, Python 3.5 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22147> _______________________________________ From report at bugs.python.org Fri Sep 10 18:27:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 10 Sep 2021 22:27:50 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1631312870.03.0.510630741568.issue45105@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Fri Sep 10 18:33:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 10 Sep 2021 22:33:22 +0000 Subject: [issue45109] pipes seems designed for bytes but is str-only In-Reply-To: <1630868099.65.0.267189111199.issue45109@roundup.psfhosted.org> Message-ID: <1631313202.93.0.59945829089.issue45109@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: guido, you seem to be the only active contributor to the pipes module. What do you think? ---------- nosy: +gvanrossum, terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45109> _______________________________________ From report at bugs.python.org Fri Sep 10 18:59:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 22:59:13 +0000 Subject: [issue18376] show the effective count of process when running the testsuite In-Reply-To: <1373107337.89.0.95411987573.issue18376@psf.upfronthosting.co.za> Message-ID: <1631314753.43.0.66618306703.issue18376@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +easy -patch versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue18376> _______________________________________ From report at bugs.python.org Fri Sep 10 19:03:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 23:03:41 +0000 Subject: [issue23774] Test failures when unable to write to install location In-Reply-To: <1427265696.1.0.371099529167.issue23774@psf.upfronthosting.co.za> Message-ID: <1631315021.42.0.888191920505.issue23774@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> allow the testsuite to run in the installed location _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue23774> _______________________________________ From report at bugs.python.org Fri Sep 10 19:18:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 23:18:27 +0000 Subject: [issue17763] test_pydoc fails with the installed testsuite In-Reply-To: <1366125816.55.0.847870350484.issue17763@psf.upfronthosting.co.za> Message-ID: <1631315907.24.0.419323923214.issue17763@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Should we close this as third party or is there something we can do about it? ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17763> _______________________________________ From report at bugs.python.org Fri Sep 10 19:26:41 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 10 Sep 2021 23:26:41 +0000 Subject: [issue45109] pipes seems designed for bytes but is str-only In-Reply-To: <1630868099.65.0.267189111199.issue45109@roundup.psfhosted.org> Message-ID: <1631316401.15.0.996076334558.issue45109@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I think that module is probably a relic from the Python 1 days? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45109> _______________________________________ From report at bugs.python.org Fri Sep 10 19:31:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 23:31:01 +0000 Subject: [issue45168] dis output for co_consts is confusing Message-ID: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: When dis doesn't have co_consts, it just prints the index of the const in () instead. This is both unnecessary and confusing because (1) we already have the index and (2) there is no indication that this is the index and not the value. Can we change the output so that it doesn't print the value if it's missing? ---------- messages: 401620 nosy: gvanrossum, iritkatriel priority: normal severity: normal status: open title: dis output for co_consts is confusing _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Fri Sep 10 19:31:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 23:31:26 +0000 Subject: [issue45168] dis output for co_consts is confusing In-Reply-To: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> Message-ID: <1631316686.58.0.310456241489.issue45168@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: See example here: https://github.com/iritkatriel/cpython/pull/30/files#r706517665 ---------- components: +Library (Lib) type: -> behavior versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Fri Sep 10 19:31:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 10 Sep 2021 23:31:40 +0000 Subject: [issue45168] dis output for LOAD_CONST is confusing In-Reply-To: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> Message-ID: <1631316700.91.0.491701262504.issue45168@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- title: dis output for co_consts is confusing -> dis output for LOAD_CONST is confusing _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Fri Sep 10 20:49:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 11 Sep 2021 00:49:58 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631321398.55.0.380012644891.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: [Mark Dickinson] > I'd also really like to avoid a system-dependent default. [Petr Viktorin] > Exactly, a platform-dependent default is a bad idea. I concur with Petr and Mark. The principal use case for int.to_bytes is to convert an integer of arbitrary size to a binary format for storage or transmission. The corresponding file load or received data needs to symmetrically restore the int. The default (whether little or big) needs to be the same on both sides to prevent bugs. Otherwise, for portable code, we would have to recommend that people not use the default because the output isn't deterministic across systems. By way of comparison, we've had long standing issues like this in other parts of the language. For example, this gives inconsistent encodings across systems: with open(filename) as f: f.write(text) Not long ago, Inada had to sweep through and add encoding="utf-8" to fix all the bugs caused by the default platform dependent encoding. Arguably, most code that has ever been written without an explicit encoding is wrong if the files were intended to be shared outside the local file system. So if Veky wants the default to be "big", that's fine by me. The important thing is that a *consistent* default be used (not platform dependent). I won't argue for a "sensible default" because apparently Veky has different sensibilities. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Fri Sep 10 22:15:36 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:15:36 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326536.23.0.468249756216.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: Thanks for all suggestions. I focused on my bisected commit and the previous. I run pyperformance with 4 functions never inlined in the sections below. _Py_DECREF() _Py_XDECREF() _Py_IS_TYPE() _Py_atomic_load_32bit_impl() are (1) never inlined in _PyEval_EvalFrameDefault(). (2) never inlined in the other funcitons. (3) never inlined in all functions. slow downs [4-funcs never inlined section] -------------------------------------------------------------- Windows x64 PGO (44job) (*) (1) (2) (3) rebuild none eval others all -------------------------------------------------------------- b98eba5 (4 funcs inlined in eval) 1.00 1.05 1.09 1.14 PR25244 ( not inlined in eval) 1.06 1.07 1.18 1.17 pyperf compare_to upper lower: (*) 1.06x slower (slower 45, faster 4, not not significant 9) (1) 1.02x slower (slower 33, faster 13, not not significant 12) (2) 1.08x slower (slower 48, faster 6, not not significant 4) (3) 1.03x slower (slower 39, faster 6, not not significant 13) -------------------------------------------------------------- Windows x86 PGO (44job) (*) (1) (2) (3) rebuild none eval others all -------------------------------------------------------------- b98eba5 (4 funcs inlined in eval) 1.00 1.03 1.06 1.15 PR25244 ( not inlined in eval) 1.13 1.13 1.22 1.24 pyperf compare_to upper lower: (*) 1.13x slower (slower 54, faster 2, not not significant 2) (1) 1.10x slower (slower 47, faster 3, not not significant 8) (2) 1.14x slower (slower 54, faster 1, not not significant 3) (3) 1.08x slower (slower 43, faster 3, not not significant 12) In both x64 and x86, it looks column (2) and (*) has similar gaps. So, I would like to simply focus on the eval-loop. I built PGO with "/d2inlinestats" and "/d2inlinelogfull:_PyEval_EvalFrameDefault" according to the blog. I posted logs. As for PR25244, the logsize is 3x smaller than the previous and pgo rejects the 4 funcs above. I will look into it later. Collecting: > Before the PR, it took 10x~ longer to link than without __forceinline function. Current build is 10x~ shorter than before to link. Before the PR, __forceinline had no impact to me. ---------- Added file: https://bugs.python.org/file50271/b98e-no-inline-in-all.diff _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:15:52 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:15:52 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326552.78.0.182238176507.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50272/b98e-no-inline-in-eval.diff _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:16:06 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:16:06 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326566.36.0.020340115192.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50273/b98e-no-inline-in-the-others.diff _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:17:00 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:17:00 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326620.54.0.216715683071.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50274/pyproject_inlinestat.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:17:40 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:17:40 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326660.04.0.117603866062.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50275/x64_28d2.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:17:57 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 02:17:57 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631326677.06.0.0981458426813.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: Added file: https://bugs.python.org/file50276/x64_b98e.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:45:22 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 11 Sep 2021 02:45:22 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631328322.99.0.866834945644.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: MSVC 2019 has a /Ob3 option: https://docs.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion >From the experience of another project, I conjecture /Ob3 increase the "global budget" mentioned in the blog. I used /Ob3 for the 3.10 branch, and there seems to be no significant performance change. If you have time, neonene welcome to verify this. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 10 22:55:07 2021 From: report at bugs.python.org (2106 Hyunwoo Oh) Date: Sat, 11 Sep 2021 02:55:07 +0000 Subject: [issue45169] Shallow copy occurs when list multiplication is used to create nested lists; can confuse users Message-ID: <1631328907.83.0.354100007036.issue45169@roundup.psfhosted.org> New submission from 2106 Hyunwoo Oh <ohwphil at gmail.com>: If you do the following: lists=[[]]*100 lists[1].append('text') print(lists[2]) you can see lists[2] contains 'text' even though it was appended to lists[1] in the text. A little more investigation with the id() function can show that the lists are shallowly copied when list multiplication occurs. I think this can confuse users when they try to use list multiplication to create nested lists, as they expected a deep copy to occur. ---------- components: Demos and Tools messages: 401625 nosy: ohwphil priority: normal severity: normal status: open title: Shallow copy occurs when list multiplication is used to create nested lists; can confuse users type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45169> _______________________________________ From report at bugs.python.org Fri Sep 10 23:00:08 2021 From: report at bugs.python.org (2106 Hyunwoo Oh) Date: Sat, 11 Sep 2021 03:00:08 +0000 Subject: [issue45169] Shallow copy occurs when list multiplication is used to create nested lists; can confuse users In-Reply-To: <1631328907.83.0.354100007036.issue45169@roundup.psfhosted.org> Message-ID: <1631329208.74.0.627237797472.issue45169@roundup.psfhosted.org> Change by 2106 Hyunwoo Oh <ohwphil at gmail.com>: ---------- components: +Interpreter Core -Demos and Tools _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45169> _______________________________________ From report at bugs.python.org Fri Sep 10 23:07:46 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 11 Sep 2021 03:07:46 +0000 Subject: [issue45169] Shallow copy occurs when list multiplication is used to create nested lists; can confuse users In-Reply-To: <1631328907.83.0.354100007036.issue45169@roundup.psfhosted.org> Message-ID: <1631329666.83.0.0469254858984.issue45169@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: This is not a bug. No copy is made at all, neither shallow nor deep. This is described in the documentation for built-in types: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations and is similar to the issue in the FAQs: https://docs.python.org/3/faq/programming.html#id16 I acknowledge that this is sometimes confusing for beginners, but it is just one of those things that programmers have to learn. Sequence multiplication does not copy the items, it replicates references to the same item. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45169> _______________________________________ From report at bugs.python.org Fri Sep 10 23:09:16 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 11 Sep 2021 03:09:16 +0000 Subject: [issue45169] Shallow copy occurs when list multiplication is used to create nested lists; can confuse users In-Reply-To: <1631328907.83.0.354100007036.issue45169@roundup.psfhosted.org> Message-ID: <1631329756.15.0.906517988584.issue45169@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Oh, I forgot: this exact issue is also in the FAQs. https://docs.python.org/3/faq/programming.html#id46 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45169> _______________________________________ From report at bugs.python.org Fri Sep 10 23:30:27 2021 From: report at bugs.python.org (neonene) Date: Sat, 11 Sep 2021 03:30:27 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631331027.38.0.501690303662.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: According to: https://docs.microsoft.com/en-us/cpp/build/profile-guided-optimizations?view=msvc-160 PGO seems to override /Ob3. Around this issue, I posted benchmark on issue44381. On python building, /Ob3 works for only non-pgo-supported dlls like, _ctypes_test _freeze_importlib _msi _testbuffer _testcapi _testconsole _testembed _testimportmultiple _testinternalcapi _testmultiphase _uuid liblzma pylauncher pyshellext pywlauncher sqlite3 venvlauncher venvwlauncher winsound I use this option in _msvccompiler.py for my pyd. I will try and report when PGO with /Ob3 makes difference in the log. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Sat Sep 11 01:11:59 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 11 Sep 2021 05:11:59 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631337119.09.0.693201908061.issue44987@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 01:37:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 11 Sep 2021 05:37:04 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631338624.93.0.591164151867.issue44987@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- keywords: +patch pull_requests: +26700 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28283 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 01:39:07 2021 From: report at bugs.python.org (paul j3) Date: Sat, 11 Sep 2021 05:39:07 +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: <1631338747.04.0.134790583973.issue41255@roundup.psfhosted.org> paul j3 <ajipanca at gmail.com> added the comment: In https://stackoverflow.com/questions/69108632/unable-to-catch-exception-error-for-argparse it looked like `exit_on_error` does not work when using subparsers. On on further thought, I realized that it has to included in the definition of the subparser. As with other `ArgumentParser` parameters, the subparsers does not inherit from the main parser. So it's basically a documentation issue. The `add_parser` method is described briefly as: which takes a command name and any ArgumentParser constructor arguments, and returns an ArgumentParser object that can be modified as usual. But as my experience shows, its relevance is easily missed, even by an experienced users. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41255> _______________________________________ From report at bugs.python.org Sat Sep 11 01:39:59 2021 From: report at bugs.python.org (paul j3) Date: Sat, 11 Sep 2021 05:39:59 +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: <1631338799.39.0.548424892211.issue41255@roundup.psfhosted.org> Change by paul j3 <ajipanca at gmail.com>: ---------- Removed message: https://bugs.python.org/msg401554 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41255> _______________________________________ From report at bugs.python.org Sat Sep 11 02:22:08 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 11 Sep 2021 06:22:08 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631341328.94.0.893862691574.issue45147@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- nosy: +python-dev nosy_count: 9.0 -> 10.0 pull_requests: +26701 pull_request: https://github.com/python/cpython/pull/28254 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Sat Sep 11 02:49:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 06:49:29 +0000 Subject: [issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' In-Reply-To: <1621631588.17.0.285799007956.issue44211@roundup.psfhosted.org> Message-ID: <1631342969.46.0.260548324578.issue44211@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Since this change has a user-visible effect a NEWS entry is required. Just copy it from issue22589. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44211> _______________________________________ From report at bugs.python.org Sat Sep 11 03:45:41 2021 From: report at bugs.python.org (daji ma) Date: Sat, 11 Sep 2021 07:45:41 +0000 Subject: [issue45170] tarfile missing cross-directory checking Message-ID: <1631346341.79.0.894184434435.issue45170@roundup.psfhosted.org> New submission from daji ma <xiongpanju at gmail.com>: tarfile missing cross-directory checking, like ../ or ..\, this potentially cause cross-directory decompression. the exp: # -*- coding: utf-8 -*- import tarfile def extract_tar(file_path, dest_path): try: with tarfile.open(file_path, 'r') as src_file: for info in src_file.getmembers(): src_file.extract(info.name, dest_path) return True except (IOError, OSError, tarfile.TarError): return False def make_tar(): tar_file=tarfile.open('x.tar.gz','w:gz') tar_file.add('bashrc', '/../../../../root/.bashrc') tar_file.list(verbose=True) tar_file.close() if __name__ == '__main__': make_tar() extract_tar('x.tar.gz', 'xx') ---------- components: Library (Lib) messages: 401631 nosy: xiongpanju priority: normal severity: normal status: open title: tarfile missing cross-directory checking type: security versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45170> _______________________________________ From report at bugs.python.org Sat Sep 11 03:59:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 07:59:12 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631347152.37.0.996918556305.issue35474@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +26702 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28286 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Sat Sep 11 04:01:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 08:01:24 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631347284.35.0.224392714106.issue35474@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Also, mutating the result of guess_all_extensions() mutated the internal state of the MimeTypes object and affected the following calls of guess_all_extensions(). ---------- stage: patch review -> versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Sat Sep 11 04:46:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 08:46:33 +0000 Subject: [issue45163] Haiku build fix Message-ID: <1631349993.04.0.408583087956.issue45163@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: New changeset 5f5b7d0c654488206ac13e27d9a5dcffbd2cc0af by David CARLIER in branch 'main': bpo-45163: Haiku build fix. (GH-28269) https://github.com/python/cpython/commit/5f5b7d0c654488206ac13e27d9a5dcffbd2cc0af ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45163> _______________________________________ From report at bugs.python.org Sat Sep 11 04:47:08 2021 From: report at bugs.python.org (fhdrsdg) Date: Sat, 11 Sep 2021 08:47:08 +0000 Subject: [issue45160] ttk.OptionMenu radiobuttons change variable value twice In-Reply-To: <1631257980.33.0.506661911605.issue45160@roundup.psfhosted.org> Message-ID: <1631350028.39.0.691692219323.issue45160@roundup.psfhosted.org> fhdrsdg <n00rbert at gmail.com> added the comment: Ah yes, you're right that `command=self._callback` doesn't pass the new value like it should. Your suggestion does, but throws a "TypeError: 'NoneType' object is not callable" when no command is given when creating the OptionMenu. The current `_setit` implementation uses a `if self.__callback:` check for that. Should we do something like this? for val in values: menu.add_radiobutton(label=val, variable=self._variable) if self._callback: menu.entryconfigure('last', command=lambda val=val: self._callback(val)) I don't have any experience making pull requests. I might look into it at some point but for now it would be great if you could make it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45160> _______________________________________ From report at bugs.python.org Sat Sep 11 04:55:11 2021 From: report at bugs.python.org (Lewis Gaul) Date: Sat, 11 Sep 2021 08:55:11 +0000 Subject: [issue45110] argparse repeats itself when formatting help metavars In-Reply-To: <1630894738.41.0.447837429449.issue45110@roundup.psfhosted.org> Message-ID: <1631350511.75.0.416893846261.issue45110@roundup.psfhosted.org> Lewis Gaul <lewis.gaul at gmail.com> added the comment: Big +1 from me for at least supporting a way to get the more concise output. I've never understood the verbosity of python's argparse where the metavar is repeated. ---------- nosy: +LewisGaul _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45110> _______________________________________ From report at bugs.python.org Sat Sep 11 06:40:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 11 Sep 2021 10:40:55 +0000 Subject: [issue38942] Possible assertion failures in csv.Dialect() In-Reply-To: <1575058849.67.0.456727251778.issue38942@roundup.psfhosted.org> Message-ID: <1631356855.81.0.940594561175.issue38942@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The patch is missing a unit test. ---------- nosy: +iritkatriel stage: patch review -> test needed versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38942> _______________________________________ From report at bugs.python.org Sat Sep 11 06:44:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 11 Sep 2021 10:44:37 +0000 Subject: [issue38942] Possible assertion failures in csv.Dialect() In-Reply-To: <1575058849.67.0.456727251778.issue38942@roundup.psfhosted.org> Message-ID: <1631357077.07.0.663915340831.issue38942@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> Assertion failure in csv module _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38942> _______________________________________ From report at bugs.python.org Sat Sep 11 06:46:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 11 Sep 2021 10:46:47 +0000 Subject: [issue37844] PyRun_SimpleFile should provide a version that does not need a FILE* In-Reply-To: <1565720500.55.0.0348058431334.issue37844@roundup.psfhosted.org> Message-ID: <1631357207.99.0.675306122597.issue37844@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- type: crash -> enhancement versions: -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37844> _______________________________________ From report at bugs.python.org Sat Sep 11 06:54:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 11 Sep 2021 10:54:03 +0000 Subject: [issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110 In-Reply-To: <1616093906.25.0.990565288145.issue43546@roundup.psfhosted.org> Message-ID: <1631357643.27.0.92791803667.issue43546@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43546> _______________________________________ From report at bugs.python.org Sat Sep 11 06:59:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 11 Sep 2021 10:59:06 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1631357946.33.0.385011451136.issue43983@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Thanks for the update Marwan. I'm closing because there doesn't seem to be any followup possible on our side. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43983> _______________________________________ From report at bugs.python.org Sat Sep 11 09:17:18 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Sat, 11 Sep 2021 13:17:18 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent Message-ID: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> New submission from Jouke Witteveen <j.witteveen at gmail.com>: Handling of `stacklevel` in the logging module makes a few unwarranted assumptions, for instance on the depth of the stack due to internal logging module calls. This can be seen for instance when using the shortcut call `logging.warning` to the root logger, instead of using `root_logger.warning`. Consider the following `stacklevel.py` file: ``` import logging import warnings root_logger = logging.getLogger() root_logger.handle = print def test(**kwargs): warnings.warn("warning-module", **kwargs) logging.warning("on-module", **kwargs) root_logger.warning("on-logger", **kwargs) for stacklevel in range(5): print(f"{stacklevel=}") test(stacklevel=stacklevel) ``` The output of running `PYTHONWARNINGS=always python stacklevel.py` is: ``` stacklevel=0 stacklevel.py:8: UserWarning: warning-module warnings.warn("warning-module", **kwargs) <LogRecord: root, 30, stacklevel.py, 9, "on-module"> <LogRecord: root, 30, stacklevel.py, 10, "on-logger"> stacklevel=1 stacklevel.py:8: UserWarning: warning-module warnings.warn("warning-module", **kwargs) <LogRecord: root, 30, stacklevel.py, 9, "on-module"> <LogRecord: root, 30, stacklevel.py, 10, "on-logger"> stacklevel=2 stacklevel.py:14: UserWarning: warning-module test(stacklevel=stacklevel) <LogRecord: root, 30, stacklevel.py, 9, "on-module"> <LogRecord: root, 30, stacklevel.py, 14, "on-logger"> stacklevel=3 sys:1: UserWarning: warning-module <LogRecord: root, 30, stacklevel.py, 14, "on-module"> <LogRecord: root, 30, stacklevel.py, 10, "on-logger"> stacklevel=4 sys:1: UserWarning: warning-module <LogRecord: root, 30, stacklevel.py, 9, "on-module"> <LogRecord: root, 30, stacklevel.py, 10, "on-logger"> ``` Looking at the line numbers, we get: stacklevel 0: lines 8, 9, 10. stacklevel 1: lines 8, 9, 10. stacklevel 2: lines 14, 9, 14. stacklevel 3: lines sys:1, 14, 10. stacklevel 4: lines sys:1, 9, 10. As can be seen, the stacklevel for the on-module (shortcut) calls lags one level of unwinding behind. ---------- components: Library (Lib) messages: 401638 nosy: joukewitteveen priority: normal severity: normal status: open title: stacklevel handling in logging module is inconsistent versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45171> _______________________________________ From report at bugs.python.org Sat Sep 11 09:25:58 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Sat, 11 Sep 2021 13:25:58 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent In-Reply-To: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> Message-ID: <1631366758.79.0.181030496834.issue45171@roundup.psfhosted.org> Change by Jouke Witteveen <j.witteveen at gmail.com>: ---------- keywords: +patch pull_requests: +26703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28287 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45171> _______________________________________ From report at bugs.python.org Sat Sep 11 09:43:46 2021 From: report at bugs.python.org (David CARLIER) Date: Sat, 11 Sep 2021 13:43:46 +0000 Subject: [issue45172] netbsd CAN protocol flags addition Message-ID: <1631367826.9.0.525504625314.issue45172@roundup.psfhosted.org> Change by David CARLIER <devnexen at gmail.com>: ---------- components: Library (Lib) nosy: devnexen priority: normal pull_requests: 26704 severity: normal status: open title: netbsd CAN protocol flags addition type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45172> _______________________________________ From report at bugs.python.org Sat Sep 11 10:02:00 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 11 Sep 2021 14:02:00 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631368920.46.0.473587004962.issue44987@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: > Well, someone should write a PR for it. Well, I sent a patch :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 10:44:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 14:44:47 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631371487.97.0.881638390591.issue35474@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 97ea18ecede8bfd33d5ab2dd0e7e2aada2051111 by Serhiy Storchaka in branch 'main': bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286) https://github.com/python/cpython/commit/97ea18ecede8bfd33d5ab2dd0e7e2aada2051111 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Sat Sep 11 10:44:55 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 11 Sep 2021 14:44:55 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631371495.8.0.935768150078.issue35474@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26706 pull_request: https://github.com/python/cpython/pull/28290 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Sat Sep 11 10:44:51 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 11 Sep 2021 14:44:51 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631371491.84.0.74764493346.issue35474@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26705 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28289 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Sat Sep 11 10:45:20 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 11 Sep 2021 14:45:20 +0000 Subject: [issue45160] ttk.OptionMenu radiobuttons change variable value twice In-Reply-To: <1631257980.33.0.506661911605.issue45160@roundup.psfhosted.org> Message-ID: <1631371520.19.0.584255236425.issue45160@roundup.psfhosted.org> Change by E. Paine <xepaine13 at gmail.com>: ---------- keywords: +patch pull_requests: +26707 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28291 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45160> _______________________________________ From report at bugs.python.org Sat Sep 11 11:04:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 15:04:42 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631372682.23.0.407610676295.issue44987@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 9abd07e5963f966c4d6df8f4e4bf390ed8191066 by Dong-hee Na in branch 'main': bpo-44987: Speed up unicode normalization of ASCII strings (GH-28283) https://github.com/python/cpython/commit/9abd07e5963f966c4d6df8f4e4bf390ed8191066 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 11:05:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 15:05:19 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631372719.09.0.28732772074.issue44987@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 12:01:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 16:01:33 +0000 Subject: [issue45163] Haiku build fix In-Reply-To: <1631349993.04.0.408583087956.issue45163@roundup.psfhosted.org> Message-ID: <1631376093.61.0.917321626657.issue45163@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45163> _______________________________________ From report at bugs.python.org Sat Sep 11 12:55:03 2021 From: report at bugs.python.org (mattip) Date: Sat, 11 Sep 2021 16:55:03 +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: <1631379303.59.0.239783914379.issue15870@roundup.psfhosted.org> mattip <matti.picus at gmail.com> added the comment: >> I wouldn't recommend [setting ob_type] after PyType_Ready is called. > Why not? What bad things will happen? It seems to be working so far. It breaks the unwritten contract that "once PyType_Ready is called, the C struct will not be modified". This is implemented in PyPy, since calling PyType_Ready creates the PyPy object in the interpreter based on the C structure. Any further changes will not be reflected in the PyPy interpreter object, so now the python-level and c-level objects do not agree what type(obj) is. We have discussed this in the PyPy team, and would like to propose relaxing the contract to state that "if the c-level contents of an object are modified, PyType_Modified must be called to re-synce the python level and c-level objects" ---------- nosy: +mattip _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Sat Sep 11 13:05:24 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 11 Sep 2021 17:05:24 +0000 Subject: [issue45170] tarfile missing cross-directory checking In-Reply-To: <1631346341.79.0.894184434435.issue45170@roundup.psfhosted.org> Message-ID: <1631379924.16.0.518041444745.issue45170@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: This is documented in the tarfile docs: Warning Never extract archives from untrusted sources without prior inspection. It is possible that files are created outside of path, e.g. members that have absolute filenames starting with "/" or filenames with two dots "..". ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45170> _______________________________________ From report at bugs.python.org Sat Sep 11 14:10:39 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 11 Sep 2021 18:10:39 +0000 Subject: [issue45173] Remove configparser deprecations Message-ID: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> New submission from Hugo van Kemenade <hugovk+python at gmail.com>: In the configparser module, these have been deprecated since Python 3.2: * the SafeConfigParser class, * the filename property of the ParsingError class, * the readfp method of the ConfigParser class, They can be removed in Python 3.11. ---------- components: Library (Lib) messages: 401644 nosy: hugovk priority: normal severity: normal status: open title: Remove configparser deprecations versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45173> _______________________________________ From report at bugs.python.org Sat Sep 11 14:13:17 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 11 Sep 2021 18:13:17 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1631383997.17.0.100255735759.issue45173@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- keywords: +patch pull_requests: +26708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28292 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45173> _______________________________________ From report at bugs.python.org Sat Sep 11 14:14:38 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 11 Sep 2021 18:14:38 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1631384078.5.0.0705514850685.issue45173@roundup.psfhosted.org> Hugo van Kemenade <hugovk+python at gmail.com> added the comment: Also, the LegacyInterpolation class is deprecated since Python 3.2 but with no DeprecationWarning. A quick sampling of GitHub results shows only copies of CPython's configparser.py and test_configparser.py https://github.com/search?l=Python&p=1&q=LegacyInterpolation+extension%3Apy+language%3APython+language%3APython&ref=advsearch&type=Code No use found in the top 200 PyPI packages. Is it safe to remove now, or should it raise DeprecationWarning for a couple of releases first? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45173> _______________________________________ From report at bugs.python.org Sat Sep 11 14:51:02 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 11 Sep 2021 18:51:02 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631386262.47.0.855008508725.issue44987@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- pull_requests: +26709 pull_request: https://github.com/python/cpython/pull/28293 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 15:06:01 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 11 Sep 2021 19:06:01 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings In-Reply-To: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> Message-ID: <1631387161.85.0.680638218817.issue44987@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: New changeset 5277ffe12d492939544ff9c54a3aaf448b913fb3 by Dong-hee Na in branch 'main': bpo-44987: Fix typo whatsnew 3.11 (GH-28293) https://github.com/python/cpython/commit/5277ffe12d492939544ff9c54a3aaf448b913fb3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44987> _______________________________________ From report at bugs.python.org Sat Sep 11 15:11:30 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 11 Sep 2021 19:11:30 +0000 Subject: [issue45125] Improve tests and docs of how `pickle` works with `SharedMemory` obejcts In-Reply-To: <1631009872.94.0.369430162871.issue45125@roundup.psfhosted.org> Message-ID: <1631387490.88.0.540053087297.issue45125@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26710 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28294 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45125> _______________________________________ From report at bugs.python.org Sat Sep 11 16:34:59 2021 From: report at bugs.python.org (David CARLIER) Date: Sat, 11 Sep 2021 20:34:59 +0000 Subject: [issue45174] DragonflyBSD fix nis module build Message-ID: <1631392499.44.0.816615961094.issue45174@roundup.psfhosted.org> Change by David CARLIER <devnexen at gmail.com>: ---------- components: Library (Lib) nosy: devnexen priority: normal pull_requests: 26711 severity: normal status: open title: DragonflyBSD fix nis module build type: compile error versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45174> _______________________________________ From report at bugs.python.org Sat Sep 11 17:01:11 2021 From: report at bugs.python.org (Ian Good) Date: Sat, 11 Sep 2021 21:01:11 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1631394071.12.0.778239336133.issue45081@roundup.psfhosted.org> Ian Good <icgood at gmail.com> added the comment: I believe this was a deeper issue that affected all classes inheriting Protocol, causing a TypeError on even the most basic case (see attached): Traceback (most recent call last): File "/.../test.py", line 14, in <module> MyClass() File "/.../test.py", line 11, in __init__ super().__init__() File "/usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 1083, in _no_init raise TypeError('Protocols cannot be instantiated') TypeError: Protocols cannot be instantiated This was a new regression in 3.9.7 and seems to be resolved by this fix. The desired behavior should be supported according to PEP 544: https://www.python.org/dev/peps/pep-0544/#explicitly-declaring-implementation ---------- nosy: +icgood Added file: https://bugs.python.org/file50277/test.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Sat Sep 11 17:10:07 2021 From: report at bugs.python.org (Jason Yundt) Date: Sat, 11 Sep 2021 21:10:07 +0000 Subject: [issue45175] No warning with '-W always' and cached import Message-ID: <1631394606.92.0.819675114557.issue45175@roundup.psfhosted.org> New submission from Jason Yundt <swagfortress at gmail.com>: I have a script which always produces a warning when you run it. If I import always_warns from another script, that script will only produce a warning once. Steps to reproduce: $ python -W always always_warns.py /tmp/Bug reproduction/always_warns.py:1: DeprecationWarning: invalid escape sequence \ "\ " $ python -W always always_warns.py /tmp/Bug reproduction/always_warns.py:1: DeprecationWarning: invalid escape sequence \ "\ " $ python -W always imports_always_warns.py /tmp/Bug reproduction/always_warns.py:1: DeprecationWarning: invalid escape sequence \ "\ " $ python -W always imports_always_warns.py $ There should be a warning for that last one, but there isn?t. If I delete __pycache__, imports_always_warns.py makes the warning appear again. ---------- files: Bug reproduction.zip messages: 401648 nosy: jayman priority: normal severity: normal status: open title: No warning with '-W always' and cached import type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50278/Bug reproduction.zip _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45175> _______________________________________ From report at bugs.python.org Sat Sep 11 17:19:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 21:19:34 +0000 Subject: [issue45175] No warning with '-W always' and cached import In-Reply-To: <1631394606.92.0.819675114557.issue45175@roundup.psfhosted.org> Message-ID: <1631395174.99.0.259591845696.issue45175@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: This warning is produced by the compiler when it compiles the source code. If it is already compiled, no compiler is involved. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45175> _______________________________________ From report at bugs.python.org Sat Sep 11 18:07:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Sep 2021 22:07:47 +0000 Subject: [issue45174] DragonflyBSD fix nis module build Message-ID: <1631398067.98.0.348265925051.issue45174@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: The main difference between platforms is that the first argument of the foreach function is int on some platforms and unsigned long on others. PR 28295 fixes code not only on DragonflyBSD, but on FreeBSD and OpenBSD, where it is unsigned long. It is a bug fix which should be backported. But I afraid that it can break code on macOS. See f6067ec336e2eff1fc1cce90c67c20b0d4e80c22. I am not sure that I understand it completely. Are there compiler warnings when compile nismodule.c on macOS now? Does nis.cat() work on macOS now? If remove a cast to foreachfunc at line 255, will the compiler complain and how? Will nis.cat() work on macOS with PR 28295 applied? ---------- components: +macOS nosy: +brett.cannon, ned.deily, ronaldoussoren, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45174> _______________________________________ From report at bugs.python.org Sat Sep 11 19:35:09 2021 From: report at bugs.python.org (Christian Tismer) Date: Sat, 11 Sep 2021 23:35:09 +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: <1631403309.3.0.50283617717.issue15870@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: Since PyPy does not use the Limited API, PySide can quite easily work around the limitations by directly working with the type object. But the usage of PyType_Modified() would make very much sense for PySide?s new switchable features. That would work immediately without any change, because we already use that function to invalidate Python 3.10?s type cache. ---------- nosy: +Christian.Tismer _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Sat Sep 11 20:33:15 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 12 Sep 2021 00:33:15 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631406795.2.0.793513019152.issue45156@roundup.psfhosted.org> Change by Karthikeyan Singaravelan <tir.karthi at gmail.com>: ---------- nosy: +xtreak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Sun Sep 12 03:53:14 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 12 Sep 2021 07:53:14 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631433194.15.0.641006566294.issue45155@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: My sensibilities are irrelevant here. I'm just saying we already have a standard byte order for data in transit, and it was introduced long before this thing called internet (it was with capital I back then:) started to interest me. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Sun Sep 12 04:21:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 08:21:45 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631434905.74.0.254488920824.issue45155@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: The struct module has 4 different modes. By default it uses not only native byte order, but native sizes and alignments which depend on OS and compiler. You need to know all these details just to understand the format codes. I think that the struct module user is more prepared to work with different word sizes and therefore with different byte ordering. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Sun Sep 12 04:38:45 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 12 Sep 2021 08:38:45 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1631435925.31.0.761669283801.issue45105@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: @Steven: the difference between indexing and the repr of list() is also explained by Eryk's explanation. s = ... # (value from msg401078) for x in repr(list(s)): print(x) The output shows characters in the expected order. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 12 04:38:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 08:38:59 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631435939.89.0.977397796239.issue45155@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: In the stdlib, there is only one use of to_bytes() with sys.byteorder (2 in tests), 16 uses of to_bytes()/from_bytes() with 'little' (22 in tests) and 22 uses with 'big' (33 in tests). So making sys.byteorder the default will help almost nobody, and the advantage of 'big' over 'litte' is so small, that making any of them the default may only help in a half of cases and confuse in the other half. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Sun Sep 12 04:57:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 08:57:14 +0000 Subject: [issue45105] Incorrect handling of unicode character \U00010900 In-Reply-To: <1630840329.53.0.683865786934.issue45105@roundup.psfhosted.org> Message-ID: <1631437034.23.0.826075594461.issue45105@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: We recently discussed the RTLO attack on Python sources (sorry, I don't remember on what resource) and decided that we should do something with this. I think this is a related issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45105> _______________________________________ From report at bugs.python.org Sun Sep 12 05:50:10 2021 From: report at bugs.python.org (Ming Hua) Date: Sun, 12 Sep 2021 09:50:10 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name Message-ID: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> New submission from Ming Hua <plateauwolf at qq.com>: Background: Since at least Windows 8, it is possible to invoke the input method engine (IME) when installing Windows and creating accounts. So at least among simplified Chinese users, it's not uncommon to have a Chinese account name. Issue: After successful installation using the 64-bit .exe installer for Windows, just to be paranoid (and to get familiar with Python's test framework), I decided to run the bundled regression tests. To my surprise I got many failures. The following is the summary of "python.exe -m test" with 3.8 some months ago (likely 3.8.6): 371 tests OK. 11 tests failed: test_cmd_line_script test_compileall test_distutils test_doctest test_locale test_mimetypes test_py_compile test_tabnanny test_urllib test_venv test_zipimport_support 43 tests skipped: test_asdl_parser test_check_c_globals test_clinic test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue test_multiprocessing_fork test_multiprocessing_forkserver test_nis test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pty test_pwd test_readline test_resource test_smtpnet test_socketserver test_spwd test_syslog test_threadsignals test_timeout test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet test_wait3 test_wait4 test_winsound test_xmlrpc_net test_xxtestfuzz test_zipfile64 Total duration: 59 min 49 sec Tests result: FAILURE The failures all look similar though, it seems Python on Windows assumes the home directory of the user, "C:\Users\<username>\", is either in ASCII or UTF-8 encoding, while it is actually in Windows native codepage, in my case cp936 for simplified Chinese (zh-CN). To take a couple of examples (these are from recent testing with 3.10.0 rc2): > python.exe -m test -W test_cmd_line_script 0:00:03 Run tests sequentially 0:00:03 [1/1] test_cmd_line_script [...] test_consistent_sys_path_for_direct_execution (test.test_cmd_line_script.CmdLineTest) ... ERROR [...] test_directory_error (test.test_cmd_line_script.CmdLineTest) ... FAIL [...] ERROR: test_consistent_sys_path_for_direct_execution (test.test_cmd_line_script.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 677, in test_consistent_sys_path_for_direct_execution out_by_name = kill_python(p).decode().splitlines() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 9: invalid start byte [...] FAIL: test_directory_error (test.test_cmd_line_script.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 268, in test_directory_error self._check_import_error(script_dir, msg) File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 151, in _check_import_error self.assertIn(expected_msg.encode('utf-8'), err) AssertionError: b"can't find '__main__' module in 'C:\\\\Users\\\\\xe5<5 bytes redacted>\\\\AppData\\\\Local\\\\Temp\\\\tmpcwkfn9ct'" not found in b"C:\\Programs\\Python\\python310\\python.exe: can't find '__main__' module in 'C:\\\\Users\\\\\xbb<3 bytes redacted>\\\\AppData\\\\Local\\\\Temp\\\\tmpcwkfn9ct'\r\n" [...] ---------------------------------------------------------------------- Ran 44 tests in 29.769s FAILED (failures=2, errors=5) test test_cmd_line_script failed test_cmd_line_script failed (5 errors, 2 failures) in 30.4 sec == Tests result: FAILURE == In the above test_directory_error AssertionError message I redacted part of the path as my account name is my real name. Hope the issue is clear enough despite the redaction, since the "\xe5<5 bytes redacted>" part is 6 bytes and apparently in UTF-8 (for two Chinese characters) and the "\xbb<3 bytes redacted>" part is 4 bytes and apparently in cp936. Postscript: As I've said above, I discovered this issue some time ago, but only have time now to report it. I believe I've see these failures in 3.8.2/6, 3.9.7, and 3.10.0 rc2. It shouldn't be hard to reproduce for people with ways to create account with non-ASCII name on Windows. If reproducing turns out to be difficult though, I'm happy to provide more information and/or run more tests. ---------- components: Tests messages: 401659 nosy: minghua priority: normal severity: normal status: open title: Many regtest failures on Windows with non-ASCII account name versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 06:21:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 10:21:49 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631442109.6.0.499824206444.issue45176@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- components: +Unicode nosy: +ezio.melotti, serhiy.storchaka, vstinner type: -> behavior versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 06:28:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 10:28:13 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631442493.6.0.908114078772.issue43413@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 92bf8691fb78f3484bf2daba836c416efedb1d8d by Serhiy Storchaka in branch 'main': bpo-43413: Fix handling keyword arguments in subclasses of some buitin classes (GH-26456) https://github.com/python/cpython/commit/92bf8691fb78f3484bf2daba836c416efedb1d8d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Sun Sep 12 06:29:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 10:29:49 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631442589.5.0.936804899164.issue43413@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Sun Sep 12 07:18:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 11:18:03 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631445483.55.0.474720272768.issue45176@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 07:20:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 12 Sep 2021 11:20:58 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631445658.16.0.770802421368.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Interestingly, "little" is faster than "big". $ python3.10 -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "little")' 5000000 loops, best of 11: 82.7 nsec per loop $ python3.10 -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "big")' 5000000 loops, best of 11: 90.6 nsec per loop ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Sun Sep 12 07:25:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 12 Sep 2021 11:25:56 +0000 Subject: [issue25853] Compile error with pytime.h - struct timespec declared inside parameter list In-Reply-To: <1449961790.19.0.27307751032.issue25853@psf.upfronthosting.co.za> Message-ID: <1631445956.32.0.565891887221.issue25853@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Closing as there isn't enough information here for us to do anything about it and there has been no response from the OP to follow-up questions. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25853> _______________________________________ From report at bugs.python.org Sun Sep 12 07:30:27 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 12 Sep 2021 11:30:27 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631446227.47.0.618284404957.issue45176@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: In Windows, the standard I/O encoding of the spawn_python() child defaults to the process active code page, i.e. GetACP(). In Windows 10, the active code page can be set to UTF-8 at the system or application level, but most systems and applications still use a legacy code page. Python's default can be overridden to UTF-8 for standard I/O via PYTHONIOENCODING, or for all I/O via PYTHONUTF8 or "-X utf8=1". I would recommend using one of these UTF-8 options instead of trying to make a test work with the legacy code page. There is no guarantee, and should be no guarantee, that a filesystem path, which is Unicode, can be encoded using a legacy code page. ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 07:39:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 12 Sep 2021 11:39:04 +0000 Subject: [issue30212] test_ssl.py is broken in Centos7 In-Reply-To: <1493507734.99.0.744824306698.issue30212@psf.upfronthosting.co.za> Message-ID: <1631446744.12.0.418124886825.issue30212@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30212> _______________________________________ From report at bugs.python.org Sun Sep 12 07:44:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Sep 2021 11:44:16 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631447056.64.0.156563899868.issue45155@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Perhaps it is because "little" is checked first. One call of _PyUnicode_EqualToASCIIId() for "little" and two for "big". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Sun Sep 12 07:57:48 2021 From: report at bugs.python.org (Ming Hua) Date: Sun, 12 Sep 2021 11:57:48 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631447868.83.0.731459688388.issue45176@roundup.psfhosted.org> Ming Hua <plateauwolf at qq.com> added the comment: Eryk Sun (eryksun) posted: > Python's default can be overridden to UTF-8 for standard I/O via PYTHONIOENCODING, or for all I/O via PYTHONUTF8 or "-X utf8=1". FWIW, I did test with "-X utf8" option and it wasn't any better. Just tested "python.exe -X utf8=1 -m test -W test_cmd_line_script" with 3.10.0 rc2 again, and got 6 errors and 2 failures this way (1 more error than without "-X utf8=1"). There is also this new error message: 0:00:01 [1/1] test_cmd_line_script Warning -- Uncaught thread exception: UnicodeDecodeError Exception in thread Thread-60 (_readerthread): Traceback (most recent call last): File "C:\Programs\Python\python310\lib\threading.py", line 1009, in _bootstrap_inner self.run() File "C:\Programs\Python\python310\lib\threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "C:\Programs\Python\python310\lib\subprocess.py", line 1494, in _readerthread buffer.append(fh.read()) File "C:\Programs\Python\python310\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 69: invalid start byte ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 08:28:00 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 12 Sep 2021 12:28:00 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631449680.59.0.368648057214.issue45126@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: New changeset c78d5ca3806d02e26f9f3fa92ff567f0805eac4c by Erlend Egeberg Aasland in branch 'main': bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231) https://github.com/python/cpython/commit/c78d5ca3806d02e26f9f3fa92ff567f0805eac4c ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Sun Sep 12 08:32:37 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 12 Sep 2021 12:32:37 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631449957.04.0.854415381832.issue45176@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: > FWIW, I did test with "-X utf8" option I was suggesting to modify the tests to use the UTF-8 mode option in the spawn_python() command line. It doesn't help to run the parent process in UTF-8 mode since it isn't inherited. It could be inherited via PYTHONUTF8, but it turns out that environment variables won't help in this case due to the use of the -E and -I command-line options. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Sun Sep 12 11:06:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 12 Sep 2021 15:06:19 +0000 Subject: [issue42119] Error when debugging logging.FileHandler subclass __init__ method In-Reply-To: <1603384667.68.0.88562918356.issue42119@roundup.psfhosted.org> Message-ID: <1631459179.52.0.26641445183.issue42119@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Changing from not a bug to duplicate of #20853. ---------- resolution: not a bug -> duplicate superseder: -> pdb "args" crashes when an arg is not printable _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42119> _______________________________________ From report at bugs.python.org Sun Sep 12 11:54:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 12 Sep 2021 15:54:56 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631462096.8.0.0916939864092.issue45126@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26712 pull_request: https://github.com/python/cpython/pull/28298 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Sun Sep 12 14:58:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 12 Sep 2021 18:58:40 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631473120.58.0.104215604033.issue45156@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11: >>> foo = mock.create_autospec(Foo) >>> mock.seal(foo) ^CTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 2917, in seal seal(m) ^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 2917, in seal seal(m) ^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 2917, in seal seal(m) ^^^^^^^ [Previous line repeated 645 more times] File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 2911, in seal m = getattr(mock, attr) ^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 662, in __getattr__ result = create_autospec( ^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 2672, in create_autospec mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/unittest/mock.py", line 416, in __new__ new = type(cls.__name__, bases, {'__doc__': cls.__doc__}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyboardInterrupt ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Sun Sep 12 15:03:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 12 Sep 2021 19:03:16 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631473396.33.0.604628024027.issue45156@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Pdb) list 2916 if m._mock_new_parent is mock: 2917 try: 2918 seal(m) 2919 except: 2920 breakpoint() 2921 -> raise 2922 2923 2924 class _AsyncIterator: 2925 """ 2926 Wraps an iterator in an asynchronous iterator. (Pdb) p m <MagicMock name='mock.foo.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.denominator.as_integer_ratio' spec='builtin_function_or_method' id='4405352848'> ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Sun Sep 12 16:42:53 2021 From: report at bugs.python.org (Julian Fortune) Date: Sun, 12 Sep 2021 20:42:53 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1631479373.27.0.214807648277.issue45081@roundup.psfhosted.org> Julian Fortune <juliandfortune at gmail.com> added the comment: Ian, `MyProtocol` does not provide an `__init__()`, and thus ``` super().__init__() ``` is calling the `__init__()` from `Protocol`. This results in the `TypeError`. Simply remove `super().__init__()` to resolve your issue. This behavior was changed in https://github.com/python/cpython/pull/27545 (see `Lib/typing.py:1384`); I don't see what you are reporting as a regression, I see it as correct behavior that I would expect. Apologies if you feel differently. Cheers, Julian ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Sun Sep 12 17:14:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 12 Sep 2021 21:14:28 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631481268.62.0.331896443894.issue5846@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26713 pull_request: https://github.com/python/cpython/pull/28299 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Sun Sep 12 17:29:15 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 12 Sep 2021 21:29:15 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631482155.98.0.705058757178.issue45156@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +26714 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28300 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Sun Sep 12 17:38:03 2021 From: report at bugs.python.org (Ian Good) Date: Sun, 12 Sep 2021 21:38:03 +0000 Subject: [issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__ In-Reply-To: <1630530371.11.0.748962218101.issue45081@roundup.psfhosted.org> Message-ID: <1631482683.67.0.92555652421.issue45081@roundup.psfhosted.org> Ian Good <ian at icgood.net> added the comment: Julian, That is certainly a workaround, however the behavior you are describing is inconsistent with PEP-544 in both word and intention. From the PEP: > To explicitly declare that a certain class implements a given protocol, it can be used as a regular base class. It further describes the semantics of inheriting as "unchanged" from a "regular base class". If the semantics are "unchanged" then it should follow that super().__init__() would pass through the protocol to the object.__init__, just like a "regular base class" would if it does not override __init__. Furthermore, the intention of inheriting a Protocol as described in the PEP: > Static analysis tools are expected to automatically detect that a class implements a given protocol. So while it's possible to subclass a protocol explicitly, it's not necessary to do so for the sake of type-checking. The purpose of adding a Protocol sub-class as an explicit base class is thus only to improve static analysis, it should *not* to modify the runtime semantics. Consider the case where a package maintainer wants to enhance the flexibility of their types by transitioning from using an ABC to using structural sub-typing. That simple typing change would be a breaking change to the package consumers, who must now remove a super().__init__() call. Ian ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45081> _______________________________________ From report at bugs.python.org Sun Sep 12 17:55:40 2021 From: report at bugs.python.org (Mark Roseman) Date: Sun, 12 Sep 2021 21:55:40 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1631483740.74.0.853986910269.issue42560@roundup.psfhosted.org> Mark Roseman <mark at markroseman.com> added the comment: Would like to throw an idea out for feedback regarding the API reference. I've done some preliminary work auto-generating documentation via widget introspection. It's missing a lot, has many bugs, but is far enough along to give a sense of what this approach could offer. Temporary snapshot is at https://tkdocs.com/tmp-pyref/ (you may need to force-refresh if your browser cached the site's stylesheet). Note that generating .rst files this way shouldn't be much of a stretch so as to fully integrate into the official Python docs. Thoughts? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42560> _______________________________________ From report at bugs.python.org Sun Sep 12 19:12:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 12 Sep 2021 23:12:23 +0000 Subject: [issue45177] Use shared test loader when possible when running test suite Message-ID: <1631488343.34.0.878407782528.issue45177@roundup.psfhosted.org> New submission from Erlend E. Aasland <erlend.aasland at innova.no>: Use unittest.defaultTestLoader instead of unittest.TestLoader() when possible, to avoid creating unnecessary many instances. ---------- components: Tests messages: 401674 nosy: erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: Use shared test loader when possible when running test suite versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45177> _______________________________________ From report at bugs.python.org Sun Sep 12 19:12:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 12 Sep 2021 23:12:53 +0000 Subject: [issue45177] Use shared test loader when possible when running test suite In-Reply-To: <1631488343.34.0.878407782528.issue45177@roundup.psfhosted.org> Message-ID: <1631488373.19.0.814959986548.issue45177@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- keywords: +patch pull_requests: +26715 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28301 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45177> _______________________________________ From report at bugs.python.org Sun Sep 12 19:29:16 2021 From: report at bugs.python.org (WGH) Date: Sun, 12 Sep 2021 23:29:16 +0000 Subject: [issue21515] Use Linux O_TMPFILE flag in tempfile.TemporaryFile? In-Reply-To: <1400231841.29.0.337128735098.issue21515@psf.upfronthosting.co.za> Message-ID: <1631489356.14.0.845596883578.issue21515@roundup.psfhosted.org> WGH <wgh at torlan.ru> added the comment: > My patch uses O_EXCL. It makes possible to use linkat() to create a path for the temporary file (I didn't try it, but I read that it's possible). I don't know if using O_EXCL should be the default. I think it is the other way around. From the manual: "If O_EXCL is not specified, then linkat(2) can ..." ---------- nosy: +WGH _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21515> _______________________________________ From report at bugs.python.org Sun Sep 12 19:45:46 2021 From: report at bugs.python.org (WGH) Date: Sun, 12 Sep 2021 23:45:46 +0000 Subject: [issue45178] Support for linking unnamed temporary files into filesystem on Linux Message-ID: <1631490346.44.0.449536820401.issue45178@roundup.psfhosted.org> New submission from WGH <wgh at torlan.ru>: In Linux, it's possible to create an unnamed temporary file in a specified directory by using open with O_TMPFILE flag (as if it was created with random name and immediately unlinked, but atomically). Unless O_EXCL is specified, the file can be then linked into filesystem using linkat syscall. It would be neat if it was possible in Python. There're a couple of things missing: 1) tempfile.TemporaryFile creates a file with O_EXCL flag, which prevents linking it into filesystem. 2) linkat must be called with AT_SYMLINK_FOLLOW flag (otherwise EXDEV is returned), which is broken right now (#37612) ---------- components: Library (Lib) messages: 401676 nosy: WGH priority: normal severity: normal status: open title: Support for linking unnamed temporary files into filesystem on Linux type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45178> _______________________________________ From report at bugs.python.org Sun Sep 12 19:47:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 12 Sep 2021 23:47:59 +0000 Subject: [issue29521] Minor warning messages when compiling documentation In-Reply-To: <1486714459.11.0.428886237265.issue29521@psf.upfronthosting.co.za> Message-ID: <1631490479.53.0.522818109355.issue29521@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29521> _______________________________________ From report at bugs.python.org Sun Sep 12 20:01:35 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 13 Sep 2021 00:01:35 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1631491295.87.0.651580771362.issue44771@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: Reported concern can be addressed in the new issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44771> _______________________________________ From report at bugs.python.org Sun Sep 12 20:03:05 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 13 Sep 2021 00:03:05 +0000 Subject: [issue45078] test_importlib: test_read_bytes() fails on AMD64 Windows8.1 Non-Debug 3.x In-Reply-To: <1630511688.74.0.180746211339.issue45078@roundup.psfhosted.org> Message-ID: <1631491385.02.0.693631012819.issue45078@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: The builder is now passing after the buildbot owner reset the checkout. ---------- resolution: -> fixed stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45078> _______________________________________ From report at bugs.python.org Sun Sep 12 22:02:43 2021 From: report at bugs.python.org (meng_xiaohui) Date: Mon, 13 Sep 2021 02:02:43 +0000 Subject: [issue45179] List.sort ERROR Message-ID: <1631498562.98.0.796323679023.issue45179@roundup.psfhosted.org> New submission from meng_xiaohui <1294886278 at qq.com>: There is a bug in this method? L.sort(key=None, reverse=False) -> None L is an instance of list. Argument key is a function. If L is in the body of argument key, L is always an empty list in test case, which is wrong ================= Run this: F = ['2', '3', '1'] G = ['7', '9', '8'] def key(i): print(F) print(G) res = int(i) + len(F) + len(G) return res G.sort(key=key) F.sort(key=key) ================= Actual output: ['2', '3', '1'] [] ['2', '3', '1'] [] ['2', '3', '1'] [] [] ['7', '8', '9'] [] ['7', '8', '9'] [] ['7', '8', '9'] ---------- components: Interpreter Core messages: 401679 nosy: meng_xiaohui priority: normal severity: normal status: open title: List.sort ERROR type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45179> _______________________________________ From report at bugs.python.org Sun Sep 12 22:10:19 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 13 Sep 2021 02:10:19 +0000 Subject: [issue45179] List.sort ERROR In-Reply-To: <1631498562.98.0.796323679023.issue45179@roundup.psfhosted.org> Message-ID: <1631499019.41.0.774661668907.issue45179@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Sorry, it is not clear what you think is the bug. What output do you expect? When I run the code, F and G are correctly sorted. ---------- nosy: +steven.daprano _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45179> _______________________________________ From report at bugs.python.org Sun Sep 12 22:15:41 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 13 Sep 2021 02:15:41 +0000 Subject: [issue45179] List.sort ERROR In-Reply-To: <1631498562.98.0.796323679023.issue45179@roundup.psfhosted.org> Message-ID: <1631499341.49.0.43816904474.issue45179@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Wait, are you talking about the list appearing to be empty during the sort? That's expected behaviour and not a bug: https://docs.python.org/3/library/stdtypes.html#list.sort I'm going to close this issue as Not A Bug. If the problem is something else, please re-open it with: - an explanation of what you think the bug is; - why you think it is a bug; - a simple test case; - the output you expect; - and the actual output. It is not enough to give the actual output with no explanation for why you think it is wrong. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45179> _______________________________________ From report at bugs.python.org Sun Sep 12 23:16:12 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 03:16:12 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631502972.83.0.0482888168039.issue45126@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26716 pull_request: https://github.com/python/cpython/pull/28302 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Sun Sep 12 23:16:17 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 13 Sep 2021 03:16:17 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631502977.56.0.476960244675.issue45126@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: New changeset aa6dd54d43dffbdf883c083e361f6ccf8642d66e by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231). (GH-28298) https://github.com/python/cpython/commit/aa6dd54d43dffbdf883c083e361f6ccf8642d66e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Mon Sep 13 00:02:54 2021 From: report at bugs.python.org (Nabeel Alzahrani) Date: Mon, 13 Sep 2021 04:02:54 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() Message-ID: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> New submission from Nabeel Alzahrani <nalza001 at ucr.edu>: The difflib.SequenceMatcher.ratio() gives 0.3 instead of 1.0 or at least 0.9 for the following two strings a and b: a=""" #include <iostream> #include <string> using namespace std; int main() { string userWord; unsigned int i; cin >> userWord; for(i = 0; i < userWord.size(); i++) { if(userWord.at(i) == 'i') { userWord.at(i) = '1'; } if(userWord.at(i) == 'a') { userWord.at(i) = '@'; } if(userWord.at(i) == 'm') { userWord.at(i) = 'M'; } if(userWord.at(i) == 'B') { userWord.at(i) = '8'; } if(userWord.at(i) == 's') { userWord.at(i) = '$'; } userWord.push_back('!'); } cout << userWord << endl; return 0; } """ b=""" #include <iostream> #include <string> using namespace std; int main() { string userWord; unsigned int i; cin >> userWord; userWord.push_back('!'); for(i = 0; i < userWord.size(); i++) { if(userWord.at(i) == 'i') { userWord.at(i) = '1'; } if(userWord.at(i) == 'a') { userWord.at(i) = '@'; } if(userWord.at(i) == 'm') { userWord.at(i) = 'M'; } if(userWord.at(i) == 'B') { userWord.at(i) = '8'; } if(userWord.at(i) == 's') { userWord.at(i) = '$'; } } cout << userWord << endl; return 0; } """ ---------- components: Library (Lib) messages: 401683 nosy: nalza001 priority: normal severity: normal status: open title: possible wrong result for difflib.SequenceMatcher.ratio() type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Mon Sep 13 00:07:43 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 04:07:43 +0000 Subject: [issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__ In-Reply-To: <1631015162.08.0.638095834379.issue45126@roundup.psfhosted.org> Message-ID: <1631506063.22.0.198762027084.issue45126@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 5d28bb699a305135a220a97ac52e90d9344a3004 by Miss Islington (bot) in branch '3.9': [3.10] bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231). (GH-28298) https://github.com/python/cpython/commit/5d28bb699a305135a220a97ac52e90d9344a3004 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45126> _______________________________________ From report at bugs.python.org Mon Sep 13 00:10:47 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 13 Sep 2021 04:10:47 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631506247.79.0.0328727194167.issue45180@roundup.psfhosted.org> Tim Peters <tim at python.org> added the comment: Unfortunately, you're getting hurt by the "autojunk" feature (see the docs). If you turn it off, you'll get a result much more to your liking: >>> print(SequenceMatcher(None, a, b).ratio()) 0.3431803896920176 >>> print(SequenceMatcher(None, a, b, autojunk=False).ratio()) 0.9553739786297926 ---------- nosy: +tim.peters resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Mon Sep 13 02:10:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 13 Sep 2021 06:10:42 +0000 Subject: [issue17913] stat.filemode returns "-" for sockets and unknown types In-Reply-To: <1367831480.84.0.461149512803.issue17913@psf.upfronthosting.co.za> Message-ID: <1631513442.62.0.402826115955.issue17913@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Thanks for the ping. The issue has been fixed a long time ago. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17913> _______________________________________ From report at bugs.python.org Mon Sep 13 02:16:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 06:16:57 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631513817.19.0.694569496711.issue5846@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +serhiy.storchaka nosy_count: 4.0 -> 5.0 pull_requests: +26717 pull_request: https://github.com/python/cpython/pull/28303 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Mon Sep 13 03:10:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:10:10 +0000 Subject: [issue45181] Rewrite loading sqlite3 tests Message-ID: <1631517010.88.0.220838315131.issue45181@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: The proposed PR rewrites the loading of sqlite3 tests. Instead of explicitly enumerating test modules and test classes in every module, and manually creating test suites, it uses unittest discover ability. Every new test files and test classes will be automatically added to tests. As a side effect, unittest filtering by pattern works now. $ ./python -m test.test_sqlite -vk long test_sqlite: testing with version '2.6.0', sqlite_version '3.31.1' test_func_return_long_long (sqlite3.test.test_userfunctions.FunctionTests) ... ok test_param_long_long (sqlite3.test.test_userfunctions.FunctionTests) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.001s OK ---------- components: Tests messages: 401687 nosy: erlendaasland, ghaering, serhiy.storchaka priority: normal severity: normal status: open title: Rewrite loading sqlite3 tests type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45181> _______________________________________ From report at bugs.python.org Mon Sep 13 03:12:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:12:58 +0000 Subject: [issue45181] Rewrite loading sqlite3 tests In-Reply-To: <1631517010.88.0.220838315131.issue45181@roundup.psfhosted.org> Message-ID: <1631517178.17.0.63615467236.issue45181@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26718 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28304 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45181> _______________________________________ From report at bugs.python.org Mon Sep 13 03:15:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:15:44 +0000 Subject: [issue45177] Use shared test loader when possible when running test suite In-Reply-To: <1631488343.34.0.878407782528.issue45177@roundup.psfhosted.org> Message-ID: <1631517344.32.0.15041556714.issue45177@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: See issue45181. Most of this code is gone. Also, TestLoader has mutable attribute "errors". I am not sure that it is good idea to share it between unrelated tests. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45177> _______________________________________ From report at bugs.python.org Mon Sep 13 03:36:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 13 Sep 2021 07:36:22 +0000 Subject: [issue45177] Use shared test loader when possible when running test suite In-Reply-To: <1631488343.34.0.878407782528.issue45177@roundup.psfhosted.org> Message-ID: <1631518582.35.0.331127756511.issue45177@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > Also, TestLoader has mutable attribute "errors". I am not sure that it is good idea to share it between unrelated tests. Noted. I'm closing this. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45177> _______________________________________ From report at bugs.python.org Mon Sep 13 03:46:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:46:28 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm Message-ID: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: requires_zlib is a decorator factory which returns a decorator, not a decorator. It should always be followed by parenthesis. In Lib/distutils/tests/test_bdist_rpm.py it is used improperly, so the corresponding tests were never ran. ---------- components: Tests messages: 401690 nosy: dstufft, eric.araujo, serhiy.storchaka priority: normal severity: normal status: open title: Incorrect use of requires_zlib in test_bdist_rpm type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 03:48:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:48:30 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631519310.3.0.385610407907.issue45182@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26719 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28305 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 03:49:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 07:49:57 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631519397.16.0.642499108238.issue5846@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 851811f5772c43f72f445e2ce1ac3ea9da951ae3 by Serhiy Storchaka in branch 'main': bpo-5846: Do not use obsolete unittest functions. (GH-28303) https://github.com/python/cpython/commit/851811f5772c43f72f445e2ce1ac3ea9da951ae3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Mon Sep 13 04:17:40 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 13 Sep 2021 08:17:40 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631521060.6.0.402926426921.issue45167@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28306 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Mon Sep 13 04:19:04 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 13 Sep 2021 08:19:04 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631521144.09.0.388893278297.issue45167@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Mon Sep 13 04:36:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 08:36:45 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631522205.77.0.224397200608.issue45167@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I think it is better to narrow the __getattr__. It can break protocols using other special methods. ---------- nosy: +gvanrossum, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Mon Sep 13 05:14:41 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 13 Sep 2021 09:14:41 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631524481.47.0.117656770815.issue45155@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: > I?m not convinced. I?m more concerned with the obscurity of the API. If I saw its use in some code I was reviewing, I?d look it up, and then I?d know exactly what it was doing. I know you would. But there are many others who just try things until they work. Also, if this does become *the* way to create bytes, it won't be obscure any more -- but you'd still need to remember to always specify byteorder for length > 1. That is, unless you *want* platform-specific behavior, which I don't think is all that often. Even in this case, you want to think about the issue, and omitting the argument is a bad way to encode that you thought about it. --- Hm, what happened to the idea of only requiring byteorder for `length > 1`? I recall it being discussed ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 05:28:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 13 Sep 2021 09:28:57 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1631525337.49.0.642715010681.issue45113@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- nosy: +erlendaasland _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Mon Sep 13 05:29:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 09:29:46 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631525386.32.0.029037765696.issue45116@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Performance regression 3.10b1 and later on Windows -> Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 13 07:01:50 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 13 Sep 2021 11:01:50 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631530910.01.0.119124095182.issue45156@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: I've proposed a solution, based on the assumption that we don't need to recurse into `_SpecState` props: ``` if isinstance(m._mock_children.get(attr), _SpecState): continue ``` It seems like a simple and reasonable thing to do. Link: https://github.com/python/cpython/pull/28300 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Mon Sep 13 07:10:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 11:10:22 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631531422.24.0.84398392363.issue45182@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 9260e6739865c966c3ec6c5c289e0b96f848403e by Serhiy Storchaka in branch 'main': bpo-45182: Fix incorrect use of requires_zlib in test_bdist_rpm (GH-28305) https://github.com/python/cpython/commit/9260e6739865c966c3ec6c5c289e0b96f848403e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 07:10:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 11:10:33 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631531433.58.0.355914960053.issue45182@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26721 pull_request: https://github.com/python/cpython/pull/28308 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 07:10:37 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 11:10:37 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631531437.9.0.00602448863359.issue45182@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26722 pull_request: https://github.com/python/cpython/pull/28309 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 07:16:13 2021 From: report at bugs.python.org (Ghostkeeper) Date: Mon, 13 Sep 2021 11:16:13 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1631531773.06.0.73917618085.issue45022@roundup.psfhosted.org> Ghostkeeper <rubend at tutanota.com> added the comment: It seems this just broke our Windows build process of Python 3.8, since the cpython-bin-deps repository now contains only a libffi-8.lib while the the Python 3.8 branch still refers to libffi-7.lib in libffi.props: https://github.com/python/cpython/blob/5a42a49477cd601d67d81483f9589258dccb14b1/PCbuild/libffi.props#L13 ---------- nosy: +Ghostkeeper _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Mon Sep 13 07:16:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 11:16:30 +0000 Subject: [issue45181] Rewrite loading sqlite3 tests In-Reply-To: <1631517010.88.0.220838315131.issue45181@roundup.psfhosted.org> Message-ID: <1631531790.52.0.599858017455.issue45181@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 3e19409d6443c66a6a7d62f58b2bb4e8330e56c4 by Serhiy Storchaka in branch 'main': bpo-45181: Simplify loading sqlite3 tests (GH-28304) https://github.com/python/cpython/commit/3e19409d6443c66a6a7d62f58b2bb4e8330e56c4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45181> _______________________________________ From report at bugs.python.org Mon Sep 13 07:20:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 11:20:36 +0000 Subject: [issue45181] Rewrite loading sqlite3 tests In-Reply-To: <1631517010.88.0.220838315131.issue45181@roundup.psfhosted.org> Message-ID: <1631532036.54.0.188743697536.issue45181@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45181> _______________________________________ From report at bugs.python.org Mon Sep 13 07:29:05 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 13 Sep 2021 11:29:05 +0000 Subject: [issue45183] Unexpected exception with zip importer Message-ID: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> New submission from Ronald Oussoren <ronaldoussoren at mac.com>: The attached file demonstrates the problem: If importlib.invalidate_caches() is called while the zipfile used by the zip importer is not available the import system breaks entirely. I found this in a testsuite that accedently did this (it should have updated sys.path). I get the following exception: $ python3.10 t.py Traceback (most recent call last): File "/Users/ronald/Projects/modulegraph2/t.py", line 27, in <module> import uu File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 945, in _find_spec File "<frozen importlib._bootstrap_external>", line 1430, in find_spec File "<frozen importlib._bootstrap_external>", line 1402, in _get_spec File "<frozen zipimport>", line 168, in find_spec File "<frozen zipimport>", line 375, in _get_module_info TypeError: argument of type 'NoneType' is not iterable This exception is not very friendly.... This particular exception is caused by setting self._files to None in the importer's invalidate_caches method, while not checking for None in _get_modules_info. I'm not sure what the best fix would be, setting self._files to an empty list would likely be the easiest fix. Note that the script runs without errors in Python 3.9. ---------- files: repro.py keywords: 3.10regression messages: 401698 nosy: ronaldoussoren priority: normal severity: normal status: open title: Unexpected exception with zip importer versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50279/repro.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Mon Sep 13 07:29:39 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 13 Sep 2021 11:29:39 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631532579.9.0.202782988622.issue45183@roundup.psfhosted.org> Change by Ronald Oussoren <ronaldoussoren at mac.com>: ---------- nosy: +pablogsal, twouters _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Mon Sep 13 07:35:17 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 11:35:17 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631532917.05.0.0849858050788.issue45182@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 2f1d9bca144f3bbb4199111f4763ef05daea8526 by Miss Islington (bot) in branch '3.10': bpo-45182: Fix incorrect use of requires_zlib in test_bdist_rpm (GH-28305) https://github.com/python/cpython/commit/2f1d9bca144f3bbb4199111f4763ef05daea8526 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 07:35:41 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 13 Sep 2021 11:35:41 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631532941.46.0.183800154647.issue45183@roundup.psfhosted.org> Change by Ronald Oussoren <ronaldoussoren at mac.com>: ---------- type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Mon Sep 13 07:40:02 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 13 Sep 2021 11:40:02 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1631533202.41.0.758403904689.issue40080@roundup.psfhosted.org> Change by Filipe La?ns <lains at riseup.net>: ---------- nosy: +FFY00 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40080> _______________________________________ From report at bugs.python.org Mon Sep 13 08:00:52 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 13 Sep 2021 12:00:52 +0000 Subject: [issue20524] format error messages should provide context information In-Reply-To: <1391642595.93.0.722493013717.issue20524@psf.upfronthosting.co.za> Message-ID: <1631534452.36.0.497713413132.issue20524@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch nosy: +sobolevn nosy_count: 4.0 -> 5.0 pull_requests: +26723 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28310 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20524> _______________________________________ From report at bugs.python.org Mon Sep 13 08:04:47 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 13 Sep 2021 12:04:47 +0000 Subject: [issue20524] format error messages should provide context information In-Reply-To: <1391642595.93.0.722493013717.issue20524@psf.upfronthosting.co.za> Message-ID: <1631534687.43.0.000320141127271.issue20524@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: > I think that would require some major surgery to the code, but would be worth it. I've decided to take an easy path: https://github.com/python/cpython/pull/28310 ``` PyErr_Format(PyExc_ValueError, "Invalid format specifier: '%s' for object of type '%s'", PyUnicode_AsUTF8AndSize(format_spec, NULL), Py_TYPE(obj)->tp_name); ``` This worked for me as the starting point. It covered: int, float, complex, and str types. > Note that in your original example, you want the error to contain "{length:%HH:%MM}". By the time the error is detected, the only thing the code knows is the format specifier "%HH:%MM". It doesn't know the "length" part. I guess it has changed since the 2014. I would love to hear any feedback on my proposal and improve it to the level when it can be merged :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20524> _______________________________________ From report at bugs.python.org Mon Sep 13 08:37:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 12:37:42 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631536662.07.0.840650279538.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 85a4748118c3793be7047ecbcbfc79dd07cb2a75 by Livius in branch 'main': bpo-21302: Add clock_nanosleep() implementation for time.sleep() (GH-28111) https://github.com/python/cpython/commit/85a4748118c3793be7047ecbcbfc79dd07cb2a75 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Mon Sep 13 08:43:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 12:43:44 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631537024.24.0.346667516221.issue21302@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26724 pull_request: https://github.com/python/cpython/pull/28311 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Mon Sep 13 09:34:50 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 13 Sep 2021 13:34:50 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1631540090.44.0.389599416653.issue42135@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- nosy: +hugovk nosy_count: 1.0 -> 2.0 pull_requests: +26725 pull_request: https://github.com/python/cpython/pull/28312 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42135> _______________________________________ From report at bugs.python.org Mon Sep 13 09:41:40 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 13 Sep 2021 13:41:40 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631540500.93.0.58651322666.issue45182@roundup.psfhosted.org> ?ric Araujo <merwok at netwok.org> added the comment: At this point, it seems that there would be more value in reporting this to setuptools than on bpo. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 10:26:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 13 Sep 2021 14:26:20 +0000 Subject: [issue45168] dis output for LOAD_CONST is confusing In-Reply-To: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> Message-ID: <1631543180.18.0.393751507108.issue45168@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26726 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28313 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Mon Sep 13 10:40:02 2021 From: report at bugs.python.org (Andreas H.) Date: Mon, 13 Sep 2021 14:40:02 +0000 Subject: [issue45184] Add `pop` function to remove context manager from (Async)ExitStack Message-ID: <1631544002.04.0.855227455654.issue45184@roundup.psfhosted.org> New submission from Andreas H. <ahangauer at gmx.net>: Currently it is not possible to remove context managers from an ExitStack (or AsyncExitStack). Workarounds are difficult and generally do accesses implementation details of (Async)ExitStack. See e.g. https://stackoverflow.com/a/37607405. It could be done as follows: class AsyncExitStackWithPop(contextlib.AsyncExitStack): """Same as AsyncExitStack but with pop, i.e. removal functionality""" async def pop(self, cm): callbacks = self._exit_callbacks self._exit_callbacks = collections.deque() found = None while callbacks: cb = callbacks.popleft() if cb[1].__self__ == cm: found = cb else: self._exit_callbacks.append(cb) if not found: raise KeyError("context manager not found") if found[0]: return found[1](None,None,None) else: return await found[1](None, None, None) The alternative is re-implementation of ExitStack with pop functionality, but that is also very difficult to get right (especially with exceptions). Which is probably the reason why there is ExitStack in the library at all. So I propose to augment (Async)ExitStack with a `pop` method like above or similar to the above. Use-Cases: An example is a component that manages several connections to network services. During run-time the network services might need to change (i.e. some be disconnected and some be connected according to business logic), or handle re-connection events (ie. graceful response to network errors). It is not too hard to imagine more use cases. Essentially every case where dynamic resource management is needed and where single resources are managable with python context managers. ---------- components: Library (Lib) messages: 401703 nosy: andreash, ncoghlan, yselivanov priority: normal severity: normal status: open title: Add `pop` function to remove context manager from (Async)ExitStack type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45184> _______________________________________ From report at bugs.python.org Mon Sep 13 10:45:40 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 13 Sep 2021 14:45:40 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1631544340.04.0.812763789365.issue45022@roundup.psfhosted.org> Zachary Ware <zachary.ware at gmail.com> added the comment: The 3.8 branch has been updated to point to the `libffi-3.3.0` tag; you can either update to the latest revision of 3.8 or pull in just 8c3a10e58b12608c3759fee684e7aa399facae2a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45022> _______________________________________ From report at bugs.python.org Mon Sep 13 10:51:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 13 Sep 2021 14:51:11 +0000 Subject: [issue4492] httplib code thinks it closes connection, but does not In-Reply-To: <1228241719.92.0.946688230988.issue4492@psf.upfronthosting.co.za> Message-ID: <1631544671.68.0.854453245895.issue4492@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: The code has changed quite a lot since this was created and it no longer matches the description in this issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue4492> _______________________________________ From report at bugs.python.org Mon Sep 13 10:59:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 14:59:05 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1631545145.6.0.953001190516.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Timeout is affected by jumps in system time -> acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Mon Sep 13 11:40:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 15:40:36 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631547636.91.0.111812977686.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 85dc53a463967659075744ad911d08a32aa70dd5 by Victor Stinner in branch 'main': bpo-21302: Update time.sleep() doc for clock_nanosleep() (GH-28311) https://github.com/python/cpython/commit/85dc53a463967659075744ad911d08a32aa70dd5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Mon Sep 13 11:45:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 15:45:02 +0000 Subject: [issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide: Linux kernel 5.15 regression In-Reply-To: <1630948256.1.0.298507689656.issue45119@roundup.psfhosted.org> Message-ID: <1631547902.83.0.4901042215.issue45119@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Update: Frederic Weisbecker proposed a kernel fix: https://lkml.org/lkml/2021/9/13/1647 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45119> _______________________________________ From report at bugs.python.org Mon Sep 13 12:22:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 16:22:04 +0000 Subject: [issue45184] Add `pop` function to remove context manager from (Async)ExitStack In-Reply-To: <1631544002.04.0.855227455654.issue45184@roundup.psfhosted.org> Message-ID: <1631550124.9.0.636061590062.issue45184@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: If you can remove context managers in arbitrary order it is no longer a stack. I think that it is just a wrong tool for your problem. Just maintain a collection of opened connections. Set or dict can be better that list or deque. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45184> _______________________________________ From report at bugs.python.org Mon Sep 13 12:38:44 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 13 Sep 2021 16:38:44 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631445658.16.0.770802421368.issue45155@roundup.psfhosted.org> Message-ID: <F5BC64BE-D044-4E91-B664-891549D01D74@python.org> Barry A. Warsaw <barry at python.org> added the comment: That?s okay, Brandt?s improved sys.byteorder is fastest <wink>. % ./python.exe -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "little")' 2000000 loops, best of 11: 94.6 nsec per loop % ./python.exe -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "big")' 2000000 loops, best of 11: 97.8 nsec per loop % ./python.exe -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10)' 5000000 loops, best of 11: 79.1 nsec per loop On Sep 12, 2021, at 04:20, Raymond Hettinger <report at bugs.python.org> wrote: > > Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > > Interestingly, "little" is faster than "big". > > $ python3.10 -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "little")' > 5000000 loops, best of 11: 82.7 nsec per loop > $ python3.10 -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "big")' > 5000000 loops, best of 11: 90.6 nsec per loop > > ---------- > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue45155> > _______________________________________ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 12:39:06 2021 From: report at bugs.python.org (Richard) Date: Mon, 13 Sep 2021 16:39:06 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1631551146.91.0.758518526329.issue38222@roundup.psfhosted.org> Richard <nyuszika7h at gmail.com> added the comment: I would like for this to be reconsidered. Yes, you can use str(), but converting back and forth becomes really clunky: log_dir = 'logs/{date}' log_file = Path(str(path).format(time.strftime('%Y-%m-%d')) / 'log.txt' ---------- nosy: +nyuszika7h _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38222> _______________________________________ From report at bugs.python.org Mon Sep 13 12:39:59 2021 From: report at bugs.python.org (Richard) Date: Mon, 13 Sep 2021 16:39:59 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1631551199.85.0.724621569928.issue38222@roundup.psfhosted.org> Richard <nyuszika7h at gmail.com> added the comment: Sorry, that should have been: log_dir = Path('logs/{date}') ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38222> _______________________________________ From report at bugs.python.org Mon Sep 13 12:47:19 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 13 Sep 2021 16:47:19 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1631551639.46.0.0292233474804.issue38222@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: > log_dir = Path('logs/{date}') > log_file = Path(str(path).format(time.strftime('%Y-%m-%d')) / 'log.txt' (I think you're missing "date=" in the call to .format().) Could you show what you think this would look like if Path.__format__ existed? I don't think anyone's suggesting that path.format() would be added by this issue, but maybe that would be a reasonable proposal as a different issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38222> _______________________________________ From report at bugs.python.org Mon Sep 13 12:52:43 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 13 Sep 2021 16:52:43 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631551963.64.0.777475024354.issue45155@roundup.psfhosted.org> Barry A. Warsaw <barry at python.org> added the comment: I created a Discourse poll: https://discuss.python.org/t/what-should-be-the-default-value-for-int-to-bytes-byteorder/10616 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 13:08:43 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 17:08:43 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631552923.32.0.198749938938.issue45182@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 218fe2cb798df32a722f61b95db280f6685ec3e6 by Miss Islington (bot) in branch '3.9': bpo-45182: Fix incorrect use of requires_zlib in test_bdist_rpm (GH-28305) https://github.com/python/cpython/commit/218fe2cb798df32a722f61b95db280f6685ec3e6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 13:12:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 13 Sep 2021 17:12:44 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1631553164.19.0.483068787634.issue45173@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 1fc41ae8709e20d741bd86c2345173688a5e84b0 by Hugo van Kemenade in branch 'main': bpo-45173 Remove configparser deprecations (GH-28292) https://github.com/python/cpython/commit/1fc41ae8709e20d741bd86c2345173688a5e84b0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45173> _______________________________________ From report at bugs.python.org Mon Sep 13 13:18:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 13 Sep 2021 17:18:12 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631553492.78.0.619597905384.issue45167@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Serhiy, can you elaborate how GH-28306 can break protocols using other special methods? I can't come up with an example. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Mon Sep 13 13:24:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 13 Sep 2021 17:24:14 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631553854.61.0.388855675754.issue35474@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 9cd8fb8d6356c17dafa1be727cab3d438f6df53f by Miss Islington (bot) in branch '3.9': bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286) (GH-28290) https://github.com/python/cpython/commit/9cd8fb8d6356c17dafa1be727cab3d438f6df53f ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Mon Sep 13 13:24:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 13 Sep 2021 17:24:33 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631553873.32.0.692351265903.issue35474@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 06c26f4d2909eae196ac81c9ed9b41e747e42685 by Miss Islington (bot) in branch '3.10': bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286) (GH-28289) https://github.com/python/cpython/commit/06c26f4d2909eae196ac81c9ed9b41e747e42685 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Mon Sep 13 13:25:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 13 Sep 2021 17:25:10 +0000 Subject: [issue35474] mimetypes.guess_all_extensions potentially mutates list In-Reply-To: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> Message-ID: <1631553910.39.0.567648080392.issue35474@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Serhiy! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35474> _______________________________________ From report at bugs.python.org Mon Sep 13 13:30:19 2021 From: report at bugs.python.org (Matthew Barnett) Date: Mon, 13 Sep 2021 17:30:19 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631554219.06.0.847255761234.issue45155@roundup.psfhosted.org> Matthew Barnett <python at mrabarnett.plus.com> added the comment: I'd probably say "In the face of ambiguity, refuse the temptation to guess". As there's disagreement about the 'correct' default, make it None and require either "big" or "little" if length > 1 (the default). ---------- nosy: +mrabarnett _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 13:37:51 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 13 Sep 2021 17:37:51 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1631554671.12.0.876953352413.issue38222@roundup.psfhosted.org> Antoine Pitrou <pitrou at free.fr> added the comment: I would be in favour of adding Path.__format__, even though I'm not terribly convinced by the use case presented. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38222> _______________________________________ From report at bugs.python.org Mon Sep 13 15:42:26 2021 From: report at bugs.python.org (Andreas H.) Date: Mon, 13 Sep 2021 19:42:26 +0000 Subject: [issue45184] Add `pop` function to remove context manager from (Async)ExitStack In-Reply-To: <1631544002.04.0.855227455654.issue45184@roundup.psfhosted.org> Message-ID: <1631562146.07.0.400667555203.issue45184@roundup.psfhosted.org> Andreas H. <ahangauer at gmx.net> added the comment: I see your point. But even with `pop` or `remove` it is still a stack or stack-like. In the normal case the context managers are still released in reverse order as they were added. Order cannot be changed arbitrarily. There is just the additional function of removing a single context manager prematurely(e.g. for graceful error recovery and such). I would perhaps say that a stack is the "wrong" solution to the problem of "programmatically combining context managers" [this is from the official documentaion] in the first place. I write wrong in quotes because it is of course not really wrong, as one wants the reverse exit order. But to adequately address the dynamic case one needs in my opinion the ability to prematurely remove context managers. Otherwise the use is limited. Reimplemeting the desired functionality with dicts or lists does not seem appealing to me as the code will be 90% the same to ExitStack. It will then also make ExitStack obsolete. So why not integrate it there? The unsymmetry of being able to add context managers but not being able to remove them also seems odd to me. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45184> _______________________________________ From report at bugs.python.org Mon Sep 13 16:14:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 20:14:35 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run Message-ID: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: test.test_ssl.TestEnumerations is not run when run ssl tests. If add it to the list of test classes it fails: ====================================================================== ERROR: test_options (test.test_ssl.TestEnumerations) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4981, in test_options enum._test_simple_enum(CheckedOptions, ssl.Options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum raise TypeError('enum mismatch:\n %s' % '\n '.join(failed)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: enum mismatch: '_use_args_': checked -> False simple -> True '__format__': checked -> <function Enum.__format__ at 0x7f18691815a0> simple -> <function IntFlag.__format__ at 0x7f1869182620> '__getnewargs__': checked -> None simple -> <method '__getnewargs__' of 'int' objects> ====================================================================== ERROR: test_sslerrornumber (test.test_ssl.TestEnumerations) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4998, in test_sslerrornumber enum._test_simple_enum(Checked_SSLMethod, ssl._SSLMethod) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum raise TypeError('enum mismatch:\n %s' % '\n '.join(failed)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: enum mismatch: extra key: 'PROTOCOL_SSLv23' ====================================================================== ERROR: test_sslmethod (test.test_ssl.TestEnumerations) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4973, in test_sslmethod enum._test_simple_enum(Checked_SSLMethod, ssl._SSLMethod) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum raise TypeError('enum mismatch:\n %s' % '\n '.join(failed)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: enum mismatch: extra key: 'PROTOCOL_SSLv23' ====================================================================== ERROR: test_verifyflags (test.test_ssl.TestEnumerations) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 5002, in test_verifyflags enum.FlagEnum, 'VerifyFlags', 'ssl', ^^^^^^^^^^^^^ AttributeError: module 'enum' has no attribute 'FlagEnum' ---------------------------------------------------------------------- ---------- components: Tests messages: 401723 nosy: christian.heimes, serhiy.storchaka priority: normal severity: normal status: open title: test.test_ssl.TestEnumerations is not run type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Mon Sep 13 16:22:37 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 13 Sep 2021 20:22:37 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run In-Reply-To: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> Message-ID: <1631564557.88.0.306028393038.issue45185@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Mon Sep 13 16:34:10 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 20:34:10 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. Message-ID: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: (See: https://github.com/python/cpython/pull/28107#issuecomment-915627148) The output from marshal (e.g. PyMarshal_WriteObjectToString(), marshal.dump()) may be different depending on if it is a debug or non-debug build. I found this while working on freezing stdlib modules. ---------- components: Interpreter Core messages: 401724 nosy: eric.snow priority: normal severity: normal stage: needs patch status: open title: Marshal output isn't completely deterministic. type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Mon Sep 13 16:34:45 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 20:34:45 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631565285.94.0.387696185859.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: FYI, I came up with a fix (for frozen modules, at least) in https://github.com/python/cpython/pull/28107. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Mon Sep 13 16:34:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 20:34:45 +0000 Subject: [issue45187] Some tests in test_socket are not run Message-ID: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Test classes ISOTPTest, J1939Test, BasicUDPLITETest, UDPLITETimeoutTest in test_socket are not included in the list of test classes and are not run by regrtest. ---------- components: Tests messages: 401725 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Some tests in test_socket are not run type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Mon Sep 13 16:36:49 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 20:36:49 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631565409.56.0.0254924678187.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: One consequence of this is that frozen module .h files can be different for debug vs. non-debug, which causes CI (and Windows builds) to fail. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Mon Sep 13 16:38:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 20:38:06 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631565486.98.0.886822145255.issue45155@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: >>> (65).to_bytes() b'A' It seems like your proposal is mostly guided by: convert an int to a byte (bytes string of length 1). IMO this case is special enough to justify the usage of a different function. What if people expect int.to_bytes() always return a single byte, but then get two bytes by mistake? ch = 256 byte = ch.to_bytes() assert len(byte) == 2 # oops A function dedicated to create a single byte is expected to raise a ValueError for values outside the range [0; 255]. Like: >>> struct.pack('B', 255) b'\xff' >>> struct.pack('B', 256) struct.error: ubyte format requires 0 <= number <= 255 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 16:38:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 20:38:51 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631565531.33.0.18592101364.issue45187@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26727 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28317 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Mon Sep 13 16:39:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 20:39:14 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631565554.02.0.144003937467.issue45155@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > In the PEP 467 discussion, I proposed (...) Since this PEP is controversial, and this issue seems to be controversial as well, maybe this idea should be part of the PEP. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 16:39:37 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 13 Sep 2021 20:39:37 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631565577.29.0.318194496759.issue45155@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: The poll is invalid, since the option that most people want is deliberately not offered. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 16:44:06 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 20:44:06 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. Message-ID: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: Currently for Windows builds, generating the frozen modules depends on first building python.exe. One consequence of this is that we must keep all frozen module .h files in the repo (which we'd like to avoid for various reasons). We should be able to freeze modules before building python.exe, like we already do via our Makefile. From what I understand, this will require that a subset of the runtime be separately buildable so we can use it in _freeze_module.c and use that before actually building python.exe. @Steve, please correct any details I got wrong here. :) ---------- components: Build messages: 401731 nosy: eric.snow, steve.dower priority: normal severity: normal stage: needs patch status: open title: De-couple the Windows builds from freezing modules. type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Mon Sep 13 16:46:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 20:46:12 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631565972.9.0.6695259024.issue45187@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: PR 28317 makes test classes in test_socket be autocollected instead of explicitly enumerated. This will save as from similar errors in future. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Mon Sep 13 16:48:21 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 20:48:21 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631566101.53.0.0223426480263.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- dependencies: +De-couple the Windows builds from freezing modules., Marshal output isn't completely deterministic. _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 13 16:53:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Sep 2021 20:53:52 +0000 Subject: =?utf-8?q?=5Bissue45157=5D_DTrace_on_RHEL7=2C_generated_Include/pydtrace?= =?utf-8?q?=5Fprobes=2Eh_fails_to_build=3A_error=3A_impossible_constraint_?= =?utf-8?b?aW4g4oCYYXNt4oCZ?= In-Reply-To: <1631227027.9.0.449949319255.issue45157@roundup.psfhosted.org> Message-ID: <1631566432.33.0.93100537801.issue45157@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Issue worked around by disabling LTO on RHEL7 buildbots: https://github.com/python/buildmaster-config/commit/b8e56c0a545b8f5176c6984dd38a4e2630f21306 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45157> _______________________________________ From report at bugs.python.org Mon Sep 13 16:59:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 13 Sep 2021 20:59:19 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1631566101.57.0.0746116557328.issue45020@roundup.psfhosted.org> Message-ID: <CAP7+vJLhpcXfHb_Ao43RKD-qExJZPdCO3aX-CHFG_48V3kFxpw@mail.gmail.com> Guido van Rossum <guido at python.org> added the comment: If you reduce the number of modules being frozen you could probably manage to land this (or most of it) before tackling those other issues. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 13 16:59:55 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 13 Sep 2021 20:59:55 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631566795.07.0.580735109835.issue45188@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Only thing I'd add is that you should just be able to list the required .c files in _freeze_module.vcxproj (formerly known as freeze_importlib.vcxproj) rather than depending on pythoncore.vcxproj. That will generate twice as many .obj files for those modules (which is fine, just takes a little more time at build), and will force everything to be regenerated if you modify them, but that's an expected part of having part of the interpreter depend upon itself. ---------- components: +Windows nosy: +paul.moore, tim.golden, zach.ware _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Mon Sep 13 17:23:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 21:23:03 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631568183.87.0.668897826129.issue45167@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I meant that the current __getattr__ breaks deepcopy(). It can break also other protocols. It already has a list of exceptions, we need to add "__copy__" and "__deepcopy__" in this list. Or maybe exclude all dunder names by default and use a white list? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Mon Sep 13 17:24:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Sep 2021 21:24:16 +0000 Subject: [issue45182] Incorrect use of requires_zlib in test_bdist_rpm In-Reply-To: <1631519188.27.0.751615077153.issue45182@roundup.psfhosted.org> Message-ID: <1631568256.67.0.374142683562.issue45182@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45182> _______________________________________ From report at bugs.python.org Mon Sep 13 17:26:02 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 21:26:02 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631568362.8.0.852975428348.issue45019@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26728 pull_request: https://github.com/python/cpython/pull/28319 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Mon Sep 13 17:50:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 13 Sep 2021 21:50:34 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631569834.26.0.067676821468.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Just reread the thread. AFAICT not a single use case was presented for having system byte ordering as the default. However, multiple respondents have pointed out that a default to system byte ordering is a bug waiting to happen, almost ensuring that some users will encounter unexpected behaviors when crossing platforms. We've seen issues like that before and should avoid them. We don't really need a poll. What is needed is for the system byte ordering proponents to present valid reasons why it would useful and to address the concerns that it is actually harmful. If the proposal goes through despite the concerns, we should ask folks writing lint tools to flag every use of the default as a potential bug and advise people to never use the default unless they know for sure that it is encoding only a single byte. Personally, I would never let system byte ordering pass a code review. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 18:18:45 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 22:18:45 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631571525.25.0.472020239143.issue45019@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset a2d8c4b81b8e68e2ffe10945f7ca69174c14e52a by Eric Snow in branch 'main': bpo-45019: Do some cleanup related to frozen modules. (gh-28319) https://github.com/python/cpython/commit/a2d8c4b81b8e68e2ffe10945f7ca69174c14e52a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Mon Sep 13 18:47:59 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 22:47:59 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631573279.93.0.733078317465.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26729 pull_request: https://github.com/python/cpython/pull/28320 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 13 18:57:57 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 13 Sep 2021 22:57:57 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1631573877.62.0.459675820336.issue42135@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: New changeset 9f93018b69d72cb48d3444554261ae3b0ea00c93 by Hugo van Kemenade in branch 'main': bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312) https://github.com/python/cpython/commit/9f93018b69d72cb48d3444554261ae3b0ea00c93 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42135> _______________________________________ From report at bugs.python.org Mon Sep 13 18:58:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 13 Sep 2021 22:58:14 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1631573894.2.0.0484554590311.issue42135@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26730 pull_request: https://github.com/python/cpython/pull/28321 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42135> _______________________________________ From report at bugs.python.org Mon Sep 13 19:19:52 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 23:19:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <CAP7+vJLhpcXfHb_Ao43RKD-qExJZPdCO3aX-CHFG_48V3kFxpw@mail.gmail.com> Message-ID: <CALFfu7C22-FL_vJe0z=b-P6SPouhcm7m3xKU2NY9rfiFSzW92g@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Mon, Sep 13, 2021 at 2:59 PM Guido van Rossum <report at bugs.python.org> wrote: > If you reduce the number of modules being frozen you could probably manage > to land this (or most of it) before tackling those other issues. Yeah, that's what I'm doing. :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 13 19:22:53 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 13 Sep 2021 23:22:53 +0000 Subject: [issue45189] Drop the "list_frozen" command from _test_embed. Message-ID: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: In Programs/_test_embed.c the "list_frozen" command prints out the name of each frozen module (defined in Python/frozen.c). The only place this is used is in Tools/scripts/generate_stdlib_module_names.py (in list_frozen()). That script can be updated to call imp._get_frozen_module_names(), which was added in PR GH-28319 for bpo-45019. Then _test_embed can go back to being used strictly for tests. (FWIW, the script could also read from Python/frozen_modules/MANIFEST after running "make regen-frozen". That file was added in GH-27980). ---------- components: Demos and Tools messages: 401741 nosy: eric.snow, vstinner priority: normal severity: normal stage: needs patch status: open title: Drop the "list_frozen" command from _test_embed. versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45189> _______________________________________ From report at bugs.python.org Mon Sep 13 19:33:13 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 13 Sep 2021 23:33:13 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1631575993.29.0.539715877698.issue42135@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: New changeset a390bb6d66027517498e75b6b91a91be5f136d28 by Miss Islington (bot) in branch '3.10': bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312) (GH-28321) https://github.com/python/cpython/commit/a390bb6d66027517498e75b6b91a91be5f136d28 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42135> _______________________________________ From report at bugs.python.org Mon Sep 13 19:37:47 2021 From: report at bugs.python.org (neonene) Date: Mon, 13 Sep 2021 23:37:47 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631576267.96.0.237615972116.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: With msvc 16.10.3 and 16.11.2 (latest), PR25244 told me the amount of code in _PyEval_EvalFrameDefault() is over the limit of PGO. In the old version of _PyEval_EvalFrameDefault (b98eba5), the same issue can be caused adding any-code anywhere with more than 20 expressions/statements. For example, at the top/middle/end of the function, repeating "if (0) {}" 10times, or "if (0) {19 statements}". As for python3.9.7, more than 800 expressions/statements. Here is just a workaround for 3.10rc2 on windows. ================================================== --- Python/ceval.c +++ Python/ceval.c @@ -1306,9 +1306 @@ -#define DISPATCH() \ - { \ - if (trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE) { \ - goto tracing_dispatch; \ - } \ - f->f_lasti = INSTR_OFFSET(); \ - NEXTOPARG(); \ - DISPATCH_GOTO(); \ - } +#define DISPATCH() goto tracing_dispatch @@ -1782,4 +1774,9 @@ tracing_dispatch: { + if (!(trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE)) { + f->f_lasti = INSTR_OFFSET(); + NEXTOPARG(); + DISPATCH_GOTO(); + } int instr_prev = f->f_lasti; f->f_lasti = INSTR_OFFSET(); ================================================== This patch becomes ineffective just adding one expression to DISPATCH macro as below #define DISPATCH() {if (1) goto tracing_dispatch;} And this approach is not sufficient for 3.11 with bigger eval-func. I don't know a cl/link option to lift such restriction of function size. 3.10rc2 x86 pgo : 1.00 patched : 1.09x faster (slower 5, faster 48, not significant 5) 3.10rc2 x64 pgo : 1.00 (roughly the same speed as official bin) patched : 1.07x faster (slower 5, faster 47, not significant 6) patched(/Ob3) : 1.07x faster (slower 7, faster 45, not significant 6) x64 results are posted. Fixing inlining rejection also made __forceinline buildable with normal processing time and memory usage. ---------- Added file: https://bugs.python.org/file50280/310rc2_benchmarks.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 13 19:51:43 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 13 Sep 2021 23:51:43 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631577103.97.0.0993269185649.issue45188@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- keywords: +patch pull_requests: +26731 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28322 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Mon Sep 13 20:21:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 00:21:13 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631578873.49.0.722655394132.issue40128@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Pablo (and Ned) PR_26672 (and backports) added one line to idlelib/autocomplete_w.py, 206 or 209. acw.update_idletasks() # Need for tk8.6.8 on macOS: #40128. NEWs item included "The added update_idletask call should be harmless and possibly helpful otherwise. " This is consistent with https://www.tcl.tk/man/tcl8.6/TclCmd/update.html At the end of the PR, Tal Einat reports "this broke completions for me with Tcl/Tk 8.6.11 on Ubuntu 20.04. Apparently also with Tcl/Tk 8.6.10, which is the current default. Also broken in my latest install of Python 3.9.7 (not built from source)." Tal, did you verify that #ing the line fixes your issues? Can you be more specific as to what you see? I rechecked on my Macbook and the line is definitely needed for 3.9.7 with tk 8.6.8. It makes no difference for 3.10.0rc2 with 8.6.11. (So the bug of requiring update_idletasks call to ever see the dropdown box was fixed.) Assume Tal's report is verified on another machine, we could, before 3.10.0, 1. Remove the line. 2. Disable the line. 3. Make it conditional on macOS and 8.6.8. It is obviously too late for 3.9.7. ---------- nosy: +lukasz.langa, pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Mon Sep 13 20:23:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 00:23:05 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631578985.76.0.484563964006.issue40128@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: https://www.tcl.tk/man/tcl8.6/TclCmd/update.html ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Mon Sep 13 20:31:01 2021 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 14 Sep 2021 00:31:01 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631579461.19.0.941375089134.issue45155@roundup.psfhosted.org> Matthew Barnett <python at mrabarnett.plus.com> added the comment: I wonder whether there should be a couple of other endianness values, namely, "native" and "network", for those cases where you want to be explicit about it. If you use "big" it's not clear whether that's because you want network endianness or because the platform is big-endian. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 13 21:17:53 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 14 Sep 2021 01:17:53 +0000 Subject: [issue45190] unicode 14.0 upgrade Message-ID: <1631582273.28.0.521036633786.issue45190@roundup.psfhosted.org> New submission from Benjamin Peterson <benjamin at python.org>: Unicode 14.0 is expected on September 14. We'll need to do the usual table regenerations. ---------- assignee: benjamin.peterson components: Unicode messages: 401747 nosy: benjamin.peterson, ezio.melotti, vstinner priority: normal severity: normal status: open title: unicode 14.0 upgrade _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45190> _______________________________________ From report at bugs.python.org Tue Sep 14 00:56:40 2021 From: report at bugs.python.org (nahco314) Date: Tue, 14 Sep 2021 04:56:40 +0000 Subject: [issue45191] Error.__traceback__.tb_lineno is wrong Message-ID: <1631595400.46.0.316069984941.issue45191@roundup.psfhosted.org> New submission from nahco314 <nahco3_ta at yahoo.co.jp>: I think that the emphasis of the errors caused by some of these equivalent expressions is wrong or inconsistent. expr1: 1 .bit_length("aaa") expr2: 1 \ .bit_length("aaa") expr3: 1 \ .bit_length(*["aaa"]) Below is the __traceback__.tb_lineno of the error given when running each version of the expression. (kubuntu20.0.4, CPython (pyenv)) The line number and location shown in the error message also correspond to this. in 3.6.14, 3,7,11 expr1: 0 expr2: 1 expr3: 1 in 3.8.11, 3.9.6 expr1: 0 expr2: 0 expr3: 0 in 3.10.0rc1, 3.11-dev(3.11.0a0) expr1: 0 expr2: 1 expr3: 0 I think the results in 3.6.14 and 3.7.11 are correct. ---------- components: Interpreter Core messages: 401748 nosy: nahco314 priority: normal severity: normal status: open title: Error.__traceback__.tb_lineno is wrong type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45191> _______________________________________ From report at bugs.python.org Tue Sep 14 01:07:09 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Sep 2021 05:07:09 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631554219.06.0.847255761234.issue45155@roundup.psfhosted.org> Message-ID: <75C3CCAB-BC42-4995-8A08-4972C82A0F58@python.org> Barry A. Warsaw <barry at python.org> added the comment: > I'd probably say "In the face of ambiguity, refuse the temptation to guess". > > As there's disagreement about the 'correct' default, make it None and require either "big" or "little" if length > 1 (the default). Jelle suggested that over in Discourse, and I?m not opposed, but it does mean that there?s no natural default for byteorder in int.from_bytes(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Tue Sep 14 01:08:53 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Sep 2021 05:08:53 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631565486.98.0.886822145255.issue45155@roundup.psfhosted.org> Message-ID: <4BDF43A4-C918-4397-BF24-FAD6C107585F@python.org> Barry A. Warsaw <barry at python.org> added the comment: On Sep 13, 2021, at 13:38, STINNER Victor <report at bugs.python.org> wrote: > It seems like your proposal is mostly guided by: convert an int to a byte (bytes string of length 1). IMO this case is special enough to justify the usage of a different function. Like bchr() ? <wink> > What if people expect int.to_bytes() always return a single byte, but then get two bytes by mistake? > > ch = 256 > byte = ch.to_bytes() The OverflowError you?ll get seems reasonable. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Tue Sep 14 01:09:31 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Sep 2021 05:09:31 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631565577.29.0.318194496759.issue45155@roundup.psfhosted.org> Message-ID: <D8CF524C-8185-4851-AB02-6B95BC584C35@python.org> Barry A. Warsaw <barry at python.org> added the comment: On Sep 13, 2021, at 13:39, Vedran ?a?i? <report at bugs.python.org> wrote: > > The poll is invalid, since the option that most people want is deliberately not offered. *Is* there an option that most people want? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Tue Sep 14 01:12:39 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 14 Sep 2021 05:12:39 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631596359.19.0.175695927291.issue45155@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: I'd say yes. Of course, one way to ascertain that would be to conduct a valid pool. ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Tue Sep 14 01:15:40 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Sep 2021 05:15:40 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631596359.19.0.175695927291.issue45155@roundup.psfhosted.org> Message-ID: <955B9951-107E-4D94-B877-AF437646D75A@python.org> Barry A. Warsaw <barry at python.org> added the comment: On Sep 13, 2021, at 22:12, Vedran ?a?i? <report at bugs.python.org> wrote: > > > Vedran ?a?i? <vedgar at gmail.com> added the comment: > > I'd say yes. Of course, one way to ascertain that would be to conduct a valid pool. ;-) People can always comment otherwise in the Discourse thread. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Tue Sep 14 01:44:04 2021 From: report at bugs.python.org (Kyungmin Lee) Date: Tue, 14 Sep 2021 05:44:04 +0000 Subject: [issue45192] The tempfile._infer_return_type function cannot infer the type of os.PathLike objects. Message-ID: <1631598244.07.0.518019074651.issue45192@roundup.psfhosted.org> New submission from Kyungmin Lee <rekyungmin at gmail.com>: The tempfile module has been updated to accept an object implementing os.PathLike protocol for path-related parameters as of Python 3.6 (e.g. dir parameter). An os.PathLike object represents a filesystem path as a str or bytes object (i.e. def __fspath__(self) -> Union[str, bytes]:). However, if an object implementing os.PathLike[bytes] is passed as a dir argument, a TypeError is raised. This bug occurs because the tempfile._infer_return_type function considers all objects other than bytes as str type. ---------- components: Library (Lib) messages: 401754 nosy: rekyungmin priority: normal severity: normal status: open title: The tempfile._infer_return_type function cannot infer the type of os.PathLike objects. type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45192> _______________________________________ From report at bugs.python.org Tue Sep 14 01:50:24 2021 From: report at bugs.python.org (Kyungmin Lee) Date: Tue, 14 Sep 2021 05:50:24 +0000 Subject: [issue45192] The tempfile._infer_return_type function cannot infer the type of os.PathLike objects. In-Reply-To: <1631598244.07.0.518019074651.issue45192@roundup.psfhosted.org> Message-ID: <1631598624.71.0.313930022774.issue45192@roundup.psfhosted.org> Kyungmin Lee <rekyungmin at gmail.com> added the comment: for example: ``` from typing import Union class FakePath: def __init__(self, path): self.path = path def __fspath__(self) -> Union[str, bytes]: return self.path if __name__ == "__main__": from tempfile import TemporaryDirectory # You need to create `existing_path` directory with TemporaryDirectory(dir=FakePath("existing_path")) as str_path: print(str_path) # 'existing_path/...' with TemporaryDirectory(dir=FakePath(b"existing_path")) as byte_path: print(byte_path) # expected b'existing_path/...' but raised TypeError ``` ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45192> _______________________________________ From report at bugs.python.org Tue Sep 14 02:05:55 2021 From: report at bugs.python.org (Kyungmin Lee) Date: Tue, 14 Sep 2021 06:05:55 +0000 Subject: [issue45192] The tempfile._infer_return_type function cannot infer the type of os.PathLike objects. In-Reply-To: <1631598244.07.0.518019074651.issue45192@roundup.psfhosted.org> Message-ID: <1631599555.5.0.536177057692.issue45192@roundup.psfhosted.org> Change by Kyungmin Lee <rekyungmin at gmail.com>: ---------- keywords: +patch pull_requests: +26732 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28323 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45192> _______________________________________ From report at bugs.python.org Tue Sep 14 02:19:40 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:19:40 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631600380.27.0.577278790718.issue40128@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: Confirmed with python 3.9.7 installed via the "deadsnakes" apt repo on another Ubuntu 20.04 machine. "Confirmed" meaning specifically that the completion window never appears, and commenting out that single line resolves the issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 02:25:49 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:25:49 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631600749.64.0.212603285055.issue40128@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: Note that _tkinter.TK_VERSION and _tkinter.TK_VERSION are simply "8.6", not enough to differentiate between patch versions. The best way to get this info appears to be tk.call("info", "patchlevel"). Specifically I suggest: TK_VERSION = tuple(map(int, tk.call("info", "patchlevel").split("."))) ... if (8, 6, 8) <= TK_VERSION < (8, 6, 10): ... ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 02:27:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Sep 2021 06:27:04 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631600824.27.0.726526858955.issue45167@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26734 pull_request: https://github.com/python/cpython/pull/28324 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Tue Sep 14 02:29:20 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:29:20 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux Message-ID: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> New submission from Tal Einat <taleinat+python at gmail.com>: The completion window never appears with Python version 3.9.7 and with the current main branch. Ubuntu 20.04 (reproduced on two separate machines) Tested with Tcl/Tk versions 8.6.10 and 8.6.11. This is directly caused by the fix for issue #40128. Commenting out that line resolves this issue entirely. (See also the PR for that fix, PR GH-26672.) ---------- assignee: terry.reedy components: IDLE messages: 401758 nosy: taleinat, terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE Show completions pop-up not working on Ubuntu Linux type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 02:30:19 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:30:19 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631601019.35.0.304298022862.issue40128@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: I've created a separate issue for the completion window not appearing on Linux, issue #45193. Let's move the discussion there. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 02:34:33 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:34:33 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631601273.67.0.92373212703.issue45193@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: I've also tested this on Windows 10 with the latest main branch (to be 3.11). The completions window works as expected with or without the recently added .update_idletasks() call. I do recommend limiting this to macOS (platform.system() == "Darwin"). Ideally we'd test this on macOS with several versions of tcl/tk (8.6.8, 8.6.9, 8.6.10, 8.6.11) and limit it to only those versions where the fix is required: TK_VERSION = tuple(map(int, tk.call("info", "patchlevel").split("."))) if (8, 6, 8) <= TK_VERSION < (8, 6, 10): acw.update_idletasks() Also we might check if calling .update() is enough, since that does less than .update_idletasks(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 02:36:29 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:36:29 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631601389.87.0.728242642874.issue45193@roundup.psfhosted.org> Change by Tal Einat <taleinat+python at gmail.com>: ---------- keywords: +patch pull_requests: +26735 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26039 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 02:38:16 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:38:16 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631601496.46.0.521961083806.issue45193@roundup.psfhosted.org> Change by Tal Einat <taleinat+python at gmail.com>: ---------- pull_requests: -26735 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 02:38:28 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 06:38:28 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631601508.79.0.826201942697.issue45193@roundup.psfhosted.org> Change by Tal Einat <taleinat+python at gmail.com>: ---------- stage: patch review -> needs patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 02:46:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 06:46:00 +0000 Subject: [issue45189] Drop the "list_frozen" command from _test_embed. In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org> Message-ID: <1631601960.71.0.787210459996.issue45189@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: imp._get_frozen_module_names() doesn't exist. I cannot see it in GH-28319. Moreover, the imp module is now deprecated. If something is added, it should be added to the private _imp module. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45189> _______________________________________ From report at bugs.python.org Tue Sep 14 02:57:28 2021 From: report at bugs.python.org (tongxiaoge) Date: Tue, 14 Sep 2021 06:57:28 +0000 Subject: [issue39503] [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1580397089.41.0.564267118679.issue39503@roundup.psfhosted.org> Message-ID: <1631602648.02.0.481380519596.issue39503@roundup.psfhosted.org> tongxiaoge <shixuantong at huawei.com> added the comment: https://github.com/python/cpython/blob/9f93018b69d72cb48d3444554261ae3b0ea00c93/Lib/urllib/request.py#L989 "headers" is a dict object? If so, the dict object does not seem to have no attribute "get_all". ---------- nosy: +sxt1001 versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39503> _______________________________________ From report at bugs.python.org Tue Sep 14 04:49:39 2021 From: report at bugs.python.org (nahco314) Date: Tue, 14 Sep 2021 08:49:39 +0000 Subject: [issue45191] Error.__traceback__.tb_lineno is wrong In-Reply-To: <1631595400.46.0.316069984941.issue45191@roundup.psfhosted.org> Message-ID: <1631609379.78.0.800172736774.issue45191@roundup.psfhosted.org> Change by nahco314 <nahco3_ta at yahoo.co.jp>: ---------- keywords: +patch pull_requests: +26736 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28325 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45191> _______________________________________ From report at bugs.python.org Tue Sep 14 04:53:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 14 Sep 2021 08:53:36 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631609616.27.0.301408672157.issue45152@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: New changeset c2f1e953371c25f6c42b599ba3d8797effbb503e by Irit Katriel in branch 'main': bpo-45152: Add HAS_CONST macro and get_const_value() function and use? (#28262) https://github.com/python/cpython/commit/c2f1e953371c25f6c42b599ba3d8797effbb503e ---------- nosy: +Mark.Shannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Tue Sep 14 05:09:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 14 Sep 2021 09:09:13 +0000 Subject: [issue45168] dis output for LOAD_CONST is confusing In-Reply-To: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> Message-ID: <1631610553.16.0.0767146506357.issue45168@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: New changeset c99fc4e53a60084df88ac5c69b3b13bc033677e1 by Irit Katriel in branch 'main': bpo-45168: change dis output to omit missing values rather than replacing them by their index (GH-28313) https://github.com/python/cpython/commit/c99fc4e53a60084df88ac5c69b3b13bc033677e1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Tue Sep 14 05:11:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 14 Sep 2021 09:11:28 +0000 Subject: [issue45168] dis output for LOAD_CONST is confusing In-Reply-To: <1631316661.34.0.984607812995.issue45168@roundup.psfhosted.org> Message-ID: <1631610688.42.0.54463776586.issue45168@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45168> _______________________________________ From report at bugs.python.org Tue Sep 14 06:20:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 10:20:46 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631614846.14.0.819153899199.issue45156@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7f60c9e1c6e22cc0e846a872c318570926cd3094 by Nikita Sobolev in branch 'main': bpo-45156: Fixes inifite loop on unittest.mock.seal() (GH-28300) https://github.com/python/cpython/commit/7f60c9e1c6e22cc0e846a872c318570926cd3094 ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Tue Sep 14 06:21:09 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 10:21:09 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631614869.48.0.624293645781.issue45156@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26737 pull_request: https://github.com/python/cpython/pull/28326 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Tue Sep 14 06:21:52 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 10:21:52 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631614912.36.0.483053231572.issue45156@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26738 pull_request: https://github.com/python/cpython/pull/28327 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Tue Sep 14 06:23:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 10:23:50 +0000 Subject: [issue39503] [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1580397089.41.0.564267118679.issue39503@roundup.psfhosted.org> Message-ID: <1631615030.58.0.0187760255638.issue39503@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > "headers" is a dict object? If so, the dict object does not seem to have no attribute "get_all". No, it's not a dict object. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39503> _______________________________________ From report at bugs.python.org Tue Sep 14 06:24:35 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 10:24:35 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631615075.5.0.277513358412.issue45193@roundup.psfhosted.org> Change by Tal Einat <taleinat+python at gmail.com>: ---------- pull_requests: +26739 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28328 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 06:26:02 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 10:26:02 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631615162.12.0.314046904528.issue45193@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: See PR GH-28328 with proposed fix. It should be tested on macOS with several relevant versions of Tcl/Tk to ensure that the Tk version range used is correct. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 06:33:05 2021 From: report at bugs.python.org (tongxiaoge) Date: Tue, 14 Sep 2021 10:33:05 +0000 Subject: [issue39503] [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1580397089.41.0.564267118679.issue39503@roundup.psfhosted.org> Message-ID: <1631615585.75.0.683824903869.issue39503@roundup.psfhosted.org> tongxiaoge <shixuantong at huawei.com> added the comment: At the beginning of the issue, there is the following reproduction code: from urllib.request import AbstractBasicAuthHandler auth_handler = AbstractBasicAuthHandler() auth_handler.http_error_auth_reqed( 'www-authenticate', 'unused', 'unused', { 'www-authenticate': 'Basic ' + ',' * 64 + ' ' + 'foo' + ' ' + 'realm' } ) Here's the headers: { 'www-authenticate': 'Basic ' + ',' * 64 + ' ' + 'foo' + ' ' + 'realm' } I think this is a dict object, so the current problem is fixed and no longer compatible with the previous usage? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39503> _______________________________________ From report at bugs.python.org Tue Sep 14 06:35:13 2021 From: report at bugs.python.org (QuadCorei8085) Date: Tue, 14 Sep 2021 10:35:13 +0000 Subject: [issue45194] asyncio scheduler jitter Message-ID: <1631615713.39.0.358857928244.issue45194@roundup.psfhosted.org> New submission from QuadCorei8085 <gulyast.reg at gmail.com>: I'm trying to do something periodically and this would be on the millisec level precision. However for some reason I could not achieve precise timing in a task. Below example shows that a simple sleep randomly awakes with a jitter between 0.1-20.0ms I haven't hystogrammed the distribution but it seems to be mostly 19-20ms. Any way to achieve better timings with asyncio? async def test_task(): while True: ts_now = time.time(); await asyncio.sleep(1.000); print("{}".format((time.time()-ts_now)*1000.0)); if __name__ == "__main__": loop = asyncio.get_event_loop() loop.create_task(thread_main()) loop.run_forever() ---------- components: asyncio messages: 401769 nosy: QuadCorei8085, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio scheduler jitter versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45194> _______________________________________ From report at bugs.python.org Tue Sep 14 06:39:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 10:39:30 +0000 Subject: [issue39503] [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1580397089.41.0.564267118679.issue39503@roundup.psfhosted.org> Message-ID: <1631615970.32.0.24664811496.issue39503@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This issue was a security vulnerability. It's now closed, please don't comment closed issues. If you consider that there is a regression, please open a new issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39503> _______________________________________ From report at bugs.python.org Tue Sep 14 06:40:09 2021 From: report at bugs.python.org (QuadCorei8085) Date: Tue, 14 Sep 2021 10:40:09 +0000 Subject: [issue45194] asyncio scheduler jitter In-Reply-To: <1631615713.39.0.358857928244.issue45194@roundup.psfhosted.org> Message-ID: <1631616009.12.0.639841875641.issue45194@roundup.psfhosted.org> QuadCorei8085 <gulyast.reg at gmail.com> added the comment: correction: a) of course i meant loop.create_task(test_task()) b) when using threading the sleep returns every 1000ms when going lower 10-15ms is also spot on. (I wanted to use threading in my app but one library - websocket - is asyncio based thus i'm stuck with asyncio) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45194> _______________________________________ From report at bugs.python.org Tue Sep 14 06:45:00 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Sep 2021 10:45:00 +0000 Subject: [issue45194] asyncio scheduler jitter In-Reply-To: <1631615713.39.0.358857928244.issue45194@roundup.psfhosted.org> Message-ID: <1631616300.17.0.304659931952.issue45194@roundup.psfhosted.org> Andrew Svetlov <andrew.svetlov at gmail.com> added the comment: asyncio provides the preemptive concurrency, not the real-time one. It means that the exact time of task switches depends on other tasks' execution and can vary by design. Sorry, the jitter is unavoidable. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45194> _______________________________________ From report at bugs.python.org Tue Sep 14 06:50:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 10:50:31 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631616631.89.0.882080770517.issue45156@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 13257d9fca13dfa1bda5b802d68ddaec72f3a07e by Miss Islington (bot) in branch '3.9': bpo-45156: Fixes inifite loop on unittest.mock.seal() (GH-28300) https://github.com/python/cpython/commit/13257d9fca13dfa1bda5b802d68ddaec72f3a07e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Tue Sep 14 07:00:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 11:00:21 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631617221.04.0.906004521895.issue45156@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset fd74d2680ef96c0140bc02cf94d1cf1f2ef814c2 by Miss Islington (bot) in branch '3.10': bpo-45156: Fixes inifite loop on unittest.mock.seal() (GH-28300) (GH-28326) https://github.com/python/cpython/commit/fd74d2680ef96c0140bc02cf94d1cf1f2ef814c2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Tue Sep 14 07:14:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 11:14:01 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x Message-ID: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: aarch64 RHEL8 Refleaks 3.x: https://buildbot.python.org/all/#/builders/551/builds/131 This issue looks like bpo-44949 which has been fixed by commit 6fb62b42f4db56ed5efe0ca4c1059049276c1083. "\r\n" is missing at the end of the expected output. === logs === readline version: 0x700 readline runtime version: 0x700 readline library version: '7.0' use libedit emulation? False FAIL: test_nonascii (test.test_readline.TestReadline) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.refleak/build/Lib/test/test_readline.py", line 258, in test_nonascii self.assertIn(b"history " + expected + b"\r\n", output) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b"history '[\\xefnserted]|t\\xebxt[after]'\r\n" not found in bytearray(b"^A^B^B^B^B^B^B^B\t\tx\t\r\n[\xc3\xafnserted]|t\xc3\xab[after]\x08\x08\x08\x08\x08\x08\x08text \'t\\xeb\'\r\nline \'[\\xefnserted]|t\\xeb[after]\'\r\nindexes 11 13\r\n\x07text \'t\\xeb\'\r\nline \'[\\xefnserted]|t\\xeb[after]\'\r\nindexes 11 13\r\nsubstitution \'t\\xeb\'\r\nmatches [\'t\\xebnt\', \'t\\xebxt\']\r\nx[after]\x08\x08\x08\x08\x08\x08\x08t[after]\x08\x08\x08\x08\x08\x08\x08\r\nresult \'[\\xefnserted]|t\\xebxt[after]\'\r\nhistory \'[\\xefnserted]|t\\xebxt[after]\'") === test.pythoninfo === readline._READLINE_LIBRARY_VERSION: 7.0 readline._READLINE_RUNTIME_VERSION: 0x700 readline._READLINE_VERSION: 0x700 platform.architecture: 64bit ELF platform.libc_ver: glibc 2.28 platform.platform: Linux-4.18.0-305.12.1.el8_4.aarch64-aarch64-with-glibc2.28 os.environ[LANG]: en_US.UTF-8 locale.encoding: UTF-8 sys.filesystem_encoding: utf-8/surrogateescape sys.stderr.encoding: utf-8/backslashreplace sys.stdin.encoding: utf-8/strict sys.stdout.encoding: utf-8/strict ---------- components: Tests messages: 401775 nosy: vstinner priority: normal severity: normal status: open title: test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Tue Sep 14 07:16:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 11:16:41 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631618201.96.0.795691153446.issue45195@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26740 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28329 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Tue Sep 14 07:17:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 11:17:05 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1631618225.83.0.517973867168.issue44949@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Similar issue in test_readline.test_nonascii(): bpo-45195. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44949> _______________________________________ From report at bugs.python.org Tue Sep 14 07:34:37 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 14 Sep 2021 11:34:37 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run In-Reply-To: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> Message-ID: <1631619277.44.0.296894333121.issue45185@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Looks like `TestEnumerations` was never added to `tests` in `test_main`. https://github.com/python/cpython/commit/a02cb474f9c097c83cd444a47e9fb5f99b4aaf45#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578R4702 I will try to enable it and fix failures. ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Tue Sep 14 07:54:51 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 14 Sep 2021 11:54:51 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run In-Reply-To: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> Message-ID: <1631620491.44.0.270536567358.issue45185@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26741 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28330 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Tue Sep 14 08:39:47 2021 From: report at bugs.python.org (Hasan) Date: Tue, 14 Sep 2021 12:39:47 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1631623187.59.0.712710523301.issue39355@roundup.psfhosted.org> Hasan <hasan.aleeyev at gmail.com> added the comment: Okey. There will be huge changes for this issue as this keyword has been used in a lot of places. That's why i will try to send pull requests module by module to keep it clean and simple for review. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39355> _______________________________________ From report at bugs.python.org Tue Sep 14 09:01:31 2021 From: report at bugs.python.org (junyixie) Date: Tue, 14 Sep 2021 13:01:31 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. Message-ID: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> New submission from junyixie <xie.junyi at outlook.com>: test_io.py ``` ================================================================= ==54932==ERROR: AddressSanitizer: requested allocation size 0x7fffffffffffffff (0x8000000000001000 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0) #0 0x102f1fa6c in wrap_malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c) #1 0x102565fcc in _buffered_init bufferedio.c:730 #2 0x10255bba4 in _io_BufferedReader___init__ bufferedio.c.h:435 #3 0x10226c8c8 in wrap_init typeobject.c:6941 #4 0x10216d3f8 in _PyObject_Call call.c:305 #5 0x102387a6c in _PyEval_EvalFrameDefault ceval.c:4285 #6 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #7 0x102396860 in call_function ceval.c:5888 #8 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206 #9 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #10 0x102396860 in call_function ceval.c:5888 #11 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206 #12 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #13 0x102172bec in method_vectorcall classobject.c:53 #14 0x102396860 in call_function ceval.c:5888 #15 0x1023885e4 in _PyEval_EvalFrameDefault ceval.c:4221 #16 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #17 0x102396860 in call_function ceval.c:5888 #18 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206 #19 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #20 0x102172af4 in method_vectorcall classobject.c:83 #21 0x10216d0a8 in PyVectorcall_Call call.c:255 #22 0x102387a6c in _PyEval_EvalFrameDefault ceval.c:4285 #23 0x10237eaa8 in _PyEval_Vector ceval.c:5073 #24 0x10216c248 in _PyObject_FastCallDictTstate call.c:142 #25 0x10216dc00 in _PyObject_Call_Prepend call.c:431 #26 0x102268740 in slot_tp_call typeobject.c:7481 #27 0x10216c5d4 in _PyObject_MakeTpCall call.c:215 #28 0x102396b88 in call_function ceval.c #29 0x1023885e4 in _PyEval_EvalFrameDefault ceval.c:4221 ==54932==HINT: if you don't care about these errors you may set allocator_may_return_null=1 SUMMARY: AddressSanitizer: allocation-size-too-big (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c) in wrap_malloc+0x94 ==54932==ABORTING Fatal Python error: Aborted Current thread 0x0000000102e93d40 (most recent call first): File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 201 in handle File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 730 in assertRaises File "/Users/xiejunyi/github-cpython/Lib/test/test_io.py", line 1558 in test_constructor File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 591 in run File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 650 in __call__ File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/xiejunyi/github-cpython/Lib/test/support/testresult.py", line 140 in run File "/Users/xiejunyi/github-cpython/Lib/test/support/__init__.py", line 990 in _run_suite File "/Users/xiejunyi/github-cpython/Lib/test/support/__init__.py", line 1115 in run_unittest File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 261 in _test_module File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 297 in _runtest_inner2 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 335 in _runtest_inner File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 215 in _runtest File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 245 in runtest File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest_mp.py", line 83 in run_tests_worker File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 678 in _main File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 658 in main File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 736 in main File "/Users/xiejunyi/github-cpython/Lib/test/regrtest.py", line 43 in _main File "/Users/xiejunyi/github-cpython/Lib/test/regrtest.py", line 47 in <module> File "/Users/xiejunyi/github-cpython/Lib/runpy.py", line 86 in _run_code File "/Users/xiejunyi/github-cpython/Lib/runpy.py", line 196 in _run_module_as_main ``` test_decimal.py ``` 0:05:09 load avg: 159.57 [287/427/30] test_decimal crashed (Exit code -6) -- running: test_pickle (1 min 35 sec), test_tokenize (3 min 14 sec), test_unparse (4 min 32 sec), test_peg_generator (48.6 sec), test_subprocess (1 min 50 sec), test_faulthandler (36.0 sec), test_capi (3 min 3 sec), test_pdb (2 min 27 sec) ================================================================= ==6547==ERROR: AddressSanitizer: requested allocation size 0xbafc24672035e58 (0xbafc24672036e58 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0) #0 0x103d4ba6c in wrap_malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c) #1 0x10e1c9828 in mpd_switch_to_dyn mpalloc.c:217 #2 0x10e1d7a50 in mpd_qshiftl mpdecimal.c:2514 #3 0x10e2207a4 in _mpd_qsqrt mpdecimal.c:7945 #4 0x10e21f188 in mpd_qsqrt mpdecimal.c:8037 #5 0x10e190d58 in dec_mpd_qsqrt _decimal.c:4128 #6 0x102f8fd88 in method_vectorcall_VARARGS_KEYWORDS descrobject.c:346 #7 0x1031a6c44 in call_function ceval.c #8 0x103195cb0 in _PyEval_EvalFrameDefault ceval.c:4350 #9 0x10318bc3c in _PyEval_Vector ceval.c:5221 #10 0x102f7f994 in method_vectorcall classobject.c:54 #11 0x1031a6c44 in call_function ceval.c #12 0x1031bb1f8 in DROGON_JIT_HELPER_CALL_FUNCTION ceval_jit_helper.h:3041 #13 0x10f0c8164 (<unknown module>) #14 0x10318d644 in _PyEval_EvalFrameDefault ceval.c:1827 #15 0x10318bc3c in _PyEval_Vector ceval.c:5221 #16 0x1031a6c44 in call_function ceval.c #17 0x1031baf98 in DROGON_JIT_HELPER_CALL_METHOD ceval_jit_helper.h:3020 #18 0x10f09e6ec (<unknown module>) #19 0x10318d644 in _PyEval_EvalFrameDefault ceval.c:1827 #20 0x10318bc3c in _PyEval_Vector ceval.c:5221 #21 0x102f7f89c in method_vectorcall classobject.c:84 #22 0x102f79e50 in PyVectorcall_Call call.c:255 #23 0x1031bb700 in DROGON_JIT_HELPER_CALL_FUNCTION_EX ceval_jit_helper.h:3117 #24 0x10f02c2c4 (<unknown module>) #25 0x10318d644 in _PyEval_EvalFrameDefault ceval.c:1827 #26 0x10318bc3c in _PyEval_Vector ceval.c:5221 #27 0x102f78ff0 in _PyObject_FastCallDictTstate call.c:142 #28 0x102f7a9a8 in _PyObject_Call_Prepend call.c:431 #29 0x103074ce0 in slot_tp_call typeobject.c:7605 ==6547==HINT: if you don't care about these errors you may set allocator_may_return_null=1 SUMMARY: AddressSanitizer: allocation-size-too-big (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c) in wrap_malloc+0x94 ==6547==ABORTING Fatal Python error: Aborted ``` ---------- components: Tests messages: 401779 nosy: JunyiXie, gregory.p.smith priority: normal severity: normal status: open title: macOS. ./configure --with-address-sanitizer; make test; cause test case crash. versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 09:01:45 2021 From: report at bugs.python.org (junyixie) Date: Tue, 14 Sep 2021 13:01:45 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631624505.62.0.756736053987.issue45196@roundup.psfhosted.org> Change by junyixie <xie.junyi at outlook.com>: ---------- type: -> crash _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 09:05:44 2021 From: report at bugs.python.org (junyixie) Date: Tue, 14 Sep 2021 13:05:44 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631624744.21.0.199562580742.issue45196@roundup.psfhosted.org> Change by junyixie <xie.junyi at outlook.com>: ---------- keywords: +patch pull_requests: +26742 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28331 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 09:09:48 2021 From: report at bugs.python.org (junyixie) Date: Tue, 14 Sep 2021 13:09:48 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631624988.79.0.89206430605.issue45196@roundup.psfhosted.org> junyixie <xie.junyi at outlook.com> added the comment: ignore test_decimal.py crash backtrace. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 09:57:58 2021 From: report at bugs.python.org (Josh Haberman) Date: Tue, 14 Sep 2021 13:57:58 +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: <1631627878.65.0.755255673452.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: I found a way to use metaclasses with the limited API. I found that I can access PyType_Type.tp_new by creating a heap type derived from PyType_Type: static PyType_Slot dummy_slots[] = { {0, NULL} }; static PyType_Spec dummy_spec = { "module.DummyClass", 0, 0, Py_TPFLAGS_DEFAULT, dummy_slots, }; PyObject *bases = Py_BuildValue("(O)", &PyType_Type); PyObject *type = PyType_FromSpecWithBases(&dummy_spec, bases); Py_DECREF(bases); type_new = PyType_GetSlot((PyTypeObject*)type, Py_tp_new); Py_DECREF(type); #ifndef Py_LIMITED_API assert(type_new == PyType_Type.tp_new); #endif // Creates a type using a metaclass. PyObject *uses_metaclass = type_new(metaclass, args, NULL); PyType_GetSlot() can't be used on PyType_Type directly, since it is not a heap type. But a heap type derived from PyType_Type will inherit tp_new, and we can call PyType_GetSlot() on that. Once we have PyType_Type.tp_new, we can use it to create a new type using a metaclass. This avoids any of the class-switching tricks I was trying before. We can also get other slots of PyType_Type like tp_getattro to do the equivalent of super(). The PyType_FromSpecEx() function proposed in this bug would still be a nicer solution to my problem. Calling type_new() doesn't let you specify object size or slots. To work around this, I derive from a type I created with PyType_FromSpec(), relying on the fact that the size and slots will be inherited. This works, but it introduces an extra class into the hierarchy that ideally could be avoided. But I do have a workaround that appears to work, and avoids the problems associated with setting ob_type directly (like PyPy incompatibility). ---------- nosy: +haberman2 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Tue Sep 14 11:33:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 14 Sep 2021 15:33:16 +0000 Subject: [issue45197] IDLE should suppress ValueError for list.remove() Message-ID: <1631633596.4.0.569139047582.issue45197@roundup.psfhosted.org> New submission from Raymond Hettinger <raymond.hettinger at gmail.com>: I got this today running a stock Python 3.9.6 for macOS downloaded from python.org. ------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892, in __call__ return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 176, in handler r = l[i](event) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 350, in keypress_event self.hide_window() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 463, in hide_window self.widget.event_delete(HIDE_VIRTUAL_EVENT_NAME, seq) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 392, in event_delete triplets.remove(triplet) ValueError: list.remove(x): x not in list ---------- assignee: terry.reedy components: IDLE messages: 401782 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: IDLE should suppress ValueError for list.remove() type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45197> _______________________________________ From report at bugs.python.org Tue Sep 14 11:38:19 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 15:38:19 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631633899.75.0.991421212858.issue45195@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26744 pull_request: https://github.com/python/cpython/pull/28334 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Tue Sep 14 11:38:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Sep 2021 15:38:16 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631633896.39.0.774994994117.issue45195@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 797c8eb9ef511f0c25f10a453b35c4d2fe383c30 by Victor Stinner in branch 'main': bpo-45195: Fix test_readline.test_nonascii() (GH-28329) https://github.com/python/cpython/commit/797c8eb9ef511f0c25f10a453b35c4d2fe383c30 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Tue Sep 14 11:38:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 15:38:15 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631633895.12.0.871100430271.issue45195@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26743 pull_request: https://github.com/python/cpython/pull/28333 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Tue Sep 14 12:03:49 2021 From: report at bugs.python.org (xitop) Date: Tue, 14 Sep 2021 16:03:49 +0000 Subject: [issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org> Message-ID: <1631635429.06.0.652943245642.issue38085@roundup.psfhosted.org> xitop <reg.bugs at poti.sk> added the comment: 2nd anniversary. Any reaction from developers would be appreciated. Thank you. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38085> _______________________________________ From report at bugs.python.org Tue Sep 14 12:09:35 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 16:09:35 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631635775.53.0.886157994403.issue45186@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- keywords: +patch pull_requests: +26746 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28335 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Tue Sep 14 12:09:35 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 16:09:35 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631635775.59.0.40900339497.issue45188@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26747 pull_request: https://github.com/python/cpython/pull/28335 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Tue Sep 14 12:09:35 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 16:09:35 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631635775.35.0.161807272166.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26745 pull_request: https://github.com/python/cpython/pull/28335 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Tue Sep 14 12:09:35 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 16:09:35 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1631635775.67.0.591095567134.issue21736@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26748 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28335 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21736> _______________________________________ From report at bugs.python.org Tue Sep 14 12:40:25 2021 From: report at bugs.python.org (xitop) Date: Tue, 14 Sep 2021 16:40:25 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes Message-ID: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> New submission from xitop <reg.bugs at poti.sk>: The object.__set_name__() function (introduced in Python 3.6 by PEP-487) is mentioned in the "what's new " summary as an extension to the descriptor protocol [1] and documented in the "implementing descriptors" section [2]. However, the PEP itself states that it "adds an __set_name__ initializer for class attributes, especially if they are descriptors.". And it indeed works for plain classes where the descriptor protocol is not used at all (no __get__ or __set__ or __delete__): ---- class NotDescriptor: def __set_name__(self, owner, name): print('__set_name__ called') class SomeClass: attr = NotDescriptor() ---- It is clear that this method is helpful when used in descriptors and that is its intended use, but other valid use-cases probably exist. I suggest to amend the documentation to clarify that (correct me if I'm wrong) the __set_name__ is called for every class used as an attribute in an other class, not only for descriptors. --- URLs: [1]: https://docs.python.org/3/whatsnew/3.6.html#pep-487-descriptor-protocol-enhancements [2]: https://docs.python.org/3/reference/datamodel.html#implementing-descriptors ---------- assignee: docs at python components: Documentation messages: 401785 nosy: docs at python, xitop priority: normal severity: normal status: open title: __set_name__ documentation not clear about its usage with non-descriptor classes versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Tue Sep 14 13:35:58 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 14 Sep 2021 17:35:58 +0000 Subject: [issue45190] unicode 14.0 upgrade In-Reply-To: <1631582273.28.0.521036633786.issue45190@roundup.psfhosted.org> Message-ID: <1631640958.32.0.519269544032.issue45190@roundup.psfhosted.org> Change by Benjamin Peterson <benjamin at python.org>: ---------- keywords: +patch pull_requests: +26749 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28336 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45190> _______________________________________ From report at bugs.python.org Tue Sep 14 14:00:50 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 14 Sep 2021 18:00:50 +0000 Subject: [issue45190] unicode 14.0 upgrade In-Reply-To: <1631582273.28.0.521036633786.issue45190@roundup.psfhosted.org> Message-ID: <1631642450.66.0.743266838092.issue45190@roundup.psfhosted.org> Benjamin Peterson <benjamin at python.org> added the comment: New changeset 024fda47d40b8cee77ac1cd3d31ee549edc11986 by Benjamin Peterson in branch 'main': closes bpo-45190: Update Unicode data to version 14.0.0. (GH-28336) https://github.com/python/cpython/commit/024fda47d40b8cee77ac1cd3d31ee549edc11986 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45190> _______________________________________ From report at bugs.python.org Tue Sep 14 14:32:01 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 14 Sep 2021 18:32:01 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631644321.39.0.896748775424.issue45196@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: New changeset b668cdfa09e9bdfcfddaadd23dbd455d5f667383 by junyixie in branch 'main': bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331) https://github.com/python/cpython/commit/b668cdfa09e9bdfcfddaadd23dbd455d5f667383 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:32:08 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 18:32:08 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631644328.04.0.394816332056.issue45196@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26750 pull_request: https://github.com/python/cpython/pull/28337 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:32:12 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 18:32:12 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631644332.22.0.518387894539.issue45196@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26751 pull_request: https://github.com/python/cpython/pull/28338 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:34:09 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 14 Sep 2021 18:34:09 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631644449.03.0.723691243418.issue45196@roundup.psfhosted.org> Change by Gregory P. Smith <greg at krypto.org>: ---------- assignee: -> gregory.p.smith versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:53:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 18:53:39 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631645619.47.0.478635979717.issue45083@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: The bug is not a crash in the interpreter and this PR touches fundamental code in the interpreter, so I think the safest approach is waiting for 3.10.1 ---------- priority: release blocker -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Tue Sep 14 14:54:34 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 18:54:34 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631645674.41.0.579486876037.issue45196@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 9ccdc90488302b212bd3405d10dc5c22052e9b4c by Miss Islington (bot) in branch '3.9': bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331) https://github.com/python/cpython/commit/9ccdc90488302b212bd3405d10dc5c22052e9b4c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:58:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 18:58:23 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631645903.13.0.973138378998.issue45196@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset be200c3c6e2f82db553c0e5424e4ba70caf189c3 by Miss Islington (bot) in branch '3.10': bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331) https://github.com/python/cpython/commit/be200c3c6e2f82db553c0e5424e4ba70caf189c3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 14:58:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 18:58:34 +0000 Subject: [issue45147] Typo in "What's New In Python 3.10" documentation In-Reply-To: <1631168340.99.0.160040683472.issue45147@roundup.psfhosted.org> Message-ID: <1631645914.95.0.237947178707.issue45147@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > @pablogsal: You might want to merge this back to 3.10.0, once it's merged to 3.10. I'll merge it shortly, once the tests have run. Thanks for the ping. I have cherry-picked PR 28259 to 3.10.0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45147> _______________________________________ From report at bugs.python.org Tue Sep 14 15:06:25 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 14 Sep 2021 19:06:25 +0000 Subject: [issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash. In-Reply-To: <1631624491.63.0.886030663913.issue45196@roundup.psfhosted.org> Message-ID: <1631646385.91.0.814443531786.issue45196@roundup.psfhosted.org> Change by Gregory P. Smith <greg at krypto.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45196> _______________________________________ From report at bugs.python.org Tue Sep 14 15:10:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:10:38 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631646638.93.0.48117593981.issue40128@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Thanks Terry, I have cherry-picked commit b441e99d89a3f05210cc36ade57699384986ca00 to the 3.10.0 release branch! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 15:17:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:17:30 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631647050.24.0.739728201118.issue45183@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I bisected this to: 3abf6f010243a91bf57cbf357dac33193f7b8407 is the first bad commit commit 3abf6f010243a91bf57cbf357dac33193f7b8407 Author: Desmond Cheong <desmondcheongzx at gmail.com> Date: Tue Mar 9 04:06:02 2021 +0800 bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159) Added an invalidate_caches() method to the zipimport.zipimporter class based on the implementation of importlib.FileFinder.invalidate_caches(). This was done by adding a get_files() method and an _archive_mtime attribute to zipimport.zipimporter to check for updates or cache invalidation whenever the cache of files and toc entry information in the zipimporter is accessed. Doc/library/zipimport.rst | 9 + Lib/test/test_zipimport.py | 41 + Lib/zipimport.py | 10 + .../2021-01-07-21-25-49.bpo-14678.1zniCH.rst | 3 + Python/importlib_zipimport.h | 1896 ++++++++++---------- 5 files changed, 1020 insertions(+), 939 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst bisect run success Which is https://bugs.python.org/issue14678 ---------- nosy: +brett.cannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Tue Sep 14 15:17:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:17:48 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631647068.17.0.819145598762.issue45183@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Brett, can you take a look when you have some time? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Tue Sep 14 15:41:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:41:08 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1631648468.79.0.623051991398.issue4356@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- nosy: +pablogsal nosy_count: 20.0 -> 21.0 pull_requests: +26752 pull_request: https://github.com/python/cpython/pull/28339 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue4356> _______________________________________ From report at bugs.python.org Tue Sep 14 15:46:09 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 14 Sep 2021 19:46:09 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631648769.48.0.129812074258.issue40128@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: Pablo, I'm not sure what you cherry-picked, but this fix for macOS broke the completions pop-up on Linux, and that appears to still be the state of things now on the 3.10.0 branch. Let's please not leave things this way if at all possible. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 15:53:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:53:22 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1631649202.3.0.379205602244.issue4356@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 1aaa85949717e4ab2ed700e58762f0a3ce049a37 by Pablo Galindo Salgado in branch 'main': bpo-4356: Mention the new key arguments for the bisect module APIs in the 3.10 What's new (GH-28339) https://github.com/python/cpython/commit/1aaa85949717e4ab2ed700e58762f0a3ce049a37 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue4356> _______________________________________ From report at bugs.python.org Tue Sep 14 15:53:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 14 Sep 2021 19:53:23 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1631649203.19.0.818033725857.issue4356@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 21.0 -> 22.0 pull_requests: +26753 pull_request: https://github.com/python/cpython/pull/28340 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue4356> _______________________________________ From report at bugs.python.org Tue Sep 14 15:57:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 19:57:16 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631649436.43.0.960482219585.issue40128@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Pablo, I'm not sure what you cherry-picked, I cherry-picked https://github.com/python/cpython/pull/26684 but this can be easily undone as this is cherry-picked to the 3.10.0 release branch that I have much more control upon. What would you prefer me to do: undo the cherry-picking or wait for https://github.com/python/cpython/pull/28328/files ? Notice that this would need to be done ASAP if you want it to be in 3.10.0, otherwise will have to wait until 3.10.1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 16:02:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 14 Sep 2021 20:02:22 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1631649742.32.0.119451953112.issue4356@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset dda5ff2d095c795f00afaa64505069a2409f6099 by Miss Islington (bot) in branch '3.10': bpo-4356: Mention the new key arguments for the bisect module APIs in the 3.10 What's new (GH-28339) (GH-28340) https://github.com/python/cpython/commit/dda5ff2d095c795f00afaa64505069a2409f6099 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue4356> _______________________________________ From report at bugs.python.org Tue Sep 14 16:36:56 2021 From: report at bugs.python.org (=?utf-8?q?Benjamin_Sz=C5=91ke?=) Date: Tue, 14 Sep 2021 20:36:56 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631651816.04.0.657447624035.issue21302@roundup.psfhosted.org> Change by Benjamin Sz?ke <egyszeregy at freemail.hu>: ---------- pull_requests: +26754 pull_request: https://github.com/python/cpython/pull/28341 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Tue Sep 14 16:47:26 2021 From: report at bugs.python.org (Jarry Shaw) Date: Tue, 14 Sep 2021 20:47:26 +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: <1631652446.56.0.561966739029.issue43893@roundup.psfhosted.org> Jarry Shaw <jarryshaw at icloud.com> added the comment: Apparently static checkers like mypy doesn't rely on the `typing.get_type_hints` function to implement its type checking functions (as I had browsed through the code repo). $ cat test.py def foo(arg) -> ' str': ... $ mypy test.py Success: no issues found in 1 source file If type checkers *think* this is acceptable, but the standard library doesn't, this can be some sort of inconsistency in my perspective. As Saiyang Gou had suggested, I would rather prefer to change the behaviour of `compile` in `eval` mode to preserve the internal consistency of builtin functions and therefore to eliminate this *buggy* behaviour of `typing.get_type_hints`. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43893> _______________________________________ From report at bugs.python.org Tue Sep 14 16:55:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 14 Sep 2021 20:55:00 +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: <1631652900.22.0.848888051292.issue43893@roundup.psfhosted.org> Change by Guido van Rossum <guido at python.org>: ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43893> _______________________________________ From report at bugs.python.org Tue Sep 14 17:22:45 2021 From: report at bugs.python.org (Greg Werbin) Date: Tue, 14 Sep 2021 21:22:45 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1631654565.36.0.684623784575.issue45027@roundup.psfhosted.org> Greg Werbin <outthere at me.gregwerbin.com> added the comment: Hi, thanks for the comment. > First of all, library developers should not be configuring loggers at all, other than adding a NullHandler to their top-level logger. This is true, and I agree. I am not expecting people to start using basicConfig() inside their libraries. > Secondly, it is fine to configure the root logger and then log to any other logger. The default mechanisms mean that handlers added to the root logger are used by loggers which are anywhere in the logger hierarchy. So users that are using basicConfig() but other loggers than the root logger may be using the system as designed. This change serves the purpose of making it easier to configure non-root loggers. Library developers often add logging to their libraries, expecting that end users will never see those log messages. However, if you configure the root logger in your application, you will see those log messages. This change is intended to let users more easily configure the specific loggers that they want to configure, without also getting a lot of extraneous output from loggers that they don't care about. I have seen experienced Python developers misunderstand how this works, and go through all kinds of ugly contortions (setting filters on handlers, etc.) to avoid the boilerplate of instantiating Handler and Formatter objects. > Thirdly, logging.config.dictConfig() allows usage of a dictionary to configure multiple loggers, handlers etc. all at once, for use cases which are more demanding than basicConfig(). It doesn't make sense to do what you're proposing, since it appears to offer a different way of configuring other loggers than the root logger, when dictConfig() already offers that. Good point. I am proposing an alternative interface to the functionality provided by dictConfig(). I would frame this proposal as a third configuration option, with complexity somewhere between the current basicConfig() and dictConfig(). Also, using the kwarg means better support for IDE tab-completion and type checking, and another opportunity for discoverability in the docs. On that note, it would be nice to adjust the type stubs for dictConfig() to use a TypedDict with types corresponding to the "dictionary configuration schema" (https://docs.python.org/3/library/logging.config.html#logging-config-dictschema) instead of Any (see https://github.com/python/typeshed/blob/ee48730/stdlib/logging/config.pyi#L22). But that's a separate change. I'm happy to make a PR to Typeshed for it, though! Regardless of whether this change is accepted, I also think there should be a note about dictConfig() in the docs for basicConfig(): https://docs.python.org/3/library/logging.html#logging.basicConfig. I believe a lot of users simply don't know about the "low-boilerplate" options for logging configuration in Python, so they either don't do it right or don't do it at all and use print(). Both are bad outcomes. Again, I'm happy to make a separate PR for that change. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45027> _______________________________________ From report at bugs.python.org Tue Sep 14 18:04:03 2021 From: report at bugs.python.org (Kevin Mills) Date: Tue, 14 Sep 2021 22:04:03 +0000 Subject: [issue43574] Regression in overallocation for literal list initialization in v3.9+ In-Reply-To: <1616293914.75.0.599644741052.issue43574@roundup.psfhosted.org> Message-ID: <1631657043.22.0.840028269294.issue43574@roundup.psfhosted.org> Change by Kevin Mills <kevin.mills226+bugs.python at gmail.com>: ---------- nosy: +Zeturic _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43574> _______________________________________ From report at bugs.python.org Tue Sep 14 18:13:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 22:13:34 +0000 Subject: [issue45199] IDLE: document search (find) and replace better Message-ID: <1631657614.15.0.441102434851.issue45199@roundup.psfhosted.org> New submission from Terry J. Reedy <tjreedy at udel.edu>: The doc currently just says that the Search, File Search, and Search&Replace dialogs exist for the corresponding menu entries. Add a short section in "Editing and navigation" to say more. 1. Any selection becomes search target, except that S&R is buggy. 2. Search is only within lines. .* and \n do not match \n even with RE. 3. [x]RE uses Python re module, not tcl re. It applies to replace also. So if target RE has capture groups, \1 (and \gname? test) in replacement works.(match.expand(repl)) 4. Refer to re chapter and RegularExpression HOWTO. ---------- assignee: terry.reedy components: IDLE messages: 401801 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: document search (find) and replace better type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45199> _______________________________________ From report at bugs.python.org Tue Sep 14 18:58:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 22:58:00 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631660280.11.0.364008862388.issue45193@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: In msg401744 I suggested any of the following for the upcoming 3.10.0 release. 1. Remove the new line. 2. Disable the line by adding '#'. 3. Make it conditional on macOS and 8.6.8. Thinking more, I am rejecting 3. because the line is not needed for IDLE and tk as installed by our macOS. As things stand now, I an only willing to support IDLE with the tk we install. But I will go with option 2 so that if someone tries to run IDLE with a different tk, and the line is needed, they only need to remove the '#'. A version of 3. is needed for 3.9 but this needs more data and discussion. In looking at your no-issue PR_28332, I realized that I would rather make a more extensive change than to patch a badly written function for at least the fourth time. I will open an issue for that PR and explain later. ---------- nosy: +lukasz.langa, ned.deily, pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 19:07:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 23:07:43 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631660863.87.0.508224990969.issue45193@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: I will just mention here that winconfig_event also calls update_idletasks, in what should be the proper place, and I think that the second call was only needed for mac tk 8.6.8 because of the unique-to-IDLE behavior I want to delete. I suspect that if we create the popup the same way we do with the others, we will not need the second call even on 8.6.8. But making sure 3.10.0 works comes first. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 19:09:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 23:09:22 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1631660962.14.0.87380983822.issue40128@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Pablo, sorry I was not clear. PR_26684 and the line it added, having been merged last June, are already in the 3.10.0rc2 release. What I want to do immediately is disable the line with a '#'. I just posted an explanation on #34193. I am about to make a new PR to do so, and once it is merged and backported to 3.10 (but not 3.9), I will ask you to cherrypick it into the release branch. ---------- priority: release blocker -> normal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40128> _______________________________________ From report at bugs.python.org Tue Sep 14 19:31:52 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 23:31:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631662312.54.0.948394430468.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset a65c86889e208dddb26a7ebe7840c24edbcca775 by Eric Snow in branch 'main': bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320) https://github.com/python/cpython/commit/a65c86889e208dddb26a7ebe7840c24edbcca775 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Tue Sep 14 19:42:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 14 Sep 2021 23:42:26 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631662946.9.0.136332483162.issue45193@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- pull_requests: +26755 pull_request: https://github.com/python/cpython/pull/28343 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Tue Sep 14 19:55:07 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 14 Sep 2021 23:55:07 +0000 Subject: [issue45189] Drop the "list_frozen" command from _test_embed. In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org> Message-ID: <1631663707.68.0.983221434357.issue45189@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Yeah, sorry, I got the PRs mixed up. I added it in https://github.com/python/cpython/pull/28320. _imp._get_frozen_module_names() should work just fine. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45189> _______________________________________ From report at bugs.python.org Tue Sep 14 22:53:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 02:53:19 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631674399.19.0.738857399066.issue45020@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- nosy: +terry.reedy nosy_count: 14.0 -> 15.0 pull_requests: +26756 pull_request: https://github.com/python/cpython/pull/28344 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Tue Sep 14 23:00:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 03:00:13 +0000 Subject: [issue45197] IDLE should suppress ValueError for list.remove() In-Reply-To: <1631633596.4.0.569139047582.issue45197@roundup.psfhosted.org> Message-ID: <1631674813.74.0.698987180593.issue45197@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: The offending function is def event_delete(self, virtual, *sequences): if virtual not in self.__eventinfo: return func, triplets = self.__eventinfo[virtual] for seq in sequences: triplet = _parse_sequence(seq) if triplet is None: #print("Tkinter event_delete: %s" % seq, file=sys.__stderr__) widget.event_delete(self, virtual, seq) else: if func is not None: self.__binders[triplet[1]].unbind(triplet, func) triplets.remove(triplet) The triplets collection is part of *virtual* whereas each triplet is derived from a member of sequences. The discrepancy seems to be extremely rare. I will catch the exception until such time as I see a plausible, reproducible, and testable reason. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45197> _______________________________________ From report at bugs.python.org Wed Sep 15 00:17:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 04:17:40 +0000 Subject: [issue45200] test_multiprocessing_fork failws with timeout Message-ID: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> New submission from Terry J. Reedy <tjreedy at udel.edu>: https://github.com/python/cpython/pull/28344/checks?check_run_id=3605759743 All tests pass until test_multiprocessing_fork timed out after 25 min. On the rerun: refail with timeout. test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout (0:20:00)! Thread 0x00007f176a71ebc0 (most recent call first): File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", line 261 in wait File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", line 349 in wait File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 1001 in test_get File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 593 in run File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 652 in __call__ File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in run File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in run File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 122 in run File "/home/runner/work/cpython/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/runner/work/cpython/cpython/Lib/unittest/runner.py", line 206 in run File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 998 in _run_suite File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 1124 in run_unittest File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", line 261 in _test_module File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", line 297 in _runtest_inner2 File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", line 340 in _runtest_inner File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", line 215 in _runtest File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/runtest.py", line 245 in runtest File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 337 in rerun_failed_tests File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 715 in _main File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 658 in main File "/home/runner/work/cpython/cpython/Lib/test/libregrtest/main.py", line 736 in main File "/home/runner/work/cpython/cpython/Lib/test/__main__.py", line 2 in <module> File "/home/runner/work/cpython/cpython/Lib/runpy.py", line 86 in _run_code File "/home/runner/work/cpython/cpython/Lib/runpy.py", line 196 in _run_module_as_main ---------- components: Library (Lib), Tests messages: 401808 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: test_multiprocessing_fork failws with timeout type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Wed Sep 15 00:18:04 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 04:18:04 +0000 Subject: [issue45200] test_multiprocessing_fork failws with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631679484.68.0.501426002683.issue45200@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- keywords: +patch pull_requests: +26757 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28344 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Wed Sep 15 00:50:12 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Sep 2021 04:50:12 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631681412.44.0.749930247129.issue45155@roundup.psfhosted.org> Barry A. Warsaw <barry at python.org> added the comment: "big" by default ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Wed Sep 15 02:03:15 2021 From: report at bugs.python.org (Cy) Date: Wed, 15 Sep 2021 06:03:15 +0000 Subject: [issue45201] API function PySignal_SetWakeupFd is not exported and unusable Message-ID: <1631685795.19.0.380145753565.issue45201@roundup.psfhosted.org> New submission from Cy <frompython at fedicy.allowed.org>: I want to wait on curl_multi_wait which messes up python's signal handling since libcurl doesn't know to exit the polling loop on signal. I created a pipe that curl could read from when python registered a signal, and PySignal_SetWakeupFd would write to the pipe, thus letting curl leave its polling loop, letting my C module return an exception condition. Except PySignal_SetWakeupFd cannot be used. In Modules/signalmodule.c, it says: int PySignal_SetWakeupFd(int fd) when it should say: PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd) This probably isn't a problem for most, since gcc has visiblity=public by default, but I guess Gentoo's process for building python sets -fvisibility=hidden, so I can't access it, and all Microsoft users should have no access to PySignal_SetWakeupFd, since Microsoft does have hidden visibility by default. ---------- components: C API messages: 401810 nosy: cy priority: normal severity: normal status: open title: API function PySignal_SetWakeupFd is not exported and unusable type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45201> _______________________________________ From report at bugs.python.org Wed Sep 15 03:08:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 07:08:54 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631689734.9.0.376232039037.issue45020@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: New changeset 369bf949ccbb689cd4638b29b4c0c12db79b927c by Terry Jan Reedy in branch 'main': bpo-45020: Don't test IDLE with frozen module. (GH-28344) https://github.com/python/cpython/commit/369bf949ccbb689cd4638b29b4c0c12db79b927c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 03:09:00 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:09:00 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631689740.43.0.0141719964841.issue45020@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26759 pull_request: https://github.com/python/cpython/pull/28346 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 03:08:56 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:08:56 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631689736.23.0.881217869442.issue45020@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 15.0 -> 16.0 pull_requests: +26758 pull_request: https://github.com/python/cpython/pull/28345 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 03:13:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 07:13:31 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631690011.14.0.400093951613.issue45193@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: New changeset 1afc7b3219b24c951bb4e6b7e1ead904228de074 by Terry Jan Reedy in branch 'main': bpo-45193: Restore IDLE completion boxes on Ubuntu (GH-28343) https://github.com/python/cpython/commit/1afc7b3219b24c951bb4e6b7e1ead904228de074 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 03:13:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:13:32 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631690012.04.0.594824001223.issue45193@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26760 pull_request: https://github.com/python/cpython/pull/28347 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 03:24:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 07:24:16 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631690656.45.0.864153800179.issue45193@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- pull_requests: +26761 pull_request: https://github.com/python/cpython/pull/28348 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 03:33:40 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:33:40 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631691220.48.0.568432820783.issue45020@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 8a9396cf1d9e1ce558841095e1ce0d3c23b7a8aa by Miss Islington (bot) in branch '3.10': bpo-45020: Don't test IDLE with frozen module. (GH-28344) https://github.com/python/cpython/commit/8a9396cf1d9e1ce558841095e1ce0d3c23b7a8aa ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 03:34:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:34:23 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631691263.42.0.736555178304.issue45020@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset f71b86e0ae194613d235086755c6a44266978be1 by Miss Islington (bot) in branch '3.9': bpo-45020: Don't test IDLE with frozen module. (GH-28344) https://github.com/python/cpython/commit/f71b86e0ae194613d235086755c6a44266978be1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 03:37:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 07:37:42 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631691462.55.0.7321542016.issue45193@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 0c64569ac7066a97e4482c6d6e4d780806692ae5 by Miss Islington (bot) in branch '3.10': bpo-45193: Restore IDLE completion boxes on Ubuntu (GH-28343) https://github.com/python/cpython/commit/0c64569ac7066a97e4482c6d6e4d780806692ae5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 04:23:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 08:23:50 +0000 Subject: [issue45189] Drop the "list_frozen" command from _test_embed. In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org> Message-ID: <1631694230.12.0.123702300948.issue45189@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I found a new _imp._frozen_module_names() function: $ ./python Python 3.11.0a0 (heads/main:1afc7b3219, Sep 15 2021, 10:22:28) [GCC >>> import _imp; _imp._frozen_module_names() ['_frozen_importlib', '_frozen_importlib_external', 'zipimport'] ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45189> _______________________________________ From report at bugs.python.org Wed Sep 15 05:14:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 15 Sep 2021 09:14:30 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631697270.92.0.595179683795.issue45152@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: New changeset 40d2ac92f9a28a486156dafdbb613016bb1f6b98 by Irit Katriel in branch 'main': bpo-45152: refactor the dis module to make handling of hasconst opcodes more generic (GH-28258) https://github.com/python/cpython/commit/40d2ac92f9a28a486156dafdbb613016bb1f6b98 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Wed Sep 15 05:18:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 09:18:59 +0000 Subject: [issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og (fail on Raspbian on 3.9, regression from 3.8) In-Reply-To: <1590258625.25.0.246740749681.issue40746@roundup.psfhosted.org> Message-ID: <1631697539.7.0.974844619163.issue40746@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_gdb now pass on ARM Raspbian 3.x. I'm not sure why test_gdb fails on 3.10 but pass on 3.x. For me, it looks more like a gcc or gdb issue, rather than a Python bug. ARM Raspbian 3.10: https://buildbot.python.org/all/#/builders/685/builds/76 test.pythoninfo: CC.version: gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110 gdb_version: GNU gdb (Raspbian 10.1-1.7) 10.1.90.20210103-git sysconfig[CCSHARED]: -fPIC sysconfig[CC]: gcc -pthread sysconfig[CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall sysconfig[CONFIG_ARGS]: '--prefix' '/var/lib/buildbot/workers/3.10.gps-raspbian/build/target' '--with-pydebug' sysconfig[HOST_GNU_TYPE]: armv7l-unknown-linux-gnueabihf sysconfig[MACHDEP]: linux sysconfig[MULTIARCH]: arm-linux-gnueabihf 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 Logs: ====================================================================== FAIL: test_bt (test.test_gdb.PyBtTests) Verify that the "py-bt" command works ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/workers/3.10.gps-raspbian/build/Lib/test/test_gdb.py", line 776, in test_bt self.assertMultilineMatches(bt, File "/var/lib/buildbot/workers/3.10.gps-raspbian/build/Lib/test/test_gdb.py", line 295, in assertMultilineMatches self.fail(msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x258ba4: file Python/bltinmodule.c, line 1194.\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".\n\nBreakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:1194\n1194\t{\nTraceback (most recent call first):\n <built-in method id of module object at remote 0xb68b8360>\n' did not match '^.*\nTraceback \\(most recent call first\\):\n <built-in method id of module object .*>\n File ".*gdb_sample.py", line 10, in baz\n id\\(42\\)\n File ".*gdb_sample.py", line 7, in bar\n baz\\(a, b, c\\)\n File ".*gdb_sample.py", line 4, in foo\n bar\\(a, b, c\\)\n File ".*gdb_sample.py", line 12, in <module>\n foo\\(1, 2, 3\\)\n' Stderr: Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0xfdfdfd83: Error occurred in Python: Cannot access memory at address 0xfdfdfd83 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40746> _______________________________________ From report at bugs.python.org Wed Sep 15 05:19:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 09:19:26 +0000 Subject: [issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og: <class 'gdb.MemoryError'> Cannot access memory at address 0xfffffedc In-Reply-To: <1590258625.25.0.246740749681.issue40746@roundup.psfhosted.org> Message-ID: <1631697566.31.0.233893501984.issue40746@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_gdb failing on 32-bit armv7l when built with GCC -Og (fail on Raspbian on 3.9, regression from 3.8) -> test_gdb failing on 32-bit armv7l when built with GCC -Og: <class 'gdb.MemoryError'> Cannot access memory at address 0xfffffedc _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40746> _______________________________________ From report at bugs.python.org Wed Sep 15 05:35:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 15 Sep 2021 09:35:25 +0000 Subject: [issue45152] Prepare for splitting LOAD_CONST into several opcodes In-Reply-To: <1631196564.41.0.680638780635.issue45152@roundup.psfhosted.org> Message-ID: <1631698525.25.0.929399735431.issue45152@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45152> _______________________________________ From report at bugs.python.org Wed Sep 15 05:37:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 09:37:23 +0000 Subject: [issue44022] CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1631698643.28.0.327863735356.issue44022@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Matej Cepl: "Is there a CVE for this?" Yes, CVE-2021-3737 was assigned to this issue. * https://access.redhat.com/security/cve/CVE-2021-3737 * https://bugzilla.redhat.com/show_bug.cgi?id=1995162 ---------- nosy: +vstinner title: urllib http client possible infinite loop on a 100 Continue response -> CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44022> _______________________________________ From report at bugs.python.org Wed Sep 15 05:46:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 09:46:36 +0000 Subject: [issue44022] CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1631699196.36.0.339516168752.issue44022@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created https://python-security.readthedocs.io/vuln/urllib-100-continue-loop.html to track the issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44022> _______________________________________ From report at bugs.python.org Wed Sep 15 05:49:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 09:49:12 +0000 Subject: [issue44022] CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1631699352.13.0.149649274802.issue44022@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not sure why the fix in the main branch was not listed here: commit 47895e31b6f626bc6ce47d175fe9d43c1098909d Author: Gen Xu <xgbarry at gmail.com> Date: Wed May 5 15:42:41 2021 -0700 bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response. Co-authored-by: Gregory P. Smith <greg at krypto.org> ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44022> _______________________________________ From report at bugs.python.org Wed Sep 15 06:01:52 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 10:01:52 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' Message-ID: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> New submission from theeshallnotknowethme <nohackingofkrowten at gmail.com>: Add a flag named 'CO_FUTURE_REVOLT_AND_REMOVE_BARRY_FROM_BDFL' assigned to `0x2000000` that can be activated with 'from __future__ import remove_barry_from_BDFL'. Reverts the effects of 'from __future__ import barry_as_FLUFL' and adds the 'CO_FUTURE_REVOLT_AND_REMOVE_BARRY_FROM_BDFL' flag in indication that Barry has been overthrown from his position. Doing this before a 'from __future__ import barry_as_FLUFL' import will have no effect whatsoever. Redoing 'from __future__ import barry_as_FLUFL' will remove the flag and re-add the 'CO_FUTURE_BARRY_AS_BDFL' flag. There can be optional messages informing users of the change. ---------- components: Library (Lib) messages: 401822 nosy: February291948 priority: normal severity: normal status: open title: Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 06:03:02 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 10:03:02 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631700182.06.0.826471826019.issue45202@roundup.psfhosted.org> Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>: ---------- keywords: +patch pull_requests: +26762 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28349 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 06:51:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 10:51:14 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631703074.72.0.249819473435.issue21302@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26764 pull_request: https://github.com/python/cpython/pull/28350 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 15 07:13:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 11:13:27 +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: <1631704407.46.0.638171657517.issue44786@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +26765 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28351 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 07:14:17 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 11:14:17 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631704457.12.0.0916068243609.issue45202@roundup.psfhosted.org> Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>: ---------- versions: +Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 07:14:22 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 11:14:22 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631704462.38.0.164271749789.issue45202@roundup.psfhosted.org> Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>: ---------- versions: -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 08:24:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 15 Sep 2021 12:24:20 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR Message-ID: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> New submission from Mark Shannon <mark at hotpy.org>: The stats for BINARY_SUBSCR and to a lesser amount LOAD_METHOD don't tell us much about what isn't being specialized. We should refine the stats to give us a better idea of what to optimize for. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 401823 nosy: Mark.Shannon priority: normal severity: normal status: open title: Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Wed Sep 15 08:26:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 12:26:52 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1631708812.54.0.0946426140657.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset b49263b698993cad2b8aaddc55cdeaa678412b30 by Victor Stinner in branch 'main': bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350) https://github.com/python/cpython/commit/b49263b698993cad2b8aaddc55cdeaa678412b30 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 15 08:39:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 12:39:00 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631709540.79.0.338787207656.issue45195@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 4ce55cceb2901c564962f724448a9ced00c8a738 by Miss Islington (bot) in branch '3.9': bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28334) https://github.com/python/cpython/commit/4ce55cceb2901c564962f724448a9ced00c8a738 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Wed Sep 15 08:38:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 12:38:52 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631709532.76.0.424634029831.issue45195@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset ececa53b7fc9c21d0c8153153e3c19da1d0a1e80 by Miss Islington (bot) in branch '3.10': bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28333) https://github.com/python/cpython/commit/ececa53b7fc9c21d0c8153153e3c19da1d0a1e80 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Wed Sep 15 08:39:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 12:39:22 +0000 Subject: [issue45195] test_readline: test_nonascii() failed on aarch64 RHEL8 Refleaks 3.x In-Reply-To: <1631618041.01.0.810175030001.issue45195@roundup.psfhosted.org> Message-ID: <1631709562.62.0.199751348188.issue45195@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45195> _______________________________________ From report at bugs.python.org Wed Sep 15 08:42:38 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 15 Sep 2021 12:42:38 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR In-Reply-To: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> Message-ID: <1631709758.46.0.19080890879.issue45203@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- keywords: +patch pull_requests: +26766 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28352 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Wed Sep 15 08:49:41 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 12:49:41 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631710181.08.0.549106963376.issue45202@roundup.psfhosted.org> Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>: ---------- components: +Interpreter Core, Parser nosy: +lys.nikolaou, pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 09:09:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:09:36 +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: <1631711376.58.0.0249445070898.issue44786@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The warning comes from this regex: Tools/c-analyzer/c_common/tables.py", line 236 _COLSPEC_RE = re.compile(textwrap.dedent(r''' ^ (?: [[] ( (?: [^\s\]] [^\]]* )? [^\s\]] ) # <label> []] )? ( \w+ ) # <field> (?: (?: : ( [<^>] ) # <align> ( \d+ ) # <width1> ) | (?: (?: : ( \d+ ) # <width2> )? (?: : ( .*? ) # <fmt> )? ) )? $ '''), re.VERBOSE) ---------- nosy: +eric.snow, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 09:11:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:11:43 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631711503.05.0.824983355366.issue45202@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: 'from __future__ import barry_as_FLUFL' is an easter egg. I don't see the point of 'from __future__ import remove_barry_from_BDFL'. ---------- nosy: +barry, serhiy.storchaka, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 09:15:16 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 13:15:16 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631711716.72.0.703775172623.issue45202@roundup.psfhosted.org> theeshallnotknowethme <nohackingofkrowten at gmail.com> added the comment: Reverting the effects of 'from __future__ import barry_as_FLUFL' without exiting the compiler. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 09:15:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:15:47 +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: <1631711747.66.0.409698656987.issue43425@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_peg_generator still emits DeprecationWarning warnings. Example: vstinner at apu$ ./python -m test test_peg_generator -v == CPython 3.11.0a0 (heads/main:b49263b698, Sep 15 2021, 14:44:10) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] == Linux-5.13.14-200.fc34.x86_64-x86_64-with-glibc2.33 little-endian == cwd: /home/vstinner/python/main/build/test_python_193641? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 15.94 Run tests sequentially 0:00:00 load avg: 15.94 [1/1] test_peg_generator test_advanced_left_recursive (test.test_peg_generator.test_c_parser.TestCParser) ... /home/vstinner/python/main/Lib/test/support/__init__.py:1713: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import ccompiler, sysconfig, spawn, errors /home/vstinner/python/main/Lib/test/support/__init__.py:1713: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils import ccompiler, sysconfig, spawn, errors (...) ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43425> _______________________________________ From report at bugs.python.org Wed Sep 15 09:15:27 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Wed, 15 Sep 2021 13:15:27 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631711727.6.0.307295514277.issue45202@roundup.psfhosted.org> theeshallnotknowethme <nohackingofkrowten at gmail.com> added the comment: *interpreter. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 09:17:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:17:11 +0000 Subject: [issue45204] test_peg_generator: test_soft_keyword() logs many messages into stdout Message-ID: <1631711831.11.0.180810271503.issue45204@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: Example (not in verbose mode!): $ ./python -m test test_peg_generator -m test_soft_keyword 0:00:00 load avg: 4.54 Run tests sequentially 0:00:00 load avg: 4.54 [1/1] test_peg_generator start() ... (looking at 1.0: NAME:'number') expect('number') ... (looking at 1.0: NAME:'number') ... expect('number') -> TokenInfo(type=1 (NAME), string='number', start=(1, 0), end=(1, 6), line='number 1') number() ... (looking at 1.7: NUMBER:'1') ... number() -> TokenInfo(type=2 (NUMBER), string='1', start=(1, 7), end=(1, 8), line='number 1') ... start() -> 1 start() ... (looking at 1.0: NAME:'string') expect('number') ... (looking at 1.0: NAME:'string') ... expect('number') -> None expect('string') ... (looking at 1.0: NAME:'string') ... expect('string') -> TokenInfo(type=1 (NAME), string='string', start=(1, 0), end=(1, 6), line="string 'b'") string() ... (looking at 1.7: STRING:"'b'") ... string() -> TokenInfo(type=3 (STRING), string="'b'", start=(1, 7), end=(1, 10), line="string 'b'") ... start() -> 'b' start() ... (looking at 1.0: NAME:'number') expect('number') ... (looking at 1.0: NAME:'number') ... expect('number') -> TokenInfo(type=1 (NAME), string='number', start=(1, 0), end=(1, 6), line='number test 1') number() ... (looking at 1.7: NAME:'test') ... number() -> None expect('string') ... (looking at 1.0: NAME:'number') ... expect('string') -> None soft_keyword() ... (looking at 1.0: NAME:'number') ... soft_keyword() -> TokenInfo(type=1 (NAME), string='number', start=(1, 0), end=(1, 6), line='number test 1') name() ... (looking at 1.7: NAME:'test') ... name() -> TokenInfo(type=1 (NAME), string='test', start=(1, 7), end=(1, 11), line='number test 1') _tmp_1() ... (looking at 1.12: NUMBER:'1') number() ... (looking at 1.12: NUMBER:'1') ... number() -> TokenInfo(type=2 (NUMBER), string='1', start=(1, 12), end=(1, 13), line='number test 1') ... _tmp_1() -> TokenInfo(type=2 (NUMBER), string='1', start=(1, 12), end=(1, 13), line='number test 1') ... start() -> test = 1 start() ... (looking at 1.0: NAME:'string') expect('number') ... (looking at 1.0: NAME:'string') ... expect('number') -> None expect('string') ... (looking at 1.0: NAME:'string') ... expect('string') -> TokenInfo(type=1 (NAME), string='string', start=(1, 0), end=(1, 6), line="string test 'b'") string() ... (looking at 1.7: NAME:'test') ... string() -> None soft_keyword() ... (looking at 1.0: NAME:'string') ... soft_keyword() -> TokenInfo(type=1 (NAME), string='string', start=(1, 0), end=(1, 6), line="string test 'b'") name() ... (looking at 1.7: NAME:'test') ... name() -> TokenInfo(type=1 (NAME), string='test', start=(1, 7), end=(1, 11), line="string test 'b'") _tmp_1() ... (looking at 1.12: STRING:"'b'") number() ... (looking at 1.12: STRING:"'b'") ... number() -> None name() ... (looking at 1.12: STRING:"'b'") ... name() -> None string() ... (looking at 1.12: STRING:"'b'") ... string() -> TokenInfo(type=3 (STRING), string="'b'", start=(1, 12), end=(1, 15), line="string test 'b'") ... _tmp_1() -> TokenInfo(type=3 (STRING), string="'b'", start=(1, 12), end=(1, 15), line="string test 'b'") ... start() -> test = 'b' start() ... (looking at 1.0: NAME:'test') expect('number') ... (looking at 1.0: NAME:'test') ... expect('number') -> None expect('string') ... (looking at 1.0: NAME:'test') ... expect('string') -> None soft_keyword() ... (looking at 1.0: NAME:'test') ... soft_keyword() -> None ... start() -> None == Tests result: SUCCESS == 1 test OK. Total duration: 246 ms Tests result: SUCCESS ---------- components: Tests messages: 401832 nosy: lys.nikolaou, pablogsal, vstinner priority: normal severity: normal status: open title: test_peg_generator: test_soft_keyword() logs many messages into stdout versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45204> _______________________________________ From report at bugs.python.org Wed Sep 15 09:19:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:19:29 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages Message-ID: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: The following 4 test_compileall tests logs "Compiling ..." messages: test_larger_than_32_bit_times (test.test_compileall.CompileallTestsWithSourceEpoch) ... Compiling '/tmp/tmp1k_q89f5/_test.py'... ok test_year_2038_mtime_compilation (test.test_compileall.CompileallTestsWithSourceEpoch) ... Compiling '/tmp/tmp83hk4o6n/_test.py'... ok test_larger_than_32_bit_times (test.test_compileall.CompileallTestsWithoutSourceEpoch) ... Compiling '/tmp/tmpf9fir94a/_test.py'... ok test_year_2038_mtime_compilation (test.test_compileall.CompileallTestsWithoutSourceEpoch) ... Compiling '/tmp/tmpw9mtirkx/_test.py'... ok Current output: ---------------- $ ./python -m test test_compileall 0:00:00 load avg: 1.09 Run tests sequentially 0:00:00 load avg: 1.09 [1/1] test_compileall Compiling '/tmp/tmpdc269658/_test.py'... Compiling '/tmp/tmppeummd0q/_test.py'... Compiling '/tmp/tmp_vf3awm7/_test.py'... Compiling '/tmp/tmpgkxrt872/_test.py'... == Tests result: SUCCESS == 1 test OK. Total duration: 23.3 sec Tests result: SUCCESS ---------------- I would prefer a quiet output (no message). ---------- components: Tests messages: 401833 nosy: vstinner priority: normal severity: normal status: open title: test_compileall logs "Compiling ..." messages versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 09:23:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:23:17 +0000 Subject: [issue45206] test_contextlib_async logs "Task was destroyed but it is pending" messages Message-ID: <1631712197.72.0.810359664637.issue45206@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: 3 tests of test_contextlib_async logs messages. I would prefer a quiet output. test_contextmanager_trap_second_yield (test.test_contextlib_async.AsyncContextManagerTestCase) ... Task was destroyed but it is pending! task: <Task pending name='Task-12' coro=<<async_generator_athrow without __name__>()>> ok test_contextmanager_trap_yield_after_throw (test.test_contextlib_async.AsyncContextManagerTestCase) ... Task was destroyed but it is pending! task: <Task pending name='Task-14' coro=<<async_generator_athrow without __name__>()>> ok test_async_gen_propagates_generator_exit (test.test_contextlib_async.TestAbstractAsyncContextManager) ... Task was destroyed but it is pending! task: <Task pending name='Task-20' coro=<<async_generator_athrow without __name__>()>> ok Current output: --- $ ./python -m test test_contextlib_async 0:00:00 load avg: 12.33 Run tests sequentially 0:00:00 load avg: 12.33 [1/1] test_contextlib_async Task was destroyed but it is pending! task: <Task pending name='Task-12' coro=<<async_generator_athrow without __name__>()>> Task was destroyed but it is pending! task: <Task pending name='Task-14' coro=<<async_generator_athrow without __name__>()>> Task was destroyed but it is pending! task: <Task pending name='Task-20' coro=<<async_generator_athrow without __name__>()>> == Tests result: SUCCESS == 1 test OK. Total duration: 837 ms Tests result: SUCCESS --- ---------- components: Tests messages: 401834 nosy: vstinner priority: normal severity: normal status: open title: test_contextlib_async logs "Task was destroyed but it is pending" messages versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45206> _______________________________________ From report at bugs.python.org Wed Sep 15 09:24:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:24:16 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages Message-ID: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: test_gdb logs many messages. I would prefer a quiet output: 0:02:05 load avg: 11.65 [155/427] test_gdb passed (...) Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_varargs_keywords" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_o" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_noargs" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. Function "meth_fastcall_keywords" not defined. ---------- components: Tests messages: 401835 nosy: vstinner priority: normal severity: normal status: open title: test_gdb logs "Function ... not defined" messages versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 09:25:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:25:33 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1631712333.16.0.556642078707.issue45021@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Race condition in thread.py -> concurrent.futures race condition _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Wed Sep 15 09:26:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:26:06 +0000 Subject: [issue44724] multiprocessing: the Resource Tracker process is never reaped In-Reply-To: <1627046993.43.0.654405119923.issue44724@roundup.psfhosted.org> Message-ID: <1631712366.8.0.551507627159.issue44724@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Resource Tracker is never reaped -> multiprocessing: the Resource Tracker process is never reaped _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44724> _______________________________________ From report at bugs.python.org Wed Sep 15 09:28:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:28:33 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages Message-ID: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: I would prefer a quiet test: test_checkline_is_not_executable (test.test_pdb.ChecklineTests) ... End of file *** Blank or comment *** Blank or comment *** Blank or comment *** Blank or comment *** Blank or comment End of file ok Current output: ------------ $ ./python -m test test_pdb 0:00:00 load avg: 1.93 Run tests sequentially 0:00:00 load avg: 1.93 [1/1] test_pdb End of file *** Blank or comment *** Blank or comment *** Blank or comment *** Blank or comment *** Blank or comment End of file == Tests result: SUCCESS == 1 test OK. Total duration: 5.1 sec Tests result: SUCCESS ------------ ---------- components: Tests messages: 401836 nosy: vstinner priority: normal severity: normal status: open title: test_pdb: test_checkline_is_not_executable() logs messages versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 09:29:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 13:29:13 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown Message-ID: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: 0:03:25 load avg: 12.33 [250/427] test_multiprocessing_forkserver passed (...) /home/vstinner/python/main/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' /home/vstinner/python/main/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/psm_33506d9a': [Errno 2] No such file or directory: '/psm_33506d9a' warnings.warn('resource_tracker: %r: %s' % (name, e)) ---------- components: Tests messages: 401837 nosy: vstinner priority: normal severity: normal status: open title: multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Wed Sep 15 09:50:40 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 15 Sep 2021 13:50:40 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631713840.95.0.950928473859.issue45019@roundup.psfhosted.org> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment: The PR 28319 seems to have introduced a new deprecation warning in tests : 0:00:13 load avg: 2.82 [ 98/427] test_ctypes passed Hello world! /home/karthikeyan/stuff/python/cpython/Lib/ctypes/test/test_values.py:5: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses import imp ---------- nosy: +xtreak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 09:55:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 15 Sep 2021 13:55:58 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR In-Reply-To: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> Message-ID: <1631714158.74.0.443014241631.issue45203@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: New changeset 11cdf2a6702639571554cbf3f69f57d688564540 by Mark Shannon in branch 'main': bpo-45203: Cleanup stats gathering code for LOAD_METHOD (GH-28352) https://github.com/python/cpython/commit/11cdf2a6702639571554cbf3f69f57d688564540 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Wed Sep 15 10:01:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 14:01:44 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631714504.14.0.542922176989.issue45202@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: But why do you need to execute 'from __future__ import barry_as_FLUFL' in your interpreter at first place? Don't do this and you would not need to revert its effect. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 10:08:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 14:08:19 +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: <1631714899.45.0.0308801965263.issue44786@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Yes, [[] looks as the start of a character set containing nested sets (e.g. "[[a-z]--[p-q]]"). This feature is supported by regex and can be added in future versions of re, breaking the code which contain such combinations. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 10:08:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 14:08:55 +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: <1631714935.49.0.127888215666.issue44786@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 1a9ef5798525bbb39a16c8af5c435b97352ee027 by Serhiy Storchaka in branch 'main': bpo-44786: Fix a warning in RE in c-analyzer (GH-28351) https://github.com/python/cpython/commit/1a9ef5798525bbb39a16c8af5c435b97352ee027 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 10:08:56 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 14:08:56 +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: <1631714936.65.0.516272542831.issue44786@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26767 pull_request: https://github.com/python/cpython/pull/28353 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 11:03:31 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Sep 2021 15:03:31 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631718211.4.0.233075891351.issue45202@roundup.psfhosted.org> Barry A. Warsaw <barry at python.org> added the comment: This bug made my day! :-D ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 11:40:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:40:22 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631720422.54.0.807604379303.issue45208@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26768 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28354 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 11:40:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:40:48 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631720448.4.0.150322989823.issue45208@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 11:42:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:42:39 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR In-Reply-To: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> Message-ID: <1631720559.62.0.727726650837.issue45203@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: load_method_fail_kind() added by commit 11cdf2a6702639571554cbf3f69f57d688564540 introduced a compiler (GCC) warning: Python/specialize.c: In function 'load_method_fail_kind': Python/specialize.c:878:1: warning: control reaches end of non-void function [-Wreturn-type] 878 | } | ^ ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Wed Sep 15 11:47:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:47:47 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631720867.55.0.450003859731.issue45207@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26769 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28355 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 11:47:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:47:52 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631720872.99.0.803565726922.issue45207@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 11:53:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Sep 2021 15:53:15 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631721195.1.0.797514239421.issue45205@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26770 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28356 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 11:54:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 15 Sep 2021 15:54:00 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631721240.91.0.225664012006.issue45202@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I think this adds too much complexity for an Easter egg. The compiler flags have been proven to be quite brittle (see past bugs regarding them) so I don't want to add new ones of we can avoid it ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 12:12:05 2021 From: report at bugs.python.org (Alexander Kanavin) Date: Wed, 15 Sep 2021 16:12:05 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631722325.45.0.490794034412.issue45128@roundup.psfhosted.org> Alexander Kanavin <alex.kanavin at gmail.com> added the comment: I am seeing this one too in my yocto builds of 3.10rc2. What is bizarre is that the issue does not occur if the multiprocessing test is run in isolation: python3 -m test -v test_multiprocessing_fork but quite reliably does occur (three times in three different spots) if the whole test suite is executed: python3 -m test -v ---------- nosy: +Alexander Kanavin _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Wed Sep 15 12:15:34 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 15 Sep 2021 16:15:34 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR In-Reply-To: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> Message-ID: <1631722534.56.0.629915843091.issue45203@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +kj nosy_count: 2.0 -> 3.0 pull_requests: +26771 pull_request: https://github.com/python/cpython/pull/28357 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Wed Sep 15 12:19:37 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 16:19:37 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631722777.51.0.573770566419.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset cbeb81971057d6c382f45ecce92df2b204d4106a by Eric Snow in branch 'main': bpo-45020: Freeze some of the modules imported during startup. (gh-28335) https://github.com/python/cpython/commit/cbeb81971057d6c382f45ecce92df2b204d4106a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Wed Sep 15 12:19:37 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 16:19:37 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631722777.83.0.484481705543.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset cbeb81971057d6c382f45ecce92df2b204d4106a by Eric Snow in branch 'main': bpo-45020: Freeze some of the modules imported during startup. (gh-28335) https://github.com/python/cpython/commit/cbeb81971057d6c382f45ecce92df2b204d4106a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 12:19:37 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 16:19:37 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631722777.98.0.719671327628.issue45188@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset cbeb81971057d6c382f45ecce92df2b204d4106a by Eric Snow in branch 'main': bpo-45020: Freeze some of the modules imported during startup. (gh-28335) https://github.com/python/cpython/commit/cbeb81971057d6c382f45ecce92df2b204d4106a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 12:23:15 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 15 Sep 2021 16:23:15 +0000 Subject: [issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og: <class 'gdb.MemoryError'> Cannot access memory at address 0xfffffedc In-Reply-To: <1590258625.25.0.246740749681.issue40746@roundup.psfhosted.org> Message-ID: <1631722995.1.0.580802451165.issue40746@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: fwiw I updated my arm raspbian buildbot from raspbian Buster to raspbian Bullseye in the last few days. That could also explain the difference. More recent toolchain versions. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40746> _______________________________________ From report at bugs.python.org Wed Sep 15 12:24:41 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 15 Sep 2021 16:24:41 +0000 Subject: [issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og: <class 'gdb.MemoryError'> Cannot access memory at address 0xfffffedc In-Reply-To: <1590258625.25.0.246740749681.issue40746@roundup.psfhosted.org> Message-ID: <1631723081.81.0.81998050954.issue40746@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: although it looks like the 3.10 failure you linked to ran after that. so... the upgrade may not explain things. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40746> _______________________________________ From report at bugs.python.org Wed Sep 15 12:33:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 15 Sep 2021 16:33:42 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631723622.14.0.499172367813.issue45198@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: You are correct that __set_name__ works for non-descriptor classes as well. The docs for it should be moved out of the "Implementing Descriptors" section. Also, it should have a non-descriptor example. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Wed Sep 15 12:41:30 2021 From: report at bugs.python.org (Stephanie Gilbert) Date: Wed, 15 Sep 2021 16:41:30 +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: <1631724090.54.0.937673530759.issue15870@roundup.psfhosted.org> Change by Stephanie Gilbert <stephaniegilbert944 at gmail.com>: ---------- components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, stephaniegilbert944, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware type: enhancement -> crash versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50281/MicrosoftOnlineServicesTerms(WW)(English)(February2021)(CR).docx _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Wed Sep 15 12:43:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 16:43:29 +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: <1631724209.6.0.702824357135.issue44786@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 89966f59c2e1d0558f8126458acc7d7ae2a8fef5 by Miss Islington (bot) in branch '3.10': bpo-44786: Fix a warning in RE in c-analyzer (GH-28351) (GH-28353) https://github.com/python/cpython/commit/89966f59c2e1d0558f8126458acc7d7ae2a8fef5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 12:44:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 16:44:21 +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: <1631724261.67.0.811307163632.issue44786@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44786> _______________________________________ From report at bugs.python.org Wed Sep 15 12:47:23 2021 From: report at bugs.python.org (Edward Yang) Date: Wed, 15 Sep 2021 16:47:23 +0000 Subject: [issue45210] tp_dealloc docs should mention error indicator may be set Message-ID: <1631724443.4.0.588312077609.issue45210@roundup.psfhosted.org> New submission from Edward Yang <ezyang at mit.edu>: The fact that the error indicator may be set during tp_dealloc is somewhat well known (https://github.com/posborne/dbus-python/blob/fef4bccfc535c6c2819e3f15384600d7bc198bc5/_dbus_bindings/conn.c#L387) but it's not documented in the official manual. We should document it. A simple suggested patch: diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index b17fb22b69..e7c9b13646 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -668,6 +668,20 @@ and :c:type:`PyType_Type` effectively act as defaults.) :c:func:`PyObject_GC_Del` if the instance was allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`. + If you may call functions that may set the error indicator, you must + use :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` to ensure you + don't clobber a preexisting error indicator (the deallocation could + have occurred while processing a different error): + + .. code-block:: c + + static void foo_dealloc(foo_object *self) { + PyObject *et, *ev, *etb; + PyErr_Fetch(&et, &ev, &etb); + ... + PyErr_Restore(et, ev, etb); + } + Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the deallocator should decrement the reference count for its type object after calling the type deallocator. In order to avoid dangling pointers, the ---------- assignee: docs at python components: Documentation messages: 401854 nosy: docs at python, ezyang priority: normal severity: normal status: open title: tp_dealloc docs should mention error indicator may be set type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45210> _______________________________________ From report at bugs.python.org Wed Sep 15 12:47:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 15 Sep 2021 16:47:55 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631724475.49.0.531311581905.issue45128@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > but quite reliably does occur (three times in three different spots) if the whole test suite is executed: The thing is that we are running the test suite constantly on CI and buildbots and non of them have seen this problem :( We should see if we could reproduce this easily first. ?ukasz, could you take a look if you have some availability? ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Wed Sep 15 12:50:05 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 15 Sep 2021 16:50:05 +0000 Subject: [issue45210] tp_dealloc docs should mention error indicator may be set In-Reply-To: <1631724443.4.0.588312077609.issue45210@roundup.psfhosted.org> Message-ID: <1631724605.3.0.487183084655.issue45210@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +26772 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28358 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45210> _______________________________________ From report at bugs.python.org Wed Sep 15 12:57:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 16:57:10 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run In-Reply-To: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> Message-ID: <1631725030.98.0.776901934858.issue45185@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset d897579a80da3f4572d96501c41bec6cacb10d84 by Nikita Sobolev in branch 'main': bpo-45185: enables `TestEnumerations` in `test_ssl` (GH-28330) https://github.com/python/cpython/commit/d897579a80da3f4572d96501c41bec6cacb10d84 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Wed Sep 15 13:00:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 17:00:40 +0000 Subject: [issue45185] test.test_ssl.TestEnumerations is not run In-Reply-To: <1631564075.33.0.576511422146.issue45185@roundup.psfhosted.org> Message-ID: <1631725240.46.0.321067511547.issue45185@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you Nikita! The test was added in issue38659 and was not backported, so it is 3.11 only issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45185> _______________________________________ From report at bugs.python.org Wed Sep 15 13:02:23 2021 From: report at bugs.python.org (Hasan) Date: Wed, 15 Sep 2021 17:02:23 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1631725343.1.0.438830146457.issue39355@roundup.psfhosted.org> Change by Hasan <hasan.aleeyev at gmail.com>: ---------- keywords: +patch pull_requests: +26773 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28359 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39355> _______________________________________ From report at bugs.python.org Wed Sep 15 13:05:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 15 Sep 2021 17:05:34 +0000 Subject: [issue45202] Add 'remove_barry_from_BDFL' future to revert effects of 'from __future__ import barry_as_FLUFL' In-Reply-To: <1631700112.53.0.581578028786.issue45202@roundup.psfhosted.org> Message-ID: <1631725534.22.0.983830169662.issue45202@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: I agree this should be rejected due to pointlessness and complexity. I'll give my usual advice: if you really want to see this happen, I suggest opening a discussion on the python-ideas mailing list. Then if there's consensus to go ahead, this issue can be re-opened. ---------- nosy: +eric.smith resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45202> _______________________________________ From report at bugs.python.org Wed Sep 15 13:05:33 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 15 Sep 2021 17:05:33 +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: <1631725533.32.0.676973037891.issue15870@roundup.psfhosted.org> Change by Zachary Ware <zachary.ware at gmail.com>: ---------- components: -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: -Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, stephaniegilbert944, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware type: crash -> enhancement versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Wed Sep 15 13:05:47 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 15 Sep 2021 17:05:47 +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: <1631725547.14.0.21520800488.issue15870@roundup.psfhosted.org> Change by Zachary Ware <zachary.ware at gmail.com>: Removed file: https://bugs.python.org/file50281/MicrosoftOnlineServicesTerms(WW)(English)(February2021)(CR).docx _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Wed Sep 15 13:11:19 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 15 Sep 2021 17:11:19 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631725879.53.0.992616346057.issue45188@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset 09b4ad11f323f8702cde795e345b75e0fbb1a9a5 by Steve Dower in branch 'main': bpo-45188: Windows now regenerates frozen modules at the start of build instead of late (GH-28322) https://github.com/python/cpython/commit/09b4ad11f323f8702cde795e345b75e0fbb1a9a5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 13:19:45 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:19:45 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. Message-ID: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: Currently we calculate a number of filesystem paths during runtime initialization in Modules/getpath.c (with the key goal of producing what will end up in sys.path). Some of those paths are preserved and some are not. In cases where the discarded data comes from filesystem access, we should preserve as much as possible. The most notable info is location of the stdlib source files. We would store this as PyConfig.stdlib_dir (and _PyPathConfig.stdlib_dir). We'd expose it with sys.stdlibdir (or sys.get_stdlib_dir() if we might need to calculate lazily), similar to sys.platlibdir, sys.home, and sys.prefix. sys.stdlibdir would allow us to avoid filesystem access, for example: * in site.py * in sysconfig.py * detect if python is running out of the source tree (needed for bpo-45020) FYI, I have a branch that mostly does what I'm suggesting here. ---------- assignee: eric.snow components: Interpreter Core messages: 401860 nosy: eric.snow priority: normal severity: normal stage: needs patch status: open title: Useful (expensive) information is discarded in getpath.c. type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Wed Sep 15 13:25:05 2021 From: report at bugs.python.org (Diego Ramirez) Date: Wed, 15 Sep 2021 17:25:05 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631726705.91.0.160449748255.issue45083@roundup.psfhosted.org> Change by Diego Ramirez <dr01191115 at gmail.com>: ---------- nosy: +DiddiLeija _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 15 13:25:57 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:25:57 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1631713840.95.0.950928473859.issue45019@roundup.psfhosted.org> Message-ID: <CALFfu7B-=c9rbSA5Wm+d-mXTLnWO9HOVO7znHBAQJ6C5B0ChRA@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Wed, Sep 15, 2021 at 7:51 AM Karthikeyan Singaravelan <report at bugs.python.org> wrote: > The PR 28319 seems to have introduced a new deprecation warning in tests : I'll fix that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 13:30:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 17:30:17 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket Message-ID: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Dangling threads are reported when run test_socket tests which raise SkipTest in setUp() in refleak mode. $ ./python -m test -R 3:3 test_socket -m testBCM 0:00:00 load avg: 2.53 Run tests sequentially 0:00:00 load avg: 2.53 [1/1] test_socket beginning 6 repetitions 123456 .Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1) Warning -- Dangling thread: <_MainThread(MainThread, started 139675429708416)> .Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1) Warning -- Dangling thread: <_MainThread(MainThread, started 139675429708416)> .Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1) Warning -- Dangling thread: <_MainThread(MainThread, started 139675429708416)> ... test_socket failed (env changed) == Tests result: SUCCESS == 1 test altered the execution environment: test_socket Total duration: 655 ms Tests result: SUCCESS It happens because tearDown() is not called if setUp() raises any exception (including SkipTest). If we want to execute some cleanup code it should be registered with addCleanup(). ---------- components: Tests messages: 401862 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Dangling threads in skipped tests in test_socket type: resource usage versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Wed Sep 15 13:34:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 15 Sep 2021 17:34:25 +0000 Subject: [issue45204] test_peg_generator: test_soft_keyword() logs many messages into stdout In-Reply-To: <1631711831.11.0.180810271503.issue45204@roundup.psfhosted.org> Message-ID: <1631727265.38.0.652514667899.issue45204@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +26774 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28360 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45204> _______________________________________ From report at bugs.python.org Wed Sep 15 13:34:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 17:34:58 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631727298.27.0.0752419579301.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26775 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28361 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Wed Sep 15 13:36:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 17:36:44 +0000 Subject: [issue45083] Need to use the exception class qualname when rendering exception (in C code) In-Reply-To: <1630532795.5.0.16726920843.issue45083@roundup.psfhosted.org> Message-ID: <1631727404.27.0.191300610356.issue45083@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45083> _______________________________________ From report at bugs.python.org Wed Sep 15 13:42:12 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:42:12 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. Message-ID: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: When looking up a frozen modules, we loop over the array of frozen modules until we find a match (or don't). See find_frozen() in Python/import.c. The frozen importer sits right after the builtin importer and right before the file-based importer. This means the import system does that frozen module lookup every time import happens (where it isn't a builtin module), even if it's a source module. ---------- components: Interpreter Core messages: 401863 nosy: barry, brett.cannon, eric.snow priority: normal severity: normal stage: needs patch status: open title: Frozen modules are looked up using a linear search. type: performance versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Wed Sep 15 13:44:16 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:44:16 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1631727856.77.0.7083843475.issue45213@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Realistically, I doubt this will ever be a problem. The list of frozen modules is fairly small and the loop in the C code is a lightweight. So it isn't that big of a deal relative to the other costs involved in import. Even if the number of frozen modules grows dramatically, it's unlikely to be a problem. So we should probably close this. Mostly I opened this so folks with the same observations could find it. I'll close the issue in a few days in case I missed something. ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Wed Sep 15 13:45:22 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:45:22 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631727922.51.0.151969928559.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: At this point the fundamental work is done. Here are some follow-up tasks to wrap up this issue: * freeze the remaining stdlib modules imported during startup (os, site, codecs, encodings.*) + blocked by bpo-45186 and bpo-45188 * default to "on" (except if actually running out of the source tree) + blocked by bpo-45211 (if we want to minimize disk access) * always default to "on" if it's a PGO build, even if running out of the source tree * stop tracking the frozen module .h files in the repo + blocked by bpo-45188 * (maybe) freeze modules imported for "python -m ..." (e.g. runpy) * (maybe) freeze a small subset of the encodings (e.g. UTF-8) + blocked by a valid __path__ (see below) and consequently bpo-45211 Other related follow-up tasks: * (maybe) make frozen stdlib modules more like source modules, with __file__ and __path__ (see bpo-21736) + blocked by bpo-45211 + __path__ allows us to have frozen stdlib packages with non-frozen submodules (e.g. encodings) * (maybe) freeze other modules (e.g. commonly used modules, sysconfig) * (maybe) use something other than linear search for looking up frozen modules (see bpo-45213) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 13:47:02 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 15 Sep 2021 17:47:02 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1631728022.46.0.253096845329.issue45209@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: I would like to work on this, if no one has started yet. ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Wed Sep 15 13:55:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 17:55:32 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1631728532.78.0.193038728856.issue45211@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Honestly I find it debatable whether we're doing anyone a favor by publishing the __file__ of the corresponding stdlib file for frozen modules. There will be situations where this points to the wrong file, and editing the file will not have an effect (unless you rebuild). I'd rather tell people to use -X frozen_modules=off until they can fix their dependency on the __file__ of frozen modules. ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Wed Sep 15 13:56:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 17:56:13 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631728573.19.0.347721728256.issue45188@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Is this now done? I.e. can we now drop the frozen .h files from the repo? ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 13:58:28 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 17:58:28 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631728708.27.0.961827052137.issue45019@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26776 pull_request: https://github.com/python/cpython/pull/28362 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 13:59:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 17:59:21 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631728761.88.0.536990169978.issue45186@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I would propose that marshal internally make an extra pass over its input in order to determine which objects are referenced multiple times. This will speed up reading marshalled data (in addition to addressing the reproducibility issue with debug builds) at the cost of slowing down writing it, so there may need to be a way for 3rd party users to turn this off (or a way for importlib and compileall to turn it on). ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Wed Sep 15 14:03:07 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 18:03:07 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631728987.53.0.56433158336.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I would move "default to "on" (except if actually running out of the source tree)" to the "maybe" category. I left a few comments in other deps. I think we should start by turning this on by default in PGO builds. Separately, I encourage you to collect reliable performance numbers. It would be nice to see a dip on speed.python.org for this benchmark: https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on (but that won't show up until we turn this on by default for PGO builds). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 14:17:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:17:00 +0000 Subject: [issue45204] test_peg_generator: test_soft_keyword() logs many messages into stdout In-Reply-To: <1631711831.11.0.180810271503.issue45204@roundup.psfhosted.org> Message-ID: <1631729820.81.0.553266436898.issue45204@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 764e6823a7632c2091db93da04c15900350ad524 by Pablo Galindo Salgado in branch 'main': bpo-45204: Reduce verbosity of test_peg_generator (GH-28360) https://github.com/python/cpython/commit/764e6823a7632c2091db93da04c15900350ad524 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45204> _______________________________________ From report at bugs.python.org Wed Sep 15 14:19:38 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:19:38 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631729978.64.0.631010803172.issue45208@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26777 pull_request: https://github.com/python/cpython/pull/28363 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 14:19:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:19:38 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631729978.19.0.370091453166.issue45208@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e08e491a6ceea8ca105612df10147418c4e105b8 by Victor Stinner in branch 'main': bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354) https://github.com/python/cpython/commit/e08e491a6ceea8ca105612df10147418c4e105b8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 14:20:55 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:20:55 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631730055.57.0.616332191886.issue45205@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26778 pull_request: https://github.com/python/cpython/pull/28364 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 14:20:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:20:48 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631730048.79.0.376948075317.issue45205@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset cc057ff5227b3a4ded637caa7ba51b67b06abaaa by Victor Stinner in branch 'main': bpo-45205: Make test_compileall quiet (GH-28356) https://github.com/python/cpython/commit/cc057ff5227b3a4ded637caa7ba51b67b06abaaa ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 14:21:14 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:21:14 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631730074.21.0.0439215747019.issue45207@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26779 pull_request: https://github.com/python/cpython/pull/28365 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 14:21:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:21:09 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631730069.61.0.965242671402.issue45207@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 84a6061e29e9dc13909bdf6f541f48c2a4f1d410 by Victor Stinner in branch 'main': bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355) https://github.com/python/cpython/commit/84a6061e29e9dc13909bdf6f541f48c2a4f1d410 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 14:21:18 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:21:18 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631730078.51.0.782686431954.issue45207@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26780 pull_request: https://github.com/python/cpython/pull/28366 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 14:25:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:25:48 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631730348.18.0.247136425109.issue45167@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 5dce51a8875d9639786741e962b3cb208596b096 by Serhiy Storchaka in branch 'main': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) https://github.com/python/cpython/commit/5dce51a8875d9639786741e962b3cb208596b096 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 14:25:54 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:25:54 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631730354.15.0.27362502248.issue45167@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26782 pull_request: https://github.com/python/cpython/pull/28368 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 14:25:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:25:49 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631730349.83.0.84948059705.issue45167@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26781 pull_request: https://github.com/python/cpython/pull/28367 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 14:26:51 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:26:51 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631730411.24.0.935995789672.issue45193@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26783 pull_request: https://github.com/python/cpython/pull/28369 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 14:26:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 18:26:47 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631730407.35.0.320234693988.issue45193@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: New changeset 9d76d28867c28bcc881b851547a9cd7ac003ae88 by Terry Jan Reedy in branch 'main': bpo-45193: News for IDLE PR_28343 (GH-28348) https://github.com/python/cpython/commit/9d76d28867c28bcc881b851547a9cd7ac003ae88 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 14:27:17 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:27:17 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631730437.11.0.493481910433.issue45205@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26784 pull_request: https://github.com/python/cpython/pull/28370 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 14:32:27 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 15 Sep 2021 18:32:27 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631728573.19.0.347721728256.issue45188@roundup.psfhosted.org> Message-ID: <67420d2d-de84-b8ae-7907-2e86335730f4@python.org> Steve Dower <steve.dower at python.org> added the comment: Should be able to, yeah. Though I didn't test that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 14:34:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:34:09 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631730849.37.0.39922462648.issue5846@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ff6d2cc55aac5cc53e331cae145d0cf35ec647b0 by Erlend Egeberg Aasland in branch 'main': bpo-5846: Deprecate obsolete methods in `unittest` (GH-28299) https://github.com/python/cpython/commit/ff6d2cc55aac5cc53e331cae145d0cf35ec647b0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Wed Sep 15 14:35:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:35:01 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1631730901.23.0.791453596395.issue34602@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 2563dd2d0a1cf793afca328ae9e195b72bd2b391 by ?ukasz Langa in branch '3.10': [3.10] bpo-34602: Quadruple stack size on macOS when compiling with UBSAN (GH-27309) (GH-28280) https://github.com/python/cpython/commit/2563dd2d0a1cf793afca328ae9e195b72bd2b391 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34602> _______________________________________ From report at bugs.python.org Wed Sep 15 14:39:13 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:39:13 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631731153.76.0.841550953895.issue45089@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26785 pull_request: https://github.com/python/cpython/pull/28371 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 14:39:19 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:39:19 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631731159.61.0.454077552108.issue45089@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26786 pull_request: https://github.com/python/cpython/pull/28372 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 14:39:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:39:10 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631731150.98.0.648133921235.issue45089@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 51056b40e711d84692d099ac8970077b33c7fafd by Erlend Egeberg Aasland in branch 'main': bpo-45089: Improve sqlite3 trace callback docs (GH-28238) https://github.com/python/cpython/commit/51056b40e711d84692d099ac8970077b33c7fafd ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 14:46:52 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 15 Sep 2021 18:46:52 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631731612.24.0.496487290177.issue45193@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset a5bc0ffc520e09226f85d5fa8faaa83be0acee68 by Miss Islington (bot) in branch '3.10': bpo-45193: News for IDLE PR_28343 (GH-28348) https://github.com/python/cpython/commit/a5bc0ffc520e09226f85d5fa8faaa83be0acee68 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 14:49:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 18:49:26 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631731766.28.0.545666025215.issue45188@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I tried this: - remove the generated .h files - touched dictobject.c - touched dictobject.h After each step I tried to rebuild. Each case the compilation of frozen.c failed and then the build stopped, so apparently the .h files weren't generated early enough. Here's the error message: C:\Users\gvanrossum\cpython\Python\frozen.c(44,10): fatal error C1083: Cannot open include file: 'frozen_modules/abc. h': No such file or directory [C:\Users\gvanrossum\cpython\PCbuild\pythoncore.vcxproj] ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 14:54:25 2021 From: report at bugs.python.org (Hasan) Date: Wed, 15 Sep 2021 18:54:25 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1631732065.09.0.957915544262.issue39355@roundup.psfhosted.org> Change by Hasan <hasan.aleeyev at gmail.com>: ---------- pull_requests: +26787 pull_request: https://github.com/python/cpython/pull/28373 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39355> _______________________________________ From report at bugs.python.org Wed Sep 15 14:56:56 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 18:56:56 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631732216.84.0.148636450769.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: That's a good idea. It's certainly cleaner than the approach I took (optionally pass in to marshal.dumps() the list of "before" object/refcount pairs to compare in w_ref()). Adding a flag to marshal.dumps() to opt out shouldn't be too big a deal. (I expect all users of marshal will want the improvement by default.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Wed Sep 15 14:56:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 18:56:40 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631732200.53.0.0570363049967.issue45208@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 0e4f913da88791644150282e38ba21d1fca5fd91 by Miss Islington (bot) in branch '3.10': bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354) (GH-28363) https://github.com/python/cpython/commit/0e4f913da88791644150282e38ba21d1fca5fd91 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Wed Sep 15 15:00:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:00:10 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631732410.54.0.421086843433.issue45089@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 87f0ac8c1de83ac63447b9fe799dfb1657a5a9db by Miss Islington (bot) in branch '3.10': bpo-45089: Improve sqlite3 trace callback docs (GH-28238) (GH-28371) https://github.com/python/cpython/commit/87f0ac8c1de83ac63447b9fe799dfb1657a5a9db ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 15:03:21 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Wed, 15 Sep 2021 19:03:21 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1631732601.93.0.543734509538.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: Another possible resolution would to simply make threads that attempt to acquire the GIL after Python starts to finalize hang (i.e. sleep until the process exits). Since the GIL can never be acquired again, this is in some sense the simplest way to fulfill the contract. This also ensures that any data stored on the thread call stack and referenced from another thread remains valid. As long as nothing on the main thread blocks waiting for one of these hung threads, there won't be deadlock. I have a case right now where a background thread (created from C++, which is similar to a daemon Python thread) acquires the GIL, and calls "call_soon_threadsafe" on an asycnio event loop. I think that causes some Python code internally to release the GIL at some point, after triggering some code to run on the main thread which happens to cause the program to exit. While `Py_FinalizeEx` is running, the call to "call_soon_threadsafe" completes on the background thread, attempts to re-acquire the GIL, which triggers a call to pthread_exit. That unwinds the C++ stack, which results in a call to Py_DECREF without the GIL held, leading to a crash. ---------- nosy: +jbms _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Wed Sep 15 15:09:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:09:35 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631732975.46.0.428001703571.issue45089@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 97802a8edb3f15aef9ecc1cac97c4c1b4ed3fdfc by Miss Islington (bot) in branch '3.9': bpo-45089: Improve sqlite3 trace callback docs (GH-28238) (GH-28372) https://github.com/python/cpython/commit/97802a8edb3f15aef9ecc1cac97c4c1b4ed3fdfc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 15:10:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:10:10 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631733010.23.0.129494649485.issue45089@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Erlend! ? ? ? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 15:10:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:10:37 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631733037.44.0.621560854733.issue45207@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset bbaf5c27e659cf372c34a6fe7ca31a2f5cb20a50 by Miss Islington (bot) in branch '3.10': bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355) (GH-28365) https://github.com/python/cpython/commit/bbaf5c27e659cf372c34a6fe7ca31a2f5cb20a50 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 15:11:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:11:25 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631733085.2.0.151434104416.issue45207@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 1c70efcbb57ab4eb65ca604b39606fceff6db4f5 by Miss Islington (bot) in branch '3.9': bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355) (GH-28366) https://github.com/python/cpython/commit/1c70efcbb57ab4eb65ca604b39606fceff6db4f5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 15:12:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:12:03 +0000 Subject: [issue45207] test_gdb logs "Function ... not defined" messages In-Reply-To: <1631712256.1.0.943755935446.issue45207@roundup.psfhosted.org> Message-ID: <1631733123.91.0.409135810212.issue45207@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Victor! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45207> _______________________________________ From report at bugs.python.org Wed Sep 15 15:12:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:12:27 +0000 Subject: [issue45089] [sqlite3] the trace callback does not raise exceptions on error In-Reply-To: <1630615346.0.0.296018695296.issue45089@roundup.psfhosted.org> Message-ID: <1631733147.81.0.122657034235.issue45089@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45089> _______________________________________ From report at bugs.python.org Wed Sep 15 15:23:14 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 15 Sep 2021 19:23:14 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631733794.35.0.725474684287.issue45183@roundup.psfhosted.org> Change by Brett Cannon <brett at python.org>: ---------- assignee: -> brett.cannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Wed Sep 15 15:31:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:31:23 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631734283.57.0.794908845741.issue45167@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 2746045a37e0d56ffdd8bb79f961bd7df0d1afba by Miss Islington (bot) in branch '3.9': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28368) https://github.com/python/cpython/commit/2746045a37e0d56ffdd8bb79f961bd7df0d1afba ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 15:32:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:32:04 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631734324.05.0.429584479445.issue45205@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 17000b5a80e6ec071ea5007dcc6792e9daaaf0f2 by Miss Islington (bot) in branch '3.10': bpo-45205: Make test_compileall quiet (GH-28356) (GH-28370) https://github.com/python/cpython/commit/17000b5a80e6ec071ea5007dcc6792e9daaaf0f2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 15:33:09 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 19:33:09 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631734389.63.0.591990714246.issue45019@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 4b30aaa0c9dc4da956199dbd48af9c06089cb271 by Eric Snow in branch 'main': bpo-45019: Silence a warning in test_ctypes. (gh-28362) https://github.com/python/cpython/commit/4b30aaa0c9dc4da956199dbd48af9c06089cb271 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 15:33:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:33:56 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631734435.99.0.901455281175.issue45205@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 9443ce4eedbcaffb3262e7ede1dd100678e85506 by Miss Islington (bot) in branch '3.9': bpo-45205: Make test_compileall quiet (GH-28356) (GH-28364) https://github.com/python/cpython/commit/9443ce4eedbcaffb3262e7ede1dd100678e85506 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 15:34:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:34:24 +0000 Subject: [issue45205] test_compileall logs "Compiling ..." messages In-Reply-To: <1631711969.83.0.460025250602.issue45205@roundup.psfhosted.org> Message-ID: <1631734464.26.0.132212515462.issue45205@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Victor! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45205> _______________________________________ From report at bugs.python.org Wed Sep 15 15:34:08 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 19:34:08 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631734448.33.0.0817658046754.issue45019@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26788 pull_request: https://github.com/python/cpython/pull/28374 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 15:35:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:35:20 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631734520.36.0.709674479626.issue45167@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset de4c9c0bdc9b62e68dacd0c4bac20d7f4c527511 by Miss Islington (bot) in branch '3.10': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28367) https://github.com/python/cpython/commit/de4c9c0bdc9b62e68dacd0c4bac20d7f4c527511 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 15:35:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 19:35:55 +0000 Subject: [issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken In-Reply-To: <1631293792.65.0.39078575611.issue45167@roundup.psfhosted.org> Message-ID: <1631734555.73.0.913142724626.issue45167@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Serhiy! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45167> _______________________________________ From report at bugs.python.org Wed Sep 15 15:47:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 19:47:12 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631735232.74.0.675690678812.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26789 pull_request: https://github.com/python/cpython/pull/28317 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Wed Sep 15 15:47:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 19:47:25 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631735245.48.0.541118321242.issue45187@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- dependencies: +Dangling threads in skipped tests in test_socket _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Wed Sep 15 15:50:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Sep 2021 19:50:36 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631735436.73.0.524207483842.issue5846@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I do not think that PR 28299 is correct. We want to deprecate these functions which are implemented in the unittest.loader module, not just names exported to the unittest module. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Wed Sep 15 15:55:44 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 19:55:44 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631735744.61.0.714905538597.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26790 pull_request: https://github.com/python/cpython/pull/28375 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 16:05:49 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 20:05:49 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1631736349.17.0.133818111424.issue45211@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Setting __file__ on frozen modules is only one example. I actually need the stdlib dir to be preserved for other uses. FWIW, I think you're probably right about __file__ on frozen modules. That said, further discussion about __file__ (or __path__) is probably more suitable in bpo-21736. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Wed Sep 15 16:15:44 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 20:15:44 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1631736944.27.0.208635555674.issue45019@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 3814e2036d96e2b6c69afce61926bb0a2a34d2d9 by Eric Snow in branch 'main': bpo-45019: Clean up the frozen __hello__ module. (gh-28374) https://github.com/python/cpython/commit/3814e2036d96e2b6c69afce61926bb0a2a34d2d9 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45019> _______________________________________ From report at bugs.python.org Wed Sep 15 16:26:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 15 Sep 2021 20:26:10 +0000 Subject: [issue45214] implement LOAD_NONE opcode Message-ID: <1631737570.2.0.756455142992.issue45214@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- assignee: iritkatriel components: Interpreter Core nosy: iritkatriel priority: normal severity: normal status: open title: implement LOAD_NONE opcode type: performance versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45214> _______________________________________ From report at bugs.python.org Wed Sep 15 16:31:55 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 15 Sep 2021 20:31:55 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1631737915.4.0.793288079308.issue45209@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: The problem was in `test_shared_memory_cleaned_after_process_termination` test. ``` ? ./python.exe -m test -v test_multiprocessing_forkserver -m test_shared_memory_cleaned_after_process_termination == CPython 3.11.0a0 (heads/main:09b4ad11f3, Sep 15 2021, 20:50:50) [Clang 11.0.0 (clang-1100.0.33.16)] == macOS-10.14.6-x86_64-i386-64bit little-endian == cwd: /Users/sobolev/Desktop/cpython/build/test_python_14874? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.98 Run tests sequentially 0:00:00 load avg: 1.98 [1/1] test_multiprocessing_forkserver test_shared_memory_cleaned_after_process_termination (test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory) ... ok /Users/sobolev/Desktop/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' /Users/sobolev/Desktop/cpython/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/psm_67480e45': [Errno 2] No such file or directory: '/psm_67480e45' warnings.warn('resource_tracker: %r: %s' % (name, e)) ---------------------------------------------------------------------- Ran 1 test in 0.775s OK == Tests result: SUCCESS == 1 test OK. Total duration: 1.6 sec Tests result: SUCCESS ``` My patch (location https://github.com/python/cpython/blob/51056b40e711d84692d099ac8970077b33c7fafd/Lib/test/_test_multiprocessing.py#L4179): ``` resource_tracker.unregister(f"/{name}", "shared_memory") ``` With this change no warning is generated: ``` ? ./python.exe -m test -v test_multiprocessing_forkserver -m test_shared_memory_cleaned_after_process_termination == CPython 3.11.0a0 (heads/main:09b4ad11f3, Sep 15 2021, 20:50:50) [Clang 11.0.0 (clang-1100.0.33.16)] == macOS-10.14.6-x86_64-i386-64bit little-endian == cwd: /Users/sobolev/Desktop/cpython/build/test_python_24281? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.80 Run tests sequentially 0:00:00 load avg: 1.80 [1/1] test_multiprocessing_forkserver test_shared_memory_cleaned_after_process_termination (test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.732s OK == Tests result: SUCCESS == 1 test OK. Total duration: 1.5 sec Tests result: SUCCESS ``` My other highly-related PR where I refactor several `SharedMemory` tests: https://github.com/python/cpython/pull/28294 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Wed Sep 15 16:33:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 15 Sep 2021 20:33:32 +0000 Subject: [issue45214] implement LOAD_NONE opcode Message-ID: <1631738012.2.0.608595230689.issue45214@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26791 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28376 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45214> _______________________________________ From report at bugs.python.org Wed Sep 15 16:33:50 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 15 Sep 2021 20:33:50 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1631738030.55.0.773170700122.issue45209@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26792 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28377 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Wed Sep 15 16:36:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 20:36:45 +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: <1631738205.95.0.652089502875.issue39710@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a75a2577259a55d816de24a4cca16aad74e02aa5 by Hubert Badocha in branch 'main': bpo-39710: Remove Python 2-specific sentence from calendar documentation (GH-26985) https://github.com/python/cpython/commit/a75a2577259a55d816de24a4cca16aad74e02aa5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39710> _______________________________________ From report at bugs.python.org Wed Sep 15 16:37:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 15 Sep 2021 20:37:37 +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: <1631738257.47.0.423615288895.issue39710@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the patch, Hubert Badocha! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39710> _______________________________________ From report at bugs.python.org Wed Sep 15 17:02:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 15 Sep 2021 21:02:16 +0000 Subject: [issue45204] test_peg_generator: test_soft_keyword() logs many messages into stdout In-Reply-To: <1631711831.11.0.180810271503.issue45204@roundup.psfhosted.org> Message-ID: <1631739736.44.0.323533617009.issue45204@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45204> _______________________________________ From report at bugs.python.org Wed Sep 15 17:02:55 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 21:02:55 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1631728987.53.0.56433158336.issue45020@roundup.psfhosted.org> Message-ID: <CALFfu7CUPONBphfj33WFe46fgzmbm+R9rtdv_Cc4tsR=rwhkXQ@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Wed, Sep 15, 2021 at 12:03 PM Guido van Rossum <report at bugs.python.org> wrote: > I would move "default to "on" (except if actually running out of the source tree)" to the "maybe" category. I left a few comments in other deps. I think we should start by turning this on by default in PGO builds. Sounds good. > Separately, I encourage you to collect reliable performance numbers. It would be nice to see a dip on speed.python.org for this benchmark: I'll do that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 17:07:12 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 21:07:12 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1631740032.97.0.128416650848.issue21736@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: > Note that the filename information is already available in the > code object's co_filename attribute. Hm, in the latest (3.11) main that's not true -- co_filename is set to something like "<frozen ntpath>". And that's about right, since the filename contained in the frozen data can at best reflect the filename at the time the freeze script ran, which is not necessarily the same as the filename when the user runs the Python binary. I don't think we should try to set __file__ or any other attributes on frozen modules (at least not for the small set of frozen modules we're contemplating for 3.11). User who need the file can run their Python 3.11 binary with -Xfrozen_modules=off, to disable the use of frozen modules (other than the three importlib bootstrap files). Tools that freeze the entire stdlib or 3rd party code may have to make a different choice, but that's not our problem (yet). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21736> _______________________________________ From report at bugs.python.org Wed Sep 15 17:08:16 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 21:08:16 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631740096.24.0.635094784383.issue45188@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: FYI, I have a PR up for dropping the .h files: https://github.com/python/cpython/pull/28375. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 17:08:37 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 15 Sep 2021 21:08:37 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631740117.41.0.698509133395.issue45188@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Can we close this? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 17:12:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 15 Sep 2021 21:12:26 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631740346.99.0.4383866484.issue45188@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: We can once GH-28375 lands. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 17:13:01 2021 From: report at bugs.python.org (Cameron Simpson) Date: Wed, 15 Sep 2021 21:13:01 +0000 Subject: [issue25625] "chdir" Contex manager for pathlib In-Reply-To: <1447523143.32.0.921942004004.issue25625@psf.upfronthosting.co.za> Message-ID: <1631740381.48.0.829472880837.issue25625@roundup.psfhosted.org> Change by Cameron Simpson <cs at cskk.id.au>: ---------- nosy: +cameron _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25625> _______________________________________ From report at bugs.python.org Wed Sep 15 18:58:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 15 Sep 2021 22:58:14 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1631746694.77.0.657425975709.issue45193@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: 0c64569ac7066a97e4482c6d6e4d780806692ae5 a5bc0ffc520e09226f85d5fa8faaa83be0acee68 are ready to be cherrypicked into into the 3.10.0 release branch. Once that is done, 'release blocker' can be removed, but issue should remain open for a separate fix for 3.9. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Wed Sep 15 21:15:34 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 01:15:34 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631754934.42.0.698843386837.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset a9757bf34d8b4cb3c24bbb70d50a06c815e2e8f3 by Eric Snow in branch 'main': bpo-45020: Drop the frozen .h files from the repo. (gh-28375) https://github.com/python/cpython/commit/a9757bf34d8b4cb3c24bbb70d50a06c815e2e8f3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 15 21:15:56 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 01:15:56 +0000 Subject: [issue45188] De-couple the Windows builds from freezing modules. In-Reply-To: <1631565846.06.0.121053368867.issue45188@roundup.psfhosted.org> Message-ID: <1631754956.79.0.48493321795.issue45188@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45188> _______________________________________ From report at bugs.python.org Wed Sep 15 22:03:59 2021 From: report at bugs.python.org (Nabeel Alzahrani) Date: Thu, 16 Sep 2021 02:03:59 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631757838.99.0.213689232533.issue45180@roundup.psfhosted.org> Nabeel Alzahrani <nalza001 at ucr.edu> added the comment: But when I turn off the "autojunk" feature for the following example, I get the wrong ratio of 0.5 instead of the correct ratio of 0.2 with autojunk enabled. a=""" #include <iostream> #include <string> using namespace std; int main() { string userPass; int sMaxIndex; char indivChar; int i; cin >> userPass; sMaxIndex = userPass.size() - 1; for (i = 0; i <= sMaxIndex; ++i) { indivChar = userPass.at(i); if (indivChar == 'i') { indivChar = '1'; cout << indivChar; } else if (indivChar == 'a') { indivChar = '@'; cout << indivChar; } else if (indivChar == 'm') { indivChar = 'M'; cout << indivChar; } else if (indivChar == 'B') { indivChar = '8'; cout << indivChar; } else if (indivChar == 's') { indivChar = '$'; cout << indivChar; } else { cout << indivChar; } } cout << "!" << endl; return 0; } """ b=""" #include <iostream> #include <string> using namespace std; int main() { string ori; cin >> ori; for (int i = 0; i < ori.size(); i++){ if (ori.at(i) == 'i') ori.at(i) = '1'; if (ori.at(i) == 'a') ori.at(i) = '@'; if (ori.at(i) == 'm') ori.at(i) = 'M'; if (ori.at(i) == 'B') ori.at(i) = '8'; if (ori.at(i) == 's') ori.at(i) = '$'; } cout << ori << endl; return 0; } """ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Wed Sep 15 22:13:10 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 16 Sep 2021 02:13:10 +0000 Subject: [issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed Message-ID: <1631758390.34.0.18935168801.issue45215@roundup.psfhosted.org> New submission from Andrei Kulakov <andrei.avk at gmail.com>: Currently using *name* and *parent* args in Mock and MagicMock is problematic in a few ways: *name* - any value can be passed silently but at a later time, any value except for an str will cause an exception when repr() or str() on the mock object is done. - a string name can be passed but will not be equal to the respective attr value: Mock(name='foo').name != 'foo', as users would expect. (this should be documented). *parent* - any value can be passed but, similarly to *name*, will cause an exception when str() or repr() is done on the object. - this arg is not documented so users will expect it to be set as an attr, but instead the attribute is going to be a Mock instance. [1] I propose to fix these issues by: - checking the types that are passed in and display a DeprecationWarning if types are wrong. (note that this check should be fast because at first value can be compared to None default, which is what it's going to be in vast majority of cases, and isinstance() check is only done after that.) (in 3.11) - in 3.12, convert warnings into TypeError. - Document that *name* attribute will be a Mock instance. - Document that *name* argument needs to be a string. - Document *parent* argument. - In the docs for the two args, point to `configure_mock()` method for setting them to arbitrary values. (Note that other args for Mock() have more specialized names and are much less likely to cause similar issues.) [1] https://bugs.python.org/issue39222 ---------- components: Tests messages: 401913 nosy: andrei.avk priority: normal severity: normal status: open title: Add docs for Mock name and parent args and deprecation warning when wrong args are passed type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45215> _______________________________________ From report at bugs.python.org Wed Sep 15 22:39:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 16 Sep 2021 02:39:05 +0000 Subject: [issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed In-Reply-To: <1631758390.34.0.18935168801.issue45215@roundup.psfhosted.org> Message-ID: <1631759945.63.0.676674018919.issue45215@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch pull_requests: +26793 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28378 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45215> _______________________________________ From report at bugs.python.org Wed Sep 15 22:55:34 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 16 Sep 2021 02:55:34 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631760934.69.0.818427893488.issue45155@roundup.psfhosted.org> Barry A. Warsaw <barry at python.org> added the comment: New changeset 07e737d002cdbf0bfee53248a652a86c9f93f02b by Barry Warsaw in branch 'main': bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder) (#28265) https://github.com/python/cpython/commit/07e737d002cdbf0bfee53248a652a86c9f93f02b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Wed Sep 15 22:56:07 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 16 Sep 2021 02:56:07 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631760967.01.0.220202057185.issue45155@roundup.psfhosted.org> Change by Barry A. Warsaw <barry at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Wed Sep 15 23:44:06 2021 From: report at bugs.python.org (Nabeel Alzahrani) Date: Thu, 16 Sep 2021 03:44:06 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631763846.69.0.551169724113.issue45180@roundup.psfhosted.org> Change by Nabeel Alzahrani <nalza001 at ucr.edu>: ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Wed Sep 15 23:46:15 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 16 Sep 2021 03:46:15 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631763975.23.0.769785009301.issue45180@roundup.psfhosted.org> Tim Peters <tim at python.org> added the comment: I have no idea why you think the result should be 0.2. 0.5630188679245283 looks correct to me with autojunk disabled: sm = SequenceMatcher(None, a, b, autojunk=False) total = 0 for m in sm.get_matching_blocks(): print(m, repr(a[m.a : m.a + m.size])) total += m.size Running that displays every matching block: Match(a=0, b=0, size=73) '\n#include <iostream>\n#include <string>\nusing namespace std;\nint main() {\n' Match(a=74, b=73, size=10) ' string ' Match(a=87, b=84, size=1) 'r' Match(a=138, b=85, size=2) 'i;' Match(a=141, b=87, size=11) '\n cin >> ' Match(a=155, b=99, size=1) 'r' Match(a=160, b=101, size=1) ';' Match(a=200, b=102, size=10) '\n for (i' Match(a=210, b=116, size=9) ' = 0; i <' Match(a=220, b=125, size=1) ' ' Match(a=221, b=130, size=1) 's' Match(a=228, b=133, size=1) 'e' Match(a=230, b=136, size=2) '; ' Match(a=232, b=139, size=2) '++' Match(a=235, b=141, size=1) ')' Match(a=237, b=142, size=1) '{' Match(a=274, b=143, size=11) '\n if (' Match(a=285, b=156, size=1) 'i' Match(a=288, b=161, size=1) 'i' Match(a=294, b=163, size=8) " == 'i')" Match(a=305, b=171, size=10) '\n ' Match(a=315, b=183, size=1) 'i' Match(a=318, b=188, size=1) 'i' Match(a=324, b=190, size=14) " = '1';\n " Match(a=380, b=204, size=4) 'if (' Match(a=384, b=210, size=1) 'i' Match(a=387, b=215, size=1) 'i' Match(a=393, b=217, size=8) " == 'a')" Match(a=404, b=225, size=10) '\n ' Match(a=414, b=237, size=1) 'i' Match(a=417, b=242, size=1) 'i' Match(a=423, b=244, size=14) " = '@';\n " Match(a=479, b=258, size=4) 'if (' Match(a=483, b=264, size=1) 'i' Match(a=486, b=269, size=1) 'i' Match(a=492, b=271, size=8) " == 'm')" Match(a=503, b=279, size=10) '\n ' Match(a=513, b=291, size=1) 'i' Match(a=516, b=296, size=1) 'i' Match(a=522, b=298, size=14) " = 'M';\n " Match(a=578, b=312, size=4) 'if (' Match(a=582, b=318, size=1) 'i' Match(a=585, b=323, size=1) 'i' Match(a=591, b=325, size=8) " == 'B')" Match(a=602, b=333, size=10) '\n ' Match(a=612, b=345, size=1) 'i' Match(a=615, b=350, size=1) 'i' Match(a=621, b=352, size=14) " = '8';\n " Match(a=677, b=366, size=4) 'if (' Match(a=681, b=372, size=1) 'i' Match(a=684, b=377, size=1) 'i' Match(a=690, b=379, size=8) " == 's')" Match(a=701, b=387, size=10) '\n ' Match(a=711, b=399, size=1) 'i' Match(a=714, b=404, size=1) 'i' Match(a=720, b=406, size=14) " = '$';\n " Match(a=763, b=420, size=1) '}' Match(a=822, b=421, size=12) '\n cout << ' Match(a=837, b=436, size=26) ' << endl;\n\n return 0;\n}\n' Match(a=863, b=462, size=0) '' and then >>> total 373 >>> 2 * total / (len(a) + len(b)) 0.5630188679245283 >>> sm.ratio() 0.5630188679245283 give identical results. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Thu Sep 16 00:33:04 2021 From: report at bugs.python.org (Nabeel Alzahrani) Date: Thu, 16 Sep 2021 04:33:04 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631766784.51.0.868277931091.issue45180@roundup.psfhosted.org> Nabeel Alzahrani <nalza001 at ucr.edu> added the comment: Here are the steps that I used to calculate 0.2 for the last example: I used class difflib.HtmlDiff to find the number of changed chars (addedChars, deletedChars, and changedChars) which is 1172 (let us call it delta) The size of both strings a and b in this example is 1470 I calculated the similality ratio using 1-(delta/totalSize) = 1-(1172/1470)=0.2 I am assuming both classes difflib.SequenceMatcher and difflib.HtmlDiff are both using the same algorithms and arguments and if so they should produce the same ratio. Is that right? ---------- status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Thu Sep 16 00:38:27 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 04:38:27 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631767107.29.0.132095753132.issue45186@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26794 pull_request: https://github.com/python/cpython/pull/28379 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Thu Sep 16 00:40:14 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 04:40:14 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631767214.79.0.533908303898.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Looks like that last commit broke one of the buildbots: https://buildbot.python.org/all/#/builders/483/builds/812 I'll fix that right away. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 00:49:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 16 Sep 2021 04:49:51 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631767791.88.0.106579442442.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: FWIW, Python/frozen_modules/__hello__.h is still in the repo somehow. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 01:00:51 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 05:00:51 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631768451.97.0.948012285.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Never mind. It's pretty late here so I'm going to revert it and sort it out in the morning. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 01:02:23 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 16 Sep 2021 05:02:23 +0000 Subject: [issue45180] possible wrong result for difflib.SequenceMatcher.ratio() In-Reply-To: <1631505774.89.0.445385938596.issue45180@roundup.psfhosted.org> Message-ID: <1631768543.07.0.00636362481393.issue45180@roundup.psfhosted.org> Tim Peters <tim at python.org> added the comment: Please stop re-opening this. The issue tracker is not a "help desk", and your confusions aren't necessarily Python bugs ;-) If you post something that looks like an actual bug, I'll re-open the report. SequenceMatcher works on sequences. HtmlFiff works on sequences OF sequences (typically lists of lines). Very different things. For example, h = difflib.HtmlDiff() h.make_file(['aaabbbbbbbbb'], ['aaacccccccc']) finds nothing at all in common. It finds that the two lines don't match, and then finds that the lines aren't "similar enough" to bother looking any deeper. But, obviously, they do share 'aaa' as a common prefix, and calling SequenceMatcher directly on the two strings will find their common prefix. There's no reason to imagine they'll produce the same results - they're not doing the same things. SequenceMatcher is used, in several places, as a building block to do the more complicated things HtmlDiff does. But HtmlDiff works on _lines_ first; SequenceMatcher has no concept of "line". As to 1-(delta/totalSize), I have no idea where that came from. What SequenceMatcher.ratio() returns is documented: """ Where T is the total number of elements in both sequences, and M is the number of matches, this is 2.0*M / T. Note that this is 1.0 if the sequences are identical, and 0.0 if they have nothing in common. """ ---------- status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45180> _______________________________________ From report at bugs.python.org Thu Sep 16 01:02:28 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 05:02:28 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631768548.85.0.427277726819.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26795 pull_request: https://github.com/python/cpython/pull/28380 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 01:02:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Sep 2021 05:02:58 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1631768578.22.0.865845136609.issue45211@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Thu Sep 16 01:27:46 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 05:27:46 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631770066.38.0.613221159499.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 9fd87a5fe5c468cf94265365091267838b004b7f by Eric Snow in branch 'main': bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380) https://github.com/python/cpython/commit/9fd87a5fe5c468cf94265365091267838b004b7f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 03:31:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:31:55 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1631777515.52.0.710176711974.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Change CPython to call abort() instead of pthread_exit() as that situation is unresolvable and the process dying is better than hanging, partially alive. That solution isn't friendly, but is better than being silent and allowing deadlock. A failing process is always better than a hung process, especially a partially hung process. The last time someone proposed to always call abort(), I proposed to add a hook instead: I added sys.unraisablehook. See bpo-36829. If we adopt this option, it can be a callback in C, something like: Py_SetThreadExitCallback(func) which would call func() rather than pthread_exit() in ceval.c. -- Another option would be to add an option to disable daemon thread. concurrent.futures has been modified to no longer use daemon threads: bpo-39812. It is really hard to write a reliable implementation of daemon threads with Python subintepreters. See bpo-40234 "[subinterpreters] Disallow daemon threads in subinterpreters optionally". There is already a private flag for that in subinterpreters to disallow spawning processes or threads: an "isolated" subintepreter. Example with _thread.start_new_thread(): PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->config._isolated_interpreter) { PyErr_SetString(PyExc_RuntimeError, "thread is not supported for isolated subinterpreters"); return NULL; } Or os.fork(): if (interp->config._isolated_interpreter) { PyErr_SetString(PyExc_RuntimeError, "fork not supported for isolated subinterpreters"); return NULL; } See also my article on fixing crashes with daemon threads: * https://vstinner.github.io/gil-bugfixes-daemon-threads-python39.html * https://vstinner.github.io/daemon-threads-python-finalization-python32.html ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 16 03:33:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Sep 2021 07:33:30 +0000 Subject: [issue45216] Remove redundand information from difflib docstrings Message-ID: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Difflib docstrings contain short descriptions of functions and methods defined in the module and classes. It is redundant because pydoc shows descriptions for every function and method just few lines below. For example: | Methods: | | __init__(linejunk=None, charjunk=None) | Construct a text differencer, with optional filters. | | compare(a, b) | Compare two sequences of lines; generate the resulting delta. | | Methods defined here: | | __init__(self, linejunk=None, charjunk=None) | Construct a text differencer, with optional filters. | | The two optional keyword parameters are for filter functions: | | - `linejunk`: A function that should accept a single string argument, | and return true iff the string is junk. The module-level function | `IS_LINE_JUNK` may be used to filter out lines without visible | characters, except for at most one splat ('#'). It is recommended | to leave linejunk None; the underlying SequenceMatcher class has | an adaptive notion of "noise" lines that's better than any static | definition the author has ever been able to craft. | | - `charjunk`: A function that should accept a string of length 1. The | module-level function `IS_CHARACTER_JUNK` may be used to filter out | whitespace characters (a blank or tab; **note**: bad idea to include | newline in this!). Use of IS_CHARACTER_JUNK is recommended. | | compare(self, a, b) | Compare two sequences of lines; generate the resulting delta. | | Each sequence must contain individual single-line strings ending with | newlines. Such sequences can be obtained from the `readlines()` method | of file-like objects. The delta generated also consists of newline- | terminated strings, ready to be printed as-is via the writeline() | method of a file-like object. | | Example: It leads to confusion because it looks like methods are described twice. Also the signature of a method in the class docstring can be outdated. For example the description of SequenceMatcher.__init__ was not updated for new parameter autojunk. ---------- assignee: docs at python components: Documentation messages: 401923 nosy: docs at python, serhiy.storchaka priority: normal severity: normal status: open title: Remove redundand information from difflib docstrings type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Thu Sep 16 03:34:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:34:50 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631777690.27.0.361358411025.issue45208@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26796 pull_request: https://github.com/python/cpython/pull/28381 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Thu Sep 16 03:36:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:36:52 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1631777812.19.0.460257650201.issue45155@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder) (#28265) The commit title is wrong, the default "big" not sys.byteorder: int.to_bytes(length=1, byteorder='big', *, signed=False) int.from_bytes(bytes, byteorder='big', *, signed=False) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 16 03:42:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:42:04 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631778124.06.0.199123104625.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > The thing is that we are running the test suite constantly on CI and buildbots and non of them have seen this problem :( Most (if not all) Python CIs run the Python test suite using -jN option which runs each test in isolation: a fresh process is spawned to a test file. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 03:53:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:53:13 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631778793.63.0.0105754301526.issue45208@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 471b3811fe695dcd388396893a0f375a8866ac0c by Victor Stinner in branch '3.9': bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354) (GH-28381) https://github.com/python/cpython/commit/471b3811fe695dcd388396893a0f375a8866ac0c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Thu Sep 16 03:53:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 07:53:25 +0000 Subject: [issue45208] test_pdb: test_checkline_is_not_executable() logs messages In-Reply-To: <1631712513.9.0.565506614817.issue45208@roundup.psfhosted.org> Message-ID: <1631778805.33.0.557643535045.issue45208@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45208> _______________________________________ From report at bugs.python.org Thu Sep 16 03:56:09 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 16 Sep 2021 07:56:09 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631778969.45.0.93314654646.issue45186@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: FYI, This issue is duplicate of https://bugs.python.org/issue34093, and I had made two pull requests to solve the issue. ---------- nosy: +methane _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Thu Sep 16 04:17:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:17:26 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631780246.11.0.457493536992.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Minimum command to reproduce the issue (on Linux): $ ./python -m test -m test.test_logging.LogRecordTest.test_multiprocessing test_genericalias test_logging test_multiprocessing_fork -v (...) 0:00:00 load avg: 0.45 Run tests sequentially 0:00:00 load avg: 0.45 [1/3] test_genericalias ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK 0:00:00 load avg: 0.49 [2/3] test_logging -- test_genericalias ran no tests test_multiprocessing (test.test_logging.LogRecordTest) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.008s OK 0:00:00 load avg: 0.49 [3/3] test_multiprocessing_fork test test_multiprocessing_fork crashed -- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/libregrtest/runtest.py", line 340, in _runtest_inner refleak = _runtest_inner2(ns, test_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/libregrtest/runtest.py", line 280, in _runtest_inner2 the_module = importlib.import_module(abstest) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1072, in _gcd_import File "<frozen importlib._bootstrap>", line 1044, in _find_and_load File "<frozen importlib._bootstrap>", line 1015, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 689, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 894, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/vstinner/python/main/Lib/test/test_multiprocessing_fork.py", line 2, in <module> import test._test_multiprocessing ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/_test_multiprocessing.py", line 5374, in <module> class TestSyncManagerTypes(unittest.TestCase): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/_test_multiprocessing.py", line 5396, in TestSyncManagerTypes manager_class = multiprocessing.managers.SyncManager ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'multiprocessing' has no attribute 'managers' test_multiprocessing_fork failed (uncaught exception) (...) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:26:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:26:27 +0000 Subject: [issue45128] test_multiprocessing fails sporadically on the release artifacts In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631780787.85.0.663758833705.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I can still reproduce the issue if test_logging.py is simplified to: --- import unittest import sys class LogRecordTest(unittest.TestCase): def test_multiprocessing(self): import multiprocessing.queues del sys.modules['multiprocessing'] import multiprocessing --- The "del sys.modules['multiprocessing']" line comes from LogRecordTest._extract_logrecord_process_name() method. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:27:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:27:15 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631780835.53.0.918831712704.issue45128@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_multiprocessing fails sporadically on the release artifacts -> test_multiprocessing_fork fails if run sequentially after test_logging _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:27:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Sep 2021 08:27:20 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631780840.62.0.852137176136.issue5846@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26797 pull_request: https://github.com/python/cpython/pull/28382 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Thu Sep 16 04:29:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:29:07 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631780947.51.0.697725686676.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > ./python -m test -m test.test_logging.LogRecordTest.test_multiprocessing test_genericalias test_logging test_multiprocessing_fork -v This command reproduces the issue: * importing test.test_genericalias imports multiprocessing submodules like multiprocessing.queues * test_logging does: del sys.modules['multiprocessing'] * test_multiprocessing_fork fails to import multiprocessing submodules ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:35:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:35:21 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631781321.49.0.811555091125.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The issue can be reproduced just with these lines: --- import sys import multiprocessing.queues del sys.modules['multiprocessing'] import multiprocessing import multiprocessing.connection from multiprocessing.connection import wait connection = multiprocessing.connection # AttributeError here --- ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:36:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 08:36:50 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631781410.92.0.778073981434.issue45128@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_multiprocessing_fork fails if run sequentially after test_logging -> test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 04:51:18 2021 From: report at bugs.python.org (sbougnoux) Date: Thu, 16 Sep 2021 08:51:18 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc Message-ID: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> New submission from sbougnoux <bougnoux at free.fr>: Just the simple following config crashes """ [Bug] Here """ Hopefully using "Here=" solves the issue, but the doc claims it shall work. https://docs.python.org/3.8/library/configparser.html?highlight=configparser#supported-ini-file-structure Save the config in "bug.ini", then write (it will raise an exception) """ from configparser import ConfigParser ConfigParser().read('bug.ini') """ ---------- assignee: docs at python components: Demos and Tools, Documentation, Library (Lib) messages: 401932 nosy: docs at python, sbougnoux priority: normal severity: normal status: open title: ConfigParser does not accept "No value" reversely to the doc type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Thu Sep 16 05:09:00 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 16 Sep 2021 09:09:00 +0000 Subject: [issue45218] cmath.log has an invalid signature Message-ID: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> New submission from Mark Dickinson <dickinsm at gmail.com>: inspect.signature reports that the cmath.log function has an invalid signature: Python 3.11.0a0 (heads/fix-44954:d0ea569eb5, Aug 19 2021, 14:59:04) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import cmath >>> import inspect >>> inspect.signature(cmath.log) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/mdickinson/Python/cpython/Lib/inspect.py", line 3215, in signature return Signature.from_callable(obj, follow_wrapped=follow_wrapped, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mdickinson/Python/cpython/Lib/inspect.py", line 2963, in from_callable return _signature_from_callable(obj, sigcls=cls, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mdickinson/Python/cpython/Lib/inspect.py", line 2432, in _signature_from_callable return _signature_from_builtin(sigcls, obj, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mdickinson/Python/cpython/Lib/inspect.py", line 2244, in _signature_from_builtin return _signature_fromstr(cls, func, s, skip_bound_arg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mdickinson/Python/cpython/Lib/inspect.py", line 2114, in _signature_fromstr raise ValueError("{!r} builtin has invalid signature".format(obj)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: <built-in function log> builtin has invalid signature ---------- components: Extension Modules messages: 401933 nosy: mark.dickinson priority: normal severity: normal status: open title: cmath.log has an invalid signature versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 05:09:13 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 16 Sep 2021 09:09:13 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1631783353.9.0.416721147714.issue45218@roundup.psfhosted.org> Change by Mark Dickinson <dickinsm at gmail.com>: ---------- type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 06:30:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 16 Sep 2021 10:30:14 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631788214.43.0.515221141227.issue45212@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26798 pull_request: https://github.com/python/cpython/pull/28384 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Thu Sep 16 06:30:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Sep 2021 10:30:09 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631788209.57.0.910273878686.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 7dacb70485a0910eb298c24b4d051720ca56fb91 by Serhiy Storchaka in branch 'main': bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361) https://github.com/python/cpython/commit/7dacb70485a0910eb298c24b4d051720ca56fb91 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Thu Sep 16 06:30:37 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 16 Sep 2021 10:30:37 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631788237.03.0.459664387046.issue45212@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26799 pull_request: https://github.com/python/cpython/pull/28385 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Thu Sep 16 06:44:35 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 16 Sep 2021 10:44:35 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631789075.22.0.851092270097.issue45183@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: I just noticed that I'm unnecessarily obtuse in my description of a possible fix, the diff (without test update): % git diff Lib/zipimport.py (main)cpython diff --git a/Lib/zipimport.py b/Lib/zipimport.py index c55fec6aa1..43ac6cbe57 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -334,7 +334,7 @@ def invalidate_caches(self): _zip_directory_cache[self.archive] = self._files except ZipImportError: _zip_directory_cache.pop(self.archive, None) - self._files = None + self._files = {} def __repr__(self): With that change the exception should not happen, and the now stale zipimporter would be ignored when flushing the cache while the zipfile referenced by the zip importer instance has been removed. That said, I haven't tested this and won't create a PR because my local tree is (still) a mess. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Thu Sep 16 07:21:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 16 Sep 2021 11:21:18 +0000 Subject: [issue45219] Expose indexing and other simple operations on dict-keys in internal API Message-ID: <1631791278.28.0.25675084804.issue45219@roundup.psfhosted.org> New submission from Mark Shannon <mark at hotpy.org>: Specialization and other optimizations rely on shared dictionary key properties (version number, no deletions, etc). However checking those properties during specialization is tricky and rather clunky as the dict-keys can only be tested indirectly through a dictionary. We should add a few internal API functions. Specifically we want to know: Is a key in a dict-keys? What index is that key at? Is a dict-keys all unicode? ---------- assignee: Mark.Shannon messages: 401936 nosy: Mark.Shannon priority: normal severity: normal status: open title: Expose indexing and other simple operations on dict-keys in internal API _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45219> _______________________________________ From report at bugs.python.org Thu Sep 16 07:45:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 16 Sep 2021 11:45:41 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1631792741.56.0.575947118513.issue45218@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: Issue #43067 is similar. I'm not sure what the best solution is in this case: - un-argument-clinic cmath.log, and document the signature using two lines (similar to range): log(z) log(z, base) - change the behaviour of cmath.log so that the second argument is allowed be None (and defaults to None) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 08:12:30 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 16 Sep 2021 12:12:30 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1631794350.39.0.197998409425.issue45218@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: See also #36306 and #29299. There may be nothing to be done here, but it would be nice if math.log and cmath.log at least behaved in the same way. A default of `None` doesn't seem like a terrible option. (BTW, just to forestall the suggestion, a default of `math.e` or `cmath.e` is definitely *not* the right thing to use as a default: `math.e` is not exactly Euler's value for e, and `log` base `math.e` is likely to be less accurate than plain natural log.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 08:35:38 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 16 Sep 2021 12:35:38 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1631795738.33.0.493325129299.issue45218@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: > and `log` base `math.e` is likely to be less accurate than plain natural log Nope, that's nonsense, since the two-argument form simply divides by log(base), and while log(math.e) is mathematically not exactly 1 (its exact value, assuming IEEE 754 binary64, starts 0.9999999999999999468176229339410862948..., which is off from 1.0 by around 0.48 ulps), it's *just* close enough that with a well-behaved libm log implementation it's exactly 1.0 after rounding. I still don't like the idea of math.e as a default value here, but I'd have to work harder to identify why it makes me uneasy. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 08:50:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 12:50:51 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1631796651.57.0.18278350482.issue45218@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The current Argument Clinic syntax for math.log() is: -------------- /*[clinic input] math.log x: object [ base: object(c_default="NULL") = math.e ] / Return the logarithm of x to the given base. (...) -------------- math.log.__text_signature__ is None. __text_signature__ is used by inspect.signature(). I guess that it's a bug in Argument Clinic. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Thu Sep 16 08:52:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 12:52:06 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631796726.86.0.975775817793.issue45212@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: def testWithTimeoutTriggeredSend(self): conn = self.accept_conn() conn.recv(88192) + time.sleep(1) Was it a deliberate choice to add a sleep of 1 second? If yes, can you please add a comment to explain why? ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Thu Sep 16 09:18:33 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 16 Sep 2021 13:18:33 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1631798313.2.0.834652949482.issue45027@roundup.psfhosted.org> Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment: > This change serves the purpose of making it easier to configure non-root loggers. My point was, they don't need to configure non-root loggers (in terms of adding handlers) because the root logger's handlers will normally be used for all loggers. > However, if you configure the root logger in your application, you will see those [other libraries'] log messages. Users certainly don't need an API change to prevent that, should they wish to. The following simple call will suffice (using 'gnupg' just as an example): logging.getLogger('gnupg').setLevel(logging.CRITICAL + 1) > I would frame this proposal as a third configuration option As you can see, it's not needed for the purpose you described (avoiding messages from third-party loggers). > it would be nice to adjust the type stubs for dictConfig() to use a TypedDict ... I'm happy to make a PR to Typeshed for it, though! Sure, sounds like a good idea. > I also think there should be a note about dictConfig() in the docs for basicConfig() ... Again, I'm happy to make a separate PR for that change. By all means. You could also look at updating the cookbook content, if you feel that parts relating to the concerns expressed in this issue could be expanded on. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45027> _______________________________________ From report at bugs.python.org Thu Sep 16 09:20:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 13:20:17 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1631798417.89.0.394518767223.issue45211@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also https://github.com/python/cpython/pull/23169 of bpo-42260 which rewrites getpath.c in pure Python. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Thu Sep 16 09:21:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 13:21:42 +0000 Subject: [issue45210] tp_dealloc docs should mention error indicator may be set In-Reply-To: <1631724443.4.0.588312077609.issue45210@roundup.psfhosted.org> Message-ID: <1631798502.65.0.45883235789.issue45210@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not sure that it's a feature. Maybe we should modify to never call tp_dealloc with an exception set. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45210> _______________________________________ From report at bugs.python.org Thu Sep 16 09:22:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 13:22:23 +0000 Subject: [issue45156] mock.seal has infinite recursion with int class attributes In-Reply-To: <1631225364.14.0.346239674418.issue45156@roundup.psfhosted.org> Message-ID: <1631798543.56.0.548374190103.issue45156@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Thanks for the report and the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45156> _______________________________________ From report at bugs.python.org Thu Sep 16 09:38:03 2021 From: report at bugs.python.org (Richard) Date: Thu, 16 Sep 2021 13:38:03 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1631799483.77.0.739565911259.issue24132@roundup.psfhosted.org> Richard <nyuszika7h at gmail.com> added the comment: I agree this would be nice. For now, I'm doing this as a hack: class Path(type(pathlib.Path())): ... ---------- nosy: +nyuszika7h _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24132> _______________________________________ From report at bugs.python.org Thu Sep 16 10:26:31 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 16 Sep 2021 14:26:31 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1631802391.65.0.411175955134.issue45128@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26800 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28387 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Thu Sep 16 10:44:30 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 16 Sep 2021 14:44:30 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631777812.19.0.460257650201.issue45155@roundup.psfhosted.org> Message-ID: <FEA4D52C-BFFE-47FE-8921-1608AD6A1373@python.org> Barry A. Warsaw <barry at python.org> added the comment: On Sep 16, 2021, at 00:36, STINNER Victor <report at bugs.python.org> wrote: > > The commit title is wrong, the default "big" not sys.byteorder: > > int.to_bytes(length=1, byteorder='big', *, signed=False) > int.from_bytes(bytes, byteorder='big', *, signed=False) Oops ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Thu Sep 16 10:45:16 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 16 Sep 2021 14:45:16 +0000 Subject: [issue45220] Windows builds sometimes fail on main branch Message-ID: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: I've started to notice that CPython's builds on Windows now simetimes fail with something like this: (both Azure and Github Actions are affected) ``` Using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" (found in the Visual Studio installation) Using py -3.9 (found 3.9 with py.exe) D:\a\cpython\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "D:\a\cpython\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /clp:summary /p:Configuration=Release /p:Platform=Win32 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\bin\git.exe" _freeze_module.c config_minimal.c atexitmodule.c faulthandler.c gcmodule.c getbuildinfo.c posixmodule.c signalmodule.c _tracemalloc.c _iomodule.c bufferedio.c bytesio.c fileio.c iobase.c stringio.c textio.c winconsoleio.c abstract.c accu.c boolobject.c Compiling... bytearrayobject.c bytes_methods.c bytesobject.c call.c capsule.c cellobject.c classobject.c codeobject.c complexobject.c descrobject.c dictobject.c enumobject.c exceptions.c fileobject.c floatobject.c frameobject.c funcobject.c genericaliasobject.c genobject.c interpreteridobject.c Compiling... iterobject.c listobject.c longobject.c memoryobject.c methodobject.c moduleobject.c namespaceobject.c object.c obmalloc.c odictobject.c picklebufobject.c rangeobject.c setobject.c sliceobject.c structseq.c tupleobject.c typeobject.c unicodectype.c unicodeobject.c unionobject.c Compiling... weakrefobject.c myreadline.c parser.c peg_api.c pegen.c string_parser.c token.c tokenizer.c getpathp.c invalid_parameter_handler.c msvcrtmodule.c winreg.c _warnings.c asdl.c ast.c ast_opt.c ast_unparse.c bltinmodule.c bootstrap_hash.c ceval.c D:\a\cpython\cpython\Python\ceval.c(3669,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj] D:\a\cpython\cpython\Python\ceval.c(3777,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj] Compiling... codecs.c compile.c context.c dtoa.c dynamic_annotations.c dynload_win.c errors.c fileutils.c formatter_unicode.c frame.c future.c getargs.c getcompiler.c getcopyright.c getopt.c getplatform.c getversion.c hamt.c hashtable.c import.c Compiling... importdl.c initconfig.c marshal.c modsupport.c mysnprintf.c mystrtoul.c pathconfig.c preconfig.c pyarena.c pyctype.c pyfpe.c pyhash.c pylifecycle.c pymath.c pystate.c pystrcmp.c pystrhex.c pystrtod.c Python-ast.c pythonrun.c Compiling... Python-tokenize.c pytime.c specialize.c structmember.c suggestions.c symtable.c sysmodule.c thread.c traceback.c Creating library D:\a\cpython\cpython\PCbuild\win32\_freeze_module.lib and object D:\a\cpython\cpython\PCbuild\win32\_freeze_module.exp Generating code Finished generating code _freeze_module.vcxproj -> D:\a\cpython\cpython\PCbuild\win32\_freeze_module.exe Updated files: __hello__.h Killing any running python.exe instances... Regenerate pycore_ast.h pycore_ast_state.h Python-ast.c D:\a\cpython\cpython\Python\Python-ast.c, D:\a\cpython\cpython\Include\internal\pycore_ast.h, D:\a\cpython\cpython\Include\internal\pycore_ast_state.h regenerated. Regenerate opcode.h opcode_targets.h Include\opcode.h regenerated from Lib\opcode.py Jump table written into Python\opcode_targets.h Regenerate token-list.inc token.h token.c token.py Generated sources are up to date Getting build info from "C:\Program Files\Git\bin\git.exe" Building heads/main-dirty:7dacb70 main _abc.c _bisectmodule.c blake2module.c blake2b_impl.c blake2s_impl.c _codecsmodule.c _collectionsmodule.c _contextvarsmodule.c _csv.c _functoolsmodule.c _heapqmodule.c _json.c _localemodule.c _lsprof.c _math.c _pickle.c _randommodule.c sha3module.c _sre.c _stat.c Compiling... _struct.c _weakref.c arraymodule.c atexitmodule.c audioop.c binascii.c cmathmodule.c _datetimemodule.c errnomodule.c faulthandler.c gcmodule.c itertoolsmodule.c main.c mathmodule.c md5module.c mmapmodule.c _opcode.c _operator.c posixmodule.c rotatingtree.c Compiling... sha1module.c sha256module.c sha512module.c signalmodule.c _statisticsmodule.c symtablemodule.c _threadmodule.c _tracemalloc.c _typingmodule.c timemodule.c xxsubtype.c _xxsubinterpretersmodule.c fileio.c bytesio.c stringio.c bufferedio.c iobase.c textio.c winconsoleio.c _iomodule.c Compiling... _codecs_cn.c _codecs_hk.c _codecs_iso2022.c _codecs_jp.c _codecs_kr.c _codecs_tw.c multibytecodec.c _winapi.c abstract.c accu.c boolobject.c bytearrayobject.c bytes_methods.c bytesobject.c call.c capsule.c cellobject.c classobject.c codeobject.c complexobject.c Compiling... descrobject.c dictobject.c enumobject.c exceptions.c fileobject.c floatobject.c frameobject.c funcobject.c genericaliasobject.c genobject.c interpreteridobject.c iterobject.c listobject.c longobject.c memoryobject.c methodobject.c moduleobject.c namespaceobject.c object.c obmalloc.c Compiling... odictobject.c picklebufobject.c rangeobject.c setobject.c sliceobject.c structseq.c tupleobject.c typeobject.c unicodectype.c unicodeobject.c unionobject.c weakrefobject.c myreadline.c tokenizer.c token.c pegen.c parser.c string_parser.c peg_api.c invalid_parameter_handler.c Compiling... winreg.c config.c getpathp.c msvcrtmodule.c pyhash.c _warnings.c asdl.c ast.c ast_opt.c ast_unparse.c bltinmodule.c bootstrap_hash.c ceval.c D:\a\cpython\cpython\Python\ceval.c(3669,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] D:\a\cpython\cpython\Python\ceval.c(3777,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] codecs.c compile.c context.c dynamic_annotations.c dynload_win.c errors.c fileutils.c Compiling... formatter_unicode.c frame.c frozen.c future.c getargs.c getcompiler.c getcopyright.c getopt.c getplatform.c getversion.c hamt.c hashtable.c import.c importdl.c initconfig.c marshal.c modsupport.c mysnprintf.c mystrtoul.c pathconfig.c Compiling... preconfig.c pyarena.c pyctype.c pyfpe.c pylifecycle.c pymath.c pytime.c pystate.c pystrcmp.c pystrhex.c pystrtod.c dtoa.c Python-ast.c Python-tokenize.c pythonrun.c specialize.c suggestions.c structmember.c symtable.c sysmodule.c Compiling... thread.c traceback.c zlibmodule.c adler32.c compress.c crc32.c deflate.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c dl_nt.c getbuildinfo.c C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: D:\a\cpython\cpython\PCbuild\obj\311win32_Release\pythoncore\RCa05056(47) : fatal error RC1116: RC terminating after preprocessor errors [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] Build FAILED. D:\a\cpython\cpython\Python\ceval.c(3669,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj] D:\a\cpython\cpython\Python\ceval.c(3777,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj] D:\a\cpython\cpython\Python\ceval.c(3669,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] D:\a\cpython\cpython\Python\ceval.c(3777,13): warning C4018: '>=': signed/unsigned mismatch [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: D:\a\cpython\cpython\PCbuild\obj\311win32_Release\pythoncore\RCa05056(47) : fatal error RC1116: RC terminating after preprocessor errors [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] 4 Warning(s) 1 Error(s) ``` Links: - https://github.com/python/cpython/runs/3620202822 - https://dev.azure.com/Python/cpython/_build/results?buildId=87889&view=logs&j=91c152bd-7320-5194-b252-1404e56e2478&t=c7e99cd8-4756-5292-d34b-246ff5fc615f ---------- components: Build messages: 401948 nosy: sobolevn priority: normal severity: normal status: open title: Windows builds sometimes fail on main branch type: compile error versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 10:46:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Sep 2021 14:46:47 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631803607.73.0.0576510025905.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Yes, it is a deliberate choice. It is difficult to explain why it was passed without it -- dues to a specific order of calling tearDown() and callbacks registered with addCleanup() in different base classes. Using an event object would fix it too, but: * Re-using an existing event object (like self.done) can have side effects in future. * Introducing a new event object has a risk of name conflicts, because the hierarchy of classes is complicated, and same name can be reused by accident. * time.sleep() is already used in other similar tests for timeouts. We only need to do a sleep longer then the timeout on the client side (0.01). Given all this, I decided that adding time.sleep(1) was the simplest, the most obvious, and maybe the most resistant to future human errors way. If we want to use an event object here, we will need to re-consider using time.sleep() in other tests. What comment do you want to add? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Thu Sep 16 10:53:42 2021 From: report at bugs.python.org (tongxiaoge) Date: Thu, 16 Sep 2021 14:53:42 +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: <1631804022.12.0.830239482946.issue44598@roundup.psfhosted.org> tongxiaoge <shixuantong at huawei.com> added the comment: I'm sorry I haven't replied for a long time. I found that the OpenSSL version I use is 1.1.1f, which is probably caused by this. Today, I tried to upgrade Python 3 to 3.8.12, and the same problem occurred. I'll try again after upgrading the OpenSSL version tomorrow. If there are still problems, I'll give a reply at that time. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44598> _______________________________________ From report at bugs.python.org Thu Sep 16 10:56:43 2021 From: report at bugs.python.org (ux) Date: Thu, 16 Sep 2021 14:56:43 +0000 Subject: [issue45221] Linker flags starting with -h breaks setup.py (regression) Message-ID: <1631804203.7.0.524724045399.issue45221@roundup.psfhosted.org> New submission from ux <bugs-python-ahmiupek at pkh.me>: Hi, Since 3.8 (included), the following build command fails: LDFLAGS=-headerpad_max_install_names ./configure make With the following error: setup.py: error: argument -h/--help: ignored explicit argument 'eaderpad_max_install_names' A quick hack in setup.py "fixes" the issue: - options, _ = parser.parse_known_args(env_val.split()) + options, _ = parser.parse_known_args([x for x in env_val.split() if not x.startswith('-h')]) Another workaround as a user is to do use `LDFLAGS=-Wl,-headerpad_max_install_names`. ---------- components: Build messages: 401951 nosy: ux priority: normal severity: normal status: open title: Linker flags starting with -h breaks setup.py (regression) type: compile error versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45221> _______________________________________ From report at bugs.python.org Thu Sep 16 11:01:19 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 16 Sep 2021 15:01:19 +0000 Subject: [issue45220] Windows builds sometimes fail on main branch In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631804479.08.0.996352340392.issue45220@roundup.psfhosted.org> Change by Zachary Ware <zachary.ware at gmail.com>: ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:06:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:06:39 +0000 Subject: [issue45220] Windows builds sometimes fail on main branch: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631804799.97.0.114604566171.issue45220@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Windows builds sometimes fail on main branch -> Windows builds sometimes fail on main branch: fatal error RC1116: RC terminating after preprocessor errors _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:06:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:06:16 +0000 Subject: [issue45220] Windows builds sometimes fail on main branch In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631804776.21.0.872617745265.issue45220@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It also fails on the 3.9 and 3.10 on the Windows jobs of GitHub Action. ---------- nosy: +vstinner versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:06:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:06:58 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631804818.47.0.61775606288.issue45220@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Windows builds sometimes fail on main branch: fatal error RC1116: RC terminating after preprocessor errors -> Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:10:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:10:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631805052.53.0.603660983368.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Is bpo-45220 "Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors" related to this issue? ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 11:10:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:10:35 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631805035.84.0.295692854286.issue45220@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It may be related to bpo-45020 which recently got a change: New changeset 9fd87a5fe5c468cf94265365091267838b004b7f by Eric Snow in branch 'main': bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380) https://github.com/python/cpython/commit/9fd87a5fe5c468cf94265365091267838b004b7f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:11:41 2021 From: report at bugs.python.org (tongxiaoge) Date: Thu, 16 Sep 2021 15:11:41 +0000 Subject: [issue45222] test_with_pip fail Message-ID: <1631805101.42.0.465576816757.issue45222@roundup.psfhosted.org> New submission from tongxiaoge <shixuantong at huawei.com>: Today, I tried to upgrade Python 3 to version 3.8.12, the test case test_with_pip failed. The error message is as follows: [ 356s] test_with_pip (test.test_venv.EnsurePipTest) ... FAIL [ 356s] [ 356s] ====================================================================== [ 356s] FAIL: test_with_pip (test.test_venv.EnsurePipTest) [ 356s] ---------------------------------------------------------------------- [ 356s] Traceback (most recent call last): [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/test/test_venv.py", line 444, in do_test_with_pip [ 356s] self.run_with_capture(venv.create, self.env_dir, [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/test/test_venv.py", line 77, in run_with_capture [ 356s] func(*args, **kwargs) [ 356s] subprocess.CalledProcessError: Command '['/tmp/tmpm13zz0cn/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. [ 356s] [ 356s] During handling of the above exception, another exception occurred: [ 356s] [ 356s] Traceback (most recent call last): [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/test/test_venv.py", line 504, in test_with_pip [ 356s] self.do_test_with_pip(False) [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/test/test_venv.py", line 452, in do_test_with_pip [ 356s] self.fail(msg.format(exc, details)) [ 356s] AssertionError: Command '['/tmp/tmpm13zz0cn/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. [ 356s] [ 356s] **Subprocess Output** [ 356s] Looking in links: /tmp/tmp7usqy615 [ 356s] Processing /tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl [ 356s] Processing /tmp/tmp7usqy615/setuptools-54.2.0-py3-none-any.whl [ 356s] Installing collected packages: setuptools, pip [ 356s] ERROR: Exception: [ 356s] Traceback (most recent call last): [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/packaging/version.py", line 57, in parse [ 356s] return Version(version) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/packaging/version.py", line 298, in __init__ [ 356s] raise InvalidVersion("Invalid version: '{0}'".format(version)) [ 356s] pip._vendor.packaging.version.InvalidVersion: Invalid version: 'setuptools' [ 356s] [ 356s] During handling of the above exception, another exception occurred: [ 356s] [ 356s] Traceback (most recent call last): [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 224, in _main [ 356s] status = self.run(options, args) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 180, in wrapper [ 356s] return func(self, options, args) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 439, in run [ 356s] working_set = pkg_resources.WorkingSet(lib_locations) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 567, in __init__ [ 356s] self.add_entry(entry) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 623, in add_entry [ 356s] for dist in find_distributions(entry, True): [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2061, in find_on_path [ 356s] path_item_entries = _by_version_descending(filtered) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2034, in _by_version_descending [ 356s] return sorted(names, key=_by_version, reverse=True) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2032, in _by_version [ 356s] return [packaging.version.parse(part) for part in parts] [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2032, in <listcomp> [ 356s] return [packaging.version.parse(part) for part in parts] [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/packaging/version.py", line 59, in parse [ 356s] return LegacyVersion(version) [ 356s] File "/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl/pip/_vendor/packaging/version.py", line 127, in __init__ [ 356s] warnings.warn( [ 356s] DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release [ 356s] Traceback (most recent call last): [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/runpy.py", line 194, in _run_module_as_main [ 356s] return _run_code(code, main_globals, None, [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/runpy.py", line 87, in _run_code [ 356s] exec(code, run_globals) [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/ensurepip/__main__.py", line 5, in <module> [ 356s] sys.exit(ensurepip._main()) [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/ensurepip/__init__.py", line 219, in _main [ 356s] return _bootstrap( [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/ensurepip/__init__.py", line 138, in _bootstrap [ 356s] return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/ensurepip/__init__.py", line 50, in _run_pip [ 356s] return subprocess.run([sys.executable, "-c", code], check=True).returncode [ 356s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.12/Lib/subprocess.py", line 516, in run [ 356s] raise CalledProcessError(retcode, process.args, [ 356s] subprocess.CalledProcessError: Command '['/tmp/tmpm13zz0cn/bin/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp7usqy615/setuptools-54.2.0-py3-none-any.whl\', \'/tmp/tmp7usqy615/pip-20.3.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp7usqy615\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 2. [ 356s] [ 356s] [ 356s] ---------------------------------------------------------------------- [ 356s] [ 356s] Ran 18 tests in 7.458s The current version of Python I use is Python 3.8.5. There is no such problem.What is the reason? ---------- messages: 401955 nosy: christian.heimes, sxt1001, thatiparthy, vstinner priority: normal severity: normal status: open title: test_with_pip fail versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45222> _______________________________________ From report at bugs.python.org Thu Sep 16 11:13:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:13:55 +0000 Subject: [issue44936] test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 In-Reply-To: <1629219302.53.0.957750750211.issue44936@roundup.psfhosted.org> Message-ID: <1631805235.3.0.129928276471.issue44936@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Recent failure, Windows x64 job of GitHub Action: https://github.com/python/cpython/runs/3617689771 0:07:18 load avg: 6.20 [425/427/2] test_concurrent_futures failed (2 failures) (1 min 51 sec) (...) ====================================================================== FAIL: test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 488, in test_cancel_futures_wait_false rc, out, err = assert_python_ok('-c', """if True: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 3221225477 command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if True:\n from concurrent.futures import ThreadPoolExecutor\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n t = ThreadPoolExecutor()\n t.submit(sleep_and_print, .1, "apple")\n t.shutdown(wait=False, cancel_futures=True)\n '] stdout: --- apple --- stderr: --- --- ====================================================================== FAIL: test_hang_issue39205 (test.test_concurrent_futures.ThreadPoolShutdownTest) shutdown(wait=False) doesn't hang at exit with running futures. ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 393, in test_hang_issue39205 rc, out, err = assert_python_ok('-c', """if True: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 3221225477 command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if True:\n from concurrent.futures import ThreadPoolExecutor\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n t = ThreadPoolExecutor(max_workers=3)\n t.submit(sleep_and_print, 1.0, "apple")\n t.shutdown(wait=False)\n '] stdout: --- apple --- stderr: --- --- ---------------------------------------------------------------------- Ran 226 tests in 111.014s FAILED (failures=2, skipped=111) test test_concurrent_futures failed ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44936> _______________________________________ From report at bugs.python.org Thu Sep 16 11:14:42 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 16 Sep 2021 15:14:42 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631805282.13.0.608457792494.issue45116@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 16 11:14:55 2021 From: report at bugs.python.org (tongxiaoge) Date: Thu, 16 Sep 2021 15:14:55 +0000 Subject: [issue45222] test_with_pip fail In-Reply-To: <1631805101.42.0.465576816757.issue45222@roundup.psfhosted.org> Message-ID: <1631805295.26.0.0929693559953.issue45222@roundup.psfhosted.org> Change by tongxiaoge <shixuantong at huawei.com>: ---------- components: +Build type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45222> _______________________________________ From report at bugs.python.org Thu Sep 16 11:17:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:17:07 +0000 Subject: [issue45222] test_with_pip fail In-Reply-To: <1631805101.42.0.465576816757.issue45222@roundup.psfhosted.org> Message-ID: <1631805427.49.0.231470402208.issue45222@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Today, I tried to upgrade Python 3 to version 3.8.12, the test case test_with_pip failed. The error message is as follows: What is your operating system? How did you install Python? Which command did you type to run tests? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45222> _______________________________________ From report at bugs.python.org Thu Sep 16 11:20:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:20:20 +0000 Subject: [issue45222] test_venv: test_with_pip fails on version 3.8.12 with: pip._vendor.packaging.version.InvalidVersion: Invalid version: 'setuptools' In-Reply-To: <1631805101.42.0.465576816757.issue45222@roundup.psfhosted.org> Message-ID: <1631805620.49.0.111190892819.issue45222@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_with_pip fail -> test_venv: test_with_pip fails on version 3.8.12 with: pip._vendor.packaging.version.InvalidVersion: Invalid version: 'setuptools' _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45222> _______________________________________ From report at bugs.python.org Thu Sep 16 11:25:44 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Thu, 16 Sep 2021 15:25:44 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1631805944.33.0.468389984989.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: Regarding your suggestion of adding a hook like `Py_SetThreadExitCallback`, it seems like there are 4 plausible behaviors that such a callback may implement: 1. Abort the process immediately with an error. 2. Exit immediately with the original exit code specified by the user. 3. Hang the thread. 4. Attempt to unwind the thread, like `pthread_exit`, calling pthread thread cleanup functions and C++ destructors. 5. Terminate the thread immediately without any cleanup or C++ destructor calls. The current behavior is (4) on POSIX platforms (`pthread_exit`), and (5) on Windows (`_endthreadex`). In general, achieving a clean shutdown will require the cooperation of all relevant code in the program, particularly code using the Python C API. Commonly the Python C API is used more by library code rather than application code, while it would presumably be the application that is responsible for setting this callback. Writing a library that supports multiple different thread shutdown behaviors would be particularly challenging. I think the callback is useful, but we would still need to discuss what the default behavior should be (hopefully different from the current behavior), and what guidance would be provided as far as what the callback is allowed to do. Option (1) is highly likely to result in a user-visible error --- a lot of Python programs that previously exited successfully will now, possibly only some of the time, exit with an error. The advantage is the user is alerted to the fact that some threads were not cleanly exited, but a lot of previously working code is now broken. This seems like a reasonable policy for a given application to impose (effectively requiring the use of an atexit handler to terminate all daemon threads), but does not seem like a reasonable default given the existing use of daemon threads. Option (2) would likely do the right thing in many cases, but main thread cleanup that was previously run would now be silently skipped. This again seems like a reasonable policy for a given application to impose, but does not seem like a reasonable default. Option (3) avoids the possibility of crashes and memory corruption. Since the thread stack remains allocated, any pointers to the thread stack held in global data structures or by other threads remain valid. There is a risk that the thread may be holding a lock, or otherwise block progress of the main thread, resulting in silent deadlock. That can be mitigated by registering an atexit handler. Option (4) in theory would allow cleanup handlers to be registered in order to avoid deadlock due to locks held. In practice, though, it causes a lot of problems: - The CPython codebase itself contains no such cleanup handlers, and I expect the vast majority of existing C extensionss are also not designed to properly handle the stack unwind triggered by `pthread_exit`. Without proper cleanup handlers, this option reverts to option (5), where there is a risk of memory corruption due to other threads accessing pointers to the freed thread stack. There is also the same risk of deadlock as in option (3). - Stack unwinding interacts particularly badly with common C++ usage because the very first thing most people want to do when using the Python C API from C++ is create a "smart pointer" type for holding a `PyObject` pointer that handles the reference counting automatically (calls `Py_INCREF` when copied, `Py_DECREF` in the destructor). When the stack unwinds due to `pthread_exit`, the current thread will NOT hold the GIL, and these `Py_DECREF` calls result in a crash / memory corruption. We would need to either create a new finalizing-safe version of Py_DECREF, that is a noop when called from a non-main thread if `_Py_IsFinalizing()` is true (and then existing C++ libraries like pybind11 would need to be changed to use it), or modify the existing `Py_DECREF` to always have that additional check. Other calls to Python C APIs in destructors are also common. - When writing code that attempts to be safe in the presence of stack unwinding due to `pthread_exit`, it is not merely explicitly GIL-related calls that are a concern. Virtually any Python C API function can transitively release and acquire the GIL and therefore you must defend against unwind from virtually all Python C API functions. - Some C++ functions in the call stack may unintentionally catch the exception thrown by `pthread_exit` and then return normally. If they return back to a CPython stack frame, memory corruption/crashing is likely. - Alternatively, some C++ functions in the call stack may be marked `noexcept`. If the unwinding reaches such a function, then we end up with option (1). - In general this option seems to require auditing and fixing a very large amount of existing code, and introduces a lot of complexity. For that reasons, I think this option should be avoided. Even on a per-application basis, this option should not be used because it requires that every C extension specifically support it. Option (5) has the risk of memory corruption due to other threads accessing pointers to the freed thread stack. There is also the same risk of deadlock as in option (3). It avoids the problem of calls to Python C APIs in C++ destructors. I would consider this options strictly worse than option (3), since there is the same risk of deadlock, but the additional risk of memory corruption. We free the thread stack slightly sooner, but since the program is exiting soon anyway that is not really advantageous. The fact that the current behavior differs between POSIX and Windows is particularly unfortunate. I would strongly urge that the default behavior be changed to (3). If `Py_SetThreadExitCallback` is added, the documentation could indicate that the callback is allowed to terminate the process or hang, but must not attempt to terminate the thread. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 16 11:30:12 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Thu, 16 Sep 2021 15:30:12 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1631806212.66.0.405963005339.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: Regarding your suggestion of banning daemon threads: I happened to come across this bug not because of daemon threads but because of threads started by C++ code directly that call into Python APIs. The solution I am planning to implement is to add an `atexit` handler to prevent this problem. I do think it is reasonable to suggest that users should ensure daemon threads are exited cleanly via an atexit handler. However, in some cases that may be challenging to implement, and there is also the issue of backward compatibility. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 16 11:35:55 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 15:35:55 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631806555.43.0.733781247983.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Thanks, Inada-san. That's super helpful. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Thu Sep 16 11:38:35 2021 From: report at bugs.python.org (Alexander Kanavin) Date: Thu, 16 Sep 2021 15:38:35 +0000 Subject: [issue45223] test_spawn_doesnt_hang (test.test_pty.PtyTest) fails when stdin isn't readable Message-ID: <1631806715.36.0.768648922349.issue45223@roundup.psfhosted.org> New submission from Alexander Kanavin <alex.kanavin at gmail.com>: I am observing the following under yocto's test harness: ====================================================================== ERROR: test_spawn_doesnt_hang (test.test_pty.PtyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.10/test/test_pty.py", line 316, in test_spawn_doesnt_hang pty.spawn([sys.executable, '-c', 'print("hi there")']) File "/usr/lib/python3.10/pty.py", line 181, in spawn _copy(master_fd, master_read, stdin_read) File "/usr/lib/python3.10/pty.py", line 157, in _copy data = stdin_read(STDIN_FILENO) File "/usr/lib/python3.10/pty.py", line 132, in _read return os.read(fd, 1024) OSError: [Errno 5] Input/output error The same tests runs fine in a regular console. ---------- messages: 401961 nosy: Alexander Kanavin priority: normal severity: normal status: open title: test_spawn_doesnt_hang (test.test_pty.PtyTest) fails when stdin isn't readable _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45223> _______________________________________ From report at bugs.python.org Thu Sep 16 11:39:19 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Sep 2021 15:39:19 +0000 Subject: [issue45223] test_spawn_doesnt_hang (test.test_pty.PtyTest) fails when stdin isn't readable In-Reply-To: <1631806715.36.0.768648922349.issue45223@roundup.psfhosted.org> Message-ID: <1631806759.27.0.313829334787.issue45223@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26801 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28388 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45223> _______________________________________ From report at bugs.python.org Thu Sep 16 11:44:02 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 15:44:02 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631807042.9.0.100577267308.issue45220@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: This is more likely to relate to bpo-45188, "De-couple the Windows builds from freezing modules.", for which the PR was merged yesterday: New changeset 09b4ad11f323f8702cde795e345b75e0fbb1a9a5 by Steve Dower in branch 'main': bpo-45188: Windows now regenerates frozen modules at the start of build instead of late (GH-28322) https://github.com/python/cpython/commit/09b4ad11f323f8702cde795e345b75e0fbb1a9a5 (https://github.com/python/cpython/pull/28322) ---------- nosy: +eric.snow _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:44:43 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 15:44:43 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631807083.09.0.7983920508.issue45220@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Of course, it might also be unrelated. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:44:50 2021 From: report at bugs.python.org (neonene) Date: Thu, 16 Sep 2021 15:44:50 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631807090.72.0.409773552669.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: I reported this issue to developercommunity of microsoft. https://developercommunity.visualstudio.com/t/1531987 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 16 11:45:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:45:06 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631807106.56.0.868112703687.issue45220@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: D:\a\cpython\cpython\PCbuild\obj\311win32_Release\pythoncore\RCa05056(47) : fatal error RC1116: RC terminating after preprocessor errors [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] Let's split it into sub-parts: * C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188 * D:\a\cpython\cpython\PCbuild\obj\311win32_Release\pythoncore\RCa05056(47) * fatal error RC1116: RC terminating after preprocessor errors * [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj] RCxxxx errors are generated by the resource compiler > C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253) What is the code at line 253? > error RC2188 What is this error? > 311win32_Release\pythoncore\RCa05056(47) Is this a directory with a generated name, or is it an error code? > fatal error RC1116 What is this error? -- Python contains the following .rc files: PC/pylauncher.rc PC/pyshellext.rc PC/python_exe.rc PC/python_nt.rc PC/pythonw_exe.rc PC/sqlite3.rc None of these files include winnt.h. In fact, "winnt.h" cannot be found in any file of the Python source code. PC/python_nt.rc includes PC/python_ver_rc.h which contains 3 includes: * #include "winver.h" => Windows SDK header file * #include "modsupport.h" => Include/modsupport.h => it includes #include <stdarg.h> * #include "patchlevel.h" => Include/patchlevel.h I'm not sure why modsupport.h is included. -- I found one page mentioning RC2188 *and* RC1116 error codes together: https://social.msdn.microsoft.com/Forums/vstudio/en-US/7ba8eb72-12e9-4c78-af68-7f50c170040f/warning-rc4011-and-error-rc2188?forum=vclanguage "RCxxxx errors are generated by the resource compiler. One of your .rc files includes directly or indirectly headers that RC can't understand so you'll have to check that and remove the #includes." ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:45:12 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 15:45:12 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631807112.67.0.104454655931.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: I left a comment on bpo-45220. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 11:46:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:46:52 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631807212.84.0.712647689124.issue45220@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > bpo-45188: Windows now regenerates frozen modules at the start of build instead of late (GH-28322) Maybe the resource compiler needs a header file which is not generated yet, and so the build fails. In msg401948 logs, I don't see when header files are generated. This build step seems to be fully quiet. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 11:47:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 15:47:16 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631807236.76.0.568877279475.issue45220@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This issue is serious: it prevents to merge many pull requests, it blocks the Python development workflow. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 12:00:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 16 Sep 2021 16:00:15 +0000 Subject: [issue45219] Expose indexing and other simple operations on dict-keys in internal API In-Reply-To: <1631791278.28.0.25675084804.issue45219@roundup.psfhosted.org> Message-ID: <1631808015.95.0.264567538062.issue45219@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- keywords: +patch pull_requests: +26802 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28389 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45219> _______________________________________ From report at bugs.python.org Thu Sep 16 12:08:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 16:08:11 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631808491.41.0.773892277468.issue45116@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26803 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28390 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 16 12:26:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 16 Sep 2021 16:26:53 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631809613.51.0.34964626565.issue45116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: These should be changed back to macros where inlining is guaranteed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 16 12:26:50 2021 From: report at bugs.python.org (Khalid Mammadov) Date: Thu, 16 Sep 2021 16:26:50 +0000 Subject: [issue45224] Argparse shows required arguments as optional Message-ID: <1631809609.68.0.875196244045.issue45224@roundup.psfhosted.org> New submission from Khalid Mammadov <khalidmammadov9 at gmail.com>: Currently argparse module shows all optional arguments under "optional arguments" section of the help. It also includes those flags/arguments that are required as well. This add confusion to a user and does not properly show intention ---------- components: Library (Lib) messages: 401969 nosy: khalidmammadov priority: normal severity: normal status: open title: Argparse shows required arguments as optional type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45224> _______________________________________ From report at bugs.python.org Thu Sep 16 12:34:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 16 Sep 2021 16:34:18 +0000 Subject: [issue45224] Argparse shows required arguments as optional In-Reply-To: <1631809609.68.0.875196244045.issue45224@roundup.psfhosted.org> Message-ID: <1631810058.47.0.0369721067507.issue45224@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: In Python3.10, "optional arguments" has been replaced with "options". We didn't backport the change because it risks breaking tests that rely on exact string matches. Also, it was really a bug, it was just an unfortunate choice of words. "Optional arguments" meant to say that it was one of the -x or --fullword style arguments which are called options, so they really are "optional arguments" as opposed to "positional arguments". Unfortunately, the most obvious reading of "optional arguments" is as the opposite of "required arguments" which is not what was meant. ---------- nosy: +rhettinger resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45224> _______________________________________ From report at bugs.python.org Thu Sep 16 12:42:54 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 16:42:54 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631810574.84.0.0989378289811.issue45116@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I agree with Raymond. Let's stop throwing more code at this until we've figured out what's going on and revert the change for now. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 16 12:45:00 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 16:45:00 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631810700.01.0.0928404442818.issue45220@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The build order change was not backported (and should not be), so it's unrelated to the failures on 3.9 and 3.10. More likely this is either a problematic compiler update, or some additional data leaking into the build information (e.g. I could see this happening if someone added a UTF-8 copyright symbol somewhere instead of an escaped version). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 12:49:31 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 16:49:31 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631810971.66.0.207825882294.issue45220@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h This appears to be the Windows 11 preview SDK, so most likely it's a bug in that. We'll obviously need some logic to not automatically upgrade to this SDK on build. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 12:59:51 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 16:59:51 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631811591.62.0.530811746851.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26804 pull_request: https://github.com/python/cpython/pull/28392 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 13:01:49 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 17:01:49 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631811709.79.0.138272432942.issue45220@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- keywords: +patch pull_requests: +26805 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28393 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 13:41:55 2021 From: report at bugs.python.org (Ulrich Petri) Date: Thu, 16 Sep 2021 17:41:55 +0000 Subject: [issue33809] Expose `capture_locals` parameter in `traceback` convenience functions In-Reply-To: <1528473140.44.0.592728768989.issue33809@psf.upfronthosting.co.za> Message-ID: <1631814115.67.0.895735499843.issue33809@roundup.psfhosted.org> Ulrich Petri <python at ulo.pe> added the comment: > If we copy all the params from TracebackException (and it will be all params, why only this one?) Why expose the internal machinery at all? If all additional parameters (and unless I'm miscounting we're talking about 2) were exposed on the convenience functions why add to the developers mental load with the underlying implementation? > more documentation and a higher cognitive load for someone reading the documentation to learn the API. I would agree if the API in question was ergonomic and the documentation easy to read in the first place. I think neither is true for the traceback module and its documentation. Another example from today where I helped a coworker who was unable to figure out on his own how to print the current stack with locals: from traceback import StackSummary, walk_stack print("".join(StackSummary.extract(walk_stack(None), capture_locals=True).format())) There are multiple things that make this API non-intuitive: - Why does walk_stack() need an explicit None argument? - Why is StackSummary created via the extract() classmethod instead of having a regular __init__? - Why can't extract() be smart if no iterator is passed and figure out on it's own if we're in an exception context or not and call walk_stack / walk_tb accordingly? - Why is the result a list if each item can contain multiple internal newlines? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33809> _______________________________________ From report at bugs.python.org Thu Sep 16 14:04:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 16 Sep 2021 18:04:41 +0000 Subject: [issue33809] Expose `capture_locals` parameter in `traceback` convenience functions In-Reply-To: <1528473140.44.0.592728768989.issue33809@psf.upfronthosting.co.za> Message-ID: <1631815481.2.0.549676855828.issue33809@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Feel free to create a new issue and propose a patch. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33809> _______________________________________ From report at bugs.python.org Thu Sep 16 14:23:41 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 18:23:41 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631816621.45.0.952330269064.issue45186@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: I'm closing this in favor of bpo-34093. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Thu Sep 16 14:29:45 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 16 Sep 2021 18:29:45 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631816985.7.0.0908572391809.issue45220@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26807 pull_request: https://github.com/python/cpython/pull/28395 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 14:29:41 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 16 Sep 2021 18:29:41 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631816981.32.0.169836504924.issue45220@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26806 pull_request: https://github.com/python/cpython/pull/28394 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 14:29:46 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 18:29:46 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631816986.92.0.247948432974.issue45220@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset f4b94b1f57827083990272b5f282aa1493ae2bf4 by Steve Dower in branch 'main': bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) https://github.com/python/cpython/commit/f4b94b1f57827083990272b5f282aa1493ae2bf4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 14:32:28 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 18:32:28 +0000 Subject: [issue34093] Reproducible pyc: FLAG_REF is not stable. In-Reply-To: <1531305608.98.0.56676864532.issue34093@psf.upfronthosting.co.za> Message-ID: <1631817148.56.0.682487523874.issue34093@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: FYI, I unknowingly created a duplicate of this issue a few days ago, bpo-45186, and created a PR for it: https://github.com/python/cpython/pull/28379. Interestingly, while I did that PR independently, it has a lot in common with Inada-san's second PR. My interest here is in how frozen modules can be affected by this problem, particularly between debug and non-debug builds. See bpo-45020, where I'm working on freezing all the stdlib modules imported during startup. ---------- components: +Interpreter Core -Extension Modules nosy: +eric.snow type: -> behavior versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34093> _______________________________________ From report at bugs.python.org Thu Sep 16 14:33:16 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 18:33:16 +0000 Subject: [issue45186] Marshal output isn't completely deterministic. In-Reply-To: <1631565250.25.0.751940112521.issue45186@roundup.psfhosted.org> Message-ID: <1631817196.16.0.327244932128.issue45186@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Reproducible pyc: FLAG_REF is not stable. _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45186> _______________________________________ From report at bugs.python.org Thu Sep 16 14:54:29 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 16 Sep 2021 18:54:29 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631818469.69.0.669156191456.issue45220@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 7ad07eed885ae333d5dfc470b9c11ff2f7b229aa by Miss Islington (bot) in branch '3.9': bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) https://github.com/python/cpython/commit/7ad07eed885ae333d5dfc470b9c11ff2f7b229aa ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 14:54:54 2021 From: report at bugs.python.org (speedrun-program) Date: Thu, 16 Sep 2021 18:54:54 +0000 Subject: [issue45225] use map function instead of genexpr in capwords Message-ID: <1631818494.19.0.506604137018.issue45225@roundup.psfhosted.org> New submission from speedrun-program <xboxlivewilliam at gmail.com>: In string.py, the capwords function passes str.join a generator expression, but the map function could be used instead. This is how capwords is currently written: -------------------- ```py def capwords(s, sep=None): """capwords(s [,sep]) -> string Split the argument into words using split, capitalize each word using capitalize, and join the capitalized words using join. If the optional second argument sep is absent or None, runs of whitespace characters are replaced by a single space and leading and trailing whitespace are removed, otherwise sep is used to split and join the words. """ return (sep or ' ').join(x.capitalize() for x in s.split(sep)) ``` -------------------- This is how capwords could be written: -------------------- ```py def capwords(s, sep=None): """capwords(s [,sep]) -> string Split the argument into words using split, capitalize each word using capitalize, and join the capitalized words using join. If the optional second argument sep is absent or None, runs of whitespace characters are replaced by a single space and leading and trailing whitespace are removed, otherwise sep is used to split and join the words. """ return (sep or ' ').join(map(str.capitalize, s.split(sep))) ``` -------------------- These are the benefits: 1. Faster performance which increases with the number of times the str is split. 2. Very slightly smaller .py and .pyc file sizes. 3. Source code is slightly more concise. This is the performance test code in ipython: -------------------- ```py def capwords_current(s, sep=None): return (sep or ' ').join(x.capitalize() for x in s.split(sep)) ? def capwords_new(s, sep=None): return (sep or ' ').join(map(str.capitalize, s.split(sep))) ? tests = ["a " * 10**n for n in range(9)] tests.append("a " * (10**9 // 2)) # I only have 16GB of RAM ``` -------------------- These are the results of a performance test using %timeit in ipython: -------------------- %timeit x = capwords_current("") 835 ns ? 15.2 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) %timeit x = capwords_new("") 758 ns ? 35.1 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[0]) 977 ns ? 16.9 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) %timeit x = capwords_new(tests[0]) 822 ns ? 30 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[1]) 3.07 ?s ? 88.8 ns per loop (mean ? std. dev. of 7 runs, 100000 loops each) %timeit x = capwords_new(tests[1]) 2.17 ?s ? 194 ns per loop (mean ? std. dev. of 7 runs, 100000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[2]) 28 ?s ? 896 ns per loop (mean ? std. dev. of 7 runs, 10000 loops each) %timeit x = capwords_new(tests[2]) 19.4 ?s ? 352 ns per loop (mean ? std. dev. of 7 runs, 100000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[3]) 236 ?s ? 14.5 ?s per loop (mean ? std. dev. of 7 runs, 1000 loops each) %timeit x = capwords_new(tests[3]) 153 ?s ? 2 ?s per loop (mean ? std. dev. of 7 runs, 10000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[4]) 2.12 ms ? 106 ?s per loop (mean ? std. dev. of 7 runs, 100 loops each) %timeit x = capwords_new(tests[4]) 1.5 ms ? 9.61 ?s per loop (mean ? std. dev. of 7 runs, 1000 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[5]) 23.8 ms ? 1.38 ms per loop (mean ? std. dev. of 7 runs, 10 loops each) %timeit x = capwords_new(tests[5]) 15.6 ms ? 355 ?s per loop (mean ? std. dev. of 7 runs, 100 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[6]) 271 ms ? 10.6 ms per loop (mean ? std. dev. of 7 runs, 1 loop each) %timeit x = capwords_new(tests[6]) 192 ms ? 807 ?s per loop (mean ? std. dev. of 7 runs, 10 loops each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[7]) 2.66 s ? 14.3 ms per loop (mean ? std. dev. of 7 runs, 1 loop each) %timeit x = capwords_new(tests[7]) 1.95 s ? 26.7 ms per loop (mean ? std. dev. of 7 runs, 1 loop each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[8]) 25.9 s ? 80.2 ms per loop (mean ? std. dev. of 7 runs, 1 loop each) %timeit x = capwords_new(tests[8]) 18.4 s ? 123 ms per loop (mean ? std. dev. of 7 runs, 1 loop each) - - - - - - - - - - - - - - - - - - - - %timeit x = capwords_current(tests[9]) 6min 17s ? 29 s per loop (mean ? std. dev. of 7 runs, 1 loop each) %timeit x = capwords_new(tests[9]) 5min 36s ? 24.8 s per loop (mean ? std. dev. of 7 runs, 1 loop each) -------------------- ---------- components: Library (Lib) messages: 401981 nosy: speedrun-program priority: normal pull_requests: 26808 severity: normal status: open title: use map function instead of genexpr in capwords type: performance _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45225> _______________________________________ From report at bugs.python.org Thu Sep 16 14:56:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Sep 2021 18:56:45 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1631818605.44.0.720683255981.issue45063@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It seems that I will have to learn to use PYTHONNODEBUGRANGES=1 and -Xno_debug_ranges. I close the issue. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45063> _______________________________________ From report at bugs.python.org Thu Sep 16 15:28:12 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 16 Sep 2021 19:28:12 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631820492.11.0.0106628173038.issue45217@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Try this: ``` from configparser import ConfigParser ConfigParser(allow_no_value=True).read('bug.ini') ``` It should work! :) But, the docs are missing this config value here (which caused this issue): > Values can be omitted, in which case the key/value delimiter may also be left out. https://github.com/python/cpython/blame/f4b94b1f57827083990272b5f282aa1493ae2bf4/Doc/library/configparser.rst#L264 I will update the docs. ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Thu Sep 16 15:47:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Sep 2021 19:47:13 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631821633.64.0.158066299016.issue45220@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset f798cef8aaaa7faeb428bdb9ebf73df1a6146304 by Miss Islington (bot) in branch '3.10': bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) (GH-28394) https://github.com/python/cpython/commit/f798cef8aaaa7faeb428bdb9ebf73df1a6146304 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 15:48:09 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 16 Sep 2021 19:48:09 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631821689.02.0.168380702107.issue45217@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26809 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28396 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Thu Sep 16 15:49:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 16 Sep 2021 19:49:41 +0000 Subject: [issue45225] use map function instead of genexpr in capwords In-Reply-To: <1631818494.19.0.506604137018.issue45225@roundup.psfhosted.org> Message-ID: <1631821781.87.0.694591434029.issue45225@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset a59ede244714455aa9ee8637608e019a20fa2ca6 by speedrun-program in branch 'main': bpo-45225: use map function instead of genexpr in capwords (GH-28342) https://github.com/python/cpython/commit/a59ede244714455aa9ee8637608e019a20fa2ca6 ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45225> _______________________________________ From report at bugs.python.org Thu Sep 16 15:50:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 16 Sep 2021 19:50:29 +0000 Subject: [issue45225] use map function instead of genexpr in capwords In-Reply-To: <1631818494.19.0.506604137018.issue45225@roundup.psfhosted.org> Message-ID: <1631821829.59.0.724788304239.issue45225@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Thanks for the PR. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45225> _______________________________________ From report at bugs.python.org Thu Sep 16 16:01:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 16 Sep 2021 20:01:48 +0000 Subject: [issue43574] Regression in overallocation for literal list initialization in v3.9+ In-Reply-To: <1616293914.75.0.599644741052.issue43574@roundup.psfhosted.org> Message-ID: <1631822508.86.0.739800959383.issue43574@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43574> _______________________________________ From report at bugs.python.org Thu Sep 16 16:15:46 2021 From: report at bugs.python.org (Khalid Mammadov) Date: Thu, 16 Sep 2021 20:15:46 +0000 Subject: [issue45224] Argparse shows required arguments as optional In-Reply-To: <1631809609.68.0.875196244045.issue45224@roundup.psfhosted.org> Message-ID: <1631823346.02.0.420148296811.issue45224@roundup.psfhosted.org> Khalid Mammadov <khalidmammadov9 at gmail.com> added the comment: May I suggest to change it again so we two sections: required and optional? This can help to be more clear from usage perspective. I have changed it locally and it looks like below: usage: myprogram.py [-h] [--foo FOO] --bar BAR required arguments: --bar BAR foo help optional arguments: -h, --help show this help message and exit --foo FOO foo help ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45224> _______________________________________ From report at bugs.python.org Thu Sep 16 16:20:57 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 20:20:57 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631823657.49.0.125580693771.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset fdc6b3d9316501d2f0068a1bf4334debc1949e62 by Eric Snow in branch 'main': bpo-45020: Drop the frozen .h files from the repo. (gh-28392) https://github.com/python/cpython/commit/fdc6b3d9316501d2f0068a1bf4334debc1949e62 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 16:22:27 2021 From: report at bugs.python.org (Khalid Mammadov) Date: Thu, 16 Sep 2021 20:22:27 +0000 Subject: [issue45224] Argparse shows required arguments as optional In-Reply-To: <1631809609.68.0.875196244045.issue45224@roundup.psfhosted.org> Message-ID: <1631823747.23.0.273060540217.issue45224@roundup.psfhosted.org> Khalid Mammadov <khalidmammadov9 at gmail.com> added the comment: This is another, larger example, where I actually stumbled on this when looking into Apache Airflow project. Below makes it confusing to see what is actually required and what not. Unless you look for square brackets. Would be it much nicer to list required ones explicitly rather than looking into options and figuring out which one is a must? usage: airflow users create [-h] -e EMAIL -f FIRSTNAME -l LASTNAME [-p PASSWORD] -r ROLE [--use-random-password] -u USERNAME Create a user optional arguments: -h, --help show this help message and exit -e EMAIL, --email EMAIL Email of the user -f FIRSTNAME, --firstname FIRSTNAME First name of the user -l LASTNAME, --lastname LASTNAME Last name of the user -p PASSWORD, --password PASSWORD Password of the user, required to create a user without --use-random-password -r ROLE, --role ROLE Role of the user. Existing roles include Admin, User, Op, Viewer, and Public --use-random-password Do not prompt for password. Use random string instead. Required to create a user without --password -u USERNAME, --username USERNAME Username of the user examples: To create an user with "Admin" role and username equals to "admin", run: $ airflow users create \ --username admin \ --firstname FIRST_NAME \ --lastname LAST_NAME \ --role Admin \ --email admin at example.org airflow users create command error: the following arguments are required: -e/--email, -f/--firstname, -l/--lastname, -r/--role, -u/--username, see help above. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45224> _______________________________________ From report at bugs.python.org Thu Sep 16 16:30:10 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 20:30:10 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1631824210.46.0.725938583443.issue45220@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Thu Sep 16 16:39:22 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 16 Sep 2021 20:39:22 +0000 Subject: [issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed In-Reply-To: <1631758390.34.0.18935168801.issue45215@roundup.psfhosted.org> Message-ID: <1631824762.52.0.882081535361.issue45215@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I forgot to include example of the breakage: >>> m=Mock(name=1) >>> m Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/ak/opensource/cpython2/Lib/unittest/mock.py", line 735, in __repr__ name = self._extract_mock_name() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ak/opensource/cpython2/Lib/unittest/mock.py", line 732, in _extract_mock_name return ''.join(_name_list) ^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, int found >>> m=Mock(parent='foo') >>> m Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/ak/opensource/cpython2/Lib/unittest/mock.py", line 735, in __repr__ name = self._extract_mock_name() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ak/opensource/cpython2/Lib/unittest/mock.py", line 719, in _extract_mock_name _name_list.append(_parent._mock_new_name + dot) ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute '_mock_new_name' ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45215> _______________________________________ From report at bugs.python.org Thu Sep 16 16:52:16 2021 From: report at bugs.python.org (Isuru Fernando) Date: Thu, 16 Sep 2021 20:52:16 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1631825536.01.0.180942724522.issue22699@roundup.psfhosted.org> Change by Isuru Fernando <isuruf at gmail.com>: ---------- keywords: +patch nosy: +isuruf nosy_count: 8.0 -> 9.0 pull_requests: +26810 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28397 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22699> _______________________________________ From report at bugs.python.org Thu Sep 16 16:56:49 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 20:56:49 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631825809.76.0.509496366072.issue45120@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Thanks for the PR. Just wanted to acknowledge that we've seen it. Unfortunately, I'm not feeling confident to take this change right now - encodings are a real minefield, and we need to think through the implications. It's been a while since I've done that, so could take some time. Unless one of the other people who have spent time working on this comes in and says they've thought it through and this is the best approach. In which case I'll happily trust them :) ---------- nosy: +eryksun, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Thu Sep 16 17:01:47 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 16 Sep 2021 21:01:47 +0000 Subject: [issue17005] Add a topological sort algorithm In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> Message-ID: <1631826107.31.0.404678453267.issue17005@roundup.psfhosted.org> Change by ?ric Araujo <merwok at netwok.org>: ---------- versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17005> _______________________________________ From report at bugs.python.org Thu Sep 16 17:27:28 2021 From: report at bugs.python.org (Isuru Fernando) Date: Thu, 16 Sep 2021 21:27:28 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1631827648.94.0.141603175327.issue40503@roundup.psfhosted.org> Isuru Fernando <isuruf at gmail.com> added the comment: > If anyone building Python for Windows shows up needing support for this, we can re-visit the issue ? I don't believe it's technically infeasible, just that the usage patterns of Python on Windows mean that it's not worth doing. At conda-forge, we need this and our current solution is https://github.com/conda-forge/python-feedstock/blob/8195ba1178041b7461238e8c5680eee62f5ea9d0/recipe/patches/0032-Fix-TZPATH-on-windows.patch#L19 I can change to check if that directory exists. What do you think? ---------- nosy: +FFY00, isuruf _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Thu Sep 16 18:06:30 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 22:06:30 +0000 Subject: [issue34093] Reproducible pyc: FLAG_REF is not stable. In-Reply-To: <1531305608.98.0.56676864532.issue34093@psf.upfronthosting.co.za> Message-ID: <1631829990.28.0.26369495417.issue34093@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26811 pull_request: https://github.com/python/cpython/pull/28379 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34093> _______________________________________ From report at bugs.python.org Thu Sep 16 18:11:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 16 Sep 2021 22:11:25 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631830285.67.0.580506382086.issue45120@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: > in CP1252, bytes \x81 \x8d \x8f \x90 \x9d map to "UNDEFINED", > whereas in bestfit1252, they map to \u0081 \u008d \u008f > \u0090 \u009d respectively This is the normal mapping in Windows, not a best-fit encoding. Within Windows, you can access the native encoding via codecs.code_page_encode() and codecs.code_page_decode(). For example: >>> codecs.code_page_encode(1252, '\x81\x8d\x8f\x90\x9d')[0] b'\x81\x8d\x8f\x90\x9d' >>> codecs.code_page_decode(1252, b'\x81\x8d\x8f\x90\x9d')[0] '\x81\x8d\x8f\x90\x9d' WinAPI WideCharToMultiByte() uses a best-fit encoding unless the flag WC_NO_BEST_FIT_CHARS is passed. For example, with code page 1252, Greek "?" is best-fit encoded as Latin b"a". code_page_encode() uses the native best-fit encoding when the "replace" error handler is specified. For example: >>> codecs.code_page_encode(1252, '?', 'replace')[0] b'a' Regarding Python's encodings, if you need a specific mapping to match Windows, I think this should be discussed on a case by case basis. I see no benefit to supporting a mapping such as "\x81" <-> b"\x81" in code page 1252. That it's not mapped in Python is possibly a small benefit, since to some extent this helps to catch a mismatched encoding. For example, code page 1251 (Cyrilic) maps ordinal b"\x81" to "?" (i.e. "\u0403"). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Thu Sep 16 18:23:55 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 16 Sep 2021 22:23:55 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631831035.92.0.577164595657.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26812 pull_request: https://github.com/python/cpython/pull/28398 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 16 18:24:38 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 22:24:38 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1631831078.48.0.976549977262.issue44848@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I (finally) posted the updated SQLite sources to the repo, so PR 27622 should build now. (I also retriggered CI) That said, it *might* need to merge from main again to take a fix for a CI-blocking issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44848> _______________________________________ From report at bugs.python.org Thu Sep 16 18:42:09 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 22:42:09 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1631832129.88.0.206708986562.issue45055@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- keywords: +patch pull_requests: +26813 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28399 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Thu Sep 16 18:43:23 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 22:43:23 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1631832203.02.0.127753693476.issue42627@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I think the PR is basically ready, unfortunately it's stuck behind a CI issue we only just fixed, and needs to merge from main before it'll clear. Posting here once CI is green will get attention faster than on GitHub. ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42627> _______________________________________ From report at bugs.python.org Thu Sep 16 18:56:44 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Sep 2021 22:56:44 +0000 Subject: [issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows In-Reply-To: <1629981685.43.0.0137911951391.issue45013@roundup.psfhosted.org> Message-ID: <1631833004.66.0.0986935799379.issue45013@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45013> _______________________________________ From report at bugs.python.org Thu Sep 16 21:06:02 2021 From: report at bugs.python.org (Maor Feldinger) Date: Fri, 17 Sep 2021 01:06:02 +0000 Subject: [issue45226] Misleading error message when pathlib.Path.symlink_to() fails with permissions error Message-ID: <1631840762.01.0.206152391874.issue45226@roundup.psfhosted.org> New submission from Maor Feldinger <rounder236 at gmail.com>: Reproduction Steps: ------------------- Create a symlink in a directory without permissions: >>> from pathlib import Path >>> >>> target = Path('/tmp/tmp/target') >>> src = Path('/tmp/tmp/src') >>> src.symlink_to(target) Actual: ------- Permission error shows reversed order: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/rh/rh-python38/root/usr/lib64/python3.8/pathlib.py", line 1382, in symlink_to if self._closed: File "/opt/rh/rh-python38/root/usr/lib64/python3.8/pathlib.py", line 445, in symlink def symlink(a, b, target_is_directory): PermissionError: [Errno 13] Permission denied: '/tmp/tmp/target' -> '/tmp/tmp/src' Expected: --------- Same as os.symlink the permission error should show the right symlink order: >>> import os >>> >>> os.symlink(str(src), str(target)) Traceback (most recent call last): File "<stdin>", line 1, in <module> PermissionError: [Errno 13] Permission denied: '/tmp/tmp/src' -> '/tmp/tmp/target' ---------- messages: 401996 nosy: dfntlymaybe priority: normal severity: normal status: open title: Misleading error message when pathlib.Path.symlink_to() fails with permissions error type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45226> _______________________________________ From report at bugs.python.org Thu Sep 16 21:13:26 2021 From: report at bugs.python.org (Maor Feldinger) Date: Fri, 17 Sep 2021 01:13:26 +0000 Subject: [issue45226] Misleading error message when pathlib.Path.symlink_to() fails with permissions error In-Reply-To: <1631840762.01.0.206152391874.issue45226@roundup.psfhosted.org> Message-ID: <1631841206.11.0.61349915473.issue45226@roundup.psfhosted.org> Change by Maor Feldinger <rounder236 at gmail.com>: ---------- components: +Library (Lib) _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45226> _______________________________________ From report at bugs.python.org Thu Sep 16 21:50:09 2021 From: report at bugs.python.org (Rafael Belo) Date: Fri, 17 Sep 2021 01:50:09 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631843409.06.0.221584888466.issue45120@roundup.psfhosted.org> Rafael Belo <rafaelblsilva at gmail.com> added the comment: As encodings are indeed a complex topic, debating this seems like a necessity. I researched this topic when i found an encoding issue regarding a mysql connector: https://github.com/PyMySQL/mysqlclient/pull/502 In MySQL itself there is a mislabel of "latin1" and "cp1252", what mysql calls "latin1" presents the behavior of cp1252. As Inada Naoki pointed out: """ See this: https://dev.mysql.com/doc/refman/8.0/en/charset-we-sets.html MySQL's latin1 is the same as the Windows cp1252 character set. This means it is the same as the official ISO 8859-1 or IANA (Internet Assigned Numbers Authority) latin1, except that IANA latin1 treats the code points between 0x80 and 0x9f as ?undefined,? whereas cp1252, and therefore MySQL's latin1, assign characters for those positions. For example, 0x80 is the Euro sign. For the ?undefined? entries in cp1252, MySQL translates 0x81 to Unicode 0x0081, 0x8d to 0x008d, 0x8f to 0x008f, 0x90 to 0x0090, and 0x9d to 0x009d. So latin1 in MySQL is actually cp1252. """ You can verify this by passing the byte 0x80 through it to get the string representation, a quick test i find useful: On MYSQL: select convert(unhex('80') using latin1); -- -> returns "?" On Postgresql: select convert_from(E'\\x80'::bytea, 'WIN1252'); -- -> returns "?" select convert_from(E'\\x80'::bytea, 'LATIN1'); -- -> returns the C1 control character "0xc2 0x80" I decided to try to fix this behavior on python because i always found it to be a little odd to receive errors in those codepoints. A discussion i particularly find useful is this one: https://comp.lang.python.narkive.com/C9oHYxxu/latin1-and-cp1252-inconsistent Which i think they didn't notice the "WindowsBestFit" folder at: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/ Digging through the commits to look for dates, i realized Amaury Forgeot d'Arc, created a tool to generate the windows encodings based on calls to "MultiByteToWideChar" which indeed generates the same mapping available on the unicode website, i've attached the file generated by it. Since there might be legacy systems which rely on this "specific" behavior, i don't think "back-porting" this update to older python versions is a good idea. That is the reason i think this should come in new versions, and treated as a "new behavior". The benefit i see in updating this is to prevent even further confusion, with the expected behavior when dealing with those encodings. ---------- Added file: https://bugs.python.org/file50282/cp1252_from_genwincodec.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Thu Sep 16 22:22:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Sep 2021 02:22:48 +0000 Subject: [issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org> Message-ID: <1631845368.43.0.295251780808.issue38085@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38085> _______________________________________ From report at bugs.python.org Thu Sep 16 22:24:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Sep 2021 02:24:12 +0000 Subject: [issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org> Message-ID: <1631845452.7.0.818843103497.issue38085@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Confirmed that this weird behavior is still present. Am not sure when someone will have the time and inclination to drill into the cause. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38085> _______________________________________ From report at bugs.python.org Thu Sep 16 22:42:36 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 17 Sep 2021 02:42:36 +0000 Subject: [issue20853] pdb "args" crashes when an arg is not printable In-Reply-To: <1394016357.17.0.646134871451.issue20853@psf.upfronthosting.co.za> Message-ID: <1631846556.74.0.206637185523.issue20853@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +26814 pull_request: https://github.com/python/cpython/pull/28400 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20853> _______________________________________ From report at bugs.python.org Thu Sep 16 22:50:22 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 17 Sep 2021 02:50:22 +0000 Subject: [issue20853] pdb "args" crashes when an arg is not printable In-Reply-To: <1394016357.17.0.646134871451.issue20853@psf.upfronthosting.co.za> Message-ID: <1631847021.99.0.634138542261.issue20853@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: p/pp commands were fixed in this commit: https://github.com/python/cpython/commit/6544b2532df ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20853> _______________________________________ From report at bugs.python.org Thu Sep 16 23:58:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Sep 2021 03:58:39 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631851119.27.0.970065286126.issue43413@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > Subclass of set can now define a __new__() method with > additional keyword parameters without overriding also __init__(). Is there any use case for this? Offhand, I can't think of any reason. The new code in set.__init__ is somewhat opaque and is likely slower, so I prefer the previous code unless there is a legitimate use case being served. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Fri Sep 17 01:57:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 05:57:31 +0000 Subject: [issue45227] Control reaches end of non-void function in specialize.c Message-ID: <1631858251.9.0.87496376949.issue45227@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Python/specialize.c: In function ?load_method_fail_kind?: Python/specialize.c:878:1: warning: control reaches end of non-void function [-Wreturn-type] 878 | } | ^ ---------- components: Interpreter Core messages: 402001 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Control reaches end of non-void function in specialize.c type: compile error versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45227> _______________________________________ From report at bugs.python.org Fri Sep 17 02:03:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 06:03:29 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631858609.99.0.264644779935.issue43413@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26815 pull_request: https://github.com/python/cpython/pull/28403 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Fri Sep 17 02:05:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 06:05:32 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631858732.27.0.344989001852.issue43413@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I do not have any particular use case. It was a side effect of unification code that uses _PyArg_NoKeywords(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Fri Sep 17 02:56:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 06:56:42 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address Message-ID: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: It can be reproduced when run test.test_socket.J1939Test (omitted in regrtests now, see issue45187) with Address Sanitizer. See for example https://github.com/python/cpython/pull/28317/checks?check_run_id=3625390397. It can be reproduced when run test.test_socket.J1939Test with unittest: $ ./python -m unittest -v test.test_socket -k J1939Test See J1939Test.log for output. The cause is using PyArg_ParseTuple() with format unit "k" (unsigned long) and variable of type uint32_t. PyArg_ParseTuple() should only be used with native integer types (short, int, long, long long), it does not support support types of fixed size (uint16_t, uint32_t, uint64_t). ---------- components: Extension Modules files: J1939Test.log messages: 402003 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Stack buffer overflow in parsing J1939 network address type: crash versions: Python 3.11 Added file: https://bugs.python.org/file50283/J1939Test.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 02:57:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 06:57:18 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631861838.37.0.503737306172.issue45187@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- dependencies: +Stack buffer overflow in parsing J1939 network address _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 02:58:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 06:58:16 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631861896.09.0.234454913166.issue45187@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Running omitted tests exposed some real bugs. See issue45212, issue45228. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 03:01:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:01:34 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631862094.92.0.215881358361.issue45228@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 03:03:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:03:42 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631862222.76.0.118531673974.issue45228@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26816 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28404 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 03:18:04 2021 From: report at bugs.python.org (sbougnoux) Date: Fri, 17 Sep 2021 07:18:04 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631863084.93.0.0524004045541.issue45217@roundup.psfhosted.org> sbougnoux <bougnoux at free.fr> added the comment: Thanks for your prompt answer. Don't you think it should be the default? It seems like unneeded precision. Just if you want to check one don't miss a value, but in that case, one can use 'allow_no_value=False'. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 03:31:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:31:12 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests Message-ID: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Currently regrtest supports two ways of collecting and running tests in module. 1. If the module contains the "test_main" function, regrtest just calls it. This function usually calls run_unittest() with a list of test classes, composed manually, it can also run doctests with run_doctest(), generate list of test classes dynamically, and run some code before and after running tests. 2. Otherwise regrtest uses unittest for for collecting tests. The disadvantage of the former way is that new test classes should be added manually to the list. If you forget to do this, new tests will not be run. See for example issue45185 and issue45187. Not runned tests can hide bugs. So it would be better to eliminate human factor and detect tests automatically. ---------- assignee: serhiy.storchaka components: Tests messages: 402006 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Always use unittest for collecting tests in regrtests type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 03:34:38 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 17 Sep 2021 07:34:38 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631864078.28.0.775823855831.issue45120@roundup.psfhosted.org> Marc-Andre Lemburg <mal at egenix.com> added the comment: Just to be clear: The Python code page encodings are (mostly) taken from the unicode.org set of mappings (ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/). This is our standards body for such mappings, where possible. In some cases, the Unicode consortium does not provide such mappings and we resort to other standards (ISO, commonly used mapping files in OSes, Wikipedia, etc). Changes to the existing mapping codecs should only be done in case corrections are applied to the mappings under those names by the standard bodies. If you want to add variants such as the best fit ones from MS, we'd have to add them under a different name, e.g. bestfit1252 (see ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/). Otherwise, interop with other systems would no longer. >From Eryk's description it sounds like we should always add WC_NO_BEST_FIT_CHARS as an option to MultiByteToWideChar() in order to make sure it doesn't use best fit variants unless explicitly requested. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Fri Sep 17 03:40:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:40:20 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1631864420.65.0.0859853046983.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26817 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28405 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 03:44:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 17 Sep 2021 07:44:35 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1631864675.51.0.712784455271.issue44848@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Thanks, Steve. I'll pull in main and see how the CI fares. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44848> _______________________________________ From report at bugs.python.org Fri Sep 17 03:44:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:44:52 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1631864692.43.0.866156727179.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: PR 28405 contains simple changes for 60 test files. It does not cover files which use complex code for generating list of test classes and running doctests (because there are subtle differences between running doctests with run_doctest() and via DocTestSuite). They are left for the following PRs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 03:45:12 2021 From: report at bugs.python.org (Wang Bingchao) Date: Fri, 17 Sep 2021 07:45:12 +0000 Subject: [issue45230] Something wrong when Calculate "3==3 is not True" Message-ID: <1631864712.39.0.927723834147.issue45230@roundup.psfhosted.org> New submission from Wang Bingchao <819576257 at qq.com>: I use python3.7 python3.6 python2.7, and run the following code: print(3==3 is not True) print(3==3 is True) print(3==2 is not True) print(3==2 is True) I got the same results as follow: True False False False but I don't think it is a reasonable result, it may be bugs? ---------- components: Subinterpreters messages: 402010 nosy: ET priority: normal severity: normal status: open title: Something wrong when Calculate "3==3 is not True" type: behavior versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45230> _______________________________________ From report at bugs.python.org Fri Sep 17 03:45:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 07:45:32 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1631864732.68.0.0108292984026.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- dependencies: +Some tests in test_socket are not run, test.test_ssl.TestEnumerations is not run _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 04:46:33 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 08:46:33 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631868393.0.0.0516309451752.issue45228@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26819 pull_request: https://github.com/python/cpython/pull/28407 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 04:46:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 08:46:29 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631868389.07.0.962313038692.issue45228@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26818 pull_request: https://github.com/python/cpython/pull/28406 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 04:46:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 08:46:26 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631868386.22.0.886281597961.issue45228@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 773319545ba60577bc140aa46eac83b360240b7a by Serhiy Storchaka in branch 'main': bpo-45228: Fix stack buffer overflow in parsing J1939 address (GH-28404) https://github.com/python/cpython/commit/773319545ba60577bc140aa46eac83b360240b7a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 04:57:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 08:57:29 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631869049.56.0.362355113878.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26820 pull_request: https://github.com/python/cpython/pull/28408 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 04:58:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 08:58:19 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631869099.89.0.0215414544426.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26821 pull_request: https://github.com/python/cpython/pull/28409 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 05:06:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 09:06:22 +0000 Subject: [issue45230] Something wrong when Calculate "3==3 is not True" In-Reply-To: <1631864712.39.0.927723834147.issue45230@roundup.psfhosted.org> Message-ID: <1631869582.32.0.950104542636.issue45230@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: No, it is a feature. Python allows you to chain comparison operations, so you can write 0 < x <= 10 which is equivalent to (0 < x) and (x <= 10). And "is" is a comparison operation. So `3==3 is not True` is equivalent to `(3==3) and (3 is not True)` which is evaluated to `True and True` which is equal to True. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45230> _______________________________________ From report at bugs.python.org Fri Sep 17 05:09:34 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 09:09:34 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631869774.39.0.586297067135.issue45228@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 62c74f34e7541cf5c9780661b260c53617291804 by Miss Islington (bot) in branch '3.10': bpo-45228: Fix stack buffer overflow in parsing J1939 address (GH-28404) https://github.com/python/cpython/commit/62c74f34e7541cf5c9780661b260c53617291804 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 05:09:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 09:09:36 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631869776.05.0.583903505911.issue5846@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset b2b035a949eff1dc54b5bafe2bc9ce72b4d24438 by Serhiy Storchaka in branch 'main': bpo-5846: Fix deprecations for obsolete unittest functions and add tests. (GH-28382) https://github.com/python/cpython/commit/b2b035a949eff1dc54b5bafe2bc9ce72b4d24438 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Fri Sep 17 05:10:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 09:10:06 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631869806.44.0.59937847589.issue5846@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Fri Sep 17 05:10:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 09:10:58 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631869858.85.0.619617063033.issue45228@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 98fef200bbfd8adec27799265deb200ab5e4513e by Miss Islington (bot) in branch '3.9': bpo-45228: Fix stack buffer overflow in parsing J1939 address (GH-28404) https://github.com/python/cpython/commit/98fef200bbfd8adec27799265deb200ab5e4513e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 05:11:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 09:11:48 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631869908.62.0.723424963391.issue5846@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Fri Sep 17 05:13:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 17 Sep 2021 09:13:12 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631869992.53.0.285430426944.issue5846@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: _makeLoader is not deprecated yet, so we might keep this open a little bit more. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Fri Sep 17 05:19:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:19:37 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631870377.36.0.603575893426.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It's no longer possible to build Python from a different directory. Example: git clean -fdx mkdir build cd build/ ../configure --with-pydebug make It fails with: ../Programs/_freeze_module importlib._bootstrap ../Lib/importlib/_bootstrap.py ../Python/frozen_modules/importlib__bootstrap.h make: ../Programs/_freeze_module: No such file or directory I'm working on a fix. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 05:19:37 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 09:19:37 +0000 Subject: [issue45227] Control reaches end of non-void function in specialize.c In-Reply-To: <1631858251.9.0.87496376949.issue45227@roundup.psfhosted.org> Message-ID: <1631870377.44.0.276954336827.issue45227@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Please see https://bugs.python.org/issue45203. A fix is available at https://github.com/python/cpython/pull/28357 or https://github.com/python/cpython/pull/28386. But we're waiting for Windows CI to pass. ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45227> _______________________________________ From report at bugs.python.org Fri Sep 17 05:22:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:22:43 +0000 Subject: [issue45231] make regen-all changes files on Linux Message-ID: <1631870563.98.0.72816558791.issue45231@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: "make regen-frozen" changes PCbuild/_freeze_module.vcxproj and PCbuild/_freeze_module.vcxproj.filters changes files end of line on Linux. I'm working on a fix. When Python is built out of the source free, "make regen-pegen" changes Parser/parser.c and Tools/peg_generator/pegen/grammar_parser.py: diff --git a/Parser/parser.c b/Parser/parser.c index 3cea370c5a..caf864d86c 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -1,4 +1,4 @@ -// @generated by pegen from ./Grammar/python.gram +// @generated by pegen from ../Grammar/python.gram #include "pegen.h" #if defined(Py_DEBUG) && defined(Py_BUILD_CORE) diff --git a/Tools/peg_generator/pegen/grammar_parser.py b/Tools/peg_generator/pegen/grammar_parser.py index 6e9f7d3d11..6e9885cef7 100644 --- a/Tools/peg_generator/pegen/grammar_parser.py +++ b/Tools/peg_generator/pegen/grammar_parser.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3.8 -# @generated by pegen from ./Tools/peg_generator/pegen/metagrammar.gram +# @generated by pegen from ../Tools/peg_generator/pegen/metagrammar.gram import ast import sys ---------- components: Build messages: 402019 nosy: vstinner priority: normal severity: normal status: open title: make regen-all changes files on Linux versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45231> _______________________________________ From report at bugs.python.org Fri Sep 17 05:23:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:23:26 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631870606.78.0.705651990757.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: There is also a minor issue, "make regen-frozen" changes the end of line of two PCbuild/ files: see bpo-45231. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 05:25:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:25:24 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631870724.41.0.525554326351.issue45020@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26822 pull_request: https://github.com/python/cpython/pull/28410 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 05:27:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:27:36 +0000 Subject: [issue45231] make regen-all changes files on Linux In-Reply-To: <1631870563.98.0.72816558791.issue45231@roundup.psfhosted.org> Message-ID: <1631870856.45.0.723586560305.issue45231@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also my PR 28410 which fix Python built out of the source tree. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45231> _______________________________________ From report at bugs.python.org Fri Sep 17 05:28:37 2021 From: report at bugs.python.org (Alex Grund) Date: Fri, 17 Sep 2021 09:28:37 +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: <1631870917.54.0.931037937558.issue43219@roundup.psfhosted.org> Alex Grund <flamefire89 at gmail.com> added the comment: The changelog wrongfully links to https://bugs.python.org/issue41928 instead of this issue. Also the fix introduced a regression: Trying to copy a directory now raises a FileNotFoundError ---------- nosy: +Alex Grund _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Fri Sep 17 05:30:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 09:30:58 +0000 Subject: [issue45231] make regen-all changes files on Linux In-Reply-To: <1631870563.98.0.72816558791.issue45231@roundup.psfhosted.org> Message-ID: <1631871058.92.0.596314903745.issue45231@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28411 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45231> _______________________________________ From report at bugs.python.org Fri Sep 17 05:48:48 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 09:48:48 +0000 Subject: [issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR In-Reply-To: <1631708660.87.0.151822641223.issue45203@roundup.psfhosted.org> Message-ID: <1631872128.06.0.507620685531.issue45203@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: New changeset 4857e53890408fd5a8ee0e83c0250dd5355b3de3 by Ken Jin in branch 'main': bpo-45203: fix compiler warnings (GH-28357) https://github.com/python/cpython/commit/4857e53890408fd5a8ee0e83c0250dd5355b3de3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45203> _______________________________________ From report at bugs.python.org Fri Sep 17 05:50:31 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 09:50:31 +0000 Subject: [issue45227] Control reaches end of non-void function in specialize.c In-Reply-To: <1631858251.9.0.87496376949.issue45227@roundup.psfhosted.org> Message-ID: <1631872231.05.0.878568437814.issue45227@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Fixed in https://github.com/python/cpython/commit/4857e53890408fd5a8ee0e83c0250dd5355b3de3. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45227> _______________________________________ From report at bugs.python.org Fri Sep 17 05:58:33 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 09:58:33 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631872713.92.0.271159416441.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: @neonene Thanks for the truly excellent investigation! @Raymond and @Steve, If I understood OP (neonene) properly, changing Py_DECREF to a macro won't get back the entire 7% lost performance in pyperformance. neonene's investigations suggest that the entire eval function is now too big for PGO on MSVC. Fixing Py_DECREF may get us a few %, but all the other hot functions in eval are likely not being inlined as well. Their suggested patch in https://bugs.python.org/msg401743 works, but IMO, _may_ slow down DISPATCH() _slightly_ since it seems to introduce another jump. I suggest using their patch only for MSVC until we think of something better in 3.11. The additional jump may not matter after PGO (and it surely isn't a 7% slowdown :). WDYT? ---------- priority: normal -> high _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 06:03:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:03:27 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631873007.81.0.37223225944.issue45217@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: No, it shouldn't be the default. It never was before (this is a library that we've maintained for 20+ years now) and changing it now would mean that existing applications would stop validating their configuration in the way they did up to now. .ini files are unfortunately very imprecisely specified but they are *mostly* interoperable between applications. Changing defaults at this point is therefore out of the question. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 06:11:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:11:32 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631873492.34.0.226679674674.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset ce59ac93626004894c2b291ec599a36cfa9fb0be by Serhiy Storchaka in branch '3.10': [3.10] bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361) (GH-28409) https://github.com/python/cpython/commit/ce59ac93626004894c2b291ec599a36cfa9fb0be ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:11:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:11:54 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631873514.08.0.86205556561.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 10c3cf78518f4b31e1527c2795694b1bcb092696 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361) (GH-28408) https://github.com/python/cpython/commit/10c3cf78518f4b31e1527c2795694b1bcb092696 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:12:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:12:00 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631873520.36.0.0115282453711.issue45212@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: We can add a comment to the effect that "the wait here needs to be longer than the client-side (0.01s)". Since you already merged the change to `main`, it will be easiest to merge the backports as well and add the comment in a follow-up series. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:12:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:12:28 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631873548.21.0.544123471128.issue45212@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Haha, which you just did. Cool. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:13:17 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 10:13:17 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631873597.7.0.0950072920591.issue45187@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26824 pull_request: https://github.com/python/cpython/pull/28412 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 06:13:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:13:13 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631873593.39.0.584313235604.issue45187@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 0361335b80b435ca3694981b41f8269e390eb892 by Serhiy Storchaka in branch 'main': bpo-45187: Collect test_socket tests using unittest (GH-28317) https://github.com/python/cpython/commit/0361335b80b435ca3694981b41f8269e390eb892 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 06:21:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:21:03 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631874063.17.0.820552397827.issue45187@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26825 pull_request: https://github.com/python/cpython/pull/28413 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 06:21:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:21:43 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631874103.78.0.424679219106.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26826 pull_request: https://github.com/python/cpython/pull/28414 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:24:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:24:57 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631874297.49.0.234698300923.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I have merged the backported PRs because they are blockers for my other PR which is a blocker for my other PR which is a blocker for my other PR and several future PRs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 06:33:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:33:32 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1631874812.29.0.242963076452.issue45162@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b by Serhiy Storchaka in branch 'main': bpo-45162: Remove many old deprecated unittest features (GH-28268) https://github.com/python/cpython/commit/b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45162> _______________________________________ From report at bugs.python.org Fri Sep 17 06:33:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 10:33:58 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1631874838.21.0.753225113025.issue45162@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45162> _______________________________________ From report at bugs.python.org Fri Sep 17 06:34:50 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 10:34:50 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631874889.99.0.762654887245.issue45187@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 5a5684a14b1417fea27af6b6a89eb7faec7fb80a by Miss Islington (bot) in branch '3.10': bpo-45187: Collect test_socket tests using unittest (GH-28317) https://github.com/python/cpython/commit/5a5684a14b1417fea27af6b6a89eb7faec7fb80a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 06:47:40 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 10:47:40 +0000 Subject: [issue45107] Improve LOAD_METHOD specialization In-Reply-To: <1630859956.74.0.360849757822.issue45107@roundup.psfhosted.org> Message-ID: <1631875660.35.0.223062902263.issue45107@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: New changeset 70bed6f9936c811472b376edd93c37bcf8f06f35 by Ken Jin in branch 'main': bpo-45107: Make LOAD_METHOD_CLASS safer and faster, clean up comments (GH-28177) https://github.com/python/cpython/commit/70bed6f9936c811472b376edd93c37bcf8f06f35 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45107> _______________________________________ From report at bugs.python.org Fri Sep 17 06:55:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 10:55:55 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631876155.61.0.0594805836616.issue45217@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset cb07838ab756564988b1ffd23871f1222a832446 by Nikita Sobolev in branch 'main': bpo-45217: adds note that `allow_no_value` in `configparser` is optional (GH-28396) https://github.com/python/cpython/commit/cb07838ab756564988b1ffd23871f1222a832446 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 06:56:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 10:56:03 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631876163.81.0.032048056575.issue45217@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26827 pull_request: https://github.com/python/cpython/pull/28416 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 07:20:55 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 17 Sep 2021 11:20:55 +0000 Subject: [issue45219] Expose indexing and other simple operations on dict-keys in internal API In-Reply-To: <1631791278.28.0.25675084804.issue45219@roundup.psfhosted.org> Message-ID: <1631877655.45.0.791074696861.issue45219@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: New changeset 064464fc38269e70f7e3a34cb25fc9085ab85782 by Mark Shannon in branch 'main': bpo-45219: Factor dictkey indexing (GH-28389) https://github.com/python/cpython/commit/064464fc38269e70f7e3a34cb25fc9085ab85782 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45219> _______________________________________ From report at bugs.python.org Fri Sep 17 07:21:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 17 Sep 2021 11:21:36 +0000 Subject: [issue45219] Expose indexing and other simple operations on dict-keys in internal API In-Reply-To: <1631791278.28.0.25675084804.issue45219@roundup.psfhosted.org> Message-ID: <1631877696.85.0.810909562892.issue45219@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45219> _______________________________________ From report at bugs.python.org Fri Sep 17 07:37:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 11:37:16 +0000 Subject: [issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' In-Reply-To: <1621631588.17.0.285799007956.issue44211@roundup.psfhosted.org> Message-ID: <1631878636.88.0.0574919612383.issue44211@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It is not clear whether we want to backport this change. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44211> _______________________________________ From report at bugs.python.org Fri Sep 17 07:40:43 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 11:40:43 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631878843.29.0.567158417207.issue45217@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26828 pull_request: https://github.com/python/cpython/pull/28418 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 07:41:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 11:41:29 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631878889.31.0.931603549393.issue45217@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 3ea1c4b66887e7ca920db487f6ffc5f1db3c873f by Miss Islington (bot) in branch '3.9': bpo-45217: adds note that `allow_no_value` in `configparser` is optional (GH-28396) (GH-28416) https://github.com/python/cpython/commit/3ea1c4b66887e7ca920db487f6ffc5f1db3c873f ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 07:47:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 11:47:58 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631879278.37.0.290719881267.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > the entire eval function is now too big for PGO on MSVC I don't think that the issue is specific to MSVC. If a function becomes too big, it becomes less efficient for CPU caches. One idea would be to move the least common opcodes into a slow-path, in a separated function, and make sure that this function is *not* inlined (use Py_NO_INLINE macro). @Mark: What do you think? Maybe we can keep current targets in the big switch, and call the function there. Something like: TARGET(DUP_TOP): TARGET(DUP_TOP_TWO): (...) ceval_slow_path(); break; _PyEval_EvalFrameDefault() takes around 3500 lines of C code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 07:48:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 11:48:58 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631879338.06.0.31037922248.issue45187@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 0f4449ecb0d678984b1343d60c070dcb1bd62e56 by ?ukasz Langa in branch '3.9': [3.9] bpo-45187: Collect test_socket tests using unittest (GH-28317) (GH-28413) https://github.com/python/cpython/commit/0f4449ecb0d678984b1343d60c070dcb1bd62e56 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 07:51:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 11:51:16 +0000 Subject: [issue45228] Stack buffer overflow in parsing J1939 network address In-Reply-To: <1631861802.59.0.0581666676393.issue45228@roundup.psfhosted.org> Message-ID: <1631879476.31.0.449179849004.issue45228@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45228> _______________________________________ From report at bugs.python.org Fri Sep 17 07:54:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 11:54:09 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631879649.76.0.578670146502.issue5846@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It is an internal function. We can remove it without deprecation. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Fri Sep 17 08:09:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 12:09:28 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631880568.88.0.716536625884.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 6b413551284a94cfe31377c9c607ff890aa06c26 by Victor Stinner in branch 'main': bpo-45116: Add the Py_ALWAYS_INLINE macro (GH-28390) https://github.com/python/cpython/commit/6b413551284a94cfe31377c9c607ff890aa06c26 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 08:11:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 12:11:52 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631880712.12.0.248303840984.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I added Py_ALWAYS_INLINE to run benchmarks more easily. Even if Py_INCREF() is converted back to a macro, there are now multiple static inline functions which are short and performance critical. Using Py_ALWAYS_INLINE *may* speed up the Python debug builds and the PGO build on Windows if I understood correctly. Right now, I'm not sure. The heuristic to decide if a function is inlined or not seems to depend a lot on the compiler and the compiler options. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 08:25:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 17 Sep 2021 12:25:25 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631881525.12.0.206585633642.issue45120@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: > From Eryk's description it sounds like we should always add > WC_NO_BEST_FIT_CHARS as an option to MultiByteToWideChar() > in order to make sure it doesn't use best fit variants > unless explicitly requested. The concept of a "best fit" encoding is unrelated to decoding with MultiByteToWideChar(). By default WideCharToMultiByte() best-fit encodes some otherwise unmapped ordinals to characters in the code page that have similar glyphs. This doesn't round trip (e.g. "?" -> b"a" -> "a"). The WC_NO_BEST_FIT_CHARS flag prevents this behavior. code_page_encode() uses WC_NO_BEST_FIT_CHARS for legacy encodings, unless the "replace" error handler is used. Windows maps every value in single-byte ANSI code pages to a Unicode ordinal, which round trips between MultiByteToWideChar() and WideCharToMultiByte(). Unless otherwise defined, a value in the range 0x80-0x9F is mapped to the corresponding ordinal in the C1 controls block. Otherwise values that have no legacy definition are mapped to a private use area (e.g. U+E000 - U+F8FF). There is no option to make MultiByteToWideChar() fail for byte values that map to a C1 control code. But mappings to the private use area are strictly invalid, and MultiByteToWideChar() will fail in these cases if the flag MB_ERR_INVALID_CHARS is used. code_page_decode() always uses this flag, but to reliably fail one needs to pass final=True, since the codec doesn't know it's a single-byte encoding. For example: >>> codecs.code_page_decode(1253, b'\xaa', 'strict') ('', 0) >>> codecs.code_page_decode(1253, b'\xaa', 'strict', True) Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'cp1253' codec can't decode bytes in position 0--1: No mapping for the Unicode character exists in the target code page. Here are the mappings to the private use area in the single-byte "ANSI" code pages: 1255 Hebrew 0xD9 U+F88D 0xDA U+F88E 0xDB U+F88F 0xDC U+F890 0xDD U+F891 0xDE U+F892 0xDF U+F893 0xFB U+F894 0xFC U+F895 0xFF U+F896 Note that 0xCA is defined as the Hebrew character U+05BA [1]. The definition is missing in the unicode.org data and Python's "cp1255" encoding. 874 Thai 0xDB U+F8C1 0xDC U+F8C2 0xDD U+F8C3 0xDE U+F8C4 0xFC U+F8C5 0xFD U+F8C6 0xFE U+F8C7 0xFF U+F8C8 1253 Greek 0xAA U+F8F9 0xD2 U+F8FA 0xFF U+F8FB 1257 Baltic 0xA1 U+F8FC 0xA5 U+F8FD There's no way to get these private use area results from code_page_decode(), but code_page_encode() allows them. For example: >>> codecs.code_page_encode(1253, '\uf8f9')[0] b'\xaa' --- [1] https://en.wikipedia.org/wiki/Windows-1255 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Fri Sep 17 08:30:29 2021 From: report at bugs.python.org (Olivier Delhomme) Date: Fri, 17 Sep 2021 12:30:29 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set Message-ID: <1631881829.49.0.378694444331.issue45232@roundup.psfhosted.org> New submission from Olivier Delhomme <olivier.delhomme at cea.fr>: $ python3 --version Python 3.6.4 Setting LANG to en_US.UTF8 works like a charm $ export LANG=en_US.UTF8 $ python3 Python 3.6.4 (default, Jan 11 2018, 16:45:55) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> machaine='????help me if you can' >>> print('{}'.format(machaine)) ????help me if you can Unsetting LANG?shell variable fails the program: $ unset LANG $ python3 Python 3.6.4 (default, Jan 11 2018, 16:45:55) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> machaine='????help me if you can' File "<stdin>", line 0 ^ SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) Setting LANG?inside the program does not change this behavior: $ unset LANG $ python3 Python 3.6.4 (default, Jan 11 2018, 16:45:55) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['LANG'] = 'en_US.UTF8' >>> machaine='????help me if you can' File "<stdin>", line 0 ^ SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) Is this an expected behavior ? How can I force an utf8 codec ? ---------- components: Interpreter Core messages: 402046 nosy: od-cea priority: normal severity: normal status: open title: ascii codec is used by default when LANG is not set type: behavior versions: Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 08:47:38 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 17 Sep 2021 12:47:38 +0000 Subject: [issue45233] Allow split key dictionaries with values owned by other objects. Message-ID: <1631882858.41.0.966804501884.issue45233@roundup.psfhosted.org> New submission from Mark Shannon <mark at hotpy.org>: Currently, if a dictionary is split, then the dictionary owns the memory for the values. Unless the values is the unique empty-values array. In order to support lazily created dictionaries for objects (see https://github.com/faster-cpython/ideas/issues/72#issuecomment-886796360), we need to allow shared keys dicts that do not own the memory of the values. I propose the following changes to the internals of dict objects. Add 4 flag bits (these can go in the low bits of the version tag) 2 bit for ownership of values, the other 2 bits for the stride of the values (1 or 3). All dictionaries would then have a non-NULL values pointer. The value of index `ix` would be always located at `dict->ma_values[ix*stride]` The two ownership bits indicate whether the dictionary owns the references and whether it owns the memory. When a dictionary is freed, the items in the values array would be decref'd if the references are owned. The values array would be freed if the memory is owned. I don't think it is possible to own the memory, but not the references. Examples: A combined dict. Stride = 3, owns_refs = 1, owns_mem = 0. A split keys dict. Stride = 1, owns_refs = 1, owns_mem = 1. Empty dict (split). Stride = 1, owns_refs = 0, owns_mem = 0. Dictionary with values embedded in object (https://github.com/faster-cpython/ideas/issues/72#issuecomment-886796360, second diagram). Stride = 1, owns_refs = 0, owns_mem = 0. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 402047 nosy: Mark.Shannon, methane priority: normal severity: normal status: open title: Allow split key dictionaries with values owned by other objects. _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45233> _______________________________________ From report at bugs.python.org Fri Sep 17 08:52:23 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 17 Sep 2021 12:52:23 +0000 Subject: [issue45233] Allow split key dictionaries with values owned by other objects. In-Reply-To: <1631882858.41.0.966804501884.issue45233@roundup.psfhosted.org> Message-ID: <1631883143.11.0.41594587715.issue45233@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: An alternative placement for the flag bits: Stride bits in the dictkeys. Ownership bits in the low bits of ma_used. This would still allow us to remove the version tag at some point. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45233> _______________________________________ From report at bugs.python.org Fri Sep 17 09:02:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 13:02:18 +0000 Subject: [issue10611] sys.exit() in a test causes a test run to die In-Reply-To: <1291339519.59.0.737922107849.issue10611@psf.upfronthosting.co.za> Message-ID: <1631883738.01.0.00626552228781.issue10611@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +serhiy.storchaka nosy_count: 4.0 -> 5.0 pull_requests: +26829 pull_request: https://github.com/python/cpython/pull/28180 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue10611> _______________________________________ From report at bugs.python.org Fri Sep 17 09:10:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 13:10:35 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631884235.83.0.928765043185.issue45217@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset a10726d3141d8f52a108c4daf70eefa29401e2fc by Miss Islington (bot) in branch '3.10': bpo-45217: adds note that `allow_no_value` in `configparser` is optional (GH-28396) (GH-28418) https://github.com/python/cpython/commit/a10726d3141d8f52a108c4daf70eefa29401e2fc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 09:11:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 13:11:28 +0000 Subject: [issue45217] ConfigParser does not accept "No value" reversely to the doc In-Reply-To: <1631782278.7.0.0138696609954.issue45217@roundup.psfhosted.org> Message-ID: <1631884288.2.0.849875229172.issue45217@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the patch, Nikita! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45217> _______________________________________ From report at bugs.python.org Fri Sep 17 09:18:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 13:18:30 +0000 Subject: [issue10611] sys.exit() in a test causes a test run to die In-Reply-To: <1291339519.59.0.737922107849.issue10611@psf.upfronthosting.co.za> Message-ID: <1631884710.94.0.596773763358.issue10611@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: -26829 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue10611> _______________________________________ From report at bugs.python.org Fri Sep 17 09:19:59 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 17 Sep 2021 13:19:59 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <1631881829.49.0.378694444331.issue45232@roundup.psfhosted.org> Message-ID: <82078f7b-9636-72e7-67b8-6895b1cc0cc4@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: Yes, this is intended. ASCII is used as fallback in case Python cannot determine the I/O encoding to use during startup. This is also the reason why later changes to the environment have no affect on this - the determination of the encoding has already been applied. You can force UTF-8 by enabling the UTF-8 mode: export PYTHONUTF8=1 This will then have Python use UTF-8 regardless of the LANG env var setting. ---------- nosy: +lemburg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 09:20:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 13:20:19 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631884819.56.0.590723389484.issue45212@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 54a1760cde7bb01e5574734c389c0746762218fd by Serhiy Storchaka in branch 'main': bpo-45212: Add a comment for time.sleep() in tests (GH-28414) https://github.com/python/cpython/commit/54a1760cde7bb01e5574734c389c0746762218fd ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 09:20:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 13:20:52 +0000 Subject: [issue45212] Dangling threads in skipped tests in test_socket In-Reply-To: <1631727017.23.0.70122988847.issue45212@roundup.psfhosted.org> Message-ID: <1631884852.47.0.766321374985.issue45212@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45212> _______________________________________ From report at bugs.python.org Fri Sep 17 09:21:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 13:21:30 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631884890.74.0.27670556449.issue45187@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 09:26:13 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 17 Sep 2021 13:26:13 +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: <1631885173.72.0.115909284042.issue30511@roundup.psfhosted.org> Change by Filipe La?ns <lains at riseup.net>: ---------- nosy: +FFY00 nosy_count: 8.0 -> 9.0 pull_requests: +26830 pull_request: https://github.com/python/cpython/pull/28271 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30511> _______________________________________ From report at bugs.python.org Fri Sep 17 09:45:19 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 17 Sep 2021 13:45:19 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1631886319.45.0.786963610605.issue45229@roundup.psfhosted.org> Zachary Ware <zachary.ware at gmail.com> added the comment: See also bpo-16748 ---------- nosy: +zach.ware _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 09:45:45 2021 From: report at bugs.python.org (Olivier Delhomme) Date: Fri, 17 Sep 2021 13:45:45 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <1631881829.49.0.378694444331.issue45232@roundup.psfhosted.org> Message-ID: <1631886345.95.0.998489254565.issue45232@roundup.psfhosted.org> Olivier Delhomme <olivier.delhomme at cea.fr> added the comment: Hi Marc-Andre, Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1": * Is external to the program and user dependent * It does not seems to work on my use case: $ unset LANG $ export PYTHONUTF8=1 $ python3 Python 3.6.4 (default, Jan 11 2018, 16:45:55) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> machaine='????help me if you can' File "<stdin>", line 0 ^ SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) Regards, Olivier. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 09:53:47 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 17 Sep 2021 13:53:47 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631886827.63.0.354405622408.issue43413@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: >> Subclass of set can now define > Is there any use case for this? Is your concern about a use-case for the general concept or for set specifically? I appreciate that Serhiy has taken the time to evaluate the specific concern I raised and extrapolate it to the implications for most/all built-in types. It seems worthwhile to me that built-in types have consistent behaviors. Moreover, it seems preferable to provide the intuitive behavior (allowing simply overriding `__new__`) without the baggage of needing to define `__init__`. I'd not be surprised if there was a real-world use-case in which `set.__new__` was overridden in a subclass and the user was forced to add an `__init__` just to bypass "set() takes no keyword arguments". Interestingly, searching the web for that exact error doesn't emit any results, so if someone has encountered it, it wasn't posted with the error message. After exploring this some, I'm convinced there may not be a strong case for this behavior. Raymond, if this new behavior was removed, how would you propose to rewrite the test (specifically https://github.com/python/cpython/blob/778b07565e38cc94aa90318eb47b9cd09716756a/Lib/test/test_set.py#L665-L673)? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Fri Sep 17 09:55:50 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 17 Sep 2021 13:55:50 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1631886950.56.0.384579663476.issue43413@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: Oh, and I see now Serhiy has proposed a change that looks reasonable. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43413> _______________________________________ From report at bugs.python.org Fri Sep 17 10:04:17 2021 From: report at bugs.python.org (Alex Grund) Date: Fri, 17 Sep 2021 14:04:17 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory Message-ID: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> New submission from Alex Grund <flamefire89 at gmail.com>: After https://bugs.python.org/issue43219 was resolved the function now shows faulty behavior when the source is a directory: `copy_file('/path/to/dir', '/target')` throws a FileNotFoundError while previously it was a IsADirectoryError which is clearly correct. See https://github.com/python/cpython/pull/27049#issuecomment-921647431 ---------- components: Library (Lib) messages: 402057 nosy: Alex Grund priority: normal severity: normal status: open title: copy_file raises FileNotFoundError when src is a directory versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Fri Sep 17 10:10:40 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 17 Sep 2021 14:10:40 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <1631886345.95.0.998489254565.issue45232@roundup.psfhosted.org> Message-ID: <74a16d0b-3807-368d-9771-ff544cbb2c4e@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On 17.09.2021 15:45, Olivier Delhomme wrote: > > Olivier Delhomme <olivier.delhomme at cea.fr> added the comment: > > Hi Marc-Andre, > > Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1": > > * Is external to the program and user dependent > * It does not seems to work on my use case: > > $ unset LANG > $ export PYTHONUTF8=1 > $ python3 > Python 3.6.4 (default, Jan 11 2018, 16:45:55) > [GCC 4.8.5] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> machaine='????help me if you can' > File "<stdin>", line 0 > > ^ > SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) UTF-8 mode is only supported in Python 3.7 and later: https://docs.python.org/3/whatsnew/3.7.html#whatsnew37-pep540 -- Marc-Andre Lemburg eGenix.com ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 10:39:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 14:39:45 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631889585.25.0.389938903551.issue45116@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26831 pull_request: https://github.com/python/cpython/pull/28419 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 10:54:29 2021 From: report at bugs.python.org (Olivier Delhomme) Date: Fri, 17 Sep 2021 14:54:29 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <74a16d0b-3807-368d-9771-ff544cbb2c4e@egenix.com> Message-ID: <1282f4ed-b588-87ae-246d-fd7b354caeb2@cea.fr> Olivier Delhomme <olivier.delhomme at cea.fr> added the comment: >> Hi Marc-Andre, >> >> Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1": >> >> * Is external to the program and user dependent >> * It does not seems to work on my use case: >> >> $ unset LANG >> $ export PYTHONUTF8=1 >> $ python3 >> Python 3.6.4 (default, Jan 11 2018, 16:45:55) >> [GCC 4.8.5] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> machaine='????help me if you can' >> File "<stdin>", line 0 >> >> ^ >> SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) > > UTF-8 mode is only supported in Python 3.7 and later: > > https://docs.python.org/3/whatsnew/3.7.html#whatsnew37-pep540 Oh. Thanks. $ unset LANG $ export PYTHONUTF8=1 $ python3 Python 3.7.5 (default, Dec 24 2019, 08:52:13) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> machaine='????help me if you can' >>> From the code point of view: $ unset LANG $ unset PYTHONUTF8 $ python3 Python 3.7.5 (default, Dec 24 2019, 08:52:13) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['PYTHONUTF8'] = '1' >>> machaine='????help me if you can' >>> Even better: $ unset LANG $ unset PYTHONUTF8 $ python3 Python 3.7.5 (default, Dec 24 2019, 08:52:13) [GCC 4.8.5] on linux Type "help", "copyright", "credits" or "license" for more information. >>> machaine='????help me if you can' >>> Works as expected. Thank you very much. You can close this bug report. Regards, Olivier. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 10:58:54 2021 From: report at bugs.python.org (Adam Schwalm) Date: Fri, 17 Sep 2021 14:58:54 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults Message-ID: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> New submission from Adam Schwalm <adamschwalm at gmail.com>: The following snippet demonstrates the problem. If a subparser flag has a default set, argparse will override the existing value in the provided 'namespace' if the flag does not appear (e.g., if the default is used): import argparse parser = argparse.ArgumentParser() sub = parser.add_subparsers() example_subparser = sub.add_parser("example") example_subparser.add_argument("--flag", default=10) print(parser.parse_args(["example"], argparse.Namespace(flag=20))) This should return 'Namespace(flag=20)' because 'flag' already exists in the namespace, but instead it returns 'Namespace(flag=10)'. This intended behavior is described and demonstrated in the second example here: https://docs.python.org/3/library/argparse.html#default Lib's behavior is correct for the non-subparser cause. ---------- components: Library (Lib) messages: 402060 nosy: ALSchwalm priority: normal severity: normal status: open title: argparse does not preserve namespace with subparser defaults type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Fri Sep 17 11:09:12 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 17 Sep 2021 15:09:12 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <1631881829.49.0.378694444331.issue45232@roundup.psfhosted.org> Message-ID: <1631891352.58.0.0821437858473.issue45232@roundup.psfhosted.org> Change by Marc-Andre Lemburg <mal at egenix.com>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 11:18:00 2021 From: report at bugs.python.org (Adam Schwalm) Date: Fri, 17 Sep 2021 15:18:00 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631891880.72.0.979755596404.issue45235@roundup.psfhosted.org> Change by Adam Schwalm <adamschwalm at gmail.com>: ---------- keywords: +patch pull_requests: +26832 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28420 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Fri Sep 17 11:25:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 17 Sep 2021 15:25:58 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1631892358.4.0.284257051448.issue45234@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch nosy: +andrei.avk nosy_count: 1.0 -> 2.0 pull_requests: +26833 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28421 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Fri Sep 17 11:26:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 17 Sep 2021 15:26:52 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1631892412.96.0.391042106775.issue45234@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Alex: thanks for the report! I've added a PR that should fix this. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Fri Sep 17 11:32:18 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 17 Sep 2021 15:32:18 +0000 Subject: [issue45232] ascii codec is used by default when LANG is not set In-Reply-To: <1631881829.49.0.378694444331.issue45232@roundup.psfhosted.org> Message-ID: <1631892738.13.0.361254355828.issue45232@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: Python 3.7+ doesn't need to explicitly enable UTF-8 mode in this case on POSIX systems. If the locale encoding is the "POSIX" or "C" locale, and "C" locale coercion is not disabled via LC_ALL or PYTHONCOERCECLOCALE=0, the interpreter tries to coerce the LC_CTYPE locale to "C.UTF-8", "C.utf8", or "UTF-8". If these attempts fail, or if coercion is disabled, the interpreter will automatically enable UTF-8 mode, unless that's also explicitly disabled. For example: $ unset LANG $ unset LC_ALL $ unset PYTHONCOERCECLOCALE $ unset PYTHONUTF8 $ python -c 'import locale; print(locale.getpreferredencoding())' UTF-8 $ PYTHONCOERCECLOCALE=0 python -c 'import locale; print(locale.getpreferredencoding())' UTF-8 $ PYTHONUTF8=0 python -c 'import locale; print(locale.getpreferredencoding())' UTF-8 $ PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import locale; print(locale.getpreferredencoding())' ANSI_X3.4-1968 ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45232> _______________________________________ From report at bugs.python.org Fri Sep 17 11:35:25 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Sep 2021 15:35:25 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631892925.36.0.651455009075.issue45116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > Right now, I'm not sure. The heuristic to decide > if a function is inlined or not seems to depend > a lot on the compiler and the compiler options. That is exactly correct. And it is why we should use the macro form which is certain to be inlined. Please do as Steve asked and revert back to the previous stable, reliable code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 11:39:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Sep 2021 15:39:03 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631893143.93.0.658860122718.issue45116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Pablo, should this be a release blocker? ---------- nosy: +lemburg, pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 12:36:16 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 17 Sep 2021 16:36:16 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631896576.29.0.624806786459.issue45116@roundup.psfhosted.org> Marc-Andre Lemburg <mal at egenix.com> added the comment: FWIW: Back in the days of Python 1.5.2, the ceval loop was too big for CPU caches as well and one of the things I experimented with at the time was rearranging the opcodes based on how often they were used and splitting the whole switch statement we had back then in two parts. This results in a 10-20% speedup. CPU caches have since gotten much larger, but the size of the loop still is something to keep in mind and optimize for, as more and more logic gets added to the inner loop of Python. IMO, we should definitely keep forced inlines / macros where they are used inside hot loops, perhaps even in all of the CPython code, since the conversion to inline functions is mostly for hiding internals from extensions, not to hide them from CPython itself. @neonene: Could you provide more details about the CPU you're using to run the tests ? BTW: Perhaps the PSF could get a few sponsors to add more hosts to speed.python.org, to provide a better overview. It looks as if the system is only compiling on Ubuntu 14.04 and running on an 11 year old system (https://speed.python.org/about/). If that's the case, the system uses a server CPU with 12MB cache (https://www.intel.com/content/www/us/en/products/sku/47916/intel-xeon-processor-x5680-12m-cache-3-33-ghz-6-40-gts-intel-qpi/specifications.html). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 12:41:58 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 17 Sep 2021 16:41:58 +0000 Subject: [issue45103] IDLE: make configdialog font page survive font failures In-Reply-To: <1630790219.84.0.830457804554.issue45103@roundup.psfhosted.org> Message-ID: <1631896918.67.0.144059732351.issue45103@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: https://core.tcl-lang.org/tk/tktview/0338867c742 IMO this should be closed as third-party, since there is very little we can / should do (yes we could remove the offending characters from the preview if the user has the font installed, but this is a lot of extra code for a very rare issue). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45103> _______________________________________ From report at bugs.python.org Fri Sep 17 13:08:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 17 Sep 2021 17:08:01 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631898481.85.0.034344417753.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Pablo, should this be a release blocker? How severe is the regression? If is severe enough we can mark it as a release blocker, but a conclusion needs to be reached ASAP because I don't want to change a fundamental macro a few days before the release ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 13:24:54 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 17 Sep 2021 17:24:54 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631899494.62.0.235718282856.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: > How severe is the regression? OP provided pyperformance of current 3.10 vs their patched version at https://bugs.python.org/file50280/310rc2_benchmarks.txt. The patch is at https://bugs.python.org/msg401743. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 14:12:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 18:12:29 +0000 Subject: [issue45231] make regen-all changes files on Linux In-Reply-To: <1631870563.98.0.72816558791.issue45231@roundup.psfhosted.org> Message-ID: <1631902349.4.0.477278246259.issue45231@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset c5a677da9e7b2b2aa43b0b6dfb3813c0212379c0 by Victor Stinner in branch 'main': bpo-45231: update_file.py preserves end of line (GH-28411) https://github.com/python/cpython/commit/c5a677da9e7b2b2aa43b0b6dfb3813c0212379c0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45231> _______________________________________ From report at bugs.python.org Fri Sep 17 14:20:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 18:20:51 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631902851.3.0.280976752841.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 41551ee7e24fb6c58846836d3655dbb212281206 by Victor Stinner in branch 'main': bpo-45020: Fix build out of source tree (GH-28410) https://github.com/python/cpython/commit/41551ee7e24fb6c58846836d3655dbb212281206 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 14:30:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 18:30:33 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631903433.86.0.464733716241.issue45187@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26834 pull_request: https://github.com/python/cpython/pull/28422 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 14:32:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 18:32:03 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631903523.5.0.537969440919.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Raymond: "Please do as Steve asked and revert back to the previous stable, reliable code." Is this issue really about Py_INCREF() being a static inline macro? Or is it more about the increased size of the _PyEval_EvalFrameDefault() function? neonene's analyzis seems to show that the the PGO optimizer of the MSC compiler has thresholds depending on the function size, and _PyEval_EvalFrameDefault() crossed these thresholds. Py_INCREF() static inline function only seems to be the top of the iceberg, it's more a "side effect" than the root issue, no? neonene showed in msg401743 that even adding *dead code* changes Python performance. So for me, it sounds weird to decide to change Py_INCREF() implementation only based on this analysis. Or maybe I missed something. neonene's analyzis starts with the commit 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 of PR 25244. Are you suggesting to revert this change? Mark Shannon is pushing many changes in ceval.c and the frame object. Multiple changes have been pushed on top of it since this commit, I don't think that this commit can be easily reverted. What I understood is that adding __forceinline on some static inline functions can make the performance regression of the commit 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 less bad. But I would prefer to validate that, since neonene's comparisons are not what I'm looking for: compare main to main+Py_ALWAYS_INLINE. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 14:40:11 2021 From: report at bugs.python.org (John Snow) Date: Fri, 17 Sep 2021 18:40:11 +0000 Subject: [issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket In-Reply-To: <1613416609.25.0.407610615564.issue43232@roundup.psfhosted.org> Message-ID: <1631904011.77.0.870218342514.issue43232@roundup.psfhosted.org> John Snow <jsnow at redhat.com> added the comment: Without sendmsg(), is there any other way to send SCM_RIGHTS ancillary messages over an asyncio-managed UNIX socket? (Is there a better place to discuss this? Kindly point me in the right direction if so.) ---------- nosy: +jnsnow _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43232> _______________________________________ From report at bugs.python.org Fri Sep 17 14:53:06 2021 From: report at bugs.python.org (Dan Snider) Date: Fri, 17 Sep 2021 18:53:06 +0000 Subject: [issue21627] Concurrently closing files and iterating over the open files directory is not well specified In-Reply-To: <1401643353.39.0.53304722389.issue21627@psf.upfronthosting.co.za> Message-ID: <1631904786.36.0.533094118491.issue21627@roundup.psfhosted.org> Dan Snider <mr.assume.away at gmail.com> added the comment: On Android, if os.close_range closes the file descriptor of the scandir iterator, the interpreter immediately crashes eg: >>> import os >>> os.scandir() <posix.ScandirIterator object at 0x7082d6ef10> >>> os.closerange(3,9999) fdsan: attempted to close file descriptor 3, expected to be unowned, actually owned by DIR* 0x7263390290 Aborted $ Sorry if this isn't an appropriate place to add this, but the title matched the concept I think and I don't know enough to judge whether this is something that needs to be fixed. ---------- nosy: +bup _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21627> _______________________________________ From report at bugs.python.org Fri Sep 17 14:56:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 18:56:45 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631905005.26.0.477659623977.issue45187@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 51ebb7f4f5e9bdcf8279a1d91be9569706f6bead by Serhiy Storchaka in branch 'main': bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422) https://github.com/python/cpython/commit/51ebb7f4f5e9bdcf8279a1d91be9569706f6bead ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 14:56:50 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 18:56:50 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631905010.15.0.901150627217.issue45187@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26835 pull_request: https://github.com/python/cpython/pull/28423 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 14:56:54 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 18:56:54 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631905014.28.0.0565395154973.issue45187@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26836 pull_request: https://github.com/python/cpython/pull/28424 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 15:04:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 19:04:53 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631905493.51.0.608413445167.issue45200@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_multiprocessing_fork failws with timeout -> test_multiprocessing_fork: test_get() fails with timeout _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 15:04:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 19:04:41 +0000 Subject: [issue45200] test_multiprocessing_fork failws with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631905481.24.0.0106256509846.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: test_multiprocessing_fork also failed on the GitHub Action "Address sanitizer" job: https://github.com/python/cpython/pull/28419 test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout (0:20:00)! Thread 0x00007f732679bbc0 (most recent call first): File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", line 261 in wait File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", line 349 in wait File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 1001 in test_get ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 15:15:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 19:15:21 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1631906121.86.0.738050360822.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you Zachary, I almost forgot about that issue. The goal of this issue is to make regrtests using test discovery instead of manually composed lists of test classes. Of course it requires that tests should be discoverable. And most of them already are, thanks to issue16748 and similar. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Fri Sep 17 15:16:11 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 19:16:11 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631906171.82.0.220083057522.issue45187@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 21711d53411e0da5976a9af591cd6ca97033f712 by Miss Islington (bot) in branch '3.10': bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422) https://github.com/python/cpython/commit/21711d53411e0da5976a9af591cd6ca97033f712 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 15:17:37 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 17 Sep 2021 19:17:37 +0000 Subject: [issue45036] turtle.onrelease() event doesn't get triggered sometimes In-Reply-To: <1630156514.02.0.346025167609.issue45036@roundup.psfhosted.org> Message-ID: <1631906257.39.0.803773258989.issue45036@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: > Sometimes it doesn't pendown when I drag Sorry, I can't think why this would be. Maybe ask on Stack Overflow? For now, though, I doubt it's a bug with turtle so IMO this issue should be closed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45036> _______________________________________ From report at bugs.python.org Fri Sep 17 15:24:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 19:24:58 +0000 Subject: [issue38063] Modify test_socket.py to use unittest test discovery In-Reply-To: <1568025092.75.0.792665697576.issue38063@roundup.psfhosted.org> Message-ID: <1631906698.48.0.953761467271.issue38063@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I has merged similar PR in issue45187. Although it required to fix some existing bugs first. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38063> _______________________________________ From report at bugs.python.org Fri Sep 17 15:29:52 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 17 Sep 2021 19:29:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1631902851.3.0.280976752841.issue45020@roundup.psfhosted.org> Message-ID: <CALFfu7BFhzshYDhCJYFRd+7SwEzXUg4gVZYcMPXOawMO8atYgg@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Thanks for fixing that, Victor! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 15:33:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 19:33:58 +0000 Subject: [issue16968] Fix test discovery for test_concurrent_futures.py In-Reply-To: <1358201974.23.0.0352259739582.issue16968@psf.upfronthosting.co.za> Message-ID: <1631907238.34.0.686754173094.issue16968@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: test_concurrent_futures was made discoverable by Victor Stinner in issue37421. It used tearDownModule() to run threading_cleanup() and reap_children(). ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue16968> _______________________________________ From report at bugs.python.org Fri Sep 17 15:34:12 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 17 Sep 2021 19:34:12 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1631907252.92.0.539521966035.issue42560@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: > Thoughts Is it possible to make non-widget specific methods more obvious (the first one that caught my eye was bind_class)? I'm thinking something like using italic with a key at the top noting that is what it means. I like the 'aka' thing, though. Thanks Mark! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42560> _______________________________________ From report at bugs.python.org Fri Sep 17 15:38:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 19:38:00 +0000 Subject: [issue14408] Support ./python -m unittest in test_socket In-Reply-To: <1332735237.61.0.855199980132.issue14408@psf.upfronthosting.co.za> Message-ID: <1631907480.57.0.159307272483.issue14408@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It has been done in issue45187. The problem with reaping threads was solved by using setUpModule() and addModuleCleanup(). Matt's patch contains also replacing calls of concrete class __init__s with using super(). It can be applied. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue14408> _______________________________________ From report at bugs.python.org Fri Sep 17 15:40:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 19:40:50 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1631907650.06.0.257940165402.issue45187@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 6c50f23ae085ec66f320a26a3f0a6c60d7f2b29d by Miss Islington (bot) in branch '3.9': bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422) (GH-28424) https://github.com/python/cpython/commit/6c50f23ae085ec66f320a26a3f0a6c60d7f2b29d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Fri Sep 17 16:10:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 20:10:13 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631909413.05.0.161300203078.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Sometimes, WithProcessesTestProcess.test_error_on_stdio_flush_1() hangs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 16:14:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Sep 2021 20:14:25 +0000 Subject: [issue42389] test_multiprocessing: @requires_hashdigest() prevents test discovery In-Reply-To: <1605626169.06.0.31570225205.issue42389@roundup.psfhosted.org> Message-ID: <1631909665.15.0.495518421454.issue42389@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Fixed in issue45042. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Many multiprocessing tests are silently skipped since 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42389> _______________________________________ From report at bugs.python.org Fri Sep 17 16:16:07 2021 From: report at bugs.python.org (Rafael Belo) Date: Fri, 17 Sep 2021 20:16:07 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631909767.24.0.844508608999.issue45120@roundup.psfhosted.org> Rafael Belo <rafaelblsilva at gmail.com> added the comment: Eryk Regarding the codecsmodule.c i don't really know its inner workings and how it is connected to other modules, and as of it, changes on that level for this use case are not critical. But it is nice to think and evaluate on that level too, since there might be some tricky situations on windows systems because of that grey zone. My proposal really aims to enhance the Lib/encodings/ module. And as Marc-Andre Lemburg advised, to only change those mappings in case of official corrections on the standard itself. Now i think that really following those standards "strictly" seems to be a good idea. On top of that, adding them under different naming seems like a better idea anyway, since those standards can be seen as different if you take a strict look at the Unicode definitions. Adding them would suffice for the needs that might arise, would still allow for catching mismatched encodings, and can even be "backported" to older python versions. I will adjust the PR accordingly to these comments, thanks for the feedback! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Fri Sep 17 16:20:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 20:20:36 +0000 Subject: [issue45231] make regen-all changes files on Linux In-Reply-To: <1631870563.98.0.72816558791.issue45231@roundup.psfhosted.org> Message-ID: <1631910036.34.0.433422808016.issue45231@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45231> _______________________________________ From report at bugs.python.org Fri Sep 17 16:25:20 2021 From: report at bugs.python.org (Greg Werbin) Date: Fri, 17 Sep 2021 20:25:20 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1631910320.76.0.374033854338.issue45027@roundup.psfhosted.org> Greg Werbin <outthere at me.gregwerbin.com> added the comment: > Users certainly don't need an API change to prevent that, should they wish to. The following simple call will suffice (using 'gnupg' just as an example): > > logging.getLogger('gnupg').setLevel(logging.CRITICAL + 1) This selectively _disables_ a logger. That isn't the same thing as selectively _enabling_ only the loggers you want to enable. Something like this would be equivalent to this proposal: logging.basicConfig(format='...', level=logging.CRITICAL + 1) logging.getLogger('my_app').setLevel(logging.INFO) > My point was, they don't need to configure non-root loggers (in terms of adding handlers) because the root logger's handlers will normally be used for all loggers. That's fair enough, but why make people do the above (which is somewhat unintuitive), when they could instead just do this: basicConfig(format='...'. level=logging.INFO, logger='my_app') Moreover, what if you want multiple different formatters and handlers for different sub-loggers? Sure, you could use dictConfig(), but why force people to do this: logging.dictConfig({ 'formatters': { 'format1': {'format': '...'}, 'format2': {'format': '...'}, 'format3': {'format': '...'}, }, 'handlers': 'handler1': {'class': 'logging.StreamHandler', 'formatter': 'format1'}, 'handler2': {'class': 'logging.StreamHandler', 'formatter': 'format2'}, 'handler3': {'class': 'logging.StreamHandler', 'formatter': 'format3'}, }, 'loggers': { 'my_app': {'level': 'WARNING', 'handlers': ['handler1']}, 'my_app.client': {'level': 'INFO', 'handlers': ['handler2']}, 'my_app.parser': {'level': 'INFO', 'handlers': ['handler3']}, } }) When they could instead do this: basicConfig(format='...', level=logging.WARNING, logger='my_app') basicConfig(format='...', level=logging.INFO, logger='my_app.client') basicConfig(format='...', level=logging.INFO, logger='my_app.parser') Not to mention the confusing bug-trap that is the `incremental` option in dictConfig(). > As you can see, it's not needed for the purpose you described (avoiding messages from third-party loggers). Not "needed", of course. Plenty of people have been logging in Python for years without it! But IMO it's a _better_ way to do it compared to the current solutions. I believe that this proposal could even become the "one obvious way to do it": run `basicConfig(logger=my_logger)` on the top-level logger in your application. My perspective is one of being an application developer, ad-hoc "script developer", and being active helper in many Python forums and chatrooms. I've seen ugly misuse of logging in serious application developed by serious organizations, by people who are not full-time Python devs, that would have been largely avoided by having an "easy" entry point like this. And I've seen countless newbies intimidated and scared away from logging "properly" in Python because of the complexity and non-obviousness of the existing interfaces. I'm open to alternative suggestions of course. But I maintain that the current dictConfig() is not a suitable alternative, nor is selectively disabling loggers. I am very aware of the high maintenance burden on the Python stdlib already, so I understand the resistance to adding new functionality. From my perspective, this is a very simple addition, can be tested with a small number of additional test assertions, and can be easily covered by in the type stubs. I could also publish this as a separate package on PyPI. If you think this proposal places an undue burden on Python implementation developers, then I'll happily drop the PR and publish my own thing. But why reinvent the wheel, especially for something so small? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45027> _______________________________________ From report at bugs.python.org Fri Sep 17 16:36:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 17 Sep 2021 20:36:52 +0000 Subject: [issue45236] pyperformance fails to build master Message-ID: <1631911012.65.0.752307140026.issue45236@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: In the main branch, pyperformance fails to build due to something regarding the freeze module: 2021-09-17 00:03:46,170: /home/pablogsal/cpython_cron/Programs/_freeze_module importlib._bootstrap /home/pablogsal/cpython_cron/Lib/importlib/_bootstrap.py /home/pablogsal/cpython_cron/Python/frozen_modules/importlib__bootstrap.h 2021-09-17 00:03:46,170: make[3]: /home/pablogsal/cpython_cron/Programs/_freeze_module: Command not found 2021-09-17 00:03:46,170: Makefile:766: recipe for target 'Python/frozen_modules/importlib__bootstrap.h' failed 2021-09-17 00:03:46,171: make[3]: *** [Python/frozen_modules/importlib__bootstrap.h] Error 127 2021-09-17 00:03:46,171: make[3]: Leaving directory '/home/pablogsal/bench_tmpdir_cron/build' 2021-09-17 00:03:46,171: Makefile:535: recipe for target 'build_all_generate_profile' failed 2021-09-17 00:03:46,172: make[2]: *** [build_all_generate_profile] Error 2 2021-09-17 00:03:46,172: make[2]: Leaving directory '/home/pablogsal/bench_tmpdir_cron/build' 2021-09-17 00:03:46,172: Makefile:509: recipe for target 'profile-gen-stamp' failed 2021-09-17 00:03:46,172: make[1]: *** [profile-gen-stamp] Error 2 2021-09-17 00:03:46,172: make[1]: Leaving directory '/home/pablogsal/bench_tmpdir_cron/build' 2021-09-17 00:03:46,172: Makefile:520: recipe for target 'profile-run-stamp' failed 2021-09-17 00:03:46,172: make: *** [profile-run-stamp] Error 2 2021-09-17 00:03:46,173: Command make profile-opt failed with exit code 2 2021-09-17 00:03:46,188: Command /home/pablogsal/venv_cron/bin/python -m pyperformance compile /home/pablogsal/simple.conf fdc6b3d9316501d2f0068a1bf4334debc1949e62 master failed with exit code 11 2021-09-17 00:03:46,188: Benchmark exit code: 11 2021-09-17 00:03:46,188: FAILED: master-fdc6b3d9316501d2f0068a1bf4334debc1949e62 The performance server has been failing from some time due to this problem :( ---------- messages: 402089 nosy: eric.snow, pablogsal, vstinner priority: normal severity: normal status: open title: pyperformance fails to build master _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45236> _______________________________________ From report at bugs.python.org Fri Sep 17 16:41:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 17 Sep 2021 20:41:03 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631911263.22.0.0539639346615.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: If https://bugs.python.org/file50280/310rc2_benchmarks.txt is correct, this means that we have a 7% slowdown in Windows PGO builds for 3.10, which I don't think is acceptable. I am marking this as a release blocker until there is some agreement. I remind you that if an agreement cannot be reached, you may reach the Steering Council for help reaching some conclusion. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 16:46:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 20:46:48 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631911608.32.0.608035178091.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset e4044e9f893350b4623677c048d33414a77edf55 by Victor Stinner in branch 'main': bpo-45116: Py_DEBUG ignores Py_ALWAYS_INLINE (GH-28419) https://github.com/python/cpython/commit/e4044e9f893350b4623677c048d33414a77edf55 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 16:56:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 20:56:56 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631912216.1.0.0887030226213.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > If https://bugs.python.org/file50280/310rc2_benchmarks.txt is correct, this means that we have a 7% slowdown in Windows PGO builds for 3.10, which I don't think is acceptable. What I understood is that the https://bugs.python.org/msg401743 patch makes 1.07x faster. But https://bugs.python.org/issue45116#msg401143 compares Python 3.10b1 to Python 3.10a7: Python 3.10b1 is slower (32-bit: "1.07", 64-bit: "1.14": "higher the slower" wrote neonene). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 17:00:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:00:28 +0000 Subject: [issue45236] pyperformance fails to build master In-Reply-To: <1631911012.65.0.752307140026.issue45236@roundup.psfhosted.org> Message-ID: <1631912428.06.0.249528876702.issue45236@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I think that I just fixed it with: commit 41551ee7e24fb6c58846836d3655dbb212281206 (HEAD -> main, upstream/main) Author: Victor Stinner <vstinner at python.org> Date: Fri Sep 17 20:20:43 2021 +0200 bpo-45020: Fix build out of source tree (GH-28410) * Makefile.pre.in: Add $(srcdir) when needed, remove it when it was used by mistake. * freeze_modules.py tool uses ./Programs/_freeze_module if the executable doesn't exist in the source tree. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45236> _______________________________________ From report at bugs.python.org Fri Sep 17 17:01:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:01:59 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631912519.63.0.500035143643.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm able to reproduce the issue in a reliable way using attached bisect10 file and the command: $ ./python -m test test_multiprocessing_fork --timeout=40 -v --matchfile=bisect10 (...) test_fork (test.test_multiprocessing_fork.WithProcessesTestQueue) ... ok test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout (0:00:40)! Thread 0x00007fd0552025c0 (most recent call first): File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 261 in wait File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 349 in wait File "/home/vstinner/python/main/Lib/test/_test_multiprocessing.py", line 1003 in test_get (...) bisect10 contains 68 tests. ---------- Added file: https://bugs.python.org/file50284/bisect10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 17:05:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:05:29 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631912729.05.0.706870802308.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I'm able to reproduce the issue in a reliable way using attached bisect10 file and the command: I'm talking about a Python built with Address Sanitizer: $ ./configure --with-address-sanitizer --without-pymalloc $ make ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 17:11:43 2021 From: report at bugs.python.org (wolfgang kuehn) Date: Fri, 17 Sep 2021 21:11:43 +0000 Subject: [issue45237] Python subprocess not honoring append mode for stdout on Windows Message-ID: <1631913103.36.0.277836027655.issue45237@roundup.psfhosted.org> New submission from wolfgang kuehn <wolfgang-kuehn at decatur.de>: On Windows, if you pass an existing file object in append mode to a subprocess, the subprocess does **not** really append to the file: 1. A file object with `Hello World` content is passed to the subprocess 2. The content is erased 3. The subprocess writes to the file 4. The expected output does not contain `Hello World` Demo: import subprocess, time, pathlib, sys print(f'Caller {sys.platform=} {sys.version=}') pathlib.Path('sub.py').write_text("""import sys, time time.sleep(1) print(f'Callee {sys.stdout.buffer.mode=}')""") file = pathlib.Path('dummy.txt') file.write_text('Hello World') popen = subprocess.Popen([sys.executable, 'sub.py'], stdout=file.open(mode='a')) file.write_text('') time.sleep(2) print(file.read_text()) Expected output on Linux Caller sys.platform='linux' sys.version='3.8.6' Callee sys.stdout.buffer.mode='wb' Unexpected bad output on Windows Caller sys.platform='win32' sys.version='3.8.6' NULNULNULNULNULNULNULNULNULNULNULCallee sys.stdout.buffer.mode='wb' Note that the expected output is given on Windows if the file is opened in the subprocess via `sys.stdout = open('dummy.txt', 'a')`. So it is definitely a subprocess thing. ---------- components: IO messages: 402096 nosy: wolfgang-kuehn priority: normal severity: normal status: open title: Python subprocess not honoring append mode for stdout on Windows type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45237> _______________________________________ From report at bugs.python.org Fri Sep 17 17:23:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:23:49 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1631913829.05.0.399515268437.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: When the test hangs, a background Python process starts to use 100% of my CPU. This process is stuck in _thread.start_new_thread(). I opened the process in gdb. (gdb) thread 1 [Switching to thread 1 (Thread 0x7fece33615c0 (LWP 132301))] #0 __interceptor_pthread_create (thread=thread at entry=0x7ffe79cd6190, attr=attr at entry=0x7ffe79cd61b0, start_routine=start_routine at entry=0x6fed30 <pythread_wrapper>, arg=arg at entry=0x60200019aed0) at ../../../../libsanitizer/asan/asan_interceptors.cpp:245 245 while (atomic_load(¶m.is_registered, memory_order_acquire) == 0) (gdb) where #0 __interceptor_pthread_create (thread=thread at entry=0x7ffe79cd6190, attr=attr at entry=0x7ffe79cd61b0, start_routine=start_routine at entry=0x6fed30 <pythread_wrapper>, arg=arg at entry=0x60200019aed0) at ../../../../libsanitizer/asan/asan_interceptors.cpp:245 #1 0x00000000006ff242 in PyThread_start_new_thread (func=func at entry=0x7f45d0 <thread_run>, arg=arg at entry=0x604000e83c50) at Python/thread_pthread.h:287 (...) (gdb) thread 2 [Switching to thread 2 (Thread 0x7fecd151c640 (LWP 132302))] #0 __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t> (mo=__sanitizer::memory_order_acquire, v=2, a=0x640000001b00) at ../../../../libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:62 62 inline typename T::Type atomic_exchange(volatile T *a, (gdb) where #0 __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t> (mo=__sanitizer::memory_order_acquire, v=2, a=0x640000001b00) at ../../../../libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:62 #1 __sanitizer::BlockingMutex::Lock (this=this at entry=0x640000001b00) at ../../../../libsanitizer/sanitizer_common/sanitizer_linux.cpp:649 #2 0x00007fece3914e15 in __sanitizer::GenericScopedLock<__sanitizer::BlockingMutex>::GenericScopedLock (mu=0x640000001b00, this=<synthetic pointer>) at ../../../../libsanitizer/sanitizer_common/sanitizer_mutex.h:183 #3 __sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::GetFromAllocator (this=this at entry=0x7fece3a13f00 <__asan::instance>, stat=stat at entry=0x7feccfb46c40, class_id=class_id at entry=36, chunks=chunks at entry=0x7feccfb42330, n_chunks=n_chunks at entry=8) at ../../../../libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:146 #4 0x00007fece3914f41 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::Refill (this=this at entry=0x7feccfb390e0, c=c at entry=0x7feccfb42320, allocator=allocator at entry=0x7fece3a13f00 <__asan::instance>, class_id=class_id at entry=36) at ../../../../libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h:102 #5 0x00007fece3915209 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::Allocate (class_id=36, allocator=0x7fece3a13f00 <__asan::instance>, this=0x7feccfb390e0) at ../../../../libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h:38 #6 __sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate (this=this at entry=0x7fece3a13f00 <__asan::instance>, cache=0x7feccfb390e0, size=<optimized out>, size at entry=8192, alignment=alignment at entry=1) at ../../../../libsanitizer/sanitizer_common/sanitizer_allocator_combined.h:69 #7 0x00007fece39118f6 in __asan::QuarantineCallback::Allocate (size=8192, this=<synthetic pointer>) at ../../../../libsanitizer/asan/asan_allocator.cpp:869 #8 __sanitizer::QuarantineCache<__asan::QuarantineCallback>::Enqueue (size=32, ptr=0x6030005477d0, cb=..., this=0x7feccfb39060) at ../../../../libsanitizer/sanitizer_common/sanitizer_quarantine.h:223 #9 __sanitizer::Quarantine<__asan::QuarantineCallback, __asan::AsanChunk>::Put (size=32, ptr=0x6030005477d0, cb=..., c=0x7feccfb39060, this=<optimized out>) at ../../../../libsanitizer/sanitizer_common/sanitizer_quarantine.h:105 #10 __asan::Allocator::QuarantineChunk (this=this at entry=0x7fece3a13f00 <__asan::instance>, m=m at entry=0x6030005477d0, stack=stack at entry=0x7fecd151b360, ptr=0x6030005477e0) at ../../../../libsanitizer/asan/asan_allocator.cpp:666 #11 0x00007fece3911ba5 in __asan::Allocator::Deallocate (alloc_type=__asan::FROM_MALLOC, stack=0x7fecd151b360, delete_alignment=0, delete_size=0, ptr=0x6030005477e0, this=0x7fece3a13f00 <__asan::instance>) at ../../../../libsanitizer/asan/asan_allocator.cpp:714 #12 0x00007fece3997618 in __interceptor_free (ptr=0x6030005477e0) at ../../../../libsanitizer/asan/asan_malloc_linux.cpp:128 #13 0x00007fece362f7a4 in pthread_getattr_np at GLIBC_2.2.5 () from /lib64/libc.so.6 #14 0x00007fece39b142e in __sanitizer::GetThreadStackTopAndBottom (at_initialization=at_initialization at entry=false, stack_top=stack_top at entry=0x7fecd151bd10, stack_bottom=stack_bottom at entry=0x7fecd151bd18) at ../../../../libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:143 #15 0x00007fece39b1778 in __sanitizer::GetThreadStackAndTls (main=<optimized out>, stk_addr=stk_addr at entry=0x7feccfb39020, stk_size=stk_size at entry=0x7fecd151bd68, tls_addr=tls_addr at entry=0x7feccfb39040, tls_size=tls_size at entry=0x7fecd151bd60) at ../../../../libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:543 #16 0x00007fece39a3c93 in __asan::AsanThread::SetThreadStackAndTls (this=this at entry=0x7feccfb39000, options=<optimized out>) at ../../../../libsanitizer/asan/asan_thread.h:81 #17 0x00007fece39a3fd6 in __asan::AsanThread::Init (this=this at entry=0x7feccfb39000, options=options at entry=0x0) at ../../../../libsanitizer/asan/asan_thread.cpp:226 #18 0x00007fece39a446e in __asan::AsanThread::ThreadStart (this=0x7feccfb39000, os_id=132302, signal_thread_is_registered=0x7ffe79cd58f8) at ../../../../libsanitizer/asan/asan_thread.cpp:258 #19 0x00007fece3781299 in start_thread () from /lib64/libpthread.so.0 #20 0x00007fece36a9353 in clone () from /lib64/libc.so.6 The thread 1 is stuck at the loop at the end of pthread_create(), line 245 an 246: wait until ¶m.is_registered == 0. 210 INTERCEPTOR(int, pthread_create, void *thread, 211 void *attr, void *(*start_routine)(void*), void *arg) { 212 EnsureMainThreadIDIsCorrect(); 213 // Strict init-order checking is thread-hostile. 214 if (flags()->strict_init_order) 215 StopInitOrderChecking(); 216 GET_STACK_TRACE_THREAD; 217 int detached = 0; 218 if (attr) 219 REAL(pthread_attr_getdetachstate)(attr, &detached); 220 ThreadStartParam param; 221 atomic_store(¶m.t, 0, memory_order_relaxed); 222 atomic_store(¶m.is_registered, 0, memory_order_relaxed); 223 int result; 224 { 225 // Ignore all allocations made by pthread_create: thread stack/TLS may be 226 // stored by pthread for future reuse even after thread destruction, and 227 // the linked list it's stored in doesn't even hold valid pointers to the 228 // objects, the latter are calculated by obscure pointer arithmetic. 229 #if CAN_SANITIZE_LEAKS 230 __lsan::ScopedInterceptorDisabler disabler; 231 #endif 232 result = REAL(pthread_create)(thread, attr, asan_thread_start, ¶m); 233 } 234 if (result == 0) { 235 u32 current_tid = GetCurrentTidOrInvalid(); 236 AsanThread *t = 237 AsanThread::Create(start_routine, arg, current_tid, &stack, detached); 238 atomic_store(¶m.t, reinterpret_cast<uptr>(t), memory_order_release); 239 // Wait until the AsanThread object is initialized and the ThreadRegistry 240 // entry is in "started" state. One reason for this is that after this 241 // interceptor exits, the child thread's stack may be the only thing holding 242 // the |arg| pointer. This may cause LSan to report a leak if leak checking 243 // happens at a point when the interceptor has already exited, but the stack 244 // range for the child thread is not yet known. 245 while (atomic_load(¶m.is_registered, memory_order_acquire) == 0) 246 internal_sched_yield(); 247 } 248 return result; 249 } The thread 2 seems to be stuck in a syscall done by __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t>, called by __sanitizer::BlockingMutex::Lock: (gdb) disassemble Dump of assembler code for function _ZN11__sanitizer13BlockingMutex4LockEv: 0x00007fece39af850 <+0>: endbr64 0x00007fece39af854 <+4>: push r12 0x00007fece39af856 <+6>: push rbp 0x00007fece39af857 <+7>: push rbx 0x00007fece39af858 <+8>: mov rcx,QWORD PTR [rdi+0x50] 0x00007fece39af85c <+12>: test rcx,rcx 0x00007fece39af85f <+15>: jne 0x7fece39af8a8 <_ZN11__sanitizer13BlockingMutex4LockEv+88> 0x00007fece39af861 <+17>: mov eax,0x1 0x00007fece39af866 <+22>: xchg DWORD PTR [rdi],eax 0x00007fece39af868 <+24>: test eax,eax 0x00007fece39af86a <+26>: je 0x7fece39af89e <_ZN11__sanitizer13BlockingMutex4LockEv+78> 0x00007fece39af86c <+28>: mov ebp,0x2 0x00007fece39af871 <+33>: mov r12d,0xca 0x00007fece39af877 <+39>: mov esi,0x80 0x00007fece39af87c <+44>: xor ebx,ebx 0x00007fece39af87e <+46>: mov edx,0x2 0x00007fece39af883 <+51>: jmp 0x7fece39af896 <_ZN11__sanitizer13BlockingMutex4LockEv+70> 0x00007fece39af885 <+53>: nop DWORD PTR [rax] 0x00007fece39af888 <+56>: mov rax,r12 0x00007fece39af88b <+59>: mov r10,rbx 0x00007fece39af88e <+62>: mov r8,rbx 0x00007fece39af891 <+65>: mov r9,rbx 0x00007fece39af894 <+68>: syscall => 0x00007fece39af896 <+70>: mov eax,ebp 0x00007fece39af898 <+72>: xchg DWORD PTR [rdi],eax 0x00007fece39af89a <+74>: test eax,eax 0x00007fece39af89c <+76>: jne 0x7fece39af888 <_ZN11__sanitizer13BlockingMutex4LockEv+56> 0x00007fece39af89e <+78>: pop rbx 0x00007fece39af89f <+79>: pop rbp 0x00007fece39af8a0 <+80>: pop r12 0x00007fece39af8a2 <+82>: ret 0x00007fece39af8a3 <+83>: nop DWORD PTR [rax+rax*1+0x0] 0x00007fece39af8a8 <+88>: xor r8d,r8d 0x00007fece39af8ab <+91>: lea rdx,[rip+0x37d7c] # 0x7fece39e762e 0x00007fece39af8b2 <+98>: mov esi,0x285 0x00007fece39af8b7 <+103>: lea rdi,[rip+0x37dfa] # 0x7fece39e76b8 0x00007fece39af8be <+110>: call 0x7fece39be990 <_ZN11__sanitizer11CheckFailedEPKciS1_yy> End of assembler dump. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Fri Sep 17 17:30:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:30:59 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631914259.5.0.0477520667791.issue45116@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26837 pull_request: https://github.com/python/cpython/pull/28427 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 17:32:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:32:04 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631914324.7.0.340652805163.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created a draft PR to mark functions like Py_INCREF() and Py_IS_TYPE() with __forceinline: PR 28427. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 17:43:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Sep 2021 21:43:41 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631915021.46.0.0635662679803.issue45116@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Can someone compare the main branch (commit e4044e9f893350b4623677c048d33414a77edf55) to the main branch + PR 28427 patch? You can download the patch from: https://patch-diff.githubusercontent.com/raw/python/cpython/pull/28427.patch How can I build Python with PGO on Windows? Visual Studio has two profiles: PGinstrument and PGupdate. I cannot find "PGO", "PGinstrument" or "PGupdate" in the https://devguide.python.org/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 18:03:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 17 Sep 2021 22:03:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631916232.51.0.439942260827.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: (Ah, now I recall how the $(srcdir) mechanism works again. Generated files do *not* have a $(srcdir) prefix, since they are generated in the destination directory. Hence the fix for the buildbot failure a few days ago. I take back my skepticism about that.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 18:21:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 17 Sep 2021 22:21:47 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631917307.83.0.354176327315.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: BTW, why does the script still run Programs/_freeze_module over all the modules to be frozen? Isn't that up to the Makefile or its Windows equivalent? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 18:25:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 22:25:02 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631917502.37.0.0853514978302.issue42038@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset aca0e08c5dcc11a8011697331931cde0b21270f2 by andrei kulakov in branch 'main': bpo-42038: fix description of returned list of lines (GH-27529) https://github.com/python/cpython/commit/aca0e08c5dcc11a8011697331931cde0b21270f2 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 18:25:05 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 22:25:05 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631917504.99.0.23715606646.issue42038@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26838 pull_request: https://github.com/python/cpython/pull/28428 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 18:25:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 22:25:09 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631917509.47.0.923992504716.issue42038@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26839 pull_request: https://github.com/python/cpython/pull/28429 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 18:31:39 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 17 Sep 2021 22:31:39 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631917899.08.0.861794678929.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 090591636c4f03ce06a039079bd7716a5b23631e by Eric Snow in branch 'main': bpo-45020: Freeze os, site, and codecs. (gh-28398) https://github.com/python/cpython/commit/090591636c4f03ce06a039079bd7716a5b23631e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 18:34:22 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 17 Sep 2021 22:34:22 +0000 Subject: [issue45120] Windows cp encodings "UNDEFINED" entries update In-Reply-To: <1630960212.43.0.654084937143.issue45120@roundup.psfhosted.org> Message-ID: <1631918062.41.0.627876124193.issue45120@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: Rafael, I was discussing code_page_decode() and code_page_encode() both as an alternative for compatibility with other programs and also to explore how MultiByteToWideChar() and WideCharToMultiByte() work -- particularly to explain best-fit mappings, which do not roundtrip. MultiByteToWideChar() does not exhibit "best fit" behavior. I don't even know what that would mean in the context of decoding. With the exception of one change to code page 1255, the definitions that you're looking to add are just for the C1 controls and private use area codes, which are not meaningful. Windows uses these arbitrary definitions to be able to roundtrip between the system ANSI and Unicode APIs. Note that Python's "mbcs" (i.e. "ansi") and "oem" encodings use the code-page codec. For example: >>> _winapi.GetACP() 1252 >>> '\x81\x8d\x8f\x90\x9d'.encode('ansi') b'\x81\x8d\x8f\x90\x9d' Best-fit encode "?" in code page 1252 [1]: >>> '?'.encode('ansi', 'replace') b'a' In your PR, the change to code page 1255 to add b"\xca" <-> "\u05ba" is the only change that I think is really worthwhile because the unicode.org data has it wrong. You can get the proper character name for the comment using the unicodedata module: >>> print(unicodedata.name('\u05ba')) HEBREW POINT HOLAM HASER FOR VAV I'm +0 in favor of leaving the mappings undefined where Windows completes legacy single-byte code pages by using C1 control codes and private use area codes. It would have been fine if Python's code-page encodings had always been based on the "WindowsBestFit" tables, but only the decoding MBTABLE, since it's reasonable. Ideally, I don't want anything to use the best-fit mappings in WCTABLE. I would rather that the 'replace' handler for code_page_encode() used the replacement character (U+FFFD) or system default character. But the world is not ideal; the system ANSI API uses the WCTABLE best-fit encoding. Back in the day with Python 2.7, it was easy to demonstrate how insidious this is. For example, in 2.7.18: >>> os.listdir(u'.') [u'\u03b1'] >>> os.listdir('.') ['a'] --- [1] https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45120> _______________________________________ From report at bugs.python.org Fri Sep 17 18:54:10 2021 From: report at bugs.python.org (Sebastian Berg) Date: Fri, 17 Sep 2021 22:54:10 +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: <1631919250.76.0.374750875076.issue15870@roundup.psfhosted.org> Sebastian Berg <sebastian at sipsolutions.net> added the comment: I am still fighting with this (and the issues surrounding it) for NumPy. The main point is that my new DTypes in NumPy are metaclasses that extend the (heap)type struct. That just feels right and matches the structure perfectly, but seems to get awkward when you want (users) to dynamically create new MetaClass instances. It also works fine: I could allow creating new instances from Python (although I don't need it now) and allow users to create static types (for this I have to fix the size of the additional fields for a stable ABI, but that is fine, I can allocate a new opaque slot). But cython or heaptypes (stable API) seem not accessible without annoying hacks... For this concrete issue, would it be acceptable to use the base classes to correctly find the metaclass and use its alloc? I personally don't see why a new signature would be needed even if the metaclass was to be passed (I do not need this), it seems like you could pass a `Py_tp_meta` slot and not add a new function? I have attached a potential patch (it is a bit large because it needs to move the `bases` discovery code to before the `res` allocation). Doing this would allow to provide a `FromSpec` function which internally calls `PyType_FromSpec`. That may not make things much neater for cython, but it feels like this is really just a bug fix? Unless you want to consider any extension of the type struct an unofficial hack to begin with :). (Python metaclasses won't get their `__new__` called, but that is already the case, presumably a metaclass author will provide their own `InitFromSpec` function that must be called immediately after type creation, or just create the type completely. I can do the second even now probably, but this tiny change would make it a lot cleaner.) Trying more desperate angles, I was even wondering today if I should instead petition for Python to "donate" a `tp_metaslot` type slot... A single `void *` unused by `PyType_Type` but available to metatypes to use as they wish. While a bit strange, that might even simplify some ABI concerns or cython compatibility ;). ---------- nosy: +seberg Added file: https://bugs.python.org/file50285/typeobject.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Fri Sep 17 18:56:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 22:56:00 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631919360.59.0.424035045813.issue42038@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset bba2332303c60d7326f08aa639ff03a6b5d44d04 by Miss Islington (bot) in branch '3.10': bpo-42038: fix description of returned list of lines (GH-27529) (GH-28428) https://github.com/python/cpython/commit/bba2332303c60d7326f08aa639ff03a6b5d44d04 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 18:56:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 22:56:30 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631919390.69.0.369238305256.issue42038@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 6302701179c458da637d669d7e88734fabb79cf6 by Miss Islington (bot) in branch '3.9': bpo-42038: fix description of returned list of lines (GH-27529) (GH-28429) https://github.com/python/cpython/commit/6302701179c458da637d669d7e88734fabb79cf6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 18:56:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 22:56:58 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1631919418.35.0.604080202286.issue42038@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Fri Sep 17 19:00:27 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 17 Sep 2021 23:00:27 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631919627.76.0.786651133642.issue45183@roundup.psfhosted.org> Change by Brett Cannon <brett at python.org>: ---------- keywords: +patch pull_requests: +26840 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28435 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 19:07:11 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 17 Sep 2021 23:07:11 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631920031.96.0.695430571131.issue45183@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: The proposed fix seems to be the right one based on my reading of the code. ---------- keywords: -patch stage: patch review -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 19:10:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 23:10:29 +0000 Subject: [issue44640] Fix punctuation in isinstance() error message In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1631920229.85.0.401999317843.issue44640@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26841 pull_request: https://github.com/python/cpython/pull/28436 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44640> _______________________________________ From report at bugs.python.org Fri Sep 17 19:10:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 17 Sep 2021 23:10:26 +0000 Subject: [issue44640] Fix punctuation in isinstance() error message In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1631920226.2.0.469809327117.issue44640@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f4813388b4506b2fafb0089848c5b11cd503758c by wyz23x2 in branch 'main': bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) https://github.com/python/cpython/commit/f4813388b4506b2fafb0089848c5b11cd503758c ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44640> _______________________________________ From report at bugs.python.org Fri Sep 17 19:48:26 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 17 Sep 2021 23:48:26 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631922506.11.0.695426348869.issue45183@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: New changeset 209b7035f714dcc41df054b0b023e0b955d7e1a2 by Brett Cannon in branch 'main': bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435) https://github.com/python/cpython/commit/209b7035f714dcc41df054b0b023e0b955d7e1a2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 19:48:25 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 17 Sep 2021 23:48:25 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631922505.77.0.562535679462.issue45183@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- keywords: +patch nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26842 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28437 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 20:14:25 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 18 Sep 2021 00:14:25 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631924065.93.0.26062826978.issue45183@roundup.psfhosted.org> Change by Brett Cannon <brett at python.org>: ---------- pull_requests: +26843 pull_request: https://github.com/python/cpython/pull/28438 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 20:24:26 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 18 Sep 2021 00:24:26 +0000 Subject: [issue45237] Python subprocess not honoring append mode for stdout on Windows In-Reply-To: <1631913103.36.0.277836027655.issue45237@roundup.psfhosted.org> Message-ID: <1631924666.38.0.397942095648.issue45237@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: In Windows, the C runtime's append mode doesn't use the native file append mode. The CRT just opens the file in read-write mode and seeks to the end, initially and before each write. subprocess.Popen() doesn't implement inheritance of file descriptors, so the CRT append mode gets lost, but the native file pointer is of course retained. After file.write_text('') in the parent overwrites the file, writes to stdout in the child process begin at the file pointer. Null values are written to the initial 11 bytes. You could use os.spawnv() to inherit file descriptors. The C runtime uses reserved fields in the process STARTUPINFO in order to marshal the fd data to the child process. This depends on the child implementing a compatible scheme for C file descriptors, which of course is the case for applications that use MSVC. A downside is that this won't be thread-safe since you'll have to temporarily redirect stdout in the current process. For example: old_stdout = os.dup(1) with file.open(mode='a') as f: os.dup2(f.fileno(), 1) try: os.spawnv(os.P_NOWAIT, sys.executable, ['python', 'sub.py']) finally: os.dup2(old_stdout, 1) Alternatively, you could open the file with native append mode and wrap the OS handle in a file descriptor. For example: import os import msvcrt from win32file import * from ntsecuritycon import FILE_APPEND_DATA h = CreateFile(os.fspath(file), FILE_APPEND_DATA, FILE_SHARE_READ | FILE_SHARE_WRITE, None, OPEN_EXISTING, 0, None) fd = msvcrt.open_osfhandle(h.Detach(), 0) with open(fd) as f: popen = subprocess.Popen([sys.executable, 'sub.py'], stdout=f) ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45237> _______________________________________ From report at bugs.python.org Fri Sep 17 20:37:31 2021 From: report at bugs.python.org (Eric Snow) Date: Sat, 18 Sep 2021 00:37:31 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1631917307.83.0.354176327315.issue45020@roundup.psfhosted.org> Message-ID: <CALFfu7BV3-aYc2OEa+eRFRTc+7aT2_BHXZ02kawE6LbiEo8THw@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Fri, Sep 17, 2021 at 4:22 PM Guido van Rossum <report at bugs.python.org> wrote: > BTW, why does the script still run Programs/_freeze_module over all the modules to be frozen? Isn't that up to the Makefile or its Windows equivalent? Yeah, it used to matter but we probably don't need to do that any longer. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 20:46:30 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 18 Sep 2021 00:46:30 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631925990.09.0.665768019026.issue45183@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: New changeset e1bdecb6dc7ac33256d5fa875d45634512d2a90e by Brett Cannon in branch '3.10': [3.10] bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435) (#28438) https://github.com/python/cpython/commit/e1bdecb6dc7ac33256d5fa875d45634512d2a90e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 20:47:38 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 18 Sep 2021 00:47:38 +0000 Subject: [issue45183] Unexpected exception with zip importer In-Reply-To: <1631532545.02.0.971781687861.issue45183@roundup.psfhosted.org> Message-ID: <1631926058.85.0.49089502151.issue45183@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: I decided that find_spec() saying something wasn't available in a finder made sense even though it was because a zip file no longer existed as the loader would still fail as appropriate. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45183> _______________________________________ From report at bugs.python.org Fri Sep 17 21:04:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 01:04:05 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631927045.49.0.13150340724.issue45198@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- keywords: +patch pull_requests: +26844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28439 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Fri Sep 17 21:21:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Sep 2021 01:21:16 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1631928076.69.0.552096523744.issue45176@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Fri Sep 17 21:22:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Sep 2021 01:22:30 +0000 Subject: [issue45178] Support linking unnamed temp files into filesystem on Linux In-Reply-To: <1631490346.44.0.449536820401.issue45178@roundup.psfhosted.org> Message-ID: <1631928150.54.0.501834957256.issue45178@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- stage: -> test needed title: Support for linking unnamed temporary files into filesystem on Linux -> Support linking unnamed temp files into filesystem on Linux versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45178> _______________________________________ From report at bugs.python.org Fri Sep 17 21:56:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 01:56:28 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631930188.14.0.48023512183.issue45020@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: It would be nice to freeze argparse.py and its dependencies. For command-line tools, startup time is important. ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 17 22:01:52 2021 From: report at bugs.python.org (neonene) Date: Sat, 18 Sep 2021 02:01:52 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631930512.92.0.866583395433.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: > (32-bit: "1.07", 64-bit: "1.14": "higher the slower" wrote neonene) 32-bit and 64-bit are in reverse. I compared b1 and a7 because this can be confirmed by anyone with official binary. If 7% of my patch has little to do with the gap, then I will be happy that 3.10 can be far faster. >How can I build Python with PGO on Windows? Try the following, PCbuild\build.bat -p x64 --no-tkinter --pgo Before building, your object.h needs to replace static inline int Py_ALWAYS_INLINE with static Py_ALWAYS_INLINE int In my case, pgo got stuck on linking with the object.h. I'm waiting the reply from developercommunity. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Fri Sep 17 22:48:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 18 Sep 2021 02:48:03 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631933283.1.0.317699230251.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: > It would be nice to freeze argparse.py and its dependencies. For command-line tools, startup time is important. I quickly checked, and argparse has at least these dependencies: argparse re enum types operator functools collections keyword reprlib sre_compile sre_parse sre_constants copyreg gettext Raymond, do you think we should also freeze the dependencies of runpy (so "python -m <module>" also starts faster)? That would be runpy importlib warnings importlib.machinery importlib.util importlib._abc contextlib collections keyword operator reprlib functools types (I didn't dedupe this from the previous list.) With all these modules frozen we'd probably run more risk of two things: - frozen modules don't have a __file__ (and are missing a few other, less commonly used, attributes) - editing a frozen module requires rebuilding, or running with -X frozen_modules=off ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 18 00:02:10 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 04:02:10 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1631937730.88.0.164945148577.issue45020@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > Raymond, do you think we should also freeze the dependencies > of runpy (so "python -m <module>" also starts faster)? Yes, please. The '-m' load option can be considered core startup functionality. It is often the recommended way to launch command line tools outside of a virtual environment. python -m pip install some_package ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 18 00:20:40 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 04:20:40 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631938840.36.0.390372547802.issue45235@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26845 pull_request: https://github.com/python/cpython/pull/28442 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 00:20:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 04:20:38 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631938838.78.0.571970186094.issue45235@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset a6e8db5e8e6780411db749d404715dbe021647c7 by Adam Schwalm in branch 'main': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) https://github.com/python/cpython/commit/a6e8db5e8e6780411db749d404715dbe021647c7 ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 00:20:44 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 04:20:44 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631938844.36.0.926346020569.issue45235@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26846 pull_request: https://github.com/python/cpython/pull/28443 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 02:47:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 06:47:20 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631947640.48.0.754834026738.issue45235@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 6e4101add568910409294554c8e863226a66bb64 by Miss Islington (bot) in branch '3.10': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28442) https://github.com/python/cpython/commit/6e4101add568910409294554c8e863226a66bb64 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 02:47:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 06:47:45 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631947665.28.0.856411195235.issue45235@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset a18d52269ab6071a605d6c72f6af585a4c533ca4 by Miss Islington (bot) in branch '3.9': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28443) https://github.com/python/cpython/commit/a18d52269ab6071a605d6c72f6af585a4c533ca4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 02:48:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 06:48:49 +0000 Subject: [issue45235] argparse does not preserve namespace with subparser defaults In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org> Message-ID: <1631947729.03.0.474711732559.issue45235@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- assignee: -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45235> _______________________________________ From report at bugs.python.org Sat Sep 18 02:49:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 06:49:46 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631947786.99.0.2158046092.issue45198@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 94b462686b7dfabbd69cc9401037d736d71c4dc2 by Raymond Hettinger in branch 'main': bpo-45198: __set_name__ documentation not clear about its usage with non-descriptor classes (GH-28439) https://github.com/python/cpython/commit/94b462686b7dfabbd69cc9401037d736d71c4dc2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Sat Sep 18 02:49:52 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 06:49:52 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631947792.18.0.958725014978.issue45198@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26847 pull_request: https://github.com/python/cpython/pull/28444 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Sat Sep 18 03:10:07 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 07:10:07 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631949007.65.0.854755597312.issue45198@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 7ab114bf1fa0f28ee267a4c69e597cc49a186a14 by Miss Islington (bot) in branch '3.10': bpo-45198: __set_name__ documentation not clear about its usage with non-descriptor classes (GH-28439) https://github.com/python/cpython/commit/7ab114bf1fa0f28ee267a4c69e597cc49a186a14 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Sat Sep 18 05:20:01 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Sat, 18 Sep 2021 09:20:01 +0000 Subject: [issue45002] won't match correct version of tcl/tk In-Reply-To: <1629902152.33.0.134354917611.issue45002@roundup.psfhosted.org> Message-ID: <1631956801.17.0.0502701234033.issue45002@roundup.psfhosted.org> ??? <jettzheng at foxmail.com> added the comment: OK... It's fine now, tests are still failing ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45002> _______________________________________ From report at bugs.python.org Sat Sep 18 06:46:05 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 18 Sep 2021 10:46:05 +0000 Subject: [issue45216] Remove redundand information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1631961965.92.0.385949854411.issue45216@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +26848 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28445 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Sat Sep 18 08:11:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 12:11:37 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631967097.67.0.403082869587.issue36674@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26849 pull_request: https://github.com/python/cpython/pull/28446 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 08:12:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 18 Sep 2021 12:12:58 +0000 Subject: [issue5846] Deprecate obsolete functions in unittest In-Reply-To: <1240703100.05.0.329458142097.issue5846@psf.upfronthosting.co.za> Message-ID: <1631967178.57.0.771954861587.issue5846@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > It is an internal function. We can remove it without deprecation. How convenient :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue5846> _______________________________________ From report at bugs.python.org Sat Sep 18 08:26:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 12:26:05 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631967965.08.0.711050403387.issue36674@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: PR 28446 makes TestCase.debug() honoring the skipping decorator. The difference with PR 13180: 1. It does not run setUp() and tearDown() for tests decorated with the skipping decorator, as TestCase.run(). 2. It has the same behavior for tests decorated with the skipping decorator and tests using skipTest() or raising a SkipTest -- raises a SkipTest. 3. Tests actually test the skipping decorator. ---------- type: enhancement -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 08:31:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 12:31:22 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631968282.81.0.857346537611.issue36674@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Since the behavior of debug() was different for the following cases: @skip('skipping') def test1(self): pass @othedecorator @skip('skipping') def test2(self): pass def test3(self): self.skipTest('skipping') I consider it as a bug and will backport the fix. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 08:34:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 12:34:26 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631968466.33.0.493919895612.issue36674@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset dea59cf88adf5d20812edda330e085a4695baba4 by Serhiy Storchaka in branch 'main': bpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446) https://github.com/python/cpython/commit/dea59cf88adf5d20812edda330e085a4695baba4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 08:34:31 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 12:34:31 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631968471.55.0.0143092710863.issue36674@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26850 pull_request: https://github.com/python/cpython/pull/28447 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 08:34:35 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 12:34:35 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631968475.52.0.851661887274.issue36674@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26851 pull_request: https://github.com/python/cpython/pull/28448 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 09:06:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 13:06:35 +0000 Subject: [issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes In-Reply-To: <1631637625.07.0.44020466506.issue45198@roundup.psfhosted.org> Message-ID: <1631970395.24.0.767317989199.issue45198@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45198> _______________________________________ From report at bugs.python.org Sat Sep 18 09:08:33 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 18 Sep 2021 13:08:33 +0000 Subject: [issue45216] Remove redundand information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1631970513.35.0.845195776525.issue45216@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- nosy: +tim.peters _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Sat Sep 18 09:22:43 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 13:22:43 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631971363.74.0.424557237865.issue36674@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 7e465a6b8273dc0b6cb484c65664f618afa22484 by Miss Islington (bot) in branch '3.9': bpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446) https://github.com/python/cpython/commit/7e465a6b8273dc0b6cb484c65664f618afa22484 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 09:22:35 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 18 Sep 2021 13:22:35 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631971355.4.0.264489906536.issue36674@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 753f7af22e78456726496fd5d8bf38e7e6567e4e by Miss Islington (bot) in branch '3.10': bpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446) https://github.com/python/cpython/commit/753f7af22e78456726496fd5d8bf38e7e6567e4e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 09:54:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 13:54:37 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase Message-ID: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: Currently debug() does not work in IsolatedAsyncioTestCase subclasses. It runs synchronous code (setUp(), tearDown(), synchronous tests and cleanup functions), but does not run any asynchronous code (asyncSetUp(), asyncTearDown(), asynchronous tests and cleanup functions) and produces warnings "RuntimeWarning: coroutine 'xxx' was never awaited". ---------- components: Library (Lib), asyncio messages: 402132 nosy: asvetlov, ezio.melotti, michael.foord, rbcollins, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Fix debug() in IsolatedAsyncioTestCase type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Sat Sep 18 10:00:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 14:00:18 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1631973618.9.0.0129824156823.issue45238@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26852 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28449 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Sat Sep 18 10:02:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 14:02:21 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631973741.03.0.842536080134.issue36674@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: See issue45238 for debug() in IsolatedAsyncioTestCase. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 10:03:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 14:03:39 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1631973819.61.0.10670815358.issue45216@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- title: Remove redundand information from difflib docstrings -> Remove redundant information from difflib docstrings _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Sat Sep 18 10:06:05 2021 From: report at bugs.python.org (Dieter Maurer) Date: Sat, 18 Sep 2021 14:06:05 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1631973965.43.0.198064313313.issue36674@roundup.psfhosted.org> Dieter Maurer <dieter at handshake.de> added the comment: Thank you for working on this issue! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36674> _______________________________________ From report at bugs.python.org Sat Sep 18 11:09:17 2021 From: report at bugs.python.org (Mark) Date: Sat, 18 Sep 2021 15:09:17 +0000 Subject: [issue45134] Protocol dealloc not called if Server is closed In-Reply-To: <1631058765.71.0.794565950389.issue45134@roundup.psfhosted.org> Message-ID: <1631977757.94.0.311887719408.issue45134@roundup.psfhosted.org> Change by Mark <markreed99 at gmail.com>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45134> _______________________________________ From report at bugs.python.org Sat Sep 18 12:26:55 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 18 Sep 2021 16:26:55 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1631982415.04.0.84764024705.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: @Pablo, > If <benchmark_link> is correct ... For some verification, I benched pyperformance on Win10 AMD64, with the Python 3.10a7 and 3.10rc2 x64 binaries downloaded directly from python.org website release pages. The results corroborate with neonene's (please see the attached file). In short, there was a 1.09x slowdown on average. FYI, `pyperf system tune` doesn't work on Windows. So I manually disabled turbo boost and intel speedstep, but I didn't have time to research setting core affinity and the other stabilizations. Nonetheless, most of the benches were stable. > I am marking this as a release blocker until there is some agreement. Got it. Setting as advised. ---------- priority: high -> release blocker Added file: https://bugs.python.org/file50286/310a7_vs_310rc2_bench.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Sat Sep 18 13:39:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 18 Sep 2021 17:39:37 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1631986777.7.0.488452743086.issue24076@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: @Stefan > FWIW, a PGO build of Py3.7 is now about 20% *faster* here than my Ubuntu 16/04 system Python 2.7 Does that mean we can close this issue? Or do I misunderstand what you are comparing? 32 vs. 64 bits? PGO vs. non-PGO? OTOH on my Mac I still find that 3.10 with PGO is still more than twice as slow than 2.7. Thinking about it that's a bit odd, since (presumably) the majority of the work in sum() involves a long int result (even though the values returned by range() all fit in 30 bits, the sum quickly exceeds that). (earlier) > I suspect that adding a free-list for single-digit PyLong objects (the most common case) would provide some visible benefit. If my theory is correct that wouldn't help this particular case, right? FWIW just "for i in [x]range(15, 10**9, 15): pass" is about the same speed in Python 2.7 as in 3.11. ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Sat Sep 18 13:44:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 18 Sep 2021 17:44:32 +0000 Subject: [issue24138] Speed up range() by caching and modifying long objects In-Reply-To: <1430929136.04.0.0158927713933.issue24138@psf.upfronthosting.co.za> Message-ID: <1631987072.41.0.996122827193.issue24138@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Should we try the free list for integers again? ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24138> _______________________________________ From report at bugs.python.org Sat Sep 18 13:55:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 18 Sep 2021 17:55:25 +0000 Subject: [issue24138] Speed up range() by caching and modifying long objects In-Reply-To: <1430929136.04.0.0158927713933.issue24138@psf.upfronthosting.co.za> Message-ID: <1631987725.14.0.174372529946.issue24138@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: (Never mind, that should have gone to https://bugs.python.org/issue24165, which is the integer freelist -- conclusion there in 2015 was also that it didn't do much.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24138> _______________________________________ From report at bugs.python.org Sat Sep 18 17:32:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Sep 2021 21:32:08 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632000728.24.0.264440410409.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Iterating large integers: $ ./python -m pyperf timeit -s 'r = range(0, 10**20, 3**35)' 'for i in r: pass' baseline: Mean +- std dev: 223 us +- 10 us PR 27986: Mean +- std dev: 128 us +- 4 us PR 28176: Mean +- std dev: 99.0 us +- 3.7 us $ ./python -m pyperf timeit -s 'r = range(0, 10**20, 3**35)' 'list(r)' baseline: Mean +- std dev: 191 us +- 13 us PR 27986: Mean +- std dev: 107 us +- 7 us PR 28176: Mean +- std dev: 91.3 us +- 2.4 us Unpickling: $ ./python -m pyperf timeit -s 'from pickle import dumps, loads; p = dumps([iter(range(i)) for i in range(1000)])' 'loads(p)' baseline: Mean +- std dev: 535 us +- 29 us PR 27986: Mean +- std dev: 420 us +- 15 us PR 28176: Mean +- std dev: 418 us +- 17 us $ ./python -m pyperf timeit -s 'from pickle import dumps, loads; p = dumps([iter(range(i*10**10)) for i in range(1000)])' 'loads(p)' baseline: Mean +- std dev: 652 us +- 37 us PR 27986: Mean +- std dev: 530 us +- 43 us PR 28176: Mean +- std dev: 523 us +- 17 us Seems PR 28176 is slightly faster than PR 27986 in iterating long integers. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sat Sep 18 18:09:17 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 18 Sep 2021 22:09:17 +0000 Subject: [issue24165] Free list for single-digits ints In-Reply-To: <1431352769.3.0.375640200007.issue24165@psf.upfronthosting.co.za> Message-ID: <1632002957.05.0.993017101565.issue24165@roundup.psfhosted.org> Change by Guido van Rossum <guido at python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24165> _______________________________________ From report at bugs.python.org Sat Sep 18 18:35:53 2021 From: report at bugs.python.org (Ben Hoyt) Date: Sat, 18 Sep 2021 22:35:53 +0000 Subject: [issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it Message-ID: <1632004553.3.0.0473045390855.issue45239@roundup.psfhosted.org> New submission from Ben Hoyt <benhoyt at gmail.com>: In going through some standard library code, I found that the email.utils.parsedate_tz() function (https://docs.python.org/3/library/email.utils.html#email.utils.parsedate_tz) has a bug if the time value is in dotted format and has more than 2 dots in it, for example: "12.34.56.78". Per the docs, it should return None in the case of invalid input. This is happening because in the case that handles the '.' separator (instead of the normal ':'), there's no else clause to return None when there's not 2 or 3 segments. >From https://github.com/python/cpython/blob/dea59cf88adf5d20812edda330e085a4695baba4/Lib/email/_parseaddr.py#L118-L132: if len(tm) == 2: [thh, tmm] = tm tss = '0' elif len(tm) == 3: [thh, tmm, tss] = tm elif len(tm) == 1 and '.' in tm[0]: # Some non-compliant MUAs use '.' to separate time elements. tm = tm[0].split('.') if len(tm) == 2: [thh, tmm] = tm tss = 0 elif len(tm) == 3: [thh, tmm, tss] = tm # HERE: need "else: return None" else: return None We simply need to include that additional "else: return None" block in the '.' handling case. I'll submit a pull request that fixes this soon (and adds a test for this case). ---------- components: Library (Lib) messages: 402140 nosy: barry, benhoyt priority: normal severity: normal status: open title: email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45239> _______________________________________ From report at bugs.python.org Sat Sep 18 18:44:33 2021 From: report at bugs.python.org (Ben Hoyt) Date: Sat, 18 Sep 2021 22:44:33 +0000 Subject: [issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it In-Reply-To: <1632004553.3.0.0473045390855.issue45239@roundup.psfhosted.org> Message-ID: <1632005073.46.0.220950731343.issue45239@roundup.psfhosted.org> Ben Hoyt <benhoyt at gmail.com> added the comment: For reference, here's a repro case: $ python3.10 -c 'import email.utils; \ email.utils.parsedate_tz("Wed, 3 Apr 2002 12.34.56.78+0800")' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.10/email/_parseaddr.py", line 50, in parsedate_tz res = _parsedate_tz(data) File "/usr/local/lib/python3.10/email/_parseaddr.py", line 134, in _parsedate_tz thh = int(thh) UnboundLocalError: local variable 'thh' referenced before assignment ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45239> _______________________________________ From report at bugs.python.org Sat Sep 18 19:36:10 2021 From: report at bugs.python.org (Ben Hoyt) Date: Sat, 18 Sep 2021 23:36:10 +0000 Subject: [issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it In-Reply-To: <1632004553.3.0.0473045390855.issue45239@roundup.psfhosted.org> Message-ID: <1632008170.51.0.708916510384.issue45239@roundup.psfhosted.org> Change by Ben Hoyt <benhoyt at gmail.com>: ---------- keywords: +patch pull_requests: +26853 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28452 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45239> _______________________________________ From report at bugs.python.org Sat Sep 18 20:37:57 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 19 Sep 2021 00:37:57 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632011877.33.0.772794966799.issue45234@roundup.psfhosted.org> Change by Eryk Sun <eryksun at gmail.com>: ---------- nosy: +gregory.p.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Sat Sep 18 20:58:51 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 19 Sep 2021 00:58:51 +0000 Subject: [issue45240] Add +REPORT_NDIFF option to pdb tests that use doctest Message-ID: <1632013131.74.0.0677212065076.issue45240@roundup.psfhosted.org> New submission from Andrei Kulakov <andrei.avk at gmail.com>: It would be useful to have +REPORT_NDIFF option applied to pdb doctests because it makes it much more convenient to add / modify pdb tests, to fix pdb bugs, add pdb features. I've worked on two pdb issues in the last few months and I wasn't aware of +REPORT_NDIFF, and so I was just looking at the output of failing tests (which are very long for some pdb tests), and comparing them manually. This option, when enabled, automatically provides diff with in-line highlighted difference for a failed doctest. Otherwise two chunks of text are provided, 'EXPECTED' and 'GOT ...'. ---------- assignee: andrei.avk components: Tests messages: 402142 nosy: andrei.avk, kj priority: normal severity: normal status: open title: Add +REPORT_NDIFF option to pdb tests that use doctest type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45240> _______________________________________ From report at bugs.python.org Sat Sep 18 21:04:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 19 Sep 2021 01:04:56 +0000 Subject: [issue45240] Add +REPORT_NDIFF option to pdb tests that use doctest In-Reply-To: <1632013131.74.0.0677212065076.issue45240@roundup.psfhosted.org> Message-ID: <1632013496.87.0.316510921553.issue45240@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch pull_requests: +26855 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28453 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45240> _______________________________________ From report at bugs.python.org Sat Sep 18 23:27:14 2021 From: report at bugs.python.org (Ma Lin) Date: Sun, 19 Sep 2021 03:27:14 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632022034.83.0.653432964472.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: > In my case, pgo got stuck on linking with the object.h. Me too. Since commit 28d28e0 (the first commit to slow down the PGO build), if add `__forceinline` attribute to _Py_DECREF() function in object.h, the PGO build hangs (>50 minutes). So PR 28427 may not be a short-term solution. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Sun Sep 19 04:20:44 2021 From: report at bugs.python.org (Ian Henderson) Date: Sun, 19 Sep 2021 08:20:44 +0000 Subject: [issue45241] python REPL leaks local variables when an exception is thrown Message-ID: <1632039644.51.0.808669340461.issue45241@roundup.psfhosted.org> New submission from Ian Henderson <ian at ianhenderson.org>: To reproduce, copy the following code: ---- import gc gc.collect() objs = gc.get_objects() for obj in objs: try: if isinstance(obj, X): print(obj) except NameError: class X: pass def f(): x = X() raise Exception() f() ---- then open a Python REPL and paste repeatedly at the prompt. Each time the code runs, another copy of the local variable x is leaked. This was originally discovered while using PyTorch -- tensors leaked this way tend to exhaust GPU memory pretty quickly. Version Info: Python 3.9.7 (default, Sep 3 2021, 04:31:11) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin ---------- components: Interpreter Core messages: 402144 nosy: ianh2 priority: normal severity: normal status: open title: python REPL leaks local variables when an exception is thrown type: resource usage versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45241> _______________________________________ From report at bugs.python.org Sun Sep 19 04:24:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 19 Sep 2021 08:24:22 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632039862.26.0.664837833069.issue45116@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- nosy: +erlendaasland _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Sun Sep 19 04:36:23 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 19 Sep 2021 08:36:23 +0000 Subject: [issue45241] python REPL leaks local variables when an exception is thrown In-Reply-To: <1632039644.51.0.808669340461.issue45241@roundup.psfhosted.org> Message-ID: <1632040583.23.0.0340781391266.issue45241@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: I'd expect that there'd be at least one instance of X alive due to sys.last_value and in particular sys.last_traceback (which has a reference to the stack frame which contains references to local variables). Btw. I cannot reproduce this with Python 3.9.7 installed with the Python.org installer (on MacOS 11): Python 3.9.7 (v3.9.7:1016ef3790, Aug 30 2021, 16:25:35) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin When I introduce a reference loop the number of X() instances does grow, but only until the cyclic garbage collector runs (for example when gc.collect is called). I used slightly tweaked code to investigate: class Y: pass class X: def __init__(self): self.y = Y() self.y.x = self pass def dump(): import gc # gc.collect() objs = gc.get_objects() for obj in objs: if isinstance(obj, X): print(obj) def f(): x = X() raise Exception() f() ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45241> _______________________________________ From report at bugs.python.org Sun Sep 19 04:43:53 2021 From: report at bugs.python.org (Ian Henderson) Date: Sun, 19 Sep 2021 08:43:53 +0000 Subject: [issue45241] python REPL leaks local variables when an exception is thrown In-Reply-To: <1632039644.51.0.808669340461.issue45241@roundup.psfhosted.org> Message-ID: <1632041033.51.0.715001928384.issue45241@roundup.psfhosted.org> Ian Henderson <ian at ianhenderson.org> added the comment: Ah, you're right -- it looks like the 'objs' global is what's keeping these objects alive. Sorry for the noise. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45241> _______________________________________ From report at bugs.python.org Sun Sep 19 04:48:54 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 19 Sep 2021 08:48:54 +0000 Subject: [issue44841] ZipInfo crashes on filemode In-Reply-To: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org> Message-ID: <1632041334.38.0.733888929619.issue44841@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: I'm not sure what the issue is here. ZipInfo does not have a filemode attribute, that's why it is not in ZipInfo.__slots__. That said, it might be interesting to add a property to ZipInfo that extracts the file mode from ZipInfo.external_attr. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44841> _______________________________________ From report at bugs.python.org Sun Sep 19 05:54:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Sep 2021 09:54:21 +0000 Subject: [issue45200] test_multiprocessing_fork: test_get() fails with timeout In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632045261.26.0.487322311803.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > https://github.com/python/cpython/pull/28344/checks?check_run_id=3605759743 That's an Address Sanitizer job. Pablo: would it be possible to make the Address Sanitizer not mandatory on pull requests, until this libasan race condition is fixed? ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Sun Sep 19 05:55:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Sep 2021 09:55:28 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632045328.77.0.707181087168.issue45200@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: test_multiprocessing_fork: test_get() fails with timeout -> Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Sun Sep 19 06:03:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 10:03:01 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632045781.69.0.458960858397.issue45238@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It turned out be more complicated than I expected. We need to keep the even loop after getting exception in debug() for having ability to run doCleanup() etc. The option is to close the even loop in __del__. But we should ensure that it is closed before running other event loop. Also, assertRaises() creates reference loops, so we cannot use it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Sun Sep 19 06:04:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Sep 2021 10:04:44 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632045884.75.0.892326075461.issue43760@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The commit 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 caused a performance regression on Windows which is currently blocking the Python 3.10.0 final release: bpo-45116. Moroever, this issue introduced a incompatible C API change which is not documented in What's New in Python 3.10, and it doesn't provide any solution for projects broken by these changes. So far, the following projects are known to be broken by the change: * Cython * greenlet (fixed) * dipy * yappi * smartcols Would it be possible to: * Bare minimum: document the change in What's in Python 3.10? * Provide a solution to broken project? If possible, solution working on old and new Python versions. Maybe a compatibility functions can added to https://github.com/pythoncapi/pythoncapi_compat if needed. * Maybe revert the change in Python 3.10 since a full solution may require additional work. By the way, I'm also disappointed that nothing was done to enhance the situation for 4 months (since the first known projects were reported here in May). I raise the priority to release blocker to make more people aware of the situation. ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Sun Sep 19 06:39:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Sep 2021 10:39:46 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632047986.66.0.432881476471.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: runpy startup time matters a lot for "python3 -m module" startup time! In Python 3.10 (bpo-41006 and bpo-41718), I reduced the number of modules imported by runpy: "The runpy module now imports fewer modules. The python3 -m module-name command startup time is 1.4x faster in average. On Linux, python3 -I -m module-name imports 69 modules on Python 3.9, whereas it only imports 51 modules (-18) on Python 3.10. (Contributed by Victor Stinner in bpo-41006 and bpo-41718.)" https://docs.python.org/dev/whatsnew/3.10.html#optimizations -- For argparse, maybe it could use a few lazy imports to reduce the number of indirect impots on "import argparse"? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sun Sep 19 07:34:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 11:34:14 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632051254.56.0.687563935009.issue45200@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Pablo: would it be possible to make the Address Sanitizer not mandatory on pull requests, until this libasan race condition is fixed? I don't think that's a good idea because then people will simply ignore it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Sun Sep 19 08:24:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 12:24:44 +0000 Subject: [issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes In-Reply-To: <1499262996.04.0.921631870961.issue30856@psf.upfronthosting.co.za> Message-ID: <1632054284.93.0.852446608154.issue30856@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 664448d81f41c5fa971d8523a71b0f19e76cc136 by Serhiy Storchaka in branch 'main': bpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180) https://github.com/python/cpython/commit/664448d81f41c5fa971d8523a71b0f19e76cc136 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30856> _______________________________________ From report at bugs.python.org Sun Sep 19 08:25:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 12:25:04 +0000 Subject: [issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes In-Reply-To: <1499262996.04.0.921631870961.issue30856@psf.upfronthosting.co.za> Message-ID: <1632054304.76.0.922615233387.issue30856@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30856> _______________________________________ From report at bugs.python.org Sun Sep 19 08:27:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 12:27:37 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632054457.15.0.0917415598758.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 40348acc180580371d25f75f46b27048e35f2435 by Serhiy Storchaka in branch 'main': bpo-45229: Remove test_main in many tests (GH-28405) https://github.com/python/cpython/commit/40348acc180580371d25f75f46b27048e35f2435 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 08:38:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 12:38:41 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632055121.07.0.0329545077051.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26856 pull_request: https://github.com/python/cpython/pull/28454 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 08:42:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 12:42:46 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632055366.72.0.473338184629.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26857 pull_request: https://github.com/python/cpython/pull/28455 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 09:17:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Sep 2021 13:17:22 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632057442.69.0.549689532314.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Pablo: > I don't think that's a good idea because then people will simply ignore it. On my PR 28419, I had to re-run the CI 2 or 3 times, it failed multiple times. It prevents to merge a PR whereas the failure is unrelated to the PR. Terry was also affected on his IDLE's PR 28344. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Sun Sep 19 09:18:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 13:18:19 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632057499.75.0.836781589454.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset a6241773869b80f2b1cac63f26ba646aa808a8db by Serhiy Storchaka in branch 'main': bpo-45229: Fix setUpModule in test_ssl (GH-28454) https://github.com/python/cpython/commit/a6241773869b80f2b1cac63f26ba646aa808a8db ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 09:19:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 13:19:15 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632057555.56.0.765673237488.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26858 pull_request: https://github.com/python/cpython/pull/28456 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 11:35:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 19 Sep 2021 15:35:19 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632065719.59.0.669059457358.issue45026@roundup.psfhosted.org> Change by Guido van Rossum <guido at python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sun Sep 19 11:59:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 15:59:40 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632067180.96.0.00633578419239.issue45200@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I understand what you mean and I sympathize with it, but this is no different to random failures that we get in the other CI. The check is not failing constantly because otherwise no PRs could be merged and that's not what is happening. I understand your points but my concerns remain: I don't think that's a good idea because then people will simply ignore it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Sun Sep 19 13:09:42 2021 From: report at bugs.python.org (Jun De) Date: Sun, 19 Sep 2021 17:09:42 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations In-Reply-To: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> Message-ID: <1632071382.98.0.5655859812.issue44687@roundup.psfhosted.org> Change by Jun De <solsticedante at gmail.com>: ---------- keywords: +patch nosy: +AngstyDuck nosy_count: 1.0 -> 2.0 pull_requests: +26859 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28457 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44687> _______________________________________ From report at bugs.python.org Sun Sep 19 14:20:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 19 Sep 2021 18:20:41 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1632075641.26.0.473767851024.issue45113@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Is the subinterpreters work still on hold pending a PEP? I thought that conversions to heap types had been suspended because there is a Steering Council level cost benefit decision. Mostly it seems that everything helps subinterpreters makes code worse in almost every other way (slower, more complex, new APIs, etc). ---------- nosy: +rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Sun Sep 19 14:23:49 2021 From: report at bugs.python.org (wolfgang kuehn) Date: Sun, 19 Sep 2021 18:23:49 +0000 Subject: [issue45237] Python subprocess not honoring append mode for stdout on Windows In-Reply-To: <1631913103.36.0.277836027655.issue45237@roundup.psfhosted.org> Message-ID: <1632075829.41.0.0503650659737.issue45237@roundup.psfhosted.org> wolfgang kuehn <wolfgang-kuehn at decatur.de> added the comment: The second alternative (wrapping the OS handle in a file descriptor) works like a charm, and is the less invasive workaround code-wise. Thanks for the magic, which I must respect as such :-) Still I feel that this is a bug since (a) it shows an unexpected behaviour, and (b) it fails to abstract away the operating system. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45237> _______________________________________ From report at bugs.python.org Sun Sep 19 14:47:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 19 Sep 2021 18:47:58 +0000 Subject: =?utf-8?q?=5Bissue39549=5D_The_reprlib=2ERepr_type_should_permit_the_?= =?utf-8?q?=E2=80=9Cfillvalue=E2=80=9D_to_be_set_by_the_user?= In-Reply-To: <1580778450.13.0.746492669497.issue39549@roundup.psfhosted.org> Message-ID: <1632077278.55.0.230007016054.issue39549@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- assignee: -> rhettinger _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39549> _______________________________________ From report at bugs.python.org Sun Sep 19 14:53:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 18:53:38 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1632077618.56.0.918459727146.issue45193@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > are ready to be cherrypicked into into the 3.10.0 release branch. Once that is done, 'release blocker' can be removed, but issue should remain open for a separate fix for 3.9. Done! I am removing the release blocker and the 3.10, 3.11 version tags. Thanks Tal and Terry for all the work! ---------- priority: release blocker -> versions: -Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45193> _______________________________________ From report at bugs.python.org Sun Sep 19 15:01:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 19:01:42 +0000 Subject: [issue45236] pyperformance fails to build master In-Reply-To: <1631911012.65.0.752307140026.issue45236@roundup.psfhosted.org> Message-ID: <1632078102.62.0.83637958859.issue45236@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I have checked and indeed this has been fixed already. Thanks a lot, Victor for the fix! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45236> _______________________________________ From report at bugs.python.org Sun Sep 19 15:10:40 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 19 Sep 2021 19:10:40 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632078640.09.0.284910894088.issue43760@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: Also Numba is broken: https://bugzilla.redhat.com/show_bug.cgi?id=2005686 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Sun Sep 19 15:11:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 19:11:45 +0000 Subject: [issue44640] Fix punctuation in isinstance() error message In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1632078705.6.0.141580190045.issue44640@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 9c23a1ebade19f20c7d6e592a7d0329545a9a746 by Miss Islington (bot) in branch '3.10': bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) (GH-28436) https://github.com/python/cpython/commit/9c23a1ebade19f20c7d6e592a7d0329545a9a746 ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44640> _______________________________________ From report at bugs.python.org Sun Sep 19 15:19:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 19:19:02 +0000 Subject: [issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError In-Reply-To: <1630965920.35.0.627159261173.issue45121@roundup.psfhosted.org> Message-ID: <1632079142.16.0.66920408692.issue45121@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Pablo, marking as release blocker. PR GH-28232 is merged to 3.10. It should be cherry-picked for 3.10.0 inclusion. Done! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45121> _______________________________________ From report at bugs.python.org Sun Sep 19 15:20:19 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sun, 19 Sep 2021 19:20:19 +0000 Subject: [issue45242] test_pdb fails Message-ID: <1632079219.73.0.310736156405.issue45242@roundup.psfhosted.org> Change by L?on Planken <python.org at oliphaunt.nl>: ---------- components: Tests nosy: oliphaunt priority: normal severity: normal status: open title: test_pdb fails versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45242> _______________________________________ From report at bugs.python.org Sun Sep 19 15:26:01 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sun, 19 Sep 2021 19:26:01 +0000 Subject: [issue45242] test_pdb fails Message-ID: <1632079561.91.0.535286155641.issue45242@roundup.psfhosted.org> New submission from L?on Planken <python.org at oliphaunt.nl>: This is a re-opening of issue 41914 (and my first issue, so apologies for any mistakes). Building Python 3.7, I ran into the same issue reported there (only line numbers differ): ====================================================================== FAIL: test_errors_in_command (__main__.PdbTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_pdb.py", line 1535, in test_errors_in_command '(Pdb) ', AssertionError: Lists differ: ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ', '\x1b[?1034h'] != ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) '] First list contains 1 additional elements. First extra element 9: '\x1b[?1034h' ['(Pdb) *** SyntaxError: unexpected EOF while parsing', '(Pdb) ENTERING RECURSIVE DEBUGGER', '*** SyntaxError: unexpected EOF while parsing', 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ENTERING RECURSIVE DEBUGGER', '> <string>(1)<module>()', "((Pdb)) *** NameError: name 'doesnotexist' is not defined", 'LEAVING RECURSIVE DEBUGGER', - '(Pdb) ', ? ^ + '(Pdb) '] ? ^ - '\x1b[?1034h'] ---------------------------------------------------------------------- Ran 39 tests in 1.024s FAILED (failures=1) I have also managed to determine the cause. As can be seen, the output from this pdb invocation contains an extraneous ANSI control sequence ("interpret "meta" key, set eighth bit"). This happens when running the test inside the GNU `screen` environment. Run the test outside `screen`, and the problem goes away. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45242> _______________________________________ From report at bugs.python.org Sun Sep 19 15:27:47 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sun, 19 Sep 2021 19:27:47 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1632079667.71.0.992690389918.issue41914@roundup.psfhosted.org> L?on Planken <python.org at oliphaunt.nl> added the comment: Re-opened as issue 45242 (also identified the culprit) ---------- nosy: +oliphaunt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41914> _______________________________________ From report at bugs.python.org Sun Sep 19 15:29:07 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sun, 19 Sep 2021 19:29:07 +0000 Subject: [issue45242] test_pdb fails In-Reply-To: <1632079561.91.0.535286155641.issue45242@roundup.psfhosted.org> Message-ID: <1632079747.59.0.766234558292.issue45242@roundup.psfhosted.org> L?on Planken <python.org at oliphaunt.nl> added the comment: (By the way, this was the only test that failed when running `make test` inside the `screen` environment.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45242> _______________________________________ From report at bugs.python.org Sun Sep 19 15:31:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 19:31:14 +0000 Subject: [issue44640] Fix punctuation in isinstance() error message In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1632079874.56.0.491165704392.issue44640@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44640> _______________________________________ From report at bugs.python.org Sun Sep 19 15:36:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Sep 2021 19:36:11 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632080171.56.0.236706216886.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset bedce3538cca3469ac3efc614ef062367cbb2ff1 by Serhiy Storchaka in branch '3.10': [3.10] bpo-45229: Remove test_main in many tests (GH-28405) (GH-28455) https://github.com/python/cpython/commit/bedce3538cca3469ac3efc614ef062367cbb2ff1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Sun Sep 19 15:39:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 19:39:59 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632080399.49.0.733153251355.issue30637@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +26860 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28459 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 16:20:56 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 19 Sep 2021 20:20:56 +0000 Subject: [issue45237] Python subprocess not honoring append mode for stdout on Windows In-Reply-To: <1631913103.36.0.277836027655.issue45237@roundup.psfhosted.org> Message-ID: <1632082856.89.0.792908618215.issue45237@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: There's nothing we could easily change to use the native OS append mode or support inheritance of file descriptors in subprocess. A general solution would be to give up on C file descriptors and CRT functions such as _wopen(), read(), etc, and instead implement our own I/O and filesystem support in the os and io modules, based on native handles and the Windows API. This change has been discussed, but I don't know whether or not it's just a pipe dream. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45237> _______________________________________ From report at bugs.python.org Sun Sep 19 17:50:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 21:50:46 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632088246.38.0.0700467624795.issue36819@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Sun Sep 19 17:54:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 21:54:42 +0000 Subject: [issue36956] Calling "functions" used to implement generators/comps easily cause crash In-Reply-To: <1558187601.17.0.878025070628.issue36956@roundup.psfhosted.org> Message-ID: <1632088482.89.0.617062439847.issue36956@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36956> _______________________________________ From report at bugs.python.org Sun Sep 19 17:57:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 21:57:38 +0000 Subject: [issue38039] Segfault when pickling dictionary with large pandas dataframes In-Reply-To: <1567702116.93.0.155927302531.issue38039@roundup.psfhosted.org> Message-ID: <1632088658.09.0.502191599252.issue38039@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Have you been able to reproduce this without pandas? If not, have you reported this problem in the pandas but tracker? ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38039> _______________________________________ From report at bugs.python.org Sun Sep 19 18:01:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:01:28 +0000 Subject: [issue39190] _result_handler dies on raised exceptions [multiprocessing] In-Reply-To: <1577968013.94.0.930637470909.issue39190@roundup.psfhosted.org> Message-ID: <1632088888.56.0.87451714796.issue39190@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39190> _______________________________________ From report at bugs.python.org Sun Sep 19 18:06:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:06:30 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632089190.37.0.71776081775.issue39778@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: I could not reproduce the crash and from the discussion it seems resolved. Is there anything left here? ---------- nosy: +iritkatriel _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Sun Sep 19 18:09:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:09:51 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632089391.24.0.209593430989.issue40413@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Is there anything to do on this issue? Gregory, perhaps you could report the crashes you see so they can be evaluated? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Sun Sep 19 18:20:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:20:15 +0000 Subject: [issue41367] Popen Timeout raised on 3.6 but not on 3.8 In-Reply-To: <1595407379.06.0.696065311763.issue41367@roundup.psfhosted.org> Message-ID: <1632090015.78.0.66176339024.issue41367@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41367> _______________________________________ From report at bugs.python.org Sun Sep 19 18:22:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:22:32 +0000 Subject: [issue26375] Python 2.7.10 and 3.4.4 hang on imaplib.IMAP4_SSL() In-Reply-To: <1455716357.67.0.858374272161.issue26375@psf.upfronthosting.co.za> Message-ID: <1632090152.31.0.10165773444.issue26375@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Please create a new issue, with a working reproducer, if this problem exists in a current version. ---------- resolution: -> out of date stage: test needed -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue26375> _______________________________________ From report at bugs.python.org Sun Sep 19 18:23:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 19 Sep 2021 22:23:29 +0000 Subject: [issue34846] Runtime failure with Failed to import site module In-Reply-To: <1538273716.55.0.545547206417.issue34846@psf.upfronthosting.co.za> Message-ID: <1632090209.13.0.793516792171.issue34846@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> rejected stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34846> _______________________________________ From report at bugs.python.org Sun Sep 19 18:35:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 19 Sep 2021 22:35:54 +0000 Subject: [issue45243] [sqlite3] add support for changing connection limits Message-ID: <1632090954.41.0.8887678667.issue45243@roundup.psfhosted.org> New submission from Erlend E. Aasland <erlend.aasland at innova.no>: I propose to add wrappers for the SQLite sqlite3_limit() C API. Using this API, it is possible to query and set limits on a connection basis. This will make it easier (and faster) to test various corner cases in the test suite without relying on test.support.bigmemtest. Quoting from the SQLite sqlite3_limit() docs: Run-time limits are intended for use in applications that manage both their own internal database and also databases that are controlled by untrusted external sources. An example application might be a web browser that has its own databases for storing history and separate databases controlled by JavaScript applications downloaded off the Internet. The internal databases can be given the large, default limits. Databases managed by external sources can be given much smaller limits designed to prevent a denial of service attack. See also: - https://sqlite.org/c3ref/limit.html - https://sqlite.org/c3ref/c_limit_attached.html - https://sqlite.org/limits.html Limit categories (C&P from SQLite docs) --------------------------------------- SQLITE_LIMIT_LENGTH The maximum size of any string or BLOB or table row, in bytes. SQLITE_LIMIT_SQL_LENGTH The maximum length of an SQL statement, in bytes. SQLITE_LIMIT_COLUMN The maximum number of columns in a table definition or in the result set of a SELECT or the maximum number of columns in an index or in an ORDER BY or GROUP BY clause. SQLITE_LIMIT_EXPR_DEPTH The maximum depth of the parse tree on any expression. SQLITE_LIMIT_COMPOUND_SELECT The maximum number of terms in a compound SELECT statement. SQLITE_LIMIT_VDBE_OP The maximum number of instructions in a virtual machine program used to implement an SQL statement. If sqlite3_prepare_v2() or the equivalent tries to allocate space for more than this many opcodes in a single prepared statement, an SQLITE_NOMEM error is returned. SQLITE_LIMIT_FUNCTION_ARG The maximum number of arguments on a function. SQLITE_LIMIT_ATTACHED The maximum number of attached databases. SQLITE_LIMIT_LIKE_PATTERN_LENGTH The maximum length of the pattern argument to the LIKE or GLOB operators. SQLITE_LIMIT_VARIABLE_NUMBER The maximum index number of any parameter in an SQL statement. SQLITE_LIMIT_TRIGGER_DEPTH The maximum depth of recursion for triggers. SQLITE_LIMIT_WORKER_THREADS The maximum number of auxiliary worker threads that a single prepared statement may start. ---------- assignee: erlendaasland components: Extension Modules messages: 402176 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: low severity: normal status: open title: [sqlite3] add support for changing connection limits type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45243> _______________________________________ From report at bugs.python.org Sun Sep 19 18:45:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 22:45:02 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632091502.5.0.714346669101.issue30637@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset e6d05a4092b4176a30d1d1596585df13c2ab676d by Pablo Galindo Salgado in branch 'main': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459) https://github.com/python/cpython/commit/e6d05a4092b4176a30d1d1596585df13c2ab676d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 18:45:12 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 22:45:12 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632091512.77.0.179983257068.issue30637@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26861 pull_request: https://github.com/python/cpython/pull/28460 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 18:45:17 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 22:45:17 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632091517.27.0.330864580547.issue30637@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26862 pull_request: https://github.com/python/cpython/pull/28461 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 18:50:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 22:50:12 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1632091812.05.0.0927227645451.issue45128@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 1d42408495402b06ecae91420735aeff454be6b5 by Nikita Sobolev in branch 'main': bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387) https://github.com/python/cpython/commit/1d42408495402b06ecae91420735aeff454be6b5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Sun Sep 19 18:50:36 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 22:50:36 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1632091836.5.0.621044587318.issue45128@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26863 pull_request: https://github.com/python/cpython/pull/28462 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Sun Sep 19 18:51:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 22:51:40 +0000 Subject: [issue45040] [sqlite3] optimise transaction control functions In-Reply-To: <1630181796.88.0.161602783336.issue45040@roundup.psfhosted.org> Message-ID: <1632091900.25.0.477964034383.issue45040@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 771a5467132f0400d4c987db8ba807f845b655bc by Erlend Egeberg Aasland in branch 'main': bpo-45040: Simplify sqlite3 transaction control functions (GH-28019) https://github.com/python/cpython/commit/771a5467132f0400d4c987db8ba807f845b655bc ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45040> _______________________________________ From report at bugs.python.org Sun Sep 19 18:51:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 22:51:56 +0000 Subject: [issue45040] [sqlite3] optimise transaction control functions In-Reply-To: <1630181796.88.0.161602783336.issue45040@roundup.psfhosted.org> Message-ID: <1632091916.85.0.0909023730929.issue45040@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45040> _______________________________________ From report at bugs.python.org Sun Sep 19 18:52:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 22:52:40 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1632091960.46.0.737240465692.issue45041@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset a6779715c4d0289acb59a8fd3660ab2e5d486c4b by Erlend Egeberg Aasland in branch 'main': bpo-45041: Simplify `sqlite3.Cursor.executescript()` (GH-28020) https://github.com/python/cpython/commit/a6779715c4d0289acb59a8fd3660ab2e5d486c4b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45041> _______________________________________ From report at bugs.python.org Sun Sep 19 19:05:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 23:05:30 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632092730.35.0.391872948605.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I could not reproduce the crash and from the discussion it seems resolved. Is there anything left here? No, this should be fixed by now. I just forgot to close the issue. Thanks for the ping! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Sun Sep 19 19:07:22 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 23:07:22 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632092842.62.0.566660071214.issue30637@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset f17c979d909f05916e354ae54c82bff71dbede35 by Miss Islington (bot) in branch '3.10': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459) https://github.com/python/cpython/commit/f17c979d909f05916e354ae54c82bff71dbede35 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 19:13:11 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 23:13:11 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1632093191.65.0.968073874625.issue45128@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 0e9608680525b120fc8eaad9f1cb2f729a6c22ae by Miss Islington (bot) in branch '3.10': bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387) https://github.com/python/cpython/commit/0e9608680525b120fc8eaad9f1cb2f729a6c22ae ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Sun Sep 19 19:14:01 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 19 Sep 2021 23:14:01 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632093241.82.0.067234731712.issue30637@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 41e2a31c13ba73e2c30e9bf0be9417fd17e8ace2 by Miss Islington (bot) in branch '3.9': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459) https://github.com/python/cpython/commit/41e2a31c13ba73e2c30e9bf0be9417fd17e8ace2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 19:19:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 19 Sep 2021 23:19:22 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1632093562.31.0.624339223763.issue45041@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Thanks for reviewing, Pablo! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45041> _______________________________________ From report at bugs.python.org Sun Sep 19 19:22:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 19 Sep 2021 23:22:04 +0000 Subject: [issue45243] [sqlite3] add support for changing connection limits In-Reply-To: <1632090954.41.0.8887678667.issue45243@roundup.psfhosted.org> Message-ID: <1632093724.79.0.869686413987.issue45243@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Christian, how about adding an audit event for something like sqlite3.Connection.setlimit()? My initial thought is: yes. ---------- nosy: +christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45243> _______________________________________ From report at bugs.python.org Sun Sep 19 19:29:31 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 19 Sep 2021 23:29:31 +0000 Subject: [issue45243] [sqlite3] add support for changing connection limits In-Reply-To: <1632090954.41.0.8887678667.issue45243@roundup.psfhosted.org> Message-ID: <1632094171.84.0.926559911622.issue45243@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- keywords: +patch pull_requests: +26864 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28463 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45243> _______________________________________ From report at bugs.python.org Sun Sep 19 19:32:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 23:32:16 +0000 Subject: [issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST) In-Reply-To: <1497271056.08.0.482498543523.issue30637@psf.upfronthosting.co.za> Message-ID: <1632094336.18.0.883015505559.issue30637@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30637> _______________________________________ From report at bugs.python.org Sun Sep 19 19:33:22 2021 From: report at bugs.python.org (Matej Cepl) Date: Sun, 19 Sep 2021 23:33:22 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632094402.19.0.806249088483.issue1170@roundup.psfhosted.org> Matej Cepl <mcepl at cepl.eu> added the comment: I cannot reproduce it with the current 3.* version. Did anybody reproduce with 3.5? Otherwise, I suggest close this, as a 2.* bug. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Sun Sep 19 19:34:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 19 Sep 2021 23:34:08 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1632094448.61.0.745449667654.issue45128@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Sun Sep 19 19:36:53 2021 From: report at bugs.python.org (Matej Cepl) Date: Sun, 19 Sep 2021 23:36:53 +0000 Subject: [issue33327] Add a method to move messages to IMAPlib In-Reply-To: <1524337803.72.0.682650639539.issue33327@psf.upfronthosting.co.za> Message-ID: <1632094613.74.0.44379125098.issue33327@roundup.psfhosted.org> Matej Cepl <mcepl at cepl.eu> added the comment: > Hans-Peter Jansen (frispete) > > imaplib.error: UID command error: BAD [b'Unrecognized UID subcommand'] You missed the fix for https://bugs.python.org/issue33336 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33327> _______________________________________ From report at bugs.python.org Sun Sep 19 19:53:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 19 Sep 2021 23:53:35 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1632095615.41.0.772466662299.issue42038@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42038> _______________________________________ From report at bugs.python.org Sun Sep 19 22:37:22 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 20 Sep 2021 02:37:22 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632105442.72.0.706891391895.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: Like OP's benchmark, if convert the inline functions to macros in object.h, the 3.10 branch is 1.03x faster, but still 1.07x slower than 28d28e0~1. @vstinner could you prepare such a PR as a candidate fix. There seem to be two ways to solve it in short-term. 1, Split the giant function. 2, Contact MSVC team to see if there is a quick solution, such as undocumented options. But the release time is too close. The worst result is to release with the performance regression, and note in the download page that there is a performance regression, if you care about performance please use 3.9. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 01:30:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 05:30:48 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632115848.81.0.565659278033.issue45116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: I concur with Ma Lin. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 01:51:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 05:51:14 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632117074.47.0.456490452061.issue39778@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: I'm thinking that edit to tp_dealloc was incorrect. The PyClear call should have been replaced (not removed) with the pattern shown in the C APIs docs ( https://docs.python.org/3/extending/newtypes.html?highlight=pyobject_clearw#weak-reference-support ): if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *) self); ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 02:26:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 06:26:29 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632119189.95.0.308631083546.issue39778@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Also a test should be added to make sure the weakref callbacks are still occurring. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 02:29:26 2021 From: report at bugs.python.org (Shreyans Jain) Date: Mon, 20 Sep 2021 06:29:26 +0000 Subject: [issue45244] pip not installed with fresh python3.8.10 installation Message-ID: <1632119366.31.0.964394896374.issue45244@roundup.psfhosted.org> New submission from Shreyans Jain <shreyansjain.3381 at gmail.com>: I have installed Python 3.8.10 on windows server 2019. When I try to run "pip list" or any other pip command, it throws error of "pip not found. unrecognized command". I checked Scripts directory where usually pip resides in the installation, and pip is missing. Note: while installing I made sure that pip should be installed along with the python installation. ---------- components: Installation messages: 402193 nosy: shreyanse081 priority: normal severity: normal status: open title: pip not installed with fresh python3.8.10 installation type: crash versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45244> _______________________________________ From report at bugs.python.org Mon Sep 20 02:34:12 2021 From: report at bugs.python.org (Martin Panter) Date: Mon, 20 Sep 2021 06:34:12 +0000 Subject: [issue45170] tarfile missing cross-directory checking In-Reply-To: <1631346341.79.0.894184434435.issue45170@roundup.psfhosted.org> Message-ID: <1632119652.46.0.672188381473.issue45170@roundup.psfhosted.org> Martin Panter <vadmium+py at gmail.com> added the comment: Issue 21109 has been open for a while and is the same as this, if I am not mistaken. ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> tarfile: Traversal attack vulnerability _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45170> _______________________________________ From report at bugs.python.org Mon Sep 20 02:34:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 06:34:59 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632119699.09.0.269926258982.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 5822ab672a1d26ff1837103c1ed8e4c3c2a42b87 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45229: Remove test_main in many tests (GH-28405) (GH-28456) https://github.com/python/cpython/commit/5822ab672a1d26ff1837103c1ed8e4c3c2a42b87 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 02:40:35 2021 From: report at bugs.python.org (Shreyans Jain) Date: Mon, 20 Sep 2021 06:40:35 +0000 Subject: [issue45245] ValueError: check_hostname requires server_hostname while pip install command on windows server 2019 Message-ID: <1632120035.45.0.581135774584.issue45245@roundup.psfhosted.org> New submission from Shreyans Jain <shreyansjain.3381 at gmail.com>: I have installed Python 3.9.7 on windows server 2019. When I run "pip list" command, it works. When I try to install any library using "pip install <library>", I get "ValueError: check_hostname requires server_hostname" error. Please check the screenshot for further details. I am getting the same error on python 3.8.10 version. ---------- assignee: christian.heimes components: Build, Library (Lib), SSL, Windows files: Value Error check hostname requires server hostname.JPG messages: 402196 nosy: christian.heimes, paul.moore, shreyanse081, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ValueError: check_hostname requires server_hostname while pip install command on windows server 2019 versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50287/Value Error check hostname requires server hostname.JPG _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45245> _______________________________________ From report at bugs.python.org Mon Sep 20 02:51:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 20 Sep 2021 06:51:49 +0000 Subject: [issue45222] test_venv: test_with_pip fails on version 3.8.12 with: pip._vendor.packaging.version.InvalidVersion: Invalid version: 'setuptools' In-Reply-To: <1631805101.42.0.465576816757.issue45222@roundup.psfhosted.org> Message-ID: <1632120709.01.0.540655297363.issue45222@roundup.psfhosted.org> Change by Christian Heimes <lists at cheimes.de>: ---------- nosy: -christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45222> _______________________________________ From report at bugs.python.org Mon Sep 20 02:53:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 20 Sep 2021 06:53:13 +0000 Subject: [issue45245] ValueError: check_hostname requires server_hostname while pip install command on windows server 2019 In-Reply-To: <1632120035.45.0.581135774584.issue45245@roundup.psfhosted.org> Message-ID: <1632120793.83.0.257421582946.issue45245@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Please report pip-related issues at https://github.com/pypa/pip ---------- assignee: christian.heimes -> components: -Build, SSL, Windows resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45245> _______________________________________ From report at bugs.python.org Mon Sep 20 02:55:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 06:55:56 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1632120956.08.0.933187292009.issue45213@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: If you close this out, consider adding a prominent comment so that the issue will be on the minds of people looking at this code. ---------- nosy: +rhettinger status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Mon Sep 20 03:14:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:14:49 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632122089.3.0.625267879113.issue39778@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 03:16:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:16:19 +0000 Subject: [issue45128] test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging In-Reply-To: <1631025233.12.0.173850188755.issue45128@roundup.psfhosted.org> Message-ID: <1632122179.69.0.792672361149.issue45128@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This bug was interesting (funny) :-) Thanks for the fix Nikita Sobolev :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45128> _______________________________________ From report at bugs.python.org Mon Sep 20 03:18:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:18:12 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632122292.36.0.334175297804.issue1170@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This issue has been fixed in Python 3 by using Unicode rather than bytes in shlex. Python 2 users: it's time to upgrade to Python 3 ;-) ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Mon Sep 20 03:22:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 07:22:26 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632122546.84.0.68698495652.issue24076@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > OTOH on my Mac I still find that 3.10 with PGO is still > more than twice as slow than 2.7. > Thinking about it that's a bit odd, since (presumably) > the majority of the work in sum() involves a long int result > (even though the values returned by range() all fit in 30 bits, > the sum quickly exceeds that). The actual accumulation of a long int result is still as fast as it ever was. The main difference from Py2.7 isn't the addition, it is that detecting and extracting a small int added has become expensive. -- Python 2 fastpath -------------------------------------- if (PyInt_CheckExact(item)) { // Very cheap long b = PyInt_AS_LONG(item); // Very cheap long x = i_result + b; // Very cheap if ((x^i_result) >= 0 || (x^b) >= 0) { // Semi cheap i_result = x; // Zero cost Py_DECREF(item); // Most expensive step, but still cheap continue; } } -- Python 3 fastpath -------------------------------------- if (PyLong_CheckExact(item) || PyBool_Check(item)) { // Cheap long b = PyLong_AsLongAndOverflow(item, &overflow); // Super Expensive if (overflow == 0 && // Branch predictable test (i_result >= 0 ? (b <= LONG_MAX - i_result) // Slower but better test : (b >= LONG_MIN - i_result))) { i_result += b; // Very cheap Py_DECREF(item); continue; } } -- Supporting function ------------------------------------ long PyLong_AsLongAndOverflow(PyObject *vv, int *overflow) // OMG, this does a lot of work { /* This version by Tim Peters */ PyLongObject *v; unsigned long x, prev; long res; Py_ssize_t i; int sign; int do_decref = 0; /* if PyNumber_Index was called */ *overflow = 0; if (vv == NULL) { PyErr_BadInternalCall(); return -1; } if (PyLong_Check(vv)) { v = (PyLongObject *)vv; } else { v = (PyLongObject *)_PyNumber_Index(vv); if (v == NULL) return -1; do_decref = 1; } res = -1; i = Py_SIZE(v); switch (i) { case -1: res = -(sdigit)v->ob_digit[0]; break; case 0: res = 0; break; case 1: res = v->ob_digit[0]; break; default: sign = 1; x = 0; if (i < 0) { sign = -1; i = -(i); } while (--i >= 0) { prev = x; x = (x << PyLong_SHIFT) | v->ob_digit[i]; if ((x >> PyLong_SHIFT) != prev) { *overflow = sign; goto exit; } } /* Haven't lost any bits, but casting to long requires extra * care (see comment above). */ if (x <= (unsigned long)LONG_MAX) { res = (long)x * sign; } else if (sign < 0 && x == PY_ABS_LONG_MIN) { res = LONG_MIN; } else { *overflow = sign; /* res is already set to -1 */ } } exit: if (do_decref) { Py_DECREF(v); } return res; } ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Mon Sep 20 03:38:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 20 Sep 2021 07:38:12 +0000 Subject: [issue38039] Segfault when pickling dictionary with large pandas dataframes In-Reply-To: <1567702116.93.0.155927302531.issue38039@roundup.psfhosted.org> Message-ID: <1632123492.68.0.559209421436.issue38039@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Also, if it?s only happening with pandas, is it any large pandas frame or only specific ones. Are you able to provide a complete script that builds the frame and pickles the dictionary and which reproduces the crash? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38039> _______________________________________ From report at bugs.python.org Mon Sep 20 03:41:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:41:00 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632123660.32.0.841334998849.issue40413@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26865 status: pending -> open pull_request: https://github.com/python/cpython/pull/28466 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 03:42:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:42:00 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632123720.66.0.541707931042.issue40413@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I'm attempting to perform the following actions multiple times in a single process with CPython 3.8.2: test_embed already has test_repeated_init_and_inittab() test which runs Py_InitializeFromConfig() + Py_RunMain() multiple times. I wrote an even more explicit test in PR 28466. I tested it manually on Python 3.9, 3.10 and 3.11: it works as expected. Python 3.8 no longer accepts bugfixes. I close the issue as outdated. Gregory: if you can still reproduce your issue on a supported Python version, please provide a reproducer. devguide.python.org/#status-of-python-branches ---------- resolution: -> out of date stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file50288/patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 03:42:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 07:42:58 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632123778.12.0.265230668548.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26866 pull_request: https://github.com/python/cpython/pull/28467 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 03:45:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 07:45:08 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632123908.54.0.60020775639.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26867 pull_request: https://github.com/python/cpython/pull/28468 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 03:49:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:49:54 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1632124194.19.0.0565299223844.issue45042@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-45128 (fixed): "test_multiprocessing_fork fails if run sequentially after test_genericalias and test_logging". ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45042> _______________________________________ From report at bugs.python.org Mon Sep 20 03:51:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:51:34 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632124294.01.0.180956418804.issue45200@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I understand what you mean and I sympathize with it, but this is no different to random failures that we get in the other CI. I'm fine with keeping a failing test if it's under our (Python) control. Here, it's a 3rd party issue. I cannot offer my help to fix libasan, but it will take time. I didn't check the error rate of this issue. Usually, I'm not sure why, but I'm the one affected by every single test which fails randomly :-D ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Mon Sep 20 03:54:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:54:09 +0000 Subject: [issue14408] Support ./python -m unittest in test_socket In-Reply-To: <1332735237.61.0.855199980132.issue14408@psf.upfronthosting.co.za> Message-ID: <1632124449.37.0.911541639743.issue14408@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Lib/test/test_socket.py has no more test_main() function, but uses: if __name__ == "__main__": unittest.main() Moreover, "./python -m unittest Lib/test/test_socket.py -v" works as expected. I close the issue. ---------- dependencies: -Fix test discovery for test_concurrent_futures.py resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Some tests in test_socket are not run _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue14408> _______________________________________ From report at bugs.python.org Mon Sep 20 03:56:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:56:00 +0000 Subject: [issue45187] Some tests in test_socket are not run In-Reply-To: <1631565285.06.0.0779555231158.issue45187@roundup.psfhosted.org> Message-ID: <1632124560.4.0.100336507249.issue45187@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > bpo-45187: Collect test_socket tests using unittest (GH-28317) Nice enhancement! Thanks. > self.addCleanup(thread.join, self.timeout) I suggest to use test.support.threading_helper.join_thread() to avoid blocking if the thread raises an exception or never completes. The function has a timeout with a reasonable default value (adapted per buildbot). ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45187> _______________________________________ From report at bugs.python.org Mon Sep 20 03:57:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 07:57:57 +0000 Subject: [issue21627] Concurrently closing files and iterating over the open files directory is not well specified In-Reply-To: <1401643353.39.0.53304722389.issue21627@psf.upfronthosting.co.za> Message-ID: <1632124677.56.0.353992510634.issue21627@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Dan Snider: "On Android, if os.close_range closes the file descriptor of the scandir iterator, the interpreter immediately crashes" I don't see anything wrong with Python. It's not different than calling os.close(3). If it hurts, don't do that :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21627> _______________________________________ From report at bugs.python.org Mon Sep 20 04:06:52 2021 From: report at bugs.python.org (Dimitri Papadopoulos Orfanos) Date: Mon, 20 Sep 2021 08:06:52 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < Message-ID: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> New submission from Dimitri Papadopoulos Orfanos <dimitri.papadopoulos at cea.fr>: The documentation of sorted() lacks any reference to the comparison mechanism between items. Compare with the documentation of list.sort(), which starts with: using only < comparisons between items This is mentioned in the "Sorting HOW TO", under "Odd and Ends": The sort routines are guaranteed to use __lt__() when making comparisons between two objects. However, the "Sorting HOW TO" is "a brief sorting tutorial", not the reference documentation. This property needs to be documented in the reference documentation of sorted(). ---------- assignee: docs at python components: Documentation messages: 402209 nosy: DimitriPapadopoulosOrfanos, docs at python priority: normal severity: normal status: open title: the sorted() documentation should refer to operator < versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Mon Sep 20 04:10:59 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 20 Sep 2021 08:10:59 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632125459.86.0.588777222679.issue24076@roundup.psfhosted.org> Change by Stefan Behnel <stefan_ml at behnel.de>: ---------- pull_requests: +26868 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28469 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Mon Sep 20 04:13:17 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 20 Sep 2021 08:13:17 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632125597.86.0.452727434661.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: I created a PR from my last patch, inlining the unpacking of single digit integers. Since most integers should fit into a single digit these days, this is as fast a path as it gets. https://github.com/python/cpython/pull/28469 ---------- versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Mon Sep 20 04:20:02 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 20 Sep 2021 08:20:02 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1632126002.55.0.207695221603.issue45027@roundup.psfhosted.org> Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment: > This selectively _disables_ a logger. That isn't the same thing as selectively _enabling_ only the loggers you want to enable. Your earlier comment referred to getting unwanted messages from third-party loggers. Suppressing the messages implies disabling them in some way. > That's fair enough, but why make people do the above (which is somewhat unintuitive) That's your opinion, but it doesn't seem that this view is widespread. We provide basicConfig() for simple configuration and dictConfig() for more elaborate requirements; dictConfig() was reviewed by Python developers in PEP 391 and accepted. > I could also publish this as a separate package on PyPI By all means, do that. As I've already said, I've no wish to add yet another way of configuring logging. If your PyPI package gains wide adoption, we can always revisit this. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45027> _______________________________________ From report at bugs.python.org Mon Sep 20 04:29:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 08:29:22 +0000 Subject: [issue21627] Concurrently closing files and iterating over the open files directory is not well specified In-Reply-To: <1401643353.39.0.53304722389.issue21627@psf.upfronthosting.co.za> Message-ID: <1632126562.8.0.29165971551.issue21627@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I close the issue as "not a bug". If you disagree, please comment the issue :-) Steven Stewart-Gallus: > In the code FD_DIR is "/proc/self/fd" on Linux. I'm not sure this code > is correct. This seems as if it would have the same problems as > iterating over a list and modifying it at the same time. I don't understand the initial issue. What makes you think that the current code is not reliable? Python is using this code for years, and so far, nobody reported any crash on this code. You didn't report a crash, you only wrote that you suspect that there is a bug. Can you prove that the current Python code is wrong? Did you look at the implementation of readdir() in the Linux glibc for example? About close() vs marking file descriptor non inheritable, I'm not convinced that marking file descriptors is faster or more reliable. On many operating systems, _Py_set_inheritable() requires 2 syscalls (get flags, set flags), whereas close() is a single syscall: calling close() is faster. --- Python now has a _Py_closerange() function which supports: * Linux closerange() syscall, calling the glibc closerange() function * FreeBSD closefrom() function * Solaris fdwalk() function On Linux, _posixsubprocess still iterates /proc/self/pid/ if this directory can be opened, even if the closerange() function is available. I'm not sure which option is the safest or the fastest. By the way, Steven Stewart-Gallus did mention his operating system. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21627> _______________________________________ From report at bugs.python.org Mon Sep 20 04:30:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 08:30:06 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632126606.57.0.274743707549.issue40413@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 5e2c32e08ed77081cabd9d51f0589f81c1572732 by Victor Stinner in branch 'main': bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466) https://github.com/python/cpython/commit/5e2c32e08ed77081cabd9d51f0589f81c1572732 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 04:30:15 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 08:30:15 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632126615.41.0.375747906605.issue40413@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26869 pull_request: https://github.com/python/cpython/pull/28470 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 04:30:22 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 08:30:22 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632126622.35.0.18422030118.issue40413@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26870 pull_request: https://github.com/python/cpython/pull/28471 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 04:37:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 08:37:04 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632127024.7.0.848314081279.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset a856364cc920d8b16750fd1fadc902efb509754c by Serhiy Storchaka in branch 'main': bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468) https://github.com/python/cpython/commit/a856364cc920d8b16750fd1fadc902efb509754c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 04:40:40 2021 From: report at bugs.python.org (Dimitri Papadopoulos Orfanos) Date: Mon, 20 Sep 2021 08:40:40 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632127240.86.0.571491144581.issue45246@roundup.psfhosted.org> Change by Dimitri Papadopoulos Orfanos <dimitri.papadopoulos at cea.fr>: ---------- keywords: +patch pull_requests: +26871 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28472 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Mon Sep 20 04:48:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 08:48:05 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632127685.36.0.779168460765.issue40413@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 3d16fc90ce36acaa846ee88bdd124f84d49395b3 by Miss Islington (bot) in branch '3.10': bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466) https://github.com/python/cpython/commit/3d16fc90ce36acaa846ee88bdd124f84d49395b3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 05:03:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 09:03:42 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632128622.34.0.880192364518.issue43760@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > A Cython issue report: https://github.com/cython/cython/issues/4153 Cython 0.29.24 released at July 13, 2021 with a fix (2 commits): * https://github.com/cython/cython/commit/be3b178296975b976107f41a6383291701e0297f * https://github.com/cython/cython/commit/8d177f4aa51a663e8c51de3210ccb329d7629d36 The Cython master branch was fixed as well: see https://github.com/cython/cython/issues/4153 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 05:22:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 20 Sep 2021 09:22:33 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632129753.62.0.0898431045766.issue43760@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- nosy: +erlendaasland _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 06:12:03 2021 From: report at bugs.python.org (neonene) Date: Mon, 20 Sep 2021 10:12:03 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632132723.78.0.903840968645.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: >release with the performance regression I'm OK with the option. The limitation of PGO seems to me a bit weird and it might be unexpected for MSVC team. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 06:33:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 10:33:17 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632133997.49.0.339501735052.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: PyThread_exit_thread() is exposed as _thread.exit() and _thread.exit_thread(). PyThread_exit_thread() is only called in take_gil() (at 3 places in the function) if tstate_must_exit(tstate) is true. It happens in two cases: * (by design) at Python exit if a daemon thread tries to "take the GIL": PyThread_exit_thread() is called. * (under an user action) at Python exit if threading._shutdown() is interrupted by CTRL+C: Python (regular) threads will continue to run while Py_Finalize() is running. In this case, when a (regular) thread tries to "take the GIL", PyThread_exit_thread() is called. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Mon Sep 20 06:40:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 10:40:41 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632134441.24.0.570889614728.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I don't think that there is a "good default behavior" where Python currently calls PyThread_exit_thread(). IMO we should take the problem from the other side and tries to reduce cases when Python can reach this case. Or even make it impossible if possible. For example, *removing* daemon threads would remove the most common case when Python has to call PyThread_exit_thread(). I'm not sure how to make this case less likely when threading._shutdown() is interrupted by CTRL+C. This function can likely hang if a thread is stuck for whatever reason. It's important than an user is able to "interrupt" or kill a stuck process with CTRL+C (SIGINT). It's a common expectation on Unix, at least for me. Maybe threading._shutdown() should be less nice and call os._exit() in this case: exit *immediately* the process in this case. Or Python should restore the default SIGINT handler: on Unix, the default SIGINT handler immediately terminate the process (like os._exit() does). I don't think that abort() should be called here (raise SIGABRT signal), since the intent of an user pressing CTRL+C is to silently terminate the process. It's not an application bug, but an user action. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Mon Sep 20 06:42:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 10:42:36 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632134556.32.0.394864173211.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-13077 "Windows: Unclear behavior of daemon threads on main thread exit". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Mon Sep 20 06:44:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 10:44:55 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632134695.85.0.390564929747.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I'm thinking that edit to tp_dealloc was incorrect. What edit are you referring to? PR 18749 only touches tp_clear and tp_traverse, not tp_dealloc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 06:45:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 10:45:38 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632134738.78.0.708924793067.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Also, the ordered dict dealloc is already doing that: https://github.com/python/cpython/blob/a856364cc920d8b16750fd1fadc902efb509754c/Objects/odictobject.c#L1372-L1373 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 06:48:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 10:48:43 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632134923.89.0.0162164543487.issue45200@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I didn't check the error rate of this issue. Usually, I'm not sure why, but I'm the one affected by every single test which fails randomly :-D If you wish, as a compromise we can ignore multiprocessing tests on ASAN build for now and leave them for the buildbots. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Mon Sep 20 06:59:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 20 Sep 2021 10:59:47 +0000 Subject: [issue45247] Add explicit support for Cython to the C API. Message-ID: <1632135587.14.0.29634943523.issue45247@roundup.psfhosted.org> New submission from Mark Shannon <mark at hotpy.org>: As the C API has evolved it has grown features in an ad-hoc way, driven by the needs to whoever has bothered to add the code. Maybe we should be a bit more principled about this. Specifically we should make sure that there is a well defined interface between CPython and the other major components of the Python ecosystem. The obvious places to start are with Cython and Numpy. This issue deals specifically with Cython. I will leave it to someone who know more about Numpy to open an issue for Numpy. Matching Cython issue: https://github.com/cython/cython/issues/4382 This issue is an attempt to stop the annual occurrence of bugs like https://bugs.python.org/issue43760#msg393401 ---------- components: C API messages: 402224 nosy: Mark.Shannon, scoder priority: normal severity: normal status: open title: Add explicit support for Cython to the C API. type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45247> _______________________________________ From report at bugs.python.org Mon Sep 20 07:05:13 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 20 Sep 2021 11:05:13 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632135913.67.0.794411522749.issue43760@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: IMO those failures are bugs in the projects listed not in CPython. Relying on the exact meaning, or even the existence of an undocumented field of a C struct is not, nor ever has been, safe. The user of the field is assuming a meaning that is not known to the developers of the library/application, so there is no way for them to preserve that meaning. This is not specific to CPython, but applies to any C API. The code in the examples given above are using `tstate->use_tracing` assuming that its meaning is to determine whether tracing is turned on or not. However, it has no such meaning. It is an internal performance optimization to avoid checking both `tstate->c_tracefunc` and `tstate->c_profilefunc`. It is `tstate->tracing` that determines whether tracing is active or not. I propose adding back `tstate->use_tracing` as a copy of `tstate->cframe->us_tracing`. Any writes to `tstate->use_tracing` will be ignored, but any code that also sets `tstate->tracing`, as the Cython code does, will work correctly. Any code that reads `tstate->use_tracing` will work correctly. I'm minded to prefix all the names of all fields in all C structs that happen to be included by Python.h with "if_you_use_this_then_we_will_break_your_code_in_some_way_that_will_ruin_your_reputation_as_a_library_developer__maybe_not_tomorrow_maybe_not_next_year_but_someday" Although that might prove tricky with a 80 character line limit :) My attempts to avoid this happening again next year, and the year after that, and... https://bugs.python.org/issue45247 https://github.com/cython/cython/issues/4382 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 07:53:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 20 Sep 2021 11:53:48 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632138828.04.0.488725288799.issue43760@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- pull_requests: +26872 pull_request: https://github.com/python/cpython/pull/28474 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 07:57:42 2021 From: report at bugs.python.org (4-launchpad-kalvdans-no-ip-org) Date: Mon, 20 Sep 2021 11:57:42 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1632139062.06.0.620897980073.issue45155@roundup.psfhosted.org> Change by 4-launchpad-kalvdans-no-ip-org <launchpad at kalvdans.no-ip.org>: ---------- nosy: +4-launchpad-kalvdans-no-ip-org _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 20 08:10:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 20 Sep 2021 12:10:34 +0000 Subject: [issue39747] test_os debug assertion failure In-Reply-To: <1582608989.67.0.495966477974.issue39747@roundup.psfhosted.org> Message-ID: <1632139834.61.0.815657506156.issue39747@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: If I understand Steve's comment it sounds like there's nothing we can do here. Shall we close it as not a bug? ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39747> _______________________________________ From report at bugs.python.org Mon Sep 20 08:13:48 2021 From: report at bugs.python.org (Xtrem532) Date: Mon, 20 Sep 2021 12:13:48 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632140028.21.0.507903924768.issue43760@roundup.psfhosted.org> Change by Xtrem532 <Xtrem532.tg at gmail.com>: ---------- nosy: +Xtrem532 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 08:27:27 2021 From: report at bugs.python.org (Ciaran Welsh) Date: Mon, 20 Sep 2021 12:27:27 +0000 Subject: [issue45248] Documentation example in copyreg errors Message-ID: <1632140847.01.0.509914617617.issue45248@roundup.psfhosted.org> New submission from Ciaran Welsh <ciaranwelsh00137 at gmail.com>: The example on https://docs.python.org/3/library/copyreg.html does not work: ``` import copyreg, copy, pickle class C: def __init__(self, a): self.a = a def pickle_c(c): print("pickling a C instance...") return C, (c.a,) copyreg.pickle(C, pickle_c) c = C(1) d = copy.copy(c) > p = pickle.dumps(c) E AttributeError: Can't pickle local object 'RoadRunnerPickleTests.test_ex.<locals>.C' picklable_swig_tests.py:133: AttributeError ``` ---------- assignee: docs at python components: Documentation messages: 402227 nosy: CiaranWelsh, docs at python priority: normal severity: normal status: open title: Documentation example in copyreg errors type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45248> _______________________________________ From report at bugs.python.org Mon Sep 20 08:31:52 2021 From: report at bugs.python.org (Ciaran Welsh) Date: Mon, 20 Sep 2021 12:31:52 +0000 Subject: [issue45248] Documentation example in copyreg errors In-Reply-To: <1632140847.01.0.509914617617.issue45248@roundup.psfhosted.org> Message-ID: <1632141112.3.0.681915308772.issue45248@roundup.psfhosted.org> Change by Ciaran Welsh <ciaranwelsh00137 at gmail.com>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45248> _______________________________________ From report at bugs.python.org Mon Sep 20 09:00:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 20 Sep 2021 13:00:34 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632142834.01.0.606016283154.issue45229@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Thank you for doing this. When I started setting up the IDLE test suite 8 years ago, I was a bit confused about the mixture of old ways (test_main) and new ways (unittest.main and possibly load_tests) in the test suite. Fortunately, Nick C. told me which was which. Updating the test suite should make it better as an example for new unittest users. ---------- nosy: +terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 09:16:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 20 Sep 2021 13:16:46 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632143806.84.0.160763945792.issue45116@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- pull_requests: +26873 pull_request: https://github.com/python/cpython/pull/28475 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 09:26:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 20 Sep 2021 13:26:32 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632144392.66.0.419502439039.issue45116@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: If we are hitting a size limit for PGO, then we need to reduce the size of _PyEval_EvalFrameDefault, to let the compiler do its job. Force inlining stuff is not going to help. Reverting https://github.com/python/cpython/pull/25244 for 3.10 seems to be the cleanest way to do this. Would someone with a reliable way to test performance on Windows test the effect of https://github.com/python/cpython/pull/28475, please? Longer term we need get PGO in MSVC working on larger functions, but I doubt that will be possible for 3.10. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 09:28:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 13:28:50 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632144530.58.0.548952868201.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Can someone repeat the benchmarks with https://github.com/python/cpython/pull/28475 ? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 09:29:25 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 20 Sep 2021 13:29:25 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632144565.2.0.405665562808.issue43760@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: > The code in the examples given above are using `tstate->use_tracing` assuming that its meaning is to determine whether tracing is turned on or not. No, actually not. It is using the field in the same way as CPython, simply because most of this code was originally copied from CPython, and we also copied the optimisation of avoiding to check the other fields (for the obvious reason of being an optimisation). > I propose adding back `tstate->use_tracing` as a copy of `tstate->cframe->us_tracing`. Cython 0.29.24 has already been adapted to this change and will use the new field in CPython 3.10b1+. > Any code that reads `tstate->use_tracing` will work correctly. Any code that reads and /writes/ the field would probably also continue to work correctly, which is what older Cython versions did. > if_you_use_this_then_we_will_break_your_code_in_some_way_that_will_ruin_your_reputation_as_a_library_developer? The thing is, new APIs can only be added to new CPython releases. Supporting features in older CPython versions (currently 2.7+) means that we always *have to* use the existing fields, and can only switch to new APIs by duplicating code based on a PY_VERSION_HEX preprocessor check. Even if a new low-latency profiling API was added in CPython 3.11, we'd have to wait until there is at least an alpha release that has it before enabling this code switch. And if the new API proves to be slower, we may end up keeping the old code around and adding a C compile-time configuration option for users to enable (or disable) its use. Cython has lots of those these days, mostly to support the different C-API capabilities of different Python implementations, e.g. to take advantage of the PyLong or PyUnicode internals if available, and use generic C-API calls if not. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 10:11:16 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Sep 2021 14:11:16 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1632120956.08.0.933187292009.issue45213@roundup.psfhosted.org> Message-ID: <CALFfu7B_bF_UHdaeA_hBn5kd3XsU5PodSYknfNuR-RaNA-bA5A@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Mon, Sep 20, 2021 at 12:55 AM Raymond Hettinger <report at bugs.python.org> wrote: > If you close this out, consider adding a prominent comment so that the issue will be on the minds of people looking at this code. Good idea! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Mon Sep 20 10:33:22 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 20 Sep 2021 14:33:22 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632148402.85.0.926458649126.issue45055@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset ef9e22b253253615098d22cb49141a2a1024ee3c by Steve Dower in branch 'main': bpo-45055: Add retry when downloading externals on Windows (GH-28399) https://github.com/python/cpython/commit/ef9e22b253253615098d22cb49141a2a1024ee3c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 10:33:13 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 14:33:13 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632148393.76.0.839303128492.issue45055@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26874 pull_request: https://github.com/python/cpython/pull/28476 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 10:33:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 14:33:18 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632148398.6.0.66214842673.issue45055@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26875 pull_request: https://github.com/python/cpython/pull/28477 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 10:36:31 2021 From: report at bugs.python.org (John Ehresman) Date: Mon, 20 Sep 2021 14:36:31 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632148591.55.0.376916614771.issue43760@roundup.psfhosted.org> John Ehresman <jpe at wingware.com> added the comment: Is adding the field back an option at this point? It would mean that extensions compiled against the release candidates may not be binary compatible with the final release My take is that use_tracing is an implementation and version dependent field, and that binary compatibility will be maintained for a specific release (e.g. 3.10) but that there's no assurance that it will be there in the next release -- though these things tend not to change. I also regard generated cython code as only being valid for the releases that a specific cython version supports. Code and API's change slowly, but eventually they do change. ---------- nosy: +jpe _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 10:38:01 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 20 Sep 2021 14:38:01 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632148681.28.0.674555432747.issue43760@roundup.psfhosted.org> Miro Hron?ok <miro at hroncok.cz> added the comment: > It would mean that extensions compiled against the release candidates may not be binary compatible with the final release If that's true, I definitively argue not to do that. We've told everybody it won't happen. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 10:42:51 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Sep 2021 14:42:51 +0000 Subject: [issue34093] Reproducible pyc: FLAG_REF is not stable. In-Reply-To: <1531305608.98.0.56676864532.issue34093@psf.upfronthosting.co.za> Message-ID: <1632148971.62.0.773241858277.issue34093@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: It turns out that I don't need this after all (once I merged gh-28392 and bpo-45188 was resolved). That impacts how much time I have to spend on this, so I might not be able to pursue this further. That said, I think it is worth doing and the PR I have up mostly does everything we need here. So I'll see if I can follow this through. :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34093> _______________________________________ From report at bugs.python.org Mon Sep 20 10:58:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 14:58:38 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632149918.03.0.963659200374.issue45055@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset ee41d01326ddf48c411c019a4e63343668ebd829 by Miss Islington (bot) in branch '3.10': bpo-45055: Add retry when downloading externals on Windows (GH-28399) https://github.com/python/cpython/commit/ee41d01326ddf48c411c019a4e63343668ebd829 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 10:59:19 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 14:59:19 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632149959.57.0.79346068696.issue45055@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 50c0551f97f86bbf9f659e1bbe78a14df7754cbe by Miss Islington (bot) in branch '3.9': bpo-45055: Add retry when downloading externals on Windows (GH-28399) https://github.com/python/cpython/commit/50c0551f97f86bbf9f659e1bbe78a14df7754cbe ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 11:09:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:09:14 +0000 Subject: [issue40497] subprocess.check_output() accept the check keyword argument In-Reply-To: <1588586088.87.0.880898235091.issue40497@roundup.psfhosted.org> Message-ID: <1632150554.22.0.716970437508.issue40497@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 4d2957c1b9a915f76da418e89bf9b5add141ca3e by R?mi Lapeyre in branch 'main': bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897) https://github.com/python/cpython/commit/4d2957c1b9a915f76da418e89bf9b5add141ca3e ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40497> _______________________________________ From report at bugs.python.org Mon Sep 20 11:09:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:09:53 +0000 Subject: [issue40497] subprocess.check_output() accept the check keyword argument In-Reply-To: <1588586088.87.0.880898235091.issue40497@roundup.psfhosted.org> Message-ID: <1632150593.17.0.548860350386.issue40497@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Fixed with GH-19897 for Python 3.11. Thanks! ? ? ? ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40497> _______________________________________ From report at bugs.python.org Mon Sep 20 11:10:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:10:37 +0000 Subject: [issue1514420] Traceback display code can attempt to open a file named "<stdin>" Message-ID: <1632150637.4.0.852932468352.issue1514420@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f71300cb0442f16ee9abc938e12537aec1eb5979 by Irit Katriel in branch 'main': bpo-1514420: Do not attempt to open files with names in <>s when formatting an exception (GH-28143) https://github.com/python/cpython/commit/f71300cb0442f16ee9abc938e12537aec1eb5979 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1514420> _______________________________________ From report at bugs.python.org Mon Sep 20 11:11:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:11:21 +0000 Subject: [issue1514420] Traceback display code can attempt to open a file named "<stdin>" Message-ID: <1632150681.94.0.548937319206.issue1514420@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Fixed for Python 3.11. Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1514420> _______________________________________ From report at bugs.python.org Mon Sep 20 11:14:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:14:21 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1632150861.15.0.567973720925.issue45055@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Looks like we can lose this with fixes merged for 3.9 - 3.11. ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45055> _______________________________________ From report at bugs.python.org Mon Sep 20 11:21:12 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Sep 2021 15:21:12 +0000 Subject: [issue34093] Reproducible pyc: FLAG_REF is not stable. In-Reply-To: <1531305608.98.0.56676864532.issue34093@psf.upfronthosting.co.za> Message-ID: <1632151272.26.0.37855142602.issue34093@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: FWIW, I found a faster solution than calling `w_object()` twice. Currently the logic for w_ref() (used for each "complex" object) looks like this: * if ob_ref == 1 * do not apply FLAG_REF * marshal normally * else if seen for the first time * apply FLAG_REF * marshal normally * otherwise * emit TYPE_REF * emit the ref index of the first instance The faster solution looks like this: * if seen for the first time * do not apply FLAG_REF * marshal normally * record the index of the type byte in the output stream * else if seen for a second time * apply FLAG_REF to the byte at the earlier-recorded position * emit TYPE_REF * emit the ref index of the first instance * otherwise * emit TYPE_REF * emit the ref index of the first instance While this is faster, there are two downsides: extra memory usage and it isn't practical when writing to a file. However, I don't think either is a significant problem. For the former, it can be mostly mitigated by using the negative values in WFILE.hashtable to store the type byte position. For the latter, "marshal.dump()" is already a light wrapper around "marshal.dump()" and for PyMarshal_WriteObjectToFile() we simply stick with the current unstable approach (or change it to do what "marshal.dump()" does). FYI, I mostly have that implemented in a branch, but am not sure when I'll get back to it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34093> _______________________________________ From report at bugs.python.org Mon Sep 20 11:21:48 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 15:21:48 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632151308.0.0.77171036939.issue45229@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26877 pull_request: https://github.com/python/cpython/pull/28479 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 11:21:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 15:21:41 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632151301.24.0.00867551949017.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset e6ba992288fdbe71aa808cfb6955f6f99da7e349 by Serhiy Storchaka in branch 'main': bpo-45229: Make pickle tests discoverable (GH-28467) https://github.com/python/cpython/commit/e6ba992288fdbe71aa808cfb6955f6f99da7e349 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 11:21:42 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 15:21:42 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632151302.92.0.461794639032.issue45229@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26876 pull_request: https://github.com/python/cpython/pull/28478 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 11:33:49 2021 From: report at bugs.python.org (Alex Waygood) Date: Mon, 20 Sep 2021 15:33:49 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1632152029.57.0.995846070749.issue35712@roundup.psfhosted.org> Alex Waygood <Alex.Waygood at Gmail.com> added the comment: The following code now leads to a `DeprecationWarning`, but I am unclear why it should. ``` >>> from enum import Enum >>> >>> class CardColour(Enum): ... """Enumeration of the two colours in a pack of cards.""" ... ... BLACK = 'black' ... RED = 'red' ... ... def other_colour(self): ... """Given one colour, get the other one.""" ... return next(filter(self.__ne__, CardColour)) ... >>> CardColour.BLACK.other_colour() <input>:5: DeprecationWarning: NotImplemented should not be used in a boolean context <CardColour.RED: 'red'> ``` If I change the last line of `other_colour` to either `return next(colour for colour in CardColour if colour != self)` or `return next(colour for colour in CardColour if colour is not self)`, the warning goes away. Is this intended behaviour? ---------- nosy: +AlexWaygood _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ From report at bugs.python.org Mon Sep 20 11:41:23 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 20 Sep 2021 15:41:23 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632152483.14.0.592149680084.issue40503@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: That looks like a relocatable path anyway, which means you wouldn't want to compile it into the binary. Your patch to select a default value at runtime is probably better. The compile-time option is meant for a system directory. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Mon Sep 20 11:48:46 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 20 Sep 2021 15:48:46 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1632152926.74.0.597927791803.issue35712@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: Please see the message https://bugs.python.org/issue35712#msg349303. Filtering with those dunder sesqui-dispatch methods really is a bug magnet. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ From report at bugs.python.org Mon Sep 20 11:51:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 15:51:40 +0000 Subject: [issue40413] Py_RunMain() crashes on subsequence call In-Reply-To: <1588038871.72.0.754759187006.issue40413@roundup.psfhosted.org> Message-ID: <1632153100.75.0.515643617806.issue40413@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 29e431419a0c23340099a9cd8cf23ec9c7788879 by Miss Islington (bot) in branch '3.9': bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466) (GH-28471) https://github.com/python/cpython/commit/29e431419a0c23340099a9cd8cf23ec9c7788879 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40413> _______________________________________ From report at bugs.python.org Mon Sep 20 11:57:12 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 20 Sep 2021 15:57:12 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1632153432.33.0.757547425762.issue45176@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I'd guess that these tests are assuming that sys.executable contains only ASCII characters. All the tests run in a non-ASCII working directory, so it's only the runtime that is not tested propersy here. The easiest way for Ming Hua to test this is to install for all users (into Program Files), and run tests with the same user account. If that's the case, we probably have to just go through the tests and make them Unicode-aware. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Mon Sep 20 11:58:21 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 20 Sep 2021 15:58:21 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1632153501.29.0.461727946579.issue44848@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: New changeset 5846c9b71ee9277fe866b1bdee4cc6702323fe7e by Erlend Egeberg Aasland in branch 'main': bpo-44848: Update Windows installer to use SQLite 3.36.0 (GH-27622) https://github.com/python/cpython/commit/5846c9b71ee9277fe866b1bdee4cc6702323fe7e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44848> _______________________________________ From report at bugs.python.org Mon Sep 20 11:59:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 20 Sep 2021 15:59:22 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1632153562.45.0.812385576422.issue44848@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44848> _______________________________________ From report at bugs.python.org Mon Sep 20 12:01:43 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 20 Sep 2021 16:01:43 +0000 Subject: [issue45237] Python subprocess not honoring append mode for stdout on Windows In-Reply-To: <1631913103.36.0.277836027655.issue45237@roundup.psfhosted.org> Message-ID: <1632153703.23.0.106041200792.issue45237@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > This change has been discussed, but I don't know whether or not it's just a pipe dream Still a bit of a pipe dream, but I'll add this issue as something that would be fixed by it (to stack up against the list of things that would be broken...) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45237> _______________________________________ From report at bugs.python.org Mon Sep 20 12:10:45 2021 From: report at bugs.python.org (Alex Waygood) Date: Mon, 20 Sep 2021 16:10:45 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1632154245.37.0.712235461518.issue35712@roundup.psfhosted.org> Alex Waygood <Alex.Waygood at Gmail.com> added the comment: Thanks, Vedran. I read https://bugs.python.org/issue35712#msg349303 before adding my message, but am not quite clear why my snippet is the same situation. `next(filter((2).__eq__, 'text'))` surely returns 't' because `(2).__eq__('t')` returns `NotImplemented`, and `NotImplemented` is truthy. (Apologies if my understanding is wrong here.) I'm unclear, however, why `x.__ne__(y)` should ever return `NotImplemented` (or even have the possibility of returning `NotImplemented`) if it is known that both `x` and `y` are members of the same `Enum`. The documentation for `Enum`s clearly states that equality comparisons between members of the same enum are defined (https://docs.python.org/3/library/enum.html#comparisons). If the argument is "filter should never be used with a predicate that could return `NotImplemented` in some situations", then I think that could usefully be added to the documentation for `filter`. Moreover, if that is the argument, then I don't understand why the following does not raise a DeprecationWarning: ``` >>> next(filter((2).__eq__, (2, 3, 4))) 2 ``` Again, apologies if I'm missing something here. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ From report at bugs.python.org Mon Sep 20 12:19:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 16:19:53 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632154793.06.0.717265304872.issue45229@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 74c6acc76fa00f1b80e96c8d4608ba1487387949 by Miss Islington (bot) in branch '3.10': bpo-45229: Make pickle tests discoverable (GH-28467) (GH-28478) https://github.com/python/cpython/commit/74c6acc76fa00f1b80e96c8d4608ba1487387949 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 12:19:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 16:19:53 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632154793.15.0.548674471763.issue45229@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 04dea46dde25d58f242171181805f0e71a042963 by Miss Islington (bot) in branch '3.9': bpo-45229: Make pickle tests discoverable (GH-28467) (GH-28479) https://github.com/python/cpython/commit/04dea46dde25d58f242171181805f0e71a042963 ---------- nosy: +lukasz.langa, lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 12:19:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Sep 2021 16:19:53 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632154793.06.0.717265304872.issue45229@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 74c6acc76fa00f1b80e96c8d4608ba1487387949 by Miss Islington (bot) in branch '3.10': bpo-45229: Make pickle tests discoverable (GH-28467) (GH-28478) https://github.com/python/cpython/commit/74c6acc76fa00f1b80e96c8d4608ba1487387949 ---------- nosy: +lukasz.langa, lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Mon Sep 20 12:24:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Sep 2021 16:24:36 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1632155076.97.0.484059741187.issue35712@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Interesting, it is because object().__eq__(object()) returns NotImplemented instead of False. object.__eq__ could return False if arguments have same type (or in some other cases). I think it would not break anything, and it would fix your case. But I am not sure that it is worth to change this. Using bound methods __eq__ and __ne__ is an antipattern, and we should not encourage this, even if it is safe as in your case. If you want to discuss this more, it is better to do this on a mailing-list or Discuss. Your code can be rewritten as: def other_colour(self): for other in CardColour: if self != other: return other assert False, "not reachable" ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ From report at bugs.python.org Mon Sep 20 12:30:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 20 Sep 2021 16:30:58 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests Message-ID: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> New submission from Andrei Kulakov <andrei.avk at gmail.com>: It seems like fine grained error locations do not work in failed doctest traceback output: version 3.11.0a0 file contents: ------------------ def a(x): """ >>> 1 1 1 """ import doctest doctest.testmod() OUTPUT ------- Failed example: 1 1 Exception raised: Traceback (most recent call last): File "/Users/ak/opensource/cpython/Lib/doctest.py", line 1348, in __run exec(compile(example.source, filename, "single", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<doctest __main__.a[0]>", line 1 1 1 ^ SyntaxError: invalid syntax. Perhaps you forgot a comma? The location in doctests that causes this: https://github.com/python/cpython/blob/5846c9b71ee9277fe866b1bdee4cc6702323fe7e/Lib/doctest.py#L1348 ---------- components: Interpreter Core, Tests messages: 402257 nosy: andrei.avk, kj, pablogsal priority: low severity: normal status: open title: Fine grained error locations do not work in doctests type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 12:34:13 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 20 Sep 2021 16:34:13 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632155653.98.0.769239812024.issue45249@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I've ran into this when looking at doctest docs, the issue is that they use the old example where a single column is highlighted, I want to update it to explain why doctest output differs from the one you get from REPL, but I probably need to understand why it happens to provide a good explanation. Alternatively this may be fixed to be consistent if it's easy enough to do. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 12:34:34 2021 From: report at bugs.python.org (Alex Waygood) Date: Mon, 20 Sep 2021 16:34:34 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1632155674.79.0.305299214362.issue35712@roundup.psfhosted.org> Alex Waygood <Alex.Waygood at Gmail.com> added the comment: Thanks, Serhiy, that makes sense. I'll consider raising this elsewhere, as you suggest. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ From report at bugs.python.org Mon Sep 20 12:39:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 16:39:48 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632155988.76.0.427126390138.issue45249@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Hummmm, could you explain a bit more in detail what is the expected output? I can see highlighting in the exec call that you pasted: exec(compile(example.source, filename, "single", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The fact that you see those "^^^^^^" indicate that is working no? What is missing? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 13:25:24 2021 From: report at bugs.python.org (Thomas) Date: Mon, 20 Sep 2021 17:25:24 +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: <1632158724.7.0.0122964712573.issue34451@roundup.psfhosted.org> Thomas <thmsdnnr at gmail.com> added the comment: I added a pull request to attempt to fix this issue. It received a label but no review and has gone stale, so I am sending out a ping. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34451> _______________________________________ From report at bugs.python.org Mon Sep 20 13:47:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 17:47:39 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1632160059.2.0.787854356456.issue45155@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- pull_requests: +26879 pull_request: https://github.com/python/cpython/pull/28465 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 20 14:01:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 20 Sep 2021 18:01:35 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632155988.76.0.427126390138.issue45249@roundup.psfhosted.org> Message-ID: <CAFW+Oq5X=V_iO5gkSs3WUMTPHYghAPoM20UV1_sdGO4QrySpyg@mail.gmail.com> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Sorry, I should have noted I?m referring to the line 1 1 Which is underlined by a single caret, but on the command line it has 3 carets as expected. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 14:15:04 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Mon, 20 Sep 2021 18:15:04 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632161704.43.0.183110618536.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: It looks like the `_thread` module does not actually expose `PyThread_exit_thread` --- the similarly named `thread_PyThread_exit_thread` just raises SystemExit. >From a search in the codebase, it appears `PyThread_exit_thread` is currently used only to kill threads when they attempt to acquire the GIL during finalization. Also, if it is changed to no longer kill the thread, it would probably make sense to rename it, e.g. to `PyThread_stop_thread_during_finalization`. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Mon Sep 20 14:22:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 18:22:43 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632162163.05.0.344464023652.issue40503@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Mon Sep 20 14:23:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 18:23:05 +0000 Subject: [issue45155] Add default arguments for int.to_bytes() In-Reply-To: <1631224831.05.0.436611360009.issue45155@roundup.psfhosted.org> Message-ID: <1632162185.75.0.93057000581.issue45155@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 9510e6f3c797b4398aaf58abc1072b9db0a644f9 by Raymond Hettinger in branch 'main': bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465) https://github.com/python/cpython/commit/9510e6f3c797b4398aaf58abc1072b9db0a644f9 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45155> _______________________________________ From report at bugs.python.org Mon Sep 20 14:26:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 18:26:01 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632162361.9.0.526670937963.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > It looks like the `_thread` module does not actually expose `PyThread_exit_thread` --- the similarly named `thread_PyThread_exit_thread` just raises SystemExit. Oh right, I was confused by the function name: "thread_PyThread_exit_thread()". It's a good thing that it's not exposed in Python :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Mon Sep 20 14:30:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 20 Sep 2021 18:30:27 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632162627.0.0.0841900910611.issue45021@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: New changeset 0bfa1106acfcddc03590e1f5d6789dbad3affe70 by nullptr in branch 'main': bpo-45021: Fix a hang in forked children (GH-28007) https://github.com/python/cpython/commit/0bfa1106acfcddc03590e1f5d6789dbad3affe70 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 14:30:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 18:30:29 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632162629.35.0.585386282593.issue45021@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26880 pull_request: https://github.com/python/cpython/pull/28480 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 14:30:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 18:30:33 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632162633.62.0.227619567316.issue45021@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26881 pull_request: https://github.com/python/cpython/pull/28481 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 14:31:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 18:31:13 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632162673.07.0.940775190661.issue45249@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Ah, but that is a different issue. This is not PEP 657, this is a SyntaxError, so is related how those are printed, which I think is separared. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 14:31:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 20 Sep 2021 18:31:53 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632162713.15.0.669344267563.issue45249@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Can you try a doctest that fails on something that is not a SyntaxError. Something like: >>> def foo(x): ... return x + 42 >>> foo(None) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 14:34:44 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 20 Sep 2021 18:34:44 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632162884.08.0.625228855363.issue45021@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: I expect the unittest for this might causes hangs on some platforms in the future as it mixes fork and threads which is a posix-nono. If so, we should just disable it on all but specific known-to-pass build configs as a future PR. 3.9 and 3.10 PRs will automerge. ---------- assignee: -> gregory.p.smith resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 14:45:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 20 Sep 2021 18:45:19 +0000 Subject: [issue45249] Fine grained error locations do not work in doctests In-Reply-To: <1632162713.15.0.669344267563.issue45249@roundup.psfhosted.org> Message-ID: <CAFW+Oq68AVtG9OxvufZqKAQjYM-077oxdBbRSdY7-PZ7AjQ=Lg@mail.gmail.com> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Pablo: that works fine, thanks! I will look into updating the doctest docs, and will close this issue later today ( or you can close it if you like). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 14:52:31 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 18:52:31 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632163951.6.0.922497091086.issue45021@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset d0d83a94314402366e04e7ea2638f809510eb830 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45021: Fix a hang in forked children (GH-28007) (GH-28480) https://github.com/python/cpython/commit/d0d83a94314402366e04e7ea2638f809510eb830 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 14:54:28 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 20 Sep 2021 18:54:28 +0000 Subject: [issue45021] concurrent.futures race condition In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1632164068.79.0.509454127342.issue45021@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset b06c3b364720ce8e8dfb74dfa24434e067ac89ba by Miss Islington (bot) in branch '3.9': [3.9] bpo-45021: Fix a hang in forked children (GH-28007) (GH-28481) https://github.com/python/cpython/commit/b06c3b364720ce8e8dfb74dfa24434e067ac89ba ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45021> _______________________________________ From report at bugs.python.org Mon Sep 20 15:38:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 19:38:45 +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: <1632166725.15.0.0107707772969.issue34451@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: False alarm. I misread the diff. All is well. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34451> _______________________________________ From report at bugs.python.org Mon Sep 20 15:39:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 19:39:06 +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: <1632166746.17.0.080163423102.issue34451@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- Removed message: https://bugs.python.org/msg402274 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34451> _______________________________________ From report at bugs.python.org Mon Sep 20 15:39:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 19:39:31 +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: <1632166771.84.0.791208086583.issue34451@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: fixed -> status: closed -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34451> _______________________________________ From report at bugs.python.org Mon Sep 20 15:40:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 19:40:09 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1632166809.53.0.309872618895.issue39778@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: False alarm. I misread the diff. All is well. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39778> _______________________________________ From report at bugs.python.org Mon Sep 20 15:59:48 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 20 Sep 2021 19:59:48 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632167988.71.0.679085538082.issue43760@roundup.psfhosted.org> Change by Guido van Rossum <guido at python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Mon Sep 20 15:59:28 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 20 Sep 2021 19:59:28 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632167968.32.0.799898567412.issue45116@roundup.psfhosted.org> Change by Guido van Rossum <guido at python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Mon Sep 20 16:03:02 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 20 Sep 2021 20:03:02 +0000 Subject: [issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are Message-ID: <1632168182.73.0.0551762354894.issue45250@roundup.psfhosted.org> New submission from Brett Cannon <brett at python.org>: There's some inaccuracies when it comes to iterable and iterators (async and not). See https://mail.python.org/archives/list/python-dev at python.org/thread/3W7TDX5KNVQVGT5CUHBK33M7VNTP25DZ/#3W7TDX5KNVQVGT5CUHBK33M7VNTP25DZ for background. Should probably check: 1. The glossary. 2. Language reference. 3. Built-ins. This applies to iter()/__iter__/iterable, next()/__next__/iterator, and their async equivalents. ---------- assignee: brett.cannon components: Documentation messages: 402276 nosy: brett.cannon priority: normal severity: normal status: open title: Make sure documentation is accurate for what an (async) iterable and (async) iterator are _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45250> _______________________________________ From report at bugs.python.org Mon Sep 20 16:03:55 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 20 Sep 2021 20:03:55 +0000 Subject: [issue45226] Misleading error message when pathlib.Path.symlink_to() fails with permissions error In-Reply-To: <1631840762.01.0.206152391874.issue45226@roundup.psfhosted.org> Message-ID: <1632168235.34.0.211987634142.issue45226@roundup.psfhosted.org> Barney Gale <barney.gale at gmail.com> added the comment: `os.symlink()` and `pathlib.Path.symlink_to()` have reversed argument orders, but in the repro steps you're supplying arguments in the same order. ---------- nosy: +barneygale _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45226> _______________________________________ From report at bugs.python.org Mon Sep 20 16:37:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 20:37:46 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632170266.18.0.831991737419.issue45246@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: -0 on this. While it is true that __lt__ is used, we don't really want people to exploit that fact. Doing so will get them into trouble elsewhere. For example, max(seq) uses __gt__. Also, when mixing types, a return of NotImplemented will trigger a call to the reflection method. And PEP 8 recommends that all six rich comparison operators be defined to avoid hard-to-find bugs. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger, tim.peters _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Mon Sep 20 17:29:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 21:29:58 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632173398.47.0.380362348288.issue21302@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26882 pull_request: https://github.com/python/cpython/pull/28483 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Mon Sep 20 17:29:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Sep 2021 21:29:45 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632173385.77.0.94985466148.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: wait.py: script to test the time.sleep() function. Press CTRL+C multiple times during the sleep to check that even if the sleep is interrupted, time.sleep() sleeps the expected duration. ---------- Added file: https://bugs.python.org/file50289/wait.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Mon Sep 20 18:27:22 2021 From: report at bugs.python.org (Thomas Caswell) Date: Mon, 20 Sep 2021 22:27:22 +0000 Subject: [issue45251] signal.SIGCLD alias is not available on OSX Message-ID: <1632176842.25.0.412458705067.issue45251@roundup.psfhosted.org> New submission from Thomas Caswell <tcaswell at gmail.com>: The module attribute signal.SIGCLD (https://docs.python.org/3/library/signal.html#signal.SIGCLD) is an "archaic" (quoting from the GNU C Library source) alias for signal.SIGCHLD (https://docs.python.org/3/library/signal.html#signal.SIGCHLD). signal.SIGCHLD is documented as being available on unix, and signal.SIGCLD is documented as an alias of signal.SIGCHLD. However, it seems that clang does not define the SIGCLD back-compatibility name [1] so the SIGCLD alias is missing on OSX (all the way to at least 2.7) because the clang headers appear to not define the SIGCLD macro and hence the logic in modulesignal.c does not find it, and hence the rest of the tooling in signal.py does not find it. I am not sure if the correct fix is to document that SIGCLD in only available on linux (which I am not sure is completely correct, maybe "availability is platform dependent, but definitely not on darwin"?) or to add the macro if SIGCHLD is defined and SIGCLD is missing (see attached patch) [1] SIGCLD is not documented in https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/signal.3.html and not the signal.h that ships with xcode ---------- assignee: docs at python components: Documentation, Library (Lib) files: osx_signal_compat.patch keywords: patch messages: 402280 nosy: docs at python, tcaswell priority: normal severity: normal status: open title: signal.SIGCLD alias is not available on OSX 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/file50290/osx_signal_compat.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45251> _______________________________________ From report at bugs.python.org Mon Sep 20 18:32:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Sep 2021 22:32:13 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632177133.19.0.419908478685.issue24076@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > I created a PR from my last patch, inlining the unpacking > of single digit integers. Thanks, that gets to the heart of the issue. I marked the PR as approved (though there is a small coding nit you may want to fix). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Mon Sep 20 19:17:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 20 Sep 2021 23:17:22 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632179842.26.0.965186902535.issue24076@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: The patch looks fine, but it looks a bit like benchmark chasing. Is the speed of builtin sum() of a sequence of integers important enough to do this bit of inlining? (It may break if we change the internals of Py_Long, as Mark Shannon has been wanting to do for a while -- see https://github.com/faster-cpython/ideas/issues/42.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Mon Sep 20 20:26:04 2021 From: report at bugs.python.org (CireSnave) Date: Tue, 21 Sep 2021 00:26:04 +0000 Subject: [issue45252] Missing support for Source Specific Multicast Message-ID: <1632183964.66.0.836467478723.issue45252@roundup.psfhosted.org> New submission from CireSnave <ciresnave at yahoo.com>: It appears that Python's socket module is missing support for the IGMPv3 socket options needed to support Source Specific Multicast. Many developers appear to be adding the necessary constants through something like: if not hasattr(socket, "IP_UNBLOCK_SOURCE"): setattr(socket, "IP_UNBLOCK_SOURCE", 37) if not hasattr(socket, "IP_BLOCK_SOURCE"): setattr(socket, "IP_BLOCK_SOURCE", 38) if not hasattr(socket, "IP_ADD_SOURCE_MEMBERSHIP"): setattr(socket, "IP_ADD_SOURCE_MEMBERSHIP", 39) if not hasattr(socket, "IP_DROP_SOURCE_MEMBERSHIP"): setattr(socket, "IP_DROP_SOURCE_MEMBERSHIP", 40) ...but it would be nice if these were added to the official module as they are supported under current versions of Windows, Linux, and BSD at the least. ---------- components: Library (Lib) messages: 402283 nosy: ciresnave priority: normal severity: normal status: open title: Missing support for Source Specific Multicast type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45252> _______________________________________ From report at bugs.python.org Mon Sep 20 20:33:01 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 00:33:01 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632184381.83.0.0688248505358.issue45234@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Mon Sep 20 22:17:16 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 02:17:16 +0000 Subject: [issue45249] Syntax error location range indicator does not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632190636.09.0.339917576913.issue45249@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Thinking a bit more on this, I'm not sure this can be closed, as SyntaxError indicators seems not to be working. I'm not sure if this is limited to doctests or not. I've updated the title to narrow it down to SyntaxErrors. I can look more into this if needed. If it's just doctests, it doesn't matter because the doctests ignore the indicators anyway, but if it can happen in some other cases, perhaps it's worth fixing. However I don't have experience with the C parts of python, so I'm not sure where / how to look. Pablo: let me know if you have any pointers on how to debug this, or if you think this should be closed. ---------- title: Fine grained error locations do not work in doctests -> Syntax error location range indicator does not work in doctests _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 20 22:48:39 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 02:48:39 +0000 Subject: [issue45249] SyntaxError location range indicator does not work in doctests In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632192519.64.0.600681965207.issue45249@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- title: Syntax error location range indicator does not work in doctests -> SyntaxError location range indicator does not work in doctests _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Tue Sep 21 01:31:20 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 05:31:20 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632202280.36.0.748792895609.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: > The patch looks fine, but it looks a bit like benchmark chasing. Is the speed of builtin sum() of a sequence of integers important enough to do this bit of inlining? Given that we already accepted essentially separate loops for the int, float and everything else cases, I think the answer is that it doesn't add much to the triplication. > It may break if we change the internals of Py_Long, as Mark Shannon has been wanting to do for a while I would assume that such a structural change would come with suitable macros to unpack the special 0-2 digit integers. Those would then apply here, too. As it stands, there are already some modules distributed over the source tree that use direct digit access: ceval.c, _decimal.c, marshal.c. They are easy to find with grep and my PR just adds one more. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 01:36:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 21 Sep 2021 05:36:23 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632202583.09.0.532876626091.issue24076@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Sounds good, you have my blessing. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 02:01:53 2021 From: report at bugs.python.org (neonene) Date: Tue, 21 Sep 2021 06:01:53 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632204113.75.0.236235856123.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: I built 3.10rc2 PGO with PR28475 applied, and posted the inliner's log. In the log, the 4-callees mentioned above are now inlined, which were "hard reject"ed before. As for the performance, a few reporters may be needed, but it's not necessary for them to care about noises in the apparent gap. 310rc2 x64 PGO : 1.00 + PR28475 build1 bench1 : 1.05x faster (slower 7, faster 43, nochange 8) bench2 : 1.05x faster (slower 2, faster 43, nochange 13) build2 : 1.05x faster (slower 4, faster 45, nochange 9) 310rc2 x64 release : 1.00 + PR28475 : 1.01x faster (slower 14, faster 25, nochange 19) Is Windows involved in the faster-cpython project? If so, the project should be provided with Windows machines for validation. ---------- Added file: https://bugs.python.org/file50291/PR28475_inline.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 02:30:42 2021 From: report at bugs.python.org (Ming Hua) Date: Tue, 21 Sep 2021 06:30:42 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1632205842.37.0.990838785358.issue45176@roundup.psfhosted.org> Ming Hua <plateauwolf at qq.com> added the comment: Steve Dower (steve.dower) posted: > I'd guess that these tests are assuming that sys.executable contains only ASCII characters. All the tests run in a non-ASCII working directory, so it's only the runtime that is not tested propersy here. > > The easiest way for Ming Hua to test this is to install for all users (into Program Files), and run tests with the same user account. I've already installed for all users, just not into the default "C:\Program Files\", but instead "C:\Programs\Python\". I don't think it's the executable's path that is problematic, but the temporary directory where the tests are run (%LOCALAPPDATA%\Temp\tmpcwkfn9ct, where %LOCALAPPDATA% is C:\Users\<account name>\AppData\Local and therefore contains non-ASCII characters). Both of these paths are shown in the error/failure logs posted in the first message. I doubt installing into "C:\Program Files\" would make a difference. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Tue Sep 21 02:47:24 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 21 Sep 2021 06:47:24 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632206844.38.0.953727792481.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: PR28475: 64-bit build is 1.03x slower than 28d28e0~1 32-bit build is 1.04x slower than 28d28e0~1 28d28e0~1 is the last good commit. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 03:49:08 2021 From: report at bugs.python.org (Manuj Chandra) Date: Tue, 21 Sep 2021 07:49:08 +0000 Subject: [issue45253] mimetypes cannot detect mime of mka files Message-ID: <1632210548.56.0.352982458661.issue45253@roundup.psfhosted.org> New submission from Manuj Chandra <manujchandra at gmail.com>: The mimetypes library cannot detect mime of mka files. It returns None instead of audio. mp3 and mkv are working. Only mka is not working. ---------- components: Library (Lib) files: Screenshot from 2021-09-21 13-10-33.png messages: 402290 nosy: manujchandra priority: normal severity: normal status: open title: mimetypes cannot detect mime of mka files type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50292/Screenshot from 2021-09-21 13-10-33.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45253> _______________________________________ From report at bugs.python.org Tue Sep 21 03:49:36 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 21 Sep 2021 07:49:36 +0000 Subject: [issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests Message-ID: <1632210576.65.0.316213829461.issue45254@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: `HAS_SHMEM` is defined in `multiprocessing.managers` module https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/multiprocessing/managers.py#L35-L40 Later the same logic is duplicated in `_test_multiprocessing`: https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/test/_test_multiprocessing.py#L52-L56 We can just use `multiprocessing.managers.HAS_SHMEM` instead. I am going to send a PR with the fix. ---------- messages: 402291 nosy: sobolevn priority: normal severity: normal status: open title: HAS_SHMEM detection logic is duplicated in implementation and tests type: behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45254> _______________________________________ From report at bugs.python.org Tue Sep 21 03:52:45 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 21 Sep 2021 07:52:45 +0000 Subject: [issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests In-Reply-To: <1632210576.65.0.316213829461.issue45254@roundup.psfhosted.org> Message-ID: <1632210765.36.0.846464814698.issue45254@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- components: +Tests versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45254> _______________________________________ From report at bugs.python.org Tue Sep 21 03:54:36 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 21 Sep 2021 07:54:36 +0000 Subject: [issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests In-Reply-To: <1632210576.65.0.316213829461.issue45254@roundup.psfhosted.org> Message-ID: <1632210876.85.0.446888353076.issue45254@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26883 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28487 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45254> _______________________________________ From report at bugs.python.org Tue Sep 21 04:19:00 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 21 Sep 2021 08:19:00 +0000 Subject: [issue45251] signal.SIGCLD alias is not available on OSX In-Reply-To: <1632176842.25.0.412458705067.issue45251@roundup.psfhosted.org> Message-ID: <1632212340.08.0.873849799039.issue45251@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: The documentation for the SIG* constants also mentions: ---- SIG* All the signal numbers are defined symbolically. For example, the hangup signal is defined as signal.SIGHUP; the variable names are identical to the names used in C programs, as found in <signal.h>. The Unix man page for ?signal()? lists the existing signals (on some systems this is signal(2), on others the list is in signal(7)). Note that not all systems define the same set of signal names; only those names defined by the system are defined by this module. ---- This is however mentioned halfway through the list of constants. I'm not sure why this is so, IMHO it would be clearer to move the fragment I quote to the start of the module constants section. We shouldn't define SIGCLD on platforms that don't have this name available in their libc headers, which includes macOS. If the fragment above were moved to the start of the section no further updates would be required (IMHO). ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45251> _______________________________________ From report at bugs.python.org Tue Sep 21 04:43:17 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 21 Sep 2021 08:43:17 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1632213797.95.0.757704617241.issue45113@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Subinterpreters are not the only reason to do this (and they're not *my* reason to do it). Adding a way to create PyStructSequence heap will help users of the stable ABI, where reduced performance is a known tradeoff (see https://www.python.org/dev/peps/pep-0652/#stable-abi: "The Stable ABI trades performance for its stability"). More generally, this would need solving one of the remaining limitations of the limited API (PEPs 489, 630): type-specific data. If Hai Shi solves the problem, the solution will be useful even if PyStructSequence_FromModuleAndDesc turns out useless. Using the proposed new API in CPython's stdlib should be done much more deliberately, and yes, would need a PEP. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Tue Sep 21 04:53:33 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 21 Sep 2021 08:53:33 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1632214413.24.0.748794242238.issue41682@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Happened to me today: https://dev.azure.com/Python/cpython/_build/results?buildId=88208&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334&t=5a421c4a-0933-53d5-26b9-04b36ad165eb ``` test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) ... FAIL test test_asyncio failed test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.SelectEventLoopTests) ... ok ====================================================================== FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\s\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving with self.assertRaises(ConnectionError): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: ConnectionError not raised ---------------------------------------------------------------------- Ran 2 tests in 0.087s FAILED (failures=1) 0:08:56 load avg: 3.51 Re-running test_concurrent_futures in verbose mode (matching: test_cancel_futures_wait_false) test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.303s OK 1 test failed again: test_asyncio ``` ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41682> _______________________________________ From report at bugs.python.org Tue Sep 21 05:01:22 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 09:01:22 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632214882.47.0.992688169904.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: New changeset debd80403721b00423680328d6adf160a28fbff4 by scoder in branch 'main': bpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469) https://github.com/python/cpython/commit/debd80403721b00423680328d6adf160a28fbff4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:10:54 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 21 Sep 2021 09:10:54 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632215454.24.0.25196319686.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Like what Ma Lin and neonene have mentioned above, PR28475 recovered half of the lost performance. It's unfortunately still 4% slower than 3.10a7. >pyperf compare_to 310a7.json 310rc2.json 310rc2patched.json Geometric mean (versus 3.10a7) ============== 310rc2: 1.09x slower 310rc2patched: 1.04x slower Attached pyperf benchmark comparisons file. ---------- Added file: https://bugs.python.org/file50293/PR28475_vs_310rc2_vs_310a7.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 05:19:32 2021 From: report at bugs.python.org (Dimitri Papadopoulos Orfanos) Date: Tue, 21 Sep 2021 09:19:32 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632215972.34.0.581542344175.issue45246@roundup.psfhosted.org> Dimitri Papadopoulos Orfanos <dimitri.papadopoulos at cea.fr> added the comment: Then what about removing it from the list.sort() documentation too? Note that maintainers of other PEPs insist that this is a known fact and base their code on that: https://github.com/python/peps/pull/2077 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 05:21:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Sep 2021 09:21:38 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632216098.95.0.963564703021.issue24076@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: What are microbenchmark results for PR 28469 in comparison with the baseline? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:24:01 2021 From: report at bugs.python.org (Dimitri Papadopoulos Orfanos) Date: Tue, 21 Sep 2021 09:24:01 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632216241.64.0.119234343177.issue45246@roundup.psfhosted.org> Dimitri Papadopoulos Orfanos <dimitri.papadopoulos at cea.fr> added the comment: I would recommend the wording in the "Sorting HOW TO" from: The sort routines are guaranteed to use __lt__() when making comparisons between two objects. to: The sort routines happen to use __lt__() when making comparisons between two objects. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 05:23:52 2021 From: report at bugs.python.org (Philippe Ombredanne) Date: Tue, 21 Sep 2021 09:23:52 +0000 Subject: [issue30349] Preparation for advanced set syntax in regular expressions In-Reply-To: <1494576853.44.0.660813121244.issue30349@psf.upfronthosting.co.za> Message-ID: <1632216232.45.0.365291404435.issue30349@roundup.psfhosted.org> Philippe Ombredanne <pombredanne at nexb.com> added the comment: FWIW, this warning is annoying because it is hard to fix in the case where the regex are source from data: the warning message does not include the regex at fault; it should otherwise the warning is noisy and ineffective IMHO. ---------- nosy: +pombredanne _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30349> _______________________________________ From report at bugs.python.org Tue Sep 21 05:38:36 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 09:38:36 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632217116.45.0.849629749072.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 149 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 2000 loops, best of 5: 107 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 2000 loops, best of 5: 107 usec per loop New: stefan at flup:~/ablage/software/Python/python-git$ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 500 loops, best of 5: 713 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 148 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 5000 loops, best of 5: 77.4 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 5000 loops, best of 5: 77.2 usec per loop Seems to be 28% faster for the single digit case and exactly as fast as before with larger integers. Note that these are not PGO builds. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:39:43 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 09:39:43 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632217183.72.0.209747432107.issue24076@roundup.psfhosted.org> Change by Stefan Behnel <stefan_ml at behnel.de>: ---------- Removed message: https://bugs.python.org/msg402301 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:40:00 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 09:40:00 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632217200.77.0.00583178778715.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 149 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 2000 loops, best of 5: 107 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 2000 loops, best of 5: 107 usec per loop New: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 500 loops, best of 5: 713 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 148 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 5000 loops, best of 5: 77.4 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 5000 loops, best of 5: 77.2 usec per loop Seems to be 28% faster for the single digit case and exactly as fast as before with larger integers. Note that these are not PGO builds. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:51:26 2021 From: report at bugs.python.org (Philippe Ombredanne) Date: Tue, 21 Sep 2021 09:51:26 +0000 Subject: [issue30349] Preparation for advanced set syntax in regular expressions In-Reply-To: <1494576853.44.0.660813121244.issue30349@psf.upfronthosting.co.za> Message-ID: <1632217886.72.0.634703110864.issue30349@roundup.psfhosted.org> Philippe Ombredanne <pombredanne at nexb.com> added the comment: Sorry, my comment was at best nonsensical gibberish! I meant to say that this warning message should include the actual regex at fault; otherwise it is hard to fix when the regex in question comes from some data structure like a list; then the line number where the warning occurs is not enough to fix the issue; the code needs to be instrumented first to catch warning which is rather heavy handed to handle a warning. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30349> _______________________________________ From report at bugs.python.org Tue Sep 21 05:52:18 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Tue, 21 Sep 2021 09:52:18 +0000 Subject: [issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are In-Reply-To: <1632168182.73.0.0551762354894.issue45250@roundup.psfhosted.org> Message-ID: <1632217938.94.0.358482415396.issue45250@roundup.psfhosted.org> Sebastian Rittau <srittau at rittau.biz> added the comment: One thing I would strongly suggest for consistent terminology: Make "iterator" mean an object that has both "__next()__" and "__iter()__". This is consistent with how an iterator has been described in the glossary for a long time, but also consistent with (abc.collections|typing).Iterator. Either invent a different term for objects having "__next__()" (but not necessarily "__iter__()"), or use a description like "an iterator or any other object that has a __next__() method". ---------- nosy: +srittau _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45250> _______________________________________ From report at bugs.python.org Tue Sep 21 05:53:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Sep 2021 09:53:19 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1632217999.31.0.351602223585.issue45176@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Not only sys.executable. Sources of non-ASCII paths: * sys.executable * __file__ of the stdlib or test modules * the current working directory * the temporary directory The last one is the most common in these failures. Tests fail when a non-ASCII path is written to the stdout or a file with the default encoding (which differs from the filesystem encoding) and then read with implying: * the ASCII encoding * the UTF-8 encoding * the filesystem encoding Fixing tests is not enough, because it is often an issue of scripts which write paths to the stdout. This problem does not have simple and general solution. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Tue Sep 21 05:55:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Sep 2021 09:55:23 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632218123.92.0.649830970281.issue24076@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you. Could you please test PGO builds? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 05:58:47 2021 From: report at bugs.python.org (neonene) Date: Tue, 21 Sep 2021 09:58:47 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632218327.66.0.84976010846.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: To be fair, the slowdowns between PR25244 and b1 seems to be an accumulation of "1.00x slower" of every commit. I don't know after b1. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 06:02:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 21 Sep 2021 10:02:22 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632218542.83.0.696804954759.issue45116@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: The only other change of any obvious significance to _PyEval_EvalFrameDefault since 3.10a7 are the changes to MATCH_MAPPING and MATCH_SEQUENCE and those make _PyEval_EvalFrameDefault smaller. We may need to look elsewhere for the remaining ~4% performance. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 06:10:04 2021 From: report at bugs.python.org (Isaac Boates) Date: Tue, 21 Sep 2021 10:10:04 +0000 Subject: [issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't Message-ID: <1632219004.38.0.384880031539.issue45255@roundup.psfhosted.org> New submission from Isaac Boates <iboates at gmail.com>: I was just using the sqlite3 package and was very confused when trying to open an sqlite database from a relative path, because the only error provided was: File "/path/to/filepy", line 50, in __init__ self.connection = sqlite3.connect(path) sqlite3.OperationalError: unable to open database file It turns out I was just executing Python from the wrong location and therefore my relative path was broken. Not a big problem. But it was confusing because it only throws this generic OperationalError. Could it instead throw a FileNotFoundError if the db simply doesn't exist at the specified path? ---------- messages: 402309 nosy: iboates priority: normal severity: normal status: open title: sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45255> _______________________________________ From report at bugs.python.org Tue Sep 21 06:29:41 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 10:29:41 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632220181.99.0.349893544152.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: Hmm, thanks for insisting, Serhiy. I was accidentally using a debug build this time. I'll make a PGO build and rerun the microbenchmarks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 06:41:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 10:41:59 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls Message-ID: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: Removing the usage of the C stack in Python-to-Python calls will allow future optimizations in the eval loop to take place and can yield some speed ups given that we will be removing C function calls and preambles by inlining the callee in the same eval loop as the caller. ---------- messages: 402311 nosy: Mark.Shannon, pablogsal priority: normal severity: normal status: open title: Remove the usage of the cstack in Python to Python calls versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 21 06:42:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 10:42:59 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632220979.96.0.436131555767.issue45256@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +26884 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28488 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 21 07:17:37 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 21 Sep 2021 11:17:37 +0000 Subject: [issue42406] Importing multiprocessing breaks pickle.whichmodule In-Reply-To: <1605791971.73.0.31216879751.issue42406@roundup.psfhosted.org> Message-ID: <1632223057.81.0.936665883758.issue42406@roundup.psfhosted.org> Change by Roundup Robot <devnull at psf.upfronthosting.co.za>: ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +26885 pull_request: https://github.com/python/cpython/pull/28489 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42406> _______________________________________ From report at bugs.python.org Tue Sep 21 07:20:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 11:20:38 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632223238.08.0.252661810474.issue44958@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 050d1035957379d70e8601e6f5636637716a264b by Erlend Egeberg Aasland in branch 'main': bpo-44958: Only reset `sqlite3` statements when needed (GH-27844) https://github.com/python/cpython/commit/050d1035957379d70e8601e6f5636637716a264b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Tue Sep 21 07:21:49 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 11:21:49 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632223309.34.0.625426294169.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: Old, with PGO: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 1000 loops, best of 5: 340 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 114 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 5000 loops, best of 5: 73.4 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 5000 loops, best of 5: 73.3 usec per loop $ ./python -m timeit -s 'd = [0] * 10000' 'sum(d)' 5000 loops, best of 5: 78.7 usec per loop New, with PGO: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)' 1000 loops, best of 5: 305 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)' 2000 loops, best of 5: 115 usec per loop $ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)' 5000 loops, best of 5: 52.4 usec per loop $ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)' 5000 loops, best of 5: 54 usec per loop $ ./python -m timeit -s 'd = [0] * 10000' 'sum(d)' 5000 loops, best of 5: 45.8 usec per loop The results are a bit more mixed with PGO optimisation (I tried a couple of times), not sure why. Might just be normal fluctuation, bad benchmark value selection, or accidental PGO tuning, can't say. In any case, the 1-digit case (10000, 2**29) is again about 28% faster and none of the other cases seems (visibly) slower. I think this is a very clear net-win. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 07:22:53 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 21 Sep 2021 11:22:53 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632223373.88.0.102839461039.issue24076@roundup.psfhosted.org> Change by Stefan Behnel <stefan_ml at behnel.de>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 07:54:47 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 21 Sep 2021 11:54:47 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1632225287.54.0.0909217833591.issue45176@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: I see no problem with changing a test -- such as test_consistent_sys_path_for_direct_execution() -- to spawn the child interpreter with `-X utf8` when the I/O encoding itself is irrelevant to the test -- except for forcing a common Unicode encoding to ensure the integrity of test data (i.e. no mojibake) and prevent encoding/decoding failures. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Tue Sep 21 08:48:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Sep 2021 12:48:29 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632228509.86.0.59809845922.issue24076@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you again Stefan. Now no doubts are left. BTW, pyperf gives more stable results. I use it if have any doubts (either the results of timeit are not stable or the difference is less than say 10%). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 08:52:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 12:52:47 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632228767.43.0.0708429329766.issue44958@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26886 pull_request: https://github.com/python/cpython/pull/28490 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Tue Sep 21 08:59:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 21 Sep 2021 12:59:28 +0000 Subject: [issue45233] Allow split key dictionaries with values owned by other objects. In-Reply-To: <1631882858.41.0.966804501884.issue45233@roundup.psfhosted.org> Message-ID: <1632229168.39.0.202492536884.issue45233@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: Experiments show that using `stride` just makes the code more complex, `dk_kind` is sufficient. We will still need ownership flags for split dicts, though. A single flag may suffice. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45233> _______________________________________ From report at bugs.python.org Tue Sep 21 09:16:04 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 13:16:04 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632230164.0.0.0113529087203.issue44958@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 3e3ff09058a71b92c32d1d7dc32470c0cf49300c by Erlend Egeberg Aasland in branch 'main': bpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490) https://github.com/python/cpython/commit/3e3ff09058a71b92c32d1d7dc32470c0cf49300c ---------- nosy: +miss-islington _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Tue Sep 21 09:56:48 2021 From: report at bugs.python.org (William Proffitt) Date: Tue, 21 Sep 2021 13:56:48 +0000 Subject: [issue45257] Compiling 3.8 branch on Windows attempts to use incompatible libffi version Message-ID: <1632232608.46.0.23021562846.issue45257@roundup.psfhosted.org> New submission from William Proffitt <proffitt at datamininglab.com>: Wasn't sure where to file this. I built Python 3.8.12 for Windows recently from the latest bugfix source release in the cpython repository. One tricky thing came up I wanted to write-up in case it matters to someone else. The version of libffi in the cpython-bin-deps repository seems to be too new for Python 3.8.12 now. The script for fetching the external dependencies (PCBuild\get_externals.bat) on the 3.8 branch fetches whatever is newest on the libffi branch, and this led to it downloading files starting with "libffi-8" and the build complaining about being unable to locate "libffi-7". I managed to resolve this by manually replacing the fetched libffi in the externals directory with the one from this commit, the latest commit I could find where the filenames started with "libffi-7": https://github.com/python/cpython-bin-deps/commit/1cf06233e3ceb49dc0a73c55e04b1174b436b632 After that, I was able to successfully run "build.bat -e -p x64" in PCBuild and "build.bat -x64" in "Tools\msi\" and end up with a working build and a working installer. (Side note that isn't that important for me but maybe worth mentioning while I'm here: the uninstaller on my newly minted installer didn't seem to work at all and I had to manually resort to deleting registry keys to overwrite my previous attempted install.) ---------- components: Build, Installation, Windows, ctypes messages: 402318 nosy: paul.moore, proffitt, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Compiling 3.8 branch on Windows attempts to use incompatible libffi version type: compile error versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45257> _______________________________________ From report at bugs.python.org Tue Sep 21 10:25:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 14:25:57 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632234357.25.0.768208231374.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Now that pysqlite_statement_reset() is only used in cursor.c, I suggest to move it to cursor.c and make it a static function. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Tue Sep 21 10:30:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 14:30:49 +0000 Subject: [issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't In-Reply-To: <1632219004.38.0.384880031539.issue45255@roundup.psfhosted.org> Message-ID: <1632234649.29.0.344292138776.issue45255@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- nosy: +erlendaasland _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45255> _______________________________________ From report at bugs.python.org Tue Sep 21 10:47:35 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 21 Sep 2021 14:47:35 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632235655.6.0.69581398663.issue45256@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 21 11:05:39 2021 From: report at bugs.python.org (neonene) Date: Tue, 21 Sep 2021 15:05:39 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632236739.1.0.936661604333.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: PR28475 PGO is 2% slower than the patch I pasted on msg401743. The function sizes are almost the same (+1:goto,+1:label), and there is no performance gap between release builds. I suspect the following. 1. PGO is too sensitive to a function size at near the limit. 2. PR28475 is not fully covered by 44 tests. (msg401346) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Tue Sep 21 11:14:18 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 15:14:18 +0000 Subject: [issue40951] csv skipinitialspace no longer working In-Reply-To: <1591914518.12.0.392827187881.issue40951@roundup.psfhosted.org> Message-ID: <1632237258.42.0.244730188325.issue40951@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Closing; if anyone finds a way to reproduce please add a comment or open a new issue. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40951> _______________________________________ From report at bugs.python.org Tue Sep 21 12:05:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:05:21 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632240321.36.0.00957975725461.issue45200@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26887 pull_request: https://github.com/python/cpython/pull/28492 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Tue Sep 21 12:28:15 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 21 Sep 2021 16:28:15 +0000 Subject: [issue45257] Compiling 3.8 branch on Windows attempts to use incompatible libffi version In-Reply-To: <1632232608.46.0.23021562846.issue45257@roundup.psfhosted.org> Message-ID: <1632241695.03.0.62351129182.issue45257@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Yes, unfortunately the external build was not referencing a tag in those sources but a branch, so when the newer version was pushed they picked it up. We fixed the pin in https://github.com/python/cpython/commit/8c3a10e58b12608c3759fee684e7aa399facae2a You should only need the get_externals.bat change. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45257> _______________________________________ From report at bugs.python.org Tue Sep 21 12:28:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:28:21 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632241701.01.0.394076297863.issue45200@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Tue Sep 21 12:28:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:28:25 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1632241705.75.0.118094443506.issue45200@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset a356272362c15f2561872f3206baf5e9a0543997 by Pablo Galindo Salgado in branch 'main': bpo-45200: Ignore test_multiprocessing_* in ASAN build due to false positives (GH-28492) https://github.com/python/cpython/commit/a356272362c15f2561872f3206baf5e9a0543997 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45200> _______________________________________ From report at bugs.python.org Tue Sep 21 12:32:42 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 21 Sep 2021 16:32:42 +0000 Subject: [issue45176] Many regtest failures on Windows with non-ASCII account name In-Reply-To: <1631440210.21.0.262674266068.issue45176@roundup.psfhosted.org> Message-ID: <1632241962.19.0.39785891596.issue45176@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > I've already installed for all users, just not into the default "C:\Program Files\", but instead "C:\Programs\Python\" Ah yes, that indeed rules out my first suspicion. > Fixing tests is not enough, because it is often an issue of scripts which write paths to the stdout. Sure, but the ones currently failing here are ours, so we are the ones who need to fix them :) And they all seem to be in our test suite. Fixing the tests doesn't make all the problems go away, just the specific ones we are responsible for on this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45176> _______________________________________ From report at bugs.python.org Tue Sep 21 12:45:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:45:45 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632242745.3.0.612623685339.issue24076@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Unfortunately commit debd80403721b00423680328d6adf160a28fbff4 introduced a reference leak: ? ./python -m test test_grammar -R : 0:00:00 load avg: 2.96 Run tests sequentially 0:00:00 load avg: 2.96 [1/1] test_grammar beginning 9 repetitions 123456789 ......... test_grammar leaked [12, 12, 12, 12] references, sum=48 test_grammar failed (reference leak) == Tests result: FAILURE == 1 test failed: test_grammar Total duration: 1.1 sec Tests result: FAILURE debd80403721b00423680328d6adf160a28fbff4 is the first bad commit commit debd80403721b00423680328d6adf160a28fbff4 Author: scoder <stefan_ml at behnel.de> Date: Tue Sep 21 11:01:18 2021 +0200 bpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469) .../Core and Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst | 1 + Python/bltinmodule.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 12:52:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:52:41 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632243161.9.0.981421876797.issue24076@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26888 pull_request: https://github.com/python/cpython/pull/28493 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 12:53:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:53:16 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632243196.95.0.750827254664.issue24076@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Opened #28493 to fix the refleak ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 12:53:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 16:53:32 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632243212.51.0.154273700053.issue24076@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Sorry, I meant PR 28493 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 12:53:29 2021 From: report at bugs.python.org (Maor Feldinger) Date: Tue, 21 Sep 2021 16:53:29 +0000 Subject: [issue45226] Misleading error message when pathlib.Path.symlink_to() fails with permissions error In-Reply-To: <1631840762.01.0.206152391874.issue45226@roundup.psfhosted.org> Message-ID: <1632243209.68.0.898181144522.issue45226@roundup.psfhosted.org> Maor Feldinger <rounder236 at gmail.com> added the comment: Oh I see what you mean, sorry about that, maybe the comperison to `os.symlink()` was wrong. It still feels wrong to me with since I am trying to make src symlink(point) to target and in the error message it looks like I am trying to do the other way around. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45226> _______________________________________ From report at bugs.python.org Tue Sep 21 12:57:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Sep 2021 16:57:11 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632243431.03.0.607966528735.issue45246@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- pull_requests: +26889 pull_request: https://github.com/python/cpython/pull/28494 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:05:07 2021 From: report at bugs.python.org (Dimitri Papadopoulos Orfanos) Date: Tue, 21 Sep 2021 17:05:07 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632243907.79.0.384418642.issue45246@roundup.psfhosted.org> Dimitri Papadopoulos Orfanos <dimitri.papadopoulos at cea.fr> added the comment: I've seen the new PR for sorted(), thank you for looking into this. Would it make sense to change list.sort() in the same way? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:15:42 2021 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 21 Sep 2021 17:15:42 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632244542.96.0.487861981513.issue40503@roundup.psfhosted.org> Change by Isuru Fernando <isuruf at gmail.com>: ---------- pull_requests: +26890 pull_request: https://github.com/python/cpython/pull/28495 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Tue Sep 21 13:16:50 2021 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 21 Sep 2021 17:16:50 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632244610.28.0.296680879113.issue40503@roundup.psfhosted.org> Isuru Fernando <isuruf at gmail.com> added the comment: Thanks @steve.dower for the info. I've created https://github.com/python/cpython/pull/28495. Let me know if it needs to have a separate bpo issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Tue Sep 21 13:26:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Sep 2021 17:26:08 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632245168.18.0.481538811706.issue45246@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > Thank you for looking into this. You're welcome :-) > Would it make sense to change list.sort() in the same way? I think not. This is a such a minor point and is a distractor. Most users would be better off focusing on the other text. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:26:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Sep 2021 17:26:36 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632245196.08.0.675881601602.issue45246@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 9a0dcc5b2e04d9c51350107734f12a1cbc0284a7 by Raymond Hettinger in branch 'main': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/9a0dcc5b2e04d9c51350107734f12a1cbc0284a7 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:26:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 17:26:55 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632245215.95.0.783677302849.issue45246@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26891 pull_request: https://github.com/python/cpython/pull/28496 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:27:00 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 17:27:00 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632245220.47.0.609403238014.issue45246@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26892 pull_request: https://github.com/python/cpython/pull/28497 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:27:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Sep 2021 17:27:27 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632245247.04.0.754040963718.issue45246@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:33:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 17:33:41 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1632245621.21.0.313499918354.issue44807@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: I'm not sure whether we should downright reject `__init__()` methods. Sadly, they aren't usable at the moment anyway, but they could. Hear me out. There seems to be a gap in the PEP 544 definition of protocols, i.e. whether `__init__` should be definable as part of a protocol. Currently this isn't specified and it looks like Mypy is ignoring `__init__` in Protocol definitions. Consider this example: https://gist.github.com/ambv/0ed9c9ec5b8469878f47074bdcd37b0c Mypy doesn't consider `__init__()` to be part of a protocol, even though it's an instance method like any other. It is valid (albeit weird) to call it again on an already initialized instance: >>> class C: ... def __init__(self) -> None: ... print('init!') ... >>> c = C() init! >>> c.__init__() init! >>> c.__init__() init! In the linked gist example, Mypy currently ignores `__init__()` but doesn't ignore `get_ball()`, thus incorrectly judging BallContainer and TwoBallContainer to be equivalent. In fact, it only rejects the third ifmain call with `object` because `object` lacks a `get_ball()` method. So... would that be useful? Do we ever want to define protocols on the basis of how their initializers look like? My uninformed intuition is that this might be potentially useful, however I fail to come up with a realistic example here. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44807> _______________________________________ From report at bugs.python.org Tue Sep 21 13:39:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 17:39:11 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632245951.92.0.260302722996.issue24076@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 1c7e98dc258a0e7ccd2325a1aefc4aa2de51e1c5 by Pablo Galindo Salgado in branch 'main': bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493) https://github.com/python/cpython/commit/1c7e98dc258a0e7ccd2325a1aefc4aa2de51e1c5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Tue Sep 21 13:39:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 17:39:33 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632245973.96.0.131667377048.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Looks like GH-28176 is faster across the board. One missing benchmark here is comparing `len()` speed as this was where the results will be reversed. It would be interesting to see to what extent. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Tue Sep 21 13:49:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 17:49:49 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632246589.68.0.267479851444.issue45209@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f604cf1c377a7648e0686044e6e49900bfc9feef by Nikita Sobolev in branch 'main': bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377) https://github.com/python/cpython/commit/f604cf1c377a7648e0686044e6e49900bfc9feef ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 13:50:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 17:50:26 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632246626.75.0.972229326281.issue43760@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26893 pull_request: https://github.com/python/cpython/pull/28498 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Tue Sep 21 13:53:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 17:53:31 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632246811.1.0.915251518103.issue45246@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset aea92de9900ceb8d679a9324fc72621940b9c8a0 by Miss Islington (bot) in branch '3.9': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/aea92de9900ceb8d679a9324fc72621940b9c8a0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 13:56:02 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 17:56:02 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632246962.36.0.780430947272.issue45209@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26894 pull_request: https://github.com/python/cpython/pull/28499 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 13:57:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 17:57:48 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632247068.47.0.184970348284.issue45209@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26895 pull_request: https://github.com/python/cpython/pull/28500 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 14:04:25 2021 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 21 Sep 2021 18:04:25 +0000 Subject: [issue45258] sysroot_paths in setup.py does not consider -isysroot for macOS Message-ID: <1632247465.13.0.0994928564671.issue45258@roundup.psfhosted.org> New submission from Isuru Fernando <isuruf at gmail.com>: It only looks at --sysroot which is Linux specific ---------- components: Build messages: 402338 nosy: FFY00, isuruf priority: normal severity: normal status: open title: sysroot_paths in setup.py does not consider -isysroot for macOS versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45258> _______________________________________ From report at bugs.python.org Tue Sep 21 14:06:23 2021 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 21 Sep 2021 18:06:23 +0000 Subject: [issue45258] sysroot_paths in setup.py does not consider -isysroot for macOS In-Reply-To: <1632247465.13.0.0994928564671.issue45258@roundup.psfhosted.org> Message-ID: <1632247583.05.0.490724380298.issue45258@roundup.psfhosted.org> Change by Isuru Fernando <isuruf at gmail.com>: ---------- keywords: +patch pull_requests: +26896 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28501 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45258> _______________________________________ From report at bugs.python.org Tue Sep 21 14:06:14 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 21 Sep 2021 18:06:14 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1632247574.29.0.914090178255.issue43976@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: > In the short term, and possible for the long term, Debian can continue to patch the install routine... The problem with this approach is Setuptools is attempting to adopt distutils by exposing its own vendored copy of distutils as `distutils` (top-level name). By doing this, it bypasses the Debian's patching of distutils as found in CPython. Because this bypass behavior breaks distutils for Debian users, the functionality has been disabled (opt-in). Setuptools would like to be able to present a version of distutils that, unpatched, runs on all the major platforms, and thus make it default. That won't be possible until Debian can stop relying on its patching of distutils. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43976> _______________________________________ From report at bugs.python.org Tue Sep 21 14:19:49 2021 From: report at bugs.python.org (William Proffitt) Date: Tue, 21 Sep 2021 18:19:49 +0000 Subject: [issue45257] Compiling 3.8 branch on Windows attempts to use incompatible libffi version In-Reply-To: <1632232608.46.0.23021562846.issue45257@roundup.psfhosted.org> Message-ID: <1632248389.2.0.242791641066.issue45257@roundup.psfhosted.org> William Proffitt <proffitt at datamininglab.com> added the comment: Ah yes, thank you Steve. I see the commit you're referencing is the cherry pick from upstream onto the 3.8 branch, but it's newer than the tag 3.8.12 I was using. Looks like I won't have to do anything if I wait until 3.8.13 before doing this again. This is good. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45257> _______________________________________ From report at bugs.python.org Tue Sep 21 14:19:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 18:19:56 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632248396.19.0.374232510639.issue45209@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 09e5016f8bb07beb7d780df221febac2d2867ad0 by Miss Islington (bot) in branch '3.10': bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377) https://github.com/python/cpython/commit/09e5016f8bb07beb7d780df221febac2d2867ad0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 14:37:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 18:37:11 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632249431.63.0.748083435077.issue45209@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 65268ab849173e9849b7fc94c3d73900b5410444 by Miss Islington (bot) in branch '3.9': bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377) (GH-28500) https://github.com/python/cpython/commit/65268ab849173e9849b7fc94c3d73900b5410444 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 14:37:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 18:37:39 +0000 Subject: [issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown In-Reply-To: <1631712553.58.0.588327071719.issue45209@roundup.psfhosted.org> Message-ID: <1632249459.11.0.0511220909413.issue45209@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Thanks Nikita Sobolev for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45209> _______________________________________ From report at bugs.python.org Tue Sep 21 14:38:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 18:38:12 +0000 Subject: [issue44480] test_compile killed by signal 9 on AMD64 FreeBSD Non-Debug 3.x In-Reply-To: <1624316683.45.0.985202182274.issue44480@roundup.psfhosted.org> Message-ID: <1632249492.19.0.988197720514.issue44480@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I didn't see this failure recently. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44480> _______________________________________ From report at bugs.python.org Tue Sep 21 14:38:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 18:38:41 +0000 Subject: [issue44416] test_threading: test_print_exception() hangs and killed after 3h15 on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1623656216.7.0.491497742026.issue44416@roundup.psfhosted.org> Message-ID: <1632249521.63.0.631053392543.issue44416@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I didn't see this failure recently. I close the issue as out of date. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44416> _______________________________________ From report at bugs.python.org Tue Sep 21 14:39:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 18:39:23 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). In-Reply-To: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> Message-ID: <1632249563.97.0.950907760255.issue44358@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I reported the compiler bug to RHEL: https://bugzilla.redhat.com/show_bug.cgi?id=1969775 I close the issue. It's now tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1969775 ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44358> _______________________________________ From report at bugs.python.org Tue Sep 21 14:52:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Sep 2021 18:52:37 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632250357.37.0.346018910014.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: length_hint(), not len(). Its cost is included in microbenchmark for list(), where it is followed by iterating 2000 items. Calling operator.length_hint() in Python: $ ./python -m pyperf timeit -s 'it = iter(range(1000)); from operator import length_hint' 'length_hint(it)' baseline: Mean +- std dev: 109 ns +- 6 ns PR 27986: Mean +- std dev: 109 ns +- 5 ns PR 28176: Mean +- std dev: 115 ns +- 5 ns $ ./python -m pyperf timeit -s 'it = iter(range(0, 10**20, 3**35)); from operator import length_hint' 'length_hint(it)' baseline: Mean +- std dev: 114 ns +- 6 ns PR 27986: Mean +- std dev: 95.6 ns +- 4.3 ns PR 28176: Mean +- std dev: 285 ns +- 13 ns Indirect call from C (it includes overhead for calling list() and iter() in Python): $ ./python -m pyperf timeit -s 'r = range(10**20, 10**20+1, 3**35)' 'list(iter(r))' baseline: Mean +- std dev: 331 ns +- 16 ns PR 27986: Mean +- std dev: 300 ns +- 16 ns PR 28176: Mean +- std dev: 391 ns +- 18 ns With few experiments I have found that PR 28176 is faster than PR 27986 for list(iter(range(...))) if a range is larger than 40-100 items. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Tue Sep 21 15:10:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 21 Sep 2021 19:10:23 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1632251423.69.0.412989059163.issue44807@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I wonder if part of the problem here isn't that protocols are primarily focused on instances, where the __init__ method is explicitly *not* considered part of the type. IIRC supporting protocols for classes was an afterthought. That said you have made a good case for seeing it as part of the protocol when the Type[] operator is applied to the protocol. So yes, I think we should be careful ruling that out too soon. Do we have any evidence that users are confused and define __init__ methods on protocols that are being ignored by their type checkers? The OP didn't say. When in doubt, let the status quo win. ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44807> _______________________________________ From report at bugs.python.org Tue Sep 21 15:11:33 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 21 Sep 2021 19:11:33 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632251493.72.0.0692505465515.issue40503@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I meant I don't think we want that path upstream, and you should keep it as your own patch. We don't have a "share" directory as part of CPython, but this would codify it. That would then conflict with your use of it in conda-forge. It also makes sysconfig non-deterministic, which is going to be problematic against some other efforts around being able to treat it as static data to make native module compilation easier, as well as more generally something that often leads to security vulnerabilities and is best avoided. So on balance, I think we will reject that patch. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Tue Sep 21 15:10:46 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 21 Sep 2021 19:10:46 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632251446.41.0.214633124577.issue45026@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: May the best PR win. :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Tue Sep 21 15:16:07 2021 From: report at bugs.python.org (Thomas) Date: Tue, 21 Sep 2021 19:16:07 +0000 Subject: [issue45259] No _heappush_max() Message-ID: <1632251766.89.0.378514161628.issue45259@roundup.psfhosted.org> New submission from Thomas <thomaslee9474 at gmail.com>: There is no heappush function for a max heap when the other supporting helper functions are already implemented (_siftdown_max()) ---------- components: Library (Lib) messages: 402351 nosy: ThomasLee94 priority: normal severity: normal status: open title: No _heappush_max() versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45259> _______________________________________ From report at bugs.python.org Tue Sep 21 15:27:31 2021 From: report at bugs.python.org (Thomas) Date: Tue, 21 Sep 2021 19:27:31 +0000 Subject: [issue45259] No _heappush_max() In-Reply-To: <1632251766.89.0.378514161628.issue45259@roundup.psfhosted.org> Message-ID: <1632252451.21.0.334508051127.issue45259@roundup.psfhosted.org> Change by Thomas <thomaslee9474 at gmail.com>: ---------- nosy: +rhettinger, stutzbach -ThomasLee94 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45259> _______________________________________ From report at bugs.python.org Tue Sep 21 15:30:15 2021 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 21 Sep 2021 19:30:15 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632252615.8.0.468430357988.issue40503@roundup.psfhosted.org> Isuru Fernando <isuruf at gmail.com> added the comment: Do you have a suggestion for how to make it configurable at compile time? In POSIX platforms, we can set `--with-tzpath` to make it configurable at compile time. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Tue Sep 21 15:32:47 2021 From: report at bugs.python.org (Thomas) Date: Tue, 21 Sep 2021 19:32:47 +0000 Subject: [issue45259] No _heappush_max() In-Reply-To: <1632251766.89.0.378514161628.issue45259@roundup.psfhosted.org> Message-ID: <1632252767.89.0.19654173755.issue45259@roundup.psfhosted.org> Change by Thomas <thomaslee9474 at gmail.com>: ---------- versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45259> _______________________________________ From report at bugs.python.org Tue Sep 21 15:59:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 19:59:51 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1632254391.89.0.768236231392.issue44531@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44531> _______________________________________ From report at bugs.python.org Tue Sep 21 16:01:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 20:01:10 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632254470.34.0.69652782439.issue45246@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- nosy: +lukasz.langa nosy_count: 5.0 -> 6.0 pull_requests: +26897 pull_request: https://github.com/python/cpython/pull/28502 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 16:03:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 20:03:59 +0000 Subject: [issue42641] Deprecate os.popen() function In-Reply-To: <1607986363.29.0.33477455927.issue42641@roundup.psfhosted.org> Message-ID: <1632254639.57.0.590079778608.issue42641@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It seems like they are legit use cases for os.popen(), so I abandon my idea of deprecating it. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42641> _______________________________________ From report at bugs.python.org Tue Sep 21 16:05:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 20:05:07 +0000 Subject: [issue40453] [subinterpreters] Add PyConfig._isolated_interpreter: isolated subinterpreters In-Reply-To: <1588276857.13.0.360538290387.issue40453@roundup.psfhosted.org> Message-ID: <1632254707.66.0.262702508729.issue40453@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40453> _______________________________________ From report at bugs.python.org Tue Sep 21 16:06:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 20:06:38 +0000 Subject: [issue44203] test__xxsubinterpreters: heap-buffer-overflow in interp_is_running() on AMD64 Arch Linux Asan 3.x In-Reply-To: <1621594117.76.0.160103726928.issue44203@roundup.psfhosted.org> Message-ID: <1632254798.47.0.941306638161.issue44203@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: On the latest build 564, there is no more error: 0:17:51 load avg: 2.50 [169/421] test__xxsubinterpreters passed ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44203> _______________________________________ From report at bugs.python.org Tue Sep 21 16:11:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 20:11:39 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1632255099.76.0.285541591094.issue44807@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Yurri, is the issue you reported your original finding? If you haven't found this issue in the wild, we might want to let this be as-is until we specify exactly whether `__init__()` should be considered part of a protocol. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44807> _______________________________________ From report at bugs.python.org Tue Sep 21 16:16:07 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 21 Sep 2021 20:16:07 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632255367.91.0.0918842658423.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: I'm still torn about the need for a __file__ attribute. Assuming it's more likely that people write code that *reads* stdlib source for some reason (maybe printing more context for error messages) than *writing* it (which would be truly strange), the amount of 3rd party code that might break due to the lack of __file__ can be expected to be larger than the amount of code (or number of users) that would be confused to having a __file__ pointing to a file that isn't actually read by the interpreter. Okay, so I'm no longer torn. We should set __file__ for frozen modules based on the pre-computed location of the stdlib. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Tue Sep 21 16:27:37 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 21 Sep 2021 20:27:37 +0000 Subject: [issue40503] PEP 615: Add zoneinfo module In-Reply-To: <1588618281.16.0.913416553136.issue40503@roundup.psfhosted.org> Message-ID: <1632256057.65.0.73105360683.issue40503@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: We'd need to implement some form of data store for values on Windows, which currently are not compiled in anywhere, and it would need a substitution syntax to be updated at runtime. We're talking a big feature now, and you'd end up having just as much code on your side to make it work. The only justification that'd make sense on our side is if we were going to bundle the tzdata file with the Windows installer, which doesn't affect you at all, apart from us then having an existing path listed that you'd want to override still. And even then, we'd probably preinstall the tzdata package which already overrides the path, and so there'd be no changes necessary to sysconfig and so we wouldn't touch it anyway. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40503> _______________________________________ From report at bugs.python.org Tue Sep 21 16:30:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 20:30:27 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632256227.95.0.175390208379.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: >From PR 28498: @vstinner @ambv The ABI is not broken, the only thing that this PR change is the size of the struct. All the offsets to the members are the same and therefore will be valid in any compiled code. Any compiled wheels will still work. Look at the ABI report: [C]'function void PyEval_AcquireThread(PyThreadState*)' at ceval.c:447:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:62:1 changed: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 1 data member changes (2 filtered): type of 'PyInterpreterState* _ts::interp' changed: in pointed to type 'typedef PyInterpreterState' at pystate.h:22:1: underlying type 'struct _is' at pycore_interp.h:220:1 changed: type size hasn't changed 1 data member changes (3 filtered): type of '_PyFrameEvalFunction _is::eval_frame' changed: underlying type 'PyObject* (PyThreadState*, PyFrameObject*, int)*' changed: in pointed to type 'function type PyObject* (PyThreadState*, PyFrameObject*, int)': parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:62:1 changed: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 1 data member changes (2 filtered): type of '_ts* _ts::next' changed: in pointed to type 'struct _ts' at pystate.h:62:1: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 no data member changes (2 filtered); [C]'function PyThreadState* PyGILState_GetThisThreadState()' at pystate.c:1455:1 has some indirect sub-type changes: return type changed: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:62:1 changed: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 no data member changes (4 filtered); [C]'function int _PyErr_CheckSignalsTstate(PyThreadState*)' at signalmodule.c:1767:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:62:1 changed: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 no data member changes (3 filtered); [C]'function void _PyErr_Clear(PyThreadState*)' at errors.c:453:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:62:1 changed: type size changed from 2240 to 2304 (in bits) 1 data member insertion: 'int _ts::use_tracing', at offset 2240 (in bits) at pystate.h:151:1 no data member changes (3 filtered); As you can see, the leaves of the change is only type size changed from 2240 to 2304. As the member is added ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Tue Sep 21 16:32:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 20:32:13 +0000 Subject: [issue45246] the sorted() documentation should refer to operator < In-Reply-To: <1632125212.88.0.211688526442.issue45246@roundup.psfhosted.org> Message-ID: <1632256333.17.0.58088461739.issue45246@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 0d41bf15702832540afc1b1c078bc4fde5baebd6 by ?ukasz Langa in branch '3.10': [3.10] bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) (GH-28502) https://github.com/python/cpython/commit/0d41bf15702832540afc1b1c078bc4fde5baebd6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45246> _______________________________________ From report at bugs.python.org Tue Sep 21 16:35:52 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 21 Sep 2021 20:35:52 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1632256552.19.0.991866699963.issue44807@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: ?ukasz this issue is my original finding. I have found this case when I was working on another issue that was related to `typing.Protocol`. I agree that we can leave it as it is for now because I didn't find any information from python community about this case. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44807> _______________________________________ From report at bugs.python.org Tue Sep 21 16:35:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 20:35:38 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632256538.56.0.251709491858.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Also, just to clarify, I also opened PR 28498 to discuss the possibility of going ahead, I still don't want to move on without consensus. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Tue Sep 21 16:38:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 20:38:24 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632256704.66.0.943463766799.issue45061@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26898 pull_request: https://github.com/python/cpython/pull/28503 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Tue Sep 21 16:39:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 21 Sep 2021 20:39:08 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632256748.49.0.656827748329.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Also, I personally thing there is absolutely no guarantee that Cython code generated for 3.9 should work for 3.10 and the thread state is a private structure that has undocumented fields and is not part of the stable API nor the limited API so, tstate->tracing disappearing is totally withing the guarantees between Python versions. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Tue Sep 21 16:43:52 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 20:43:52 +0000 Subject: [issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't In-Reply-To: <1632219004.38.0.384880031539.issue45255@roundup.psfhosted.org> Message-ID: <1632257032.87.0.106350981039.issue45255@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > Could it instead throw a FileNotFoundError if the db simply doesn't exist at the specified path? We pass the database path pretty much straight to sqlite3_open_v2(), via the os.PathLike interface, so any errors we get come straight from SQLite (apart from os.PathLike errors). We translate SQLite error codes to the corresponding DP-API exception, as defined per PEP 249. Raising FileNotFoundError would mean adding support for validating the path prior to calling sqlite3_open_v2() _and_ maintaining backwards compatibility (in-memory database, creating new database file if the path points to a valid directory, etc.). This will complicate the code unnecessary, IMO. I suggest to keep the current behaviour. See also the slightly related bpo-24139. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45255> _______________________________________ From report at bugs.python.org Tue Sep 21 16:44:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 20:44:02 +0000 Subject: [issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't In-Reply-To: <1632219004.38.0.384880031539.issue45255@roundup.psfhosted.org> Message-ID: <1632257042.99.0.200541052852.issue45255@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45255> _______________________________________ From report at bugs.python.org Tue Sep 21 16:44:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 20:44:58 +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: <1632257098.03.0.26088590385.issue15373@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I think the advantage of asdict() method is it's more discoverable and it doesn't leave any uncertainty of whether returned value will update environment or not. If a user sees `dict(os.environ)` in code, they may wonder if it does or does not; and there's no obvious way to confirm. If they see os.environ.asdict(), it will be safe to assume that the method is provided exactly for this purpose, and the way to confirm is obvious - checking the docstring. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15373> _______________________________________ From report at bugs.python.org Tue Sep 21 16:51:04 2021 From: report at bugs.python.org (Anton Barkovsky) Date: Tue, 21 Sep 2021 20:51:04 +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: <1632257464.85.0.109769120158.issue15373@roundup.psfhosted.org> Change by Anton Barkovsky <anton at swarmer.me>: ---------- nosy: -anton.barkovsky _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15373> _______________________________________ From report at bugs.python.org Tue Sep 21 17:04:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:04:41 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632258281.41.0.167865165109.issue45061@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 79a31480992c3fa5890fc7a6c5d9af6d337d5844 by Victor Stinner in branch 'main': bpo-45061: Detect refcount bug on empty tuple singleton (GH-28503) https://github.com/python/cpython/commit/79a31480992c3fa5890fc7a6c5d9af6d337d5844 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Tue Sep 21 17:19:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:19:40 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632259180.59.0.469563099528.issue45061@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26899 pull_request: https://github.com/python/cpython/pull/28504 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Tue Sep 21 17:21:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 21 Sep 2021 21:21:58 +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: <1632259318.12.0.912241213591.issue15373@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: I guess the easy way to test it would be to modify the copy and check os.environ, but still there would be some uncertainty if it's consistent across platforms and python versions, if it's expected to still work in future python versions, etc. asdict() docstring is much more explicit. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15373> _______________________________________ From report at bugs.python.org Tue Sep 21 17:31:20 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21:31:20 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632259880.35.0.709905778231.issue45216@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26900 pull_request: https://github.com/python/cpython/pull/28505 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 17:31:24 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21:31:24 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632259884.08.0.208965744897.issue45216@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26901 pull_request: https://github.com/python/cpython/pull/28506 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 17:31:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:31:19 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632259879.18.0.27955688754.issue45216@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 06e1773c8d8fe375423bb7fcf5922b49bc737b75 by Nikita Sobolev in branch 'main': bpo-45216: Remove extraneous method docs from `difflib` (GH-28445) https://github.com/python/cpython/commit/06e1773c8d8fe375423bb7fcf5922b49bc737b75 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 17:34:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:34:10 +0000 Subject: [issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1632260050.91.0.539905971479.issue39947@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See bpo-43760 and PR 28498 for a discussion about the PyThreadState.use_tracing member. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39947> _______________________________________ From report at bugs.python.org Tue Sep 21 17:39:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:39:28 +0000 Subject: [issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed In-Reply-To: <1631758390.34.0.18935168801.issue45215@roundup.psfhosted.org> Message-ID: <1632260368.17.0.908259545949.issue45215@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Have you encountered misuse of Mock's `name` and `parent` in the wild? As you're saying, since `str()` and `repr()` will error out anyway, it's unlikely users were doing this in the first place. I'm a little hesitant to accept the deprecation since there are very many places in the stdlib where we accept an equivalent of, say, `name=` during some object's `__init__()` and just assign it to a field. If that happens not to be printable and crash `repr()` then too bad... but we won't be adding checks for each such case, right? ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45215> _______________________________________ From report at bugs.python.org Tue Sep 21 17:43:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:43:16 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632260596.99.0.932613510008.issue45061@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 86f28372b17c8c56539e9543bea9f125ab11b8aa by Victor Stinner in branch 'main': bpo-45061: Detect refcount bug on empty string singleton (GH-28504) https://github.com/python/cpython/commit/86f28372b17c8c56539e9543bea9f125ab11b8aa ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Tue Sep 21 17:45:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:45:48 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632260748.8.0.187245650923.issue45061@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I don't want to add a deallocator to bytes and int types to detect when their singleton is destroyed, since it would slow down C extensions which have no refcount bug. Maybe it could be added only if Py_DEBUG macro is defined. But I don't think that Py_DECREF() bugs on these singletons are common enough to justify these. I don't want to make Python debug build slower. IMO detecting refcount bugs on the most common singletons is enough: None, True, False, (), "". I implemented these checks because it was simple and had no major on performance, even on the debug build. I now consider that the issue is fully fixed ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Tue Sep 21 17:51:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:51:54 +0000 Subject: [issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef() In-Reply-To: <1604914934.45.0.492738703952.issue42294@roundup.psfhosted.org> Message-ID: <1632261114.96.0.0456746623532.issue42294@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: There is no consensus on changing things, so I just close my issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42294> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:53: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: <1632261191.67.0.152720006491.issue43219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b7eac52b466f697d3e89f47508e0df0196a98970 by andrei kulakov in branch 'main': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) https://github.com/python/cpython/commit/b7eac52b466f697d3e89f47508e0df0196a98970 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:53:11 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632261191.78.0.0840133663287.issue45234@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b7eac52b466f697d3e89f47508e0df0196a98970 by andrei kulakov in branch 'main': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) https://github.com/python/cpython/commit/b7eac52b466f697d3e89f47508e0df0196a98970 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:47 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21: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: <1632261227.87.0.258083279119.issue43219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26905 pull_request: https://github.com/python/cpython/pull/28508 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21:53:43 +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: <1632261223.78.0.33388898853.issue43219@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26903 pull_request: https://github.com/python/cpython/pull/28507 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:53:51 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632261231.45.0.975188837003.issue45216@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e6b6c1d23b3702052637f70551451d12695403a1 by Miss Islington (bot) in branch '3.10': bpo-45216: Remove extraneous method docs from `difflib` (GH-28445) (GH-28505) https://github.com/python/cpython/commit/e6b6c1d23b3702052637f70551451d12695403a1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:47 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21:53:47 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632261227.77.0.00903751812053.issue45234@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26904 pull_request: https://github.com/python/cpython/pull/28508 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 17:53:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 21 Sep 2021 21:53:43 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632261223.69.0.25414338328.issue45234@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26902 pull_request: https://github.com/python/cpython/pull/28507 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 17:56:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:56:32 +0000 Subject: [issue42260] [C API] Add _PyInterpreterState_SetConfig(): reconfigure an interpreter In-Reply-To: <1604501121.18.0.0957616798897.issue42260@roundup.psfhosted.org> Message-ID: <1632261392.19.0.300030062947.issue42260@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The initial issue, adding an API to reconfigure an interepreter, is implemented: I added _PyInterpreterState_SetConfig(). But I failed finding time to finish the larger project "rewrite getpath.c in Python" (PR 23169). It requires changing the C API of the PEP 587 which is not easy. Also I'm not fully convinced that there is a strong need to change getpath.c. I would be interested to move code from site.py to _getpath.py, but it's also not obvious if there a strong benefit. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter -> [C API] Add _PyInterpreterState_SetConfig(): reconfigure an interpreter _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42260> _______________________________________ From report at bugs.python.org Tue Sep 21 17:57:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:57:43 +0000 Subject: [issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API In-Reply-To: <1592255135.39.0.855912884014.issue40989@roundup.psfhosted.org> Message-ID: <1632261463.48.0.115166783783.issue40989@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I still consider that these functions must be moved to the internal C API. But I failed to find time to design a *public* C API for that, or help projects using these functions to avoid it. I prefer to close the isseu for now. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40989> _______________________________________ From report at bugs.python.org Tue Sep 21 17:57:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 21:57:53 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632261473.02.0.301467180101.issue45216@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset df1006b561f9dca5a15af98d54f0337a75b69445 by Miss Islington (bot) in branch '3.9': bpo-45216: Remove extraneous method docs from `difflib` (GH-28445) (GH-28506) https://github.com/python/cpython/commit/df1006b561f9dca5a15af98d54f0337a75b69445 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 17:59:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 21:59:56 +0000 Subject: [issue41078] [C API] Convert PyTuple_GET_ITEM() macro to a static inline function In-Reply-To: <1592837413.67.0.409413280161.issue41078@roundup.psfhosted.org> Message-ID: <1632261596.86.0.508824664867.issue41078@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The PEP 620 is still a draft. I prefer to work on other C API changes before coming back to this change which may break many C extensions. I failed finding time to design an API to expose a PyObject** array "view" with a function to release/destroy the view. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41078> _______________________________________ From report at bugs.python.org Tue Sep 21 18:00:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:00:55 +0000 Subject: [issue45216] Remove redundant information from difflib docstrings In-Reply-To: <1631777610.22.0.0340838668525.issue45216@roundup.psfhosted.org> Message-ID: <1632261655.83.0.483103671691.issue45216@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45216> _______________________________________ From report at bugs.python.org Tue Sep 21 18:01:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:01:35 +0000 Subject: [issue42648] subprocess: add a helper/parameter to catch exec() OSError exception In-Reply-To: <1608051942.35.0.527198192461.issue42648@roundup.psfhosted.org> Message-ID: <1632261695.12.0.998471356732.issue42648@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I failed finding time to finish to design this feature. I'm not convinced that it's really needed. I abandoned my idea of deprecating os.popen(): bpo-42641. I close the issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42648> _______________________________________ From report at bugs.python.org Tue Sep 21 18:04:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:04:01 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1632261841.42.0.484372988322.issue44807@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Marking issue as "pending" until we figure out how PEP 544 should be amended. ---------- status: open -> pending _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44807> _______________________________________ From report at bugs.python.org Tue Sep 21 18:04:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:04:23 +0000 Subject: [issue42671] Make the Python finalization more deterministic In-Reply-To: <1608239600.62.0.0456277879965.issue42671@roundup.psfhosted.org> Message-ID: <1632261863.94.0.231369288528.issue42671@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not really excited about breaking applications. While there is maybe a way to make the Python finalization more determistic, sorry, I'm not the one who will be brave enough to do it today. I abandon my idea for now. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42671> _______________________________________ From report at bugs.python.org Tue Sep 21 18:05:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 22:05:37 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1632261937.03.0.771594234989.issue45041@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26906 pull_request: https://github.com/python/cpython/pull/28509 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45041> _______________________________________ From report at bugs.python.org Tue Sep 21 18:08:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:08:50 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1632262130.55.0.655171793054.issue43770@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: The code is way more complicated than what I expected. I hope that my work on this issue will help future developers who will try to understand the code. But I prefer to stop the refactoring at this point. I pushed enough changes ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43770> _______________________________________ From report at bugs.python.org Tue Sep 21 18:12:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:12:31 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1632262351.01.0.713073444132.issue45035@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Should we simply close the issue and leave distutils as it is? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45035> _______________________________________ From report at bugs.python.org Tue Sep 21 18:13:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:13:48 +0000 Subject: [issue19829] _pyio.BufferedReader and _pyio.TextIOWrapper destructor don't emit ResourceWarning if the file is not closed In-Reply-To: <1385721421.95.0.384748799117.issue19829@psf.upfronthosting.co.za> Message-ID: <1632262428.82.0.0880078285457.issue19829@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: While it would be great to also emit ResourceWarning, in the last 8 years, nobody managed to implement the feature. Also, this issue has no activity. I prefer to close the issue. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue19829> _______________________________________ From report at bugs.python.org Tue Sep 21 18:14:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:14:48 +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: <1632262488.84.0.126226720931.issue43219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 41d48bc038b254cc4a78a2d840097196b9545a84 by Miss Islington (bot) in branch '3.10': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28508) https://github.com/python/cpython/commit/41d48bc038b254cc4a78a2d840097196b9545a84 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Tue Sep 21 18:14:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:14:48 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632262488.93.0.19747458812.issue45234@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 41d48bc038b254cc4a78a2d840097196b9545a84 by Miss Islington (bot) in branch '3.10': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28508) https://github.com/python/cpython/commit/41d48bc038b254cc4a78a2d840097196b9545a84 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 18:15:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:15:08 +0000 Subject: [issue27069] webbrowser creates zombi processes in the background mode In-Reply-To: <1463746997.46.0.620771266968.issue27069@psf.upfronthosting.co.za> Message-ID: <1632262508.59.0.205847439617.issue27069@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Python 3.6 was released 5 years ago. Nobody complained about ResourceWarning. While it would be nice to fix the issue, nobody managed to write a fix in 5 years and this issue has no activity for 3 years. I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27069> _______________________________________ From report at bugs.python.org Tue Sep 21 18:15:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:15:46 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632262546.44.0.856909844144.issue45234@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Pablo, this regression was fixed in GH-28508 which should go into 3.10.0. ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 18:16:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:16:07 +0000 Subject: [issue28977] Document PyObject_CallFunction() special case more explicitly In-Reply-To: <1481790961.1.0.0700086912401.issue28977@psf.upfronthosting.co.za> Message-ID: <1632262567.99.0.578790125217.issue28977@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I don't know what to do with this old issue, so I prefer to simply close it. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28977> _______________________________________ From report at bugs.python.org Tue Sep 21 18:17:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:17:04 +0000 Subject: [issue29312] Use FASTCALL in dict.update() In-Reply-To: <1484759262.53.0.625567482548.issue29312@psf.upfronthosting.co.za> Message-ID: <1632262624.44.0.770867886195.issue29312@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It seems like using FASTCALL would make the code slower, not faster. I close this old issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29312> _______________________________________ From report at bugs.python.org Tue Sep 21 18:20:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:20:13 +0000 Subject: [issue29502] Should PyObject_Call() call the profiler on C functions, use C_TRACE() macro? In-Reply-To: <1486568378.9.0.904847418882.issue29502@psf.upfronthosting.co.za> Message-ID: <1632262813.35.0.697376489635.issue29502@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: This issue has no activity for 3 years and was created 4 years ago. I close it. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29502> _______________________________________ From report at bugs.python.org Tue Sep 21 18:20:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:20:34 +0000 Subject: [issue29811] Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs() In-Reply-To: <1489527382.61.0.961347131551.issue29811@psf.upfronthosting.co.za> Message-ID: <1632262834.66.0.517328174953.issue29811@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29811> _______________________________________ From report at bugs.python.org Tue Sep 21 18:21:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:21:09 +0000 Subject: [issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! In-Reply-To: <1511187317.56.0.213398074469.issue32085@psf.upfronthosting.co.za> Message-ID: <1632262869.17.0.730081711421.issue32085@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: No activity for 3 years, I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32085> _______________________________________ From report at bugs.python.org Tue Sep 21 18:21:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:21:33 +0000 Subject: [issue33793] asyncio: _ProactorReadPipeTransport reads by chunk of 32 KiB: chunk size should be configurable In-Reply-To: <1528368275.57.0.592728768989.issue33793@psf.upfronthosting.co.za> Message-ID: <1632262893.63.0.365486282346.issue33793@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Nobody implemented the feature. I prefer to abandon my idea. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33793> _______________________________________ From report at bugs.python.org Tue Sep 21 18:21:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:21:18 +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: <1632262878.54.0.91698915932.issue43219@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 09390c837a0bf73e213db2fbde34d756fa77a837 by Miss Islington (bot) in branch '3.9': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28507) https://github.com/python/cpython/commit/09390c837a0bf73e213db2fbde34d756fa77a837 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43219> _______________________________________ From report at bugs.python.org Tue Sep 21 18:21:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Sep 2021 22:21:18 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632262878.64.0.86546683275.issue45234@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 09390c837a0bf73e213db2fbde34d756fa77a837 by Miss Islington (bot) in branch '3.9': bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28507) https://github.com/python/cpython/commit/09390c837a0bf73e213db2fbde34d756fa77a837 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Tue Sep 21 18:22:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:22:37 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1632262957.69.0.685438846142.issue35276@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: It would be nice to document thread safety, but it's a large project. Maybe the Documentation Working Group could look into this issue. But nobody managed to write the doc in 3 years, I prefer to close the issue. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35276> _______________________________________ From report at bugs.python.org Tue Sep 21 18:23:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:23:05 +0000 Subject: [issue34090] Python function call optimization: avoid temporary tuple to pass **kwargs In-Reply-To: <1531264419.35.0.56676864532.issue34090@psf.upfronthosting.co.za> Message-ID: <1632262985.0.0.772563459292.issue34090@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: No activity for 2 years, I close the issue. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue34090> _______________________________________ From report at bugs.python.org Tue Sep 21 18:23:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:23:35 +0000 Subject: [issue38199] python3.8-config --ldflags must not generate -L/usr/lib64 In-Reply-To: <1568727937.94.0.575779306656.issue38199@roundup.psfhosted.org> Message-ID: <1632263015.49.0.264294180714.issue38199@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38199> _______________________________________ From report at bugs.python.org Tue Sep 21 18:23:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:23:54 +0000 Subject: [issue37475] What is urllib.request.urlcleanup() function? In-Reply-To: <1562004108.37.0.0869622537038.issue37475@roundup.psfhosted.org> Message-ID: <1632263034.24.0.0342929446919.issue37475@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37475> _______________________________________ From report at bugs.python.org Tue Sep 21 18:24:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:24:43 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1632263083.82.0.312854191472.issue37322@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: ResourceWarning is no longer emitted. I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37322> _______________________________________ From report at bugs.python.org Tue Sep 21 18:24:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:24:59 +0000 Subject: [issue36437] method_descriptor surprising error message when self is passed a keyword argument In-Reply-To: <1553605980.78.0.197035304135.issue36437@roundup.psfhosted.org> Message-ID: <1632263099.39.0.530812072028.issue36437@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36437> _______________________________________ From report at bugs.python.org Tue Sep 21 18:25:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:25:24 +0000 Subject: [issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore In-Reply-To: <1545044915.94.0.788709270274.issue35518@psf.upfronthosting.co.za> Message-ID: <1632263124.8.0.0802259356596.issue35518@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35518> _______________________________________ From report at bugs.python.org Tue Sep 21 18:26:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:26:36 +0000 Subject: [issue35478] multiprocessing: ApplyResult.get() hangs if the pool is terminated In-Reply-To: <1544661051.76.0.788709270274.issue35478@psf.upfronthosting.co.za> Message-ID: <1632263196.6.0.766150797061.issue35478@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35478> _______________________________________ From report at bugs.python.org Tue Sep 21 18:26:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:26:17 +0000 Subject: [issue35479] multiprocessing.Pool.join() always takes at least 100 ms In-Reply-To: <1544661414.71.0.788709270274.issue35479@psf.upfronthosting.co.za> Message-ID: <1632263177.46.0.897830994086.issue35479@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Nobody managed to find a solution in 3 years. I close the issue. ---------- dependencies: -multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit, multiprocessing: ApplyResult.get() hangs if the pool is terminated resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35479> _______________________________________ From report at bugs.python.org Tue Sep 21 18:26:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:26:52 +0000 Subject: [issue35333] [C API] Rename private structs to use names closer to types In-Reply-To: <1543363954.23.0.788709270274.issue35333@psf.upfronthosting.co.za> Message-ID: <1632263212.44.0.251541175951.issue35333@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35333> _______________________________________ From report at bugs.python.org Tue Sep 21 18:27:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:27:14 +0000 Subject: [issue36136] Windows: python._pth sets isolated mode late during Python initialization In-Reply-To: <1551277286.04.0.945215476701.issue36136@roundup.psfhosted.org> Message-ID: <1632263234.72.0.155344503264.issue36136@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36136> _______________________________________ From report at bugs.python.org Tue Sep 21 18:28:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:28:10 +0000 Subject: [issue38564] test_asyncio: test_run_coroutine_threadsafe_with_timeout() has a race condition In-Reply-To: <1571841860.24.0.514293762677.issue38564@roundup.psfhosted.org> Message-ID: <1632263290.8.0.772813974975.issue38564@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38564> _______________________________________ From report at bugs.python.org Tue Sep 21 18:29:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Sep 2021 22:29:15 +0000 Subject: [issue38620] Shell python-config --includes returns the same path twice In-Reply-To: <1572279446.17.0.15456686003.issue38620@roundup.psfhosted.org> Message-ID: <1632263355.01.0.553614948947.issue38620@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38620> _______________________________________ From report at bugs.python.org Tue Sep 21 18:33:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 21 Sep 2021 22:33:36 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632263616.38.0.347146899048.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > Now that pysqlite_statement_reset() is only used in cursor.c, I suggest to move it to cursor.c and make it a static function. I'll wait until PR 25984 is merged before opening a PR for relocating pysqlite_statement_reset(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Tue Sep 21 19:33:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Sep 2021 23:33:03 +0000 Subject: [issue45259] No _heappush_max() In-Reply-To: <1632251766.89.0.378514161628.issue45259@roundup.psfhosted.org> Message-ID: <1632267183.52.0.669700899599.issue45259@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: The underscore functions are private and for internal use. There is no _heappush_max() because we didn't need it internally and it would just be dead code. Thanks for the report. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45259> _______________________________________ From report at bugs.python.org Tue Sep 21 22:09:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 22 Sep 2021 02:09:52 +0000 Subject: [issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed In-Reply-To: <1631758390.34.0.18935168801.issue45215@roundup.psfhosted.org> Message-ID: <1632276592.19.0.282497085122.issue45215@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: ?ukasz: For parent, there's this issue: #39222 (which is why I started looking into this). For name, I couldn't find anything here or on SO, but it's hard to search for this because keywords 'mock argument name' on SO finds over 700 results but they're referring to argument names, rather than literal argument `name`. I didn't look through all 700 though :) The scenario that I was thinking about that could cause issues is that one developer creates a bunch of tests with Mock(name=1) for example, that doesn't cause any issues if the mocks aren't printed (for example if they're attributes). Some time later another dev is expanding or debugging the tests and needs to print the mocks, which causes errors. Now the 2nd dev will need to figure out why the first dev used these names and if they can be safely changed to strings - quite annoying. It seems like the instances in the std lib of name args are of the form: init(name) self.name = name repr() return '<... %s ...>' % self.name or equivalent; I've also did a grep for `return self.name` and it was a fairly short list so i was able to check all of them, and all of the hits either internal use classes or functions, or check the type of `name` in __init__, or the return is not from __repr__ but from some other function. I didn't check all instances of where name arg is passed to init, because it's a much longer list and I figured the cases where it could be a problem would be ones with `__repr__(): return self.name`, and those are all fine. The case with Mock is also different because users are not passing it as a known argument but as a "mock accepts all arguments and sets them as attrs" type of usage. On the other hand, I don't think this is a high priority issue, users are probably not using name and parent args that often, and when they do, most of them probably try to print them as they work on the test; and if they do run into this issue later, it's not very hard to fix. So it might be worth just leaving this open and seeing if more users run into it. Let me know what you think! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45215> _______________________________________ From report at bugs.python.org Tue Sep 21 22:10:21 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 22 Sep 2021 02:10:21 +0000 Subject: [issue45258] sysroot_paths in setup.py does not consider -isysroot for macOS In-Reply-To: <1632247465.13.0.0994928564671.issue45258@roundup.psfhosted.org> Message-ID: <1632276621.63.0.550990008345.issue45258@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: See my comment on the PR. ---------- components: +macOS -Build nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45258> _______________________________________ From report at bugs.python.org Wed Sep 22 00:38:43 2021 From: report at bugs.python.org (wyz23x2) Date: Wed, 22 Sep 2021 04:38:43 +0000 Subject: [issue41266] IDLE call hints and completions confused by ints and floats In-Reply-To: <1594370995.93.0.883531134582.issue41266@roundup.psfhosted.org> Message-ID: <1632285523.71.0.0863488353811.issue41266@roundup.psfhosted.org> wyz23x2 <wyz23x2 at 163.com> added the comment: Ping. >>> from datetime import datetime as d >>> d(2021, 9, 22)-d(2020, 7, 10) datetime.timedelta(days=439) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41266> _______________________________________ From report at bugs.python.org Wed Sep 22 02:14:37 2021 From: report at bugs.python.org (zcpara) Date: Wed, 22 Sep 2021 06:14:37 +0000 Subject: [issue45260] Implement superinstruction UNPACK_SEQUENCE_ST Message-ID: <1632291277.5.0.29382799945.issue45260@roundup.psfhosted.org> New submission from zcpara <zhangchaospecial at gmail.com>: PEP 659 quickening provides a mechanism for replacing instructions. We add another super-instruction UNPACK_SEQUENCE_ST to replace the original UNPACK_SEQUENCE and the following n STROE_FAST instructions. See https://github.com/faster-cpython/ideas/issues/16. ---------- messages: 402407 nosy: gvanrossum, zhangchaospecial priority: normal severity: normal status: open title: Implement superinstruction UNPACK_SEQUENCE_ST type: performance versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45260> _______________________________________ From report at bugs.python.org Wed Sep 22 02:56:04 2021 From: report at bugs.python.org (karl) Date: Wed, 22 Sep 2021 06:56:04 +0000 Subject: [issue44423] copy2 / sendfile fails on linux with large file In-Reply-To: <1623736345.91.0.29501439742.issue44423@roundup.psfhosted.org> Message-ID: <1632293764.63.0.162515824789.issue44423@roundup.psfhosted.org> karl <k.r.goger+github at gmail.com> added the comment: could not reproduce the error ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44423> _______________________________________ From report at bugs.python.org Wed Sep 22 03:36:10 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Sep 2021 07:36:10 +0000 Subject: [issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't In-Reply-To: <1632219004.38.0.384880031539.issue45255@roundup.psfhosted.org> Message-ID: <1632296170.56.0.874581105292.issue45255@roundup.psfhosted.org> Marc-Andre Lemburg <mal at egenix.com> added the comment: Such a change would be backwards incompatible and no longer in line with PEP 249. I also don't understand what you regard as confusing about the message "unable to open database file". The message could be extended to include the path, but apart from that, it's as clear as it can get :-) ---------- nosy: +lemburg status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45255> _______________________________________ From report at bugs.python.org Wed Sep 22 04:03:04 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 22 Sep 2021 08:03:04 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632297784.58.0.284956978032.issue24076@roundup.psfhosted.org> Stefan Behnel <stefan_ml at behnel.de> added the comment: Sorry for that, Pablo. I knew exactly where the problem was, the second I read your notification. Thank you for resolving it so quickly. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Wed Sep 22 04:12:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Sep 2021 08:12:53 +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: <1632298373.98.0.136606817455.issue41203@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26907 pull_request: https://github.com/python/cpython/pull/28515 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Wed Sep 22 04:15:55 2021 From: report at bugs.python.org (Tim Holy) Date: Wed, 22 Sep 2021 08:15:55 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) Message-ID: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> New submission from Tim Holy <tim.holy at gmail.com>: This is a lightly-edited reposting of https://stackoverflow.com/questions/69164027/unreliable-results-from-timeit-cache-issue I am interested in timing certain operations in numpy and skimage, but I'm occasionally seeing surprising transitions (not entirely reproducible) in the reported times. Briefly, sometimes timeit returns results that differ by about 5-fold from earlier runs. Here's the setup: import skimage import numpy as np import timeit nrep = 16 def run_complement(img): def inner(): skimage.util.invert(img) return inner img = np.random.randint(0, 65535, (512, 512, 3), dtype='uint16') and here's an example session: In [1]: %run python_timing_bug.py In [2]: t = timeit.Timer(run_complement(img)) In [3]: t.repeat(nrep, number=1) Out[3]: [0.0024439050030196086, 0.0020311699918238446, 0.00033007100864779204, 0.0002889479947043583, 0.0002851780009223148, 0.0002851030003512278, 0.00028487699455581605, 0.00032116699730977416, 0.00030912700458429754, 0.0002877369988709688, 0.0002840430097421631, 0.00028515000303741544, 0.00030791999597568065, 0.00029302599432412535, 0.00030723700183443725, 0.0002916679950430989] In [4]: t = timeit.Timer(run_complement(img)) In [5]: t.repeat(nrep, number=1) Out[5]: [0.0006320849934127182, 0.0004014919977635145, 0.00030359599622897804, 0.00029224599711596966, 0.0002907510061049834, 0.0002920039987657219, 0.0002918920072261244, 0.0003095199936069548, 0.00029789700056426227, 0.0002885590074583888, 0.00040198900387622416, 0.00037131100543774664, 0.00040271600300911814, 0.0003492849937174469, 0.0003378120018169284, 0.00029762100894004107] In [6]: t = timeit.Timer(run_complement(img)) In [7]: t.repeat(nrep, number=1) Out[7]: [0.00026428700948599726, 0.00012682100350502878, 7.380900206044316e-05, 6.346100417431444e-05, 6.29679998382926e-05, 6.278700311668217e-05, 6.320899410638958e-05, 6.25409884378314e-05, 6.262199894990772e-05, 6.247499550227076e-05, 6.293901242315769e-05, 6.259800284169614e-05, 6.285199197009206e-05, 6.293600017670542e-05, 6.309800664894283e-05, 6.248900899663568e-05] Notice that in the final run, the minimum times were on the order of 0.6e-4 vs the previous minimum of ~3e-4, about 5x smaller than the times measured in previous runs. It's not entirely predictable when this "kicks in." The faster time corresponds to 0.08ns/element of the array, which given that the 2.6GHz clock on my i7-8850H CPU ticks every ~0.4ns, seems to be pushing the limits of credibility (though thanks to SIMD on my AVX2 CPU, this cannot be entirely ruled out). My understanding is that this operation is implemented as a subtraction and most likely gets reduced to a bitwise-not by the compiler. So you do indeed expect this to be fast, but it's not entirely certain it should be this fast, and in either event the non-reproducibility is problematic. It may be relevant to note that the total amount of data is In [15]: img.size * 2 Out[15]: 1572864 and lshw reports that I have 384KiB L1 cache and 1536KiB of L2 cache: In [16]: 384*1024 Out[16]: 393216 In [17]: 1536*1024 Out[17]: 1572864 So it seems possible that this result is being influenced by just fitting in L2 cache. (Note that even in the "fast block," the first run was not fast.) If I increase the size of the image: img = np.random.randint(0, 65535, (2048, 2048, 3), dtype='uint16') then my results seem more reproducible in the sense that I have not yet seen one of these transitions. ---------- components: Library (Lib) messages: 402411 nosy: timholy priority: normal severity: normal status: open title: Unreliable (?) results from timeit (cache issue?) type: behavior versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 04:32:26 2021 From: report at bugs.python.org (Benjamin Schiller) Date: Wed, 22 Sep 2021 08:32:26 +0000 Subject: [issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application Message-ID: <1632299546.72.0.498896278525.issue45262@roundup.psfhosted.org> New submission from Benjamin Schiller <benjamin.schiller at vector.com>: We have embedded Python in our application and we deinitialize/initialize the interpreter at some point of time. If a simple script with a thread that sleeps with asyncio.sleep is loaded before and after the re-initialization, then we get the following assertion in the second run of the python module: "Assertion failed: Py_IS_TYPE(rl, &PyRunningLoopHolder_Type), file D:\a\1\s\Modules_asynciomodule.c, line 261" Example to reproduce this crash: https://github.com/benjamin-sch/asyncio_crash_in_second_run ---------- components: asyncio messages: 402412 nosy: asvetlov, benjamin-sch, yselivanov priority: normal severity: normal status: open title: crash if asyncio is used before and after re-initialization if using python embedded in an application type: crash versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45262> _______________________________________ From report at bugs.python.org Wed Sep 22 05:23:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 09:23:49 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632302629.78.0.856780799981.issue45061@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26908 pull_request: https://github.com/python/cpython/pull/28516 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Wed Sep 22 05:51:41 2021 From: report at bugs.python.org (Kenneth Fossen) Date: Wed, 22 Sep 2021 09:51:41 +0000 Subject: [issue45263] round displays 2 instead of 3 digits Message-ID: <1632304301.35.0.921542504833.issue45263@roundup.psfhosted.org> New submission from Kenneth Fossen <fossen.kenneth at gmail.com>: When round is given 3 as argument for number of decimal points, the expected behaviour is to return a digit with 3 decimal points Example: ig1 = 0.4199730940219749 ig2 = 0.4189730940219749 print(round(ig1, 3)) # 0.42 expected to be 0.420 print(round(ig2, 3)) # 0.419 ---------- messages: 402413 nosy: kenfos priority: normal severity: normal status: open title: round displays 2 instead of 3 digits type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45263> _______________________________________ From report at bugs.python.org Wed Sep 22 05:57:44 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 22 Sep 2021 09:57:44 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632304664.43.0.280882460159.issue45261@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Running timeit with number=1 for fast running processes is not likely to be reliable. The problem is that modern computers are *incredibly noisy*, there are typically hundreds of processes running on them at any one time. Trying to get deterministic times from something that runs in 0.3 ms or less is not easy. You can see yourself that the first couple of runs are of the order of 2-10 times higher before settling down. And as you point out, then there is a further drop by a factor of 5. I agree that a CPU cache kicking in is a likely explanation. When I use timeit, I generally try to have large enough number that the time is at least 0.1s per loop. To be perfectly honest, I don't know if that is actually helpful or if it is just superstition, but using that as a guide, I've never seen the sort of large drop in timing results that you are getting. I presume you have read the notes in the doc about the default time? "default_timer() measurements can be affected by other programs running on the same machine" https://docs.python.org/3/library/timeit.html There are more comments about timing in the source code and the commentary by Tim Peters in the Cookbook. Another alternative is to try Victor Stinner's pyperf tool. I don't know how it works though. ---------- nosy: +steven.daprano, tim.peters, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 06:06:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 10:06:31 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632305191.9.0.231070943254.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I'm removing the release blocker as per above, feel free to close of there is nothing else to discuss or act on here. ---------- priority: release blocker -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Wed Sep 22 06:05:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 10:05:13 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632305113.97.0.420535333616.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I discussed this particular instance with the Steering Council and the conclusion was that this field (use_tracing) is considered an implementation detail and therefore its removal it's justified so we won't be restoring it. I'm therefore closing PR28498 Notice that this decision only affects this particular issue and should not be generalized to other fields or structures. We will try to determine and open a discusion in the future about what is considered public/private in these ambiguous cases and what can users expect regarding stability and backwards compatibility. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Wed Sep 22 06:16:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 10:16:57 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1632305817.3.0.707540460297.issue45061@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 8620be99da930230b18ec05f4d7446ee403531af by Victor Stinner in branch 'main': bpo-45061: Revert unicode_is_singleton() change (GH-28516) https://github.com/python/cpython/commit/8620be99da930230b18ec05f4d7446ee403531af ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45061> _______________________________________ From report at bugs.python.org Wed Sep 22 06:24:11 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 22 Sep 2021 10:24:11 +0000 Subject: [issue45263] round displays 2 instead of 3 digits In-Reply-To: <1632304301.35.0.921542504833.issue45263@roundup.psfhosted.org> Message-ID: <1632306251.43.0.497850696578.issue45263@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: "the expected behaviour is to return a digit with 3 decimal points" I presume you mean a float with 3 digits after the decimal point. Three decimal points would be a bug :-) I am afraid that you are misinterpreting what you are seeing. Rounding a number does not force it to display with trailing zeroes. Floats display using the most natural form, which means trailing zeroes are dropped. 0.42 will display as 0.42 not 0.420 or 0.4200 or 0.4200000000. The number has no idea that you want to display three digits, and cannot know. There is no way for each number to remember that at some point it came from you calling round(). If you need to format the number for display to a fixed size, don't use round, use one of the many different string methods: >>> num = 0.42 >>> print("x = %.4f" % num) x = 0.4200 >>> print("x = {:.8f}".format(num)) x = 0.42000000 >>> print(f"x = {num:.12f}") x = 0.420000000000 This is for reporting bugs, not a help desk. In the future, it is best to check with more experienced programmers before reporting things as a bug. There are many useful forums such as the Python Discuss website, Reddit's r/learnpython, or the Python-List mailing list where people will be happy to help guide you whether you have discovered a bug or not. https://www.python.org/community/forums/ This is *especially* important when it comes to numeric issues which can be tricky even for experienced coders. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45263> _______________________________________ From report at bugs.python.org Wed Sep 22 06:26:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 10:26:07 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632306367.37.0.084544173381.issue45261@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: PyPy emits a warning when the timeit module is used, suggesting to use pyperf. timeit uses the minimum, whereas pyperf uses the average (arithmetic mean). timeit uses a single process, pyperf spawns 21 processes: 1 just for the loop calibration, 20 to compute values. timeit computes 5 values, pyperf computes 60 values. timeit uses all computed values, pyperf ignores the first value considered as a "warmup value" (the number of warmup values can be configured). timeit doesn't compute the standard deviation, pyperf does. The standard deviation gives an idea if the benchmark looks reliable or not. IMO results without standard deviation should not be trusted. pyperf also emits warning when a benchmark doesn't look reliable. For example, if the user ran various workload while the benchmark was running. pyperf also supports storing results in a JSON file which stores all values, but also metadata. I cannot force people to stop using timeit. But there are reason why pyperf is more reliable than timeit. Benchmarking is hard. See pyperf documentation giving hints how to get reproducible benchmark results: https://pyperf.readthedocs.io/en/latest/run_benchmark.html#how-to-get-reproducible-benchmark-results Read also this important article ;-) "Biased Benchmarks (honesty is hard)" http://matthewrocklin.com/blog/work/2017/03/09/biased-benchmarks ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 06:26:36 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 22 Sep 2021 10:26:36 +0000 Subject: [issue45263] round displays 2 instead of 3 digits In-Reply-To: <1632304301.35.0.921542504833.issue45263@roundup.psfhosted.org> Message-ID: <1632306396.25.0.932171900056.issue45263@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Oh, I forgot: Python mailing lists and IRC: https://www.python.org/community/lists/ https://www.python.org/community/irc/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45263> _______________________________________ From report at bugs.python.org Wed Sep 22 06:30:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 10:30:16 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1632306616.96.0.939290862883.issue24076@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Always happy to help :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24076> _______________________________________ From report at bugs.python.org Wed Sep 22 06:46:30 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 22 Sep 2021 10:46:30 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632306367.37.0.084544173381.issue45261@roundup.psfhosted.org> Message-ID: <20210922104225.GI11377@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: Thanks Victor for the explanation about pyperf's addition features. They do sound very useful. Perhaps we should consider adding some of them to timeit? However, in my opinion using the average is statistically wrong. Using the mean is good when errors are two-sided, that is, your measured value can be either too low or too high compared to the measured value: measurement = true value ? random error If the random errors are symmetrically distributed, then taking the average tends to cancel them out and give you a better estimate of the true value. Even if the errors aren't symmetrical, the mean will still be a better estimate of the true value. (Or perhaps a trimmed mean, or the median, if there are a lot of outliers.) But timing results are not like that, the measurement errors are one-sided, not two: measurement = true value + random error So by taking the average, all you are doing is averaging the errors, not cancelling them. The result you get is *worse* as an estimate of the true value than the minimum. All those other factors (ignore the warmup, check for a small stdev, etc) seem good to me. But the minimum, not the mean, is still going to be closer to the true cost of running the code. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 08:03:51 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 22 Sep 2021 12:03:51 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632312231.68.0.0690651420236.issue44958@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Erlend, I suspect that 050d1035957379d70e8601e6f5636637716a264b may have introduced a perf regression in pyperformance's sqlite_synth benchmark: https://speed.python.org/timeline/?exe=12&base=&ben=sqlite_synth&env=1&revs=50&equid=off&quarts=on&extr=on The benchmark code is here https://github.com/python/pyperformance/blob/main/pyperformance/benchmarks/bm_sqlite_synth.py. ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Wed Sep 22 08:11:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 22 Sep 2021 12:11:19 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632312679.97.0.609984716134.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Ouch, that's quite a regression! Thanks for the heads up! I'll have a look at it right away. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Wed Sep 22 08:19:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 22 Sep 2021 12:19:39 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632313179.14.0.998087668322.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: I'm unable to reproduce this regression on my machine (macOS, debug build, no optimisations). Are you able to reproduce, Ken? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Wed Sep 22 08:24:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 22 Sep 2021 12:24:21 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632313461.01.0.862488329684.issue45256@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Wed Sep 22 08:24:33 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 22 Sep 2021 12:24:33 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632313473.08.0.484715439964.issue43760@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: > The ABI is not broken, the only thing that this PR change is the size of the struct. All the offsets to the members are the same and therefore will be valid in any compiled code. I'll just note that a change in struct size does technically break ABI, since *arrays* of PyThreadState will break. So the size shouldn't be changed in RCs or point releases. (But since it's not part of stable ABI, it was OK to change it for 3.10.) > We will try to determine and open a discussion in the future about what is considered public/private in these ambiguous cases and what can users expect regarding stability and backwards compatibility. Please keep me in the loop; I'm working on summarizing my understanding of this (in a form that can be added to the docs if approved). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Wed Sep 22 08:27:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 22 Sep 2021 12:27:53 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632313673.11.0.19956187209.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: > I'm unable to reproduce this regression on my machine (macOS, debug build, no optimisations) [...] Correction: I _am_ able to reproduce this. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Wed Sep 22 08:39:51 2021 From: report at bugs.python.org (tongxiaoge) Date: Wed, 22 Sep 2021 12:39:51 +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: <1632314391.73.0.55583691156.issue44598@roundup.psfhosted.org> tongxiaoge <shixuantong at huawei.com> added the comment: I installed OpenSSL version 1.1.1l and tested it again. The problem disappeared. It should be the reason why the OpenSSL version I used before is too low. The current issue is closed ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44598> _______________________________________ From report at bugs.python.org Wed Sep 22 08:44:50 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 22 Sep 2021 12:44:50 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632314690.85.0.616189456819.issue45261@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 08:52:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Sep 2021 12:52:08 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632315128.83.0.342782851078.issue45256@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: AFAIK Mark Shannon proposed this idea, but it was rejected. ---------- nosy: +gvanrossum, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Wed Sep 22 09:04:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 13:04:35 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632315875.06.0.535376618952.issue45256@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: What was rejected was https://www.python.org/dev/peps/pep-0651/ which included this idea but had a lot more stuff in it. In particular, it was rejected because it gave semantics to overflow exceptions (two exceptions were proposed), new APIs and it had lack consistent guarantees for different platforms, among other considerations. This version is just for optimization purposes with no changes in semantics. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Wed Sep 22 09:12:34 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 22 Sep 2021 13:12:34 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1632316354.96.0.320604768727.issue45213@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: I thought about the Trie implementation for this case. But as Eric said, it can be overkilling for this time. ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Wed Sep 22 09:19:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 13:19:57 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632316797.9.0.519183605772.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I'll just note that a change in struct size does technically break ABI, since *arrays* of PyThreadState will break. Not that matters now because we are not proceeding but just to clarify why I deemed this acceptable: arrays of PyThreadState is extremelly unlikely in extensions because we pass it by Pointer and is always manipulated by pointer. To place it in an array you either need to create one or copy one into an array, which I cannot see what would be the point because the fields are mainly pointers that would become useless as the interpreter will not update anything ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Wed Sep 22 09:22:03 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Sep 2021 13:22:03 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1632316923.96.0.611376150182.issue45213@roundup.psfhosted.org> Marc-Andre Lemburg <mal at egenix.com> added the comment: Perhaps a frozen dict could be used instead of the linear search. This could then also be made available as sys.frozen_modules for inspection by applications and tools such as debuggers or introspection tools trying to find source code (and potentially failing at this). Not urgent, though. ---------- nosy: +lemburg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Wed Sep 22 09:22:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 13:22:31 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632316951.0.0.820144153114.issue43760@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Also, I checked the DWARF tree of all existing wheels for 3.10 on PyPI (there aren't many) and none had anything that uses the size of the struct. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Wed Sep 22 09:39:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 13:39:06 +0000 Subject: [issue41137] pdb uses the locale encoding for .pdbrc In-Reply-To: <1593242595.67.0.594029276449.issue41137@roundup.psfhosted.org> Message-ID: <1632317946.83.0.122413425551.issue41137@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +vstinner nosy_count: 4.0 -> 5.0 pull_requests: +26909 pull_request: https://github.com/python/cpython/pull/28518 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41137> _______________________________________ From report at bugs.python.org Wed Sep 22 09:51:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 13:51:35 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632318695.16.0.214608602727.issue45261@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > But timing results are not like that, the measurement errors are one-sided, not two: (..) I suggest you to run tons of benchmarks and look at the distribution. The reality is more complex than what you may think. > measurement = true value + random error In my experience, there is no single "true value", they are multiple values. Concrete example where the Python randomized hash function gives different value each time you spawn a new Python process: https://vstinner.github.io/journey-to-stable-benchmark-average.html Each process has its own "true value", but pyperf spawns 20 Python processes :-) There are multiple sources of randomness, not only the Python randomized hash function. On Linux, the process address space is randomized by ASLR. I may give different timing at each run. Code placement, exact memory address, etc. Many things enter into the game when you look into functions which take less than 100 ns. Here is report is about a value lower than a single nanosecond: "0.08ns/element". -- I wrote articles about benchmarking: https://vstinner.readthedocs.io/benchmark.html#my-articles I gave a talk about it: * https://raw.githubusercontent.com/vstinner/talks/main/2017-FOSDEM-Brussels/howto_run_stable_benchmarks.pdf * https://archive.fosdem.org/2017/schedule/event/python_stable_benchmark/ Again, good luck with benchmarking, it's a hard problem ;-) -- Once you will consider that you know everything about benchmarking, you should read the following paper and cry: https://arxiv.org/abs/1602.00602 See also my analysis of PyPy performance: https://vstinner.readthedocs.io/pypy_warmups.html ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 09:56:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 13:56:33 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1632318993.45.0.734035124675.issue28307@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: commit a0bd9e9c11f5f52c7ddd19144c8230da016b53c6 Author: Serhiy Storchaka <storchaka at gmail.com> Date: Sat May 8 22:33:10 2021 +0300 bpo-28307: Convert simple C-style formatting with literal format into f-string. (GH-5012) C-style formatting with literal format containing only format codes %s, %r and %a (with optional width, precision and alignment) will be converted to an equivalent f-string expression. It can speed up formatting more than 2 times by eliminating runtime parsing of the format string and creating temporary tuple. commit 8b010673185d36d13e69e5bf7d902a0b3fa63051 Author: Serhiy Storchaka <storchaka at gmail.com> Date: Sun May 23 19:06:48 2021 +0300 bpo-28307: Tests and fixes for optimization of C-style formatting (GH-26318) Fix errors: * "%10.s" should be equal to "%10.0s", not "%10s". * Tuples with starred expressions caused a SyntaxError. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28307> _______________________________________ From report at bugs.python.org Wed Sep 22 10:07:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:07:09 +0000 Subject: [issue45256] Remove the usage of the cstack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632319629.54.0.752467531106.issue45256@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Wed Sep 22 10:09:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:09:38 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632319778.6.0.380710638702.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 58f8adfda3c2b42f654a55500e8e3a6433cb95f2 by Victor Stinner in branch 'main': bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483) https://github.com/python/cpython/commit/58f8adfda3c2b42f654a55500e8e3a6433cb95f2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 10:13:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:13:34 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632320014.58.0.249356375971.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Livius: your first PR modified Sleep() in Modules/_tkinter.c to use nanosleep(). I don't see the point since this function has a solution of 1 ms (10^-3). Using select() on Unix is enough: resolution of 1 us (10^-6). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 10:34:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 22 Sep 2021 14:34:45 +0000 Subject: [issue41266] IDLE call hints and completions confused by ints and floats In-Reply-To: <1594370995.93.0.883531134582.issue41266@roundup.psfhosted.org> Message-ID: <1632321285.83.0.839125123308.issue41266@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: What is your point? Code without explanation is useless. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41266> _______________________________________ From report at bugs.python.org Wed Sep 22 10:50:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:50:04 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632322204.91.0.0495149188188.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: bench.py: measure the shortest possible sleep. Use time.sleep(1e-10): 0.1 nanosecond. It should be rounded to the resolution of the used sleep function, like 1 ns on Linux. On Linux with Fedora 34 Python 3.10 executable, I get: Mean +- std dev: 60.5 us +- 12.9 us (80783 values) On Windows with a Python 3.11 debug build, I get: Mean +- std dev: 21.9 ms +- 7.8 ms (228 values) Sadly, it seems like on Windows 10, one of the following function still uses the infamous 15.6 ms resolution: * CreateWaitableTimerW() * SetWaitableTimer() * WaitForMultipleObjects() ---------- Added file: https://bugs.python.org/file50294/bench.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 10:51:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:51:54 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632322314.95.0.943750540819.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > On Windows with a Python 3.11 debug build, I get: > Mean +- std dev: 21.9 ms +- 7.8 ms (228 values) I wrote an optimization to cache the Windows timer handle between time.sleep() calls (don't close it). I don't think that it's needed because they shortest sleep is about 15.6 ms. CreateWaitableTimerW() is likely way more fast than 15.6 ms. So this optimization is basically useless. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 10:52:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 14:52:28 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632322348.88.0.574392054679.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Livius: do you care about using nanosleep(), or can I close the issue? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 11:02:17 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 22 Sep 2021 15:02:17 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1632322937.18.0.369196659074.issue40116@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: This can be mitigated, if not entirely fixed, by storing an ordering bit vector in the values. This way all instances of the class SometimesShared in the example above can share the keys. The keys might be ("optional", "attr") For any instances with only "attr" as an attibute, the values would be (NULL, value) and the order would be (1,) The downsides of this approach are: 1. Each values, and thus dict needs an extra 64 bit value. 2. Shared keys have a maximum size of 16. Overall, I expect the improved sharing to more than compensate for the disadvantages. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Wed Sep 22 11:03:05 2021 From: report at bugs.python.org (zcpara) Date: Wed, 22 Sep 2021 15:03:05 +0000 Subject: [issue45260] Implement superinstruction UNPACK_SEQUENCE_ST In-Reply-To: <1632291277.5.0.29382799945.issue45260@roundup.psfhosted.org> Message-ID: <1632322985.64.0.259524769016.issue45260@roundup.psfhosted.org> Change by zcpara <zhangchaospecial at gmail.com>: ---------- keywords: +patch pull_requests: +26910 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28519 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45260> _______________________________________ From report at bugs.python.org Wed Sep 22 11:05:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 22 Sep 2021 15:05:03 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1632323103.14.0.640212119474.issue40116@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- keywords: +patch pull_requests: +26911 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28520 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Wed Sep 22 11:23:41 2021 From: report at bugs.python.org (John Wodder) Date: Wed, 22 Sep 2021 15:23:41 +0000 Subject: [issue45264] venv: Make activate et al. export custom prompt prefix as an envvar Message-ID: <1632324221.63.0.136489331913.issue45264@roundup.psfhosted.org> New submission from John Wodder <bugs.python.org at varonathe.org>: I use a custom script (and I'm sure many others have similar scripts as well) for setting my prompt in Bash. It shows the name of the current venv (if any) by querying the `VIRTUAL_ENV` environment variable, but if the venv was created with a custom `--prompt`, it is unable to use this prompt prefix, as the `activate` script does not make this information available. I thus suggest that the `activate` et al. scripts should set and export an environment variable named something like `VIRTUAL_ENV_PROMPT_PREFIX` that contains the prompt prefix (either custom or default) that venv would prepend to the prompt. Ideally, this should be set even when `VIRTUAL_ENV_DISABLE_PROMPT` is set in case the user wants total control over their prompt. (This was originally posted as an issue for virtualenv at <https://github.com/pypa/virtualenv/issues/2194>, and it was suggested to post it here for feedback.) ---------- components: Library (Lib) messages: 402444 nosy: jwodder priority: normal severity: normal status: open title: venv: Make activate et al. export custom prompt prefix as an envvar type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45264> _______________________________________ From report at bugs.python.org Wed Sep 22 11:35:14 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 22 Sep 2021 15:35:14 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632318695.16.0.214608602727.issue45261@roundup.psfhosted.org> Message-ID: <20210922153108.GJ11377@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: Thank you Victor, I don't know whether I can convince you or you will convince me, but this is very interesting one way or the other. And I hope that Tim Holy is interested too :-) On Wed, Sep 22, 2021 at 01:51:35PM +0000, STINNER Victor wrote: > > But timing results are not like that, the measurement errors are > > one-sided, not two: (..) > > I suggest you to run tons of benchmarks and look at the distribution. > The reality is more complex than what you may think. We are trying to find the ideal time that the code would take with no external factors slowing it. No noise, no other processes running, no operating system overhead. The baseline time that it would take to run the code if the CPU could dedicate every cycle to your code and nothing else. (Obviously we cannot measure that time on a real computer where there is always other processes running, but we want the best estimate of that time we can reach.) There may still be conditions that can shift the baseline, e.g. the data fits in the CPU cache or it doesn't, but that's not *environmental* noise except so far as the impact of other processes might push your data out of the cache. So in a noisy system (a real computer) there is some ideal time that the code would take to run if the CPU was dedicated to running your code only, and some actual time (ideal time + environmental noise) that we can measure. The enviromental noise is never negative. That would mean that running more processes on the machine could make it faster. That cannot be. > > measurement = true value + random error > > In my experience, there is no single "true value", they are multiple > values. Concrete example where the Python randomized hash function > gives different value each time you spawn a new Python process: > > https://vstinner.github.io/journey-to-stable-benchmark-average.html > > Each process has its own "true value", but pyperf spawns 20 Python > processes :-) Thank you for the link, I have read it. Of course the more processes you spawn, the more environmental noise there is, which means more noise in your measurements. If you run with 10 processes, or 100 processes, you probably won't get the same results for the two runs. (Sorry, I have not tried this myself. Consider this a prediction.) You say: "But how can we compare performances if results are random? Take the minimum? No! You must never (ever again) use the minimum for benchmarking! Compute the average and some statistics like the standard deviation" but you give no reason for why you should not use the minimum. Without a reason why the minimum is *wrong*, I cannot accept that prohibition. > Here is report is about a value lower than a single nanosecond: > "0.08ns/element". An Intel i7 CPU performs at approximately 220000 MIPS, so you can execute about 17 or 18 CPU instructions in 0.08 ns. (Depends on the instruction, of course.) AMD Ryzen Threadripper may be ten times as fast. Without knowing the CPU and code I cannot tell whether to be impressed or shocked at the time. > Again, good luck with benchmarking, it's a hard problem ;-) Thank you, and I do appreciate all the work you have put into it, even if you have not convinced me to stop using the minimum. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 11:43:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 15:43:30 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632325410.82.0.368938763236.issue45238@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d by Serhiy Storchaka in branch 'main': bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) https://github.com/python/cpython/commit/ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 11:43:36 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 22 Sep 2021 15:43:36 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1632316923.96.0.611376150182.issue45213@roundup.psfhosted.org> Message-ID: <CALFfu7BJGxMJbjHd0d8mdNqES+zBgA9AEEsoemX_=CELjD5qtw@mail.gmail.com> Eric Snow <ericsnowcurrently at gmail.com> added the comment: On Wed, Sep 22, 2021 at 7:12 AM Dong-hee Na <report at bugs.python.org> wrote: > I thought about the Trie implementation for this case. On Wed, Sep 22, 2021 at 7:22 AM Marc-Andre Lemburg <report at bugs.python.org> wrote: > Perhaps a frozen dict could be used instead of the linear search. > > This could then also be made available as sys.frozen_modules for inspection by applications and tools such as debuggers or introspection tools trying to find source code (and potentially failing at this). Both are worth exploring later. FWIW, I was also considering _Py_hashtable_t (from Include/internal/pycore_hashtable.h). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Wed Sep 22 11:43:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 15:43:55 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632325435.2.0.922046636852.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-19007: "precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 11:52:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 15:52:23 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632325943.01.0.560550856234.issue45261@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > but you give no reason for why you should not use the minimum. See https://pyperf.readthedocs.io/en/latest/analyze.html#minimum-vs-average I'm not really interested to convince you. Use the minimum if you believe that it better fits your needs. But pyperf will stick to the mean to get more reproducible benchmark results ;-) There are many believes and assumptions made by people running benchmarks. As I wrote, do your own experiments ;-) Enjoy multimodal distributions ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 11:53:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 15:53:43 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632326023.77.0.464225720049.issue45261@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I suggest to close this issue. timeit works as expected. It has limitations, but that's ok. Previous attempts to enhance timeit were rejected. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 11:57:37 2021 From: report at bugs.python.org (Tim Holy) Date: Wed, 22 Sep 2021 15:57:37 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632326257.0.0.357065882651.issue45261@roundup.psfhosted.org> Tim Holy <tim.holy at gmail.com> added the comment: To make sure it's clear, it's not 0.08ns/function call, it's a loop and it comes out to 0.08ns/element. The purpose of quoting that number was to compare to the CPU clock interval, which on my machine is ~0.4ns. Any operation that's less than 1 clock cycle is suspicious, but not automatically wrong because of SIMD (if the compiler generates such instructions for this operation, but I'm not sure how one checks that in Python). On my AVX2 processor, as many as 16 `uint16` values could fit simultaneously, and so you can't entirely rule out times well below one clock cycle (although the need for load, manipulation, store, and increment means that its not plausible to be 1/16th of the clock cycle). Interestingly, increasing `number` does seem to make it consistent, without obvious transitions. I'm curious why the reported times are not "per number"; I find myself making comparisons using list(map(lambda tm : tm / 1000, t.repeat(repeat=nrep, number=1000))) Should the documentation mention that the timing of the core operation should be divided by `number`? However, in the bigger picture of things I suspect this should be closed. I'll let others chime in first, in case they think documentation or other things need to be changed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 11:57:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Sep 2021 15:57:55 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632326275.63.0.105370384931.issue45256@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Remove the usage of the cstack in Python to Python calls -> Remove the usage of the C stack in Python to Python calls _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Wed Sep 22 12:10:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:10:49 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632327049.65.0.855722606543.issue45238@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26912 pull_request: https://github.com/python/cpython/pull/28521 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 12:13:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:13:31 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632327211.59.0.23988410468.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Since len timings for ranges of 100 items are negligible anyway, I personally still favor GH-28176 which is clearly faster during iteration. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Wed Sep 22 12:16:57 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Sep 2021 16:16:57 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632325943.01.0.560550856234.issue45261@roundup.psfhosted.org> Message-ID: <12eaf0ee-9ce7-c274-7aa4-49ea48474ea1@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On the topic average vs. minimum, it's interesting to see this pop up every now and then. When I originally wrote pybench late in 1997, I used average, since it gave good results on my PC at the time. Later on, before pybench was added to Tools/ in Python 2.5 in 2006, people started complaining about sometimes getting weird results (e.g. negative times due to the calibration runs not being stable enough). A lot of noise was made from the minimum fans, so I switched to minimum, which then made the results more stable, but I left in the average figures as well. Then some years later, people complained about pybench not being good enough for comparing to e.g. PyPy, since those other implementations optimized away some of the micro-benchmarks which were used in pybench. It was then eventually removed, to not confuse people not willing to try to understand what the benchmark suite was meant for, nor understand the issues around running such benchmarks on more modern CPUs. CPUs have advanced a lot since the days pybench was written and so reliable timings are not easy to get unless you invest in dedicated hardware, custom OS and CPU settings and lots of time to calibrate everything. See Victor's research for more details. What we have here is essentially the same issue. timeit() is mostly being used for micro-benchmarks, but those need to be run in dedicated environments. timeit() is good for quick checks, but not really up to the task of providing reliable timing results. One of these days, we should ask the PSF or one of its sponsors to provide funding and devtime to set up such a reliable testing environment. One which runs not only high end machines, but also average and lower end machines, and using different OSes, so that we can detect performance regressions early and easily on different platforms. ---------- nosy: +lemburg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 12:19:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:19:28 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632327568.63.0.31962728556.issue45238@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26913 pull_request: https://github.com/python/cpython/pull/28522 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 12:42:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:42:23 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632328943.18.0.939916544411.issue45238@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 44396aaba9b92b3a38a4b422a000d1a8eb05185a by ?ukasz Langa in branch '3.10': [3.10] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28521) https://github.com/python/cpython/commit/44396aaba9b92b3a38a4b422a000d1a8eb05185a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 12:48:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:48:40 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632329320.04.0.138113073566.issue45238@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e06b0fddf69b933fe82f60d78a0f6248ca36a0a3 by ?ukasz Langa in branch '3.9': [3.9] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28522) https://github.com/python/cpython/commit/e06b0fddf69b933fe82f60d78a0f6248ca36a0a3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 12:57:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 22 Sep 2021 16:57:42 +0000 Subject: [issue45238] Fix debug() in IsolatedAsyncioTestCase In-Reply-To: <1631973277.87.0.115937136988.issue45238@roundup.psfhosted.org> Message-ID: <1632329862.2.0.749375170834.issue45238@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Serhiy! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45238> _______________________________________ From report at bugs.python.org Wed Sep 22 13:33:52 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 22 Sep 2021 17:33:52 +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: <1632332032.73.0.574930944003.issue41203@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26915 pull_request: https://github.com/python/cpython/pull/28524 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Wed Sep 22 13:33:46 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 22 Sep 2021 17:33:46 +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: <1632332026.26.0.624966780621.issue41203@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26914 pull_request: https://github.com/python/cpython/pull/28523 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Wed Sep 22 13:34:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Sep 2021 17:34:04 +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: <1632332044.79.0.829480197216.issue41203@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 36122e18148c5b6c78ebce1d36d514fd7cf250f5 by Serhiy Storchaka in branch 'main': bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) https://github.com/python/cpython/commit/36122e18148c5b6c78ebce1d36d514fd7cf250f5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Wed Sep 22 14:01:40 2021 From: report at bugs.python.org (Nima) Date: Wed, 22 Sep 2021 18:01:40 +0000 Subject: [issue45265] Bug in append() method in order to appending a temporary list to a empty list using for loop Message-ID: <1632333699.99.0.749582001831.issue45265@roundup.psfhosted.org> New submission from Nima <nim4fl at gmail.com>: I want to make an list consist on subsequences of another list, for example: -------------------------------------------------------------- input: array = [4, 1, 8, 2] output that i expect: [[4], [4,1], [4, 1, 8], [4, 1, 8, 2]] -------------------------------------------------------------- but output is: [[4, 1, 8, 2], [4, 1, 8, 2], [4, 1, 8, 2], [4, 1, 8, 2]] -------------------------------------------------------------- my code is: num = [4, 1, 8, 2] temp = [] sub = [] for item in num: temp.append(item) sub.append(temp) -------------------------------------------------------------- i think it's a bug because, append() must add an item to the end of the list, but here every time it add the temp to the sub it changes the previous item as well, so if it's not a bug please help me to write the correct code. ---------- components: Windows messages: 402458 nosy: nima_fl, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Bug in append() method in order to appending a temporary list to a empty list using for loop type: behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45265> _______________________________________ From report at bugs.python.org Wed Sep 22 14:08:34 2021 From: report at bugs.python.org (Brian) Date: Wed, 22 Sep 2021 18:08:34 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1632334114.35.0.136507369956.issue40027@roundup.psfhosted.org> Brian <python-bugs at brisammon.fastmail.fm> added the comment: I just ran into this change in behavior myself. It's worth noting that the new behavior appears to match perl's behavior: # perl -e 'print(("he" =~ s/e*\Z/ah/rg), "\n")' hahah ---------- nosy: +bsammon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40027> _______________________________________ From report at bugs.python.org Wed Sep 22 14:08:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 22 Sep 2021 18:08:45 +0000 Subject: [issue45265] Bug in append() method in order to appending a temporary list to a empty list using for loop In-Reply-To: <1632333699.99.0.749582001831.issue45265@roundup.psfhosted.org> Message-ID: <1632334124.99.0.666465373755.issue45265@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: This is expected behavior. To get a better understanding, see: https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x To get help writing correct code, please do not use the bug tracker. Consider posting to StackOverflow instead. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45265> _______________________________________ From report at bugs.python.org Wed Sep 22 14:18:55 2021 From: report at bugs.python.org (Brian) Date: Wed, 22 Sep 2021 18:18:55 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1632334735.81.0.132845563859.issue40027@roundup.psfhosted.org> Brian <python-bugs at brisammon.fastmail.fm> added the comment: txt = ' test' txt = re.sub(r'^\s*', '^', txt) substitutes once because the * is greedy. txt = ' test' txt = re.sub(r'^\s*?', '^', txt) substitutes twice, consistent with the \Z behavior. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40027> _______________________________________ From report at bugs.python.org Wed Sep 22 14:31:48 2021 From: report at bugs.python.org (Tim Holy) Date: Wed, 22 Sep 2021 18:31:48 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632335508.74.0.204528477241.issue45261@roundup.psfhosted.org> Tim Holy <tim.holy at gmail.com> added the comment: > And I hope that Tim Holy is interested too :-) Sure, I'll bite :-). On the topic of which statistic to show, I am a real fan of the histogram. As has been pointed out, timing in the real world can be pretty complicated, and I don't think it does anyone good to hide that complexity. Even in cases where machines aren't busy doing other things, you can get weird multimodal distributions. A great example (maybe not relevant to a lot of Python benchmarks...) is in multithreaded algorithms where the main thread is both responsible for scheduling other threads and for a portion of the work. Even in an almost-idle machine, you can get little race conditions where the main thread decides to pick up some work instants before another thread starts looking for more work. That can generate peaks in the histogram that are separated by the time for one "unit" of work. But if you have to quote one and only one number, I'm a fan of the minimum (as long as you can trust it---which relies on assuming that you've accurately calibrated away all the overhead of your timing apparatus, and not any more). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Wed Sep 22 14:47:16 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 22 Sep 2021 18:47:16 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632336436.28.0.83896636757.issue45020@roundup.psfhosted.org> Brett Cannon <brett at python.org> added the comment: What about if there isn't a pre-computed location for __file__? I could imagine a self-contained CPython build where there is no concept of a file location on disk for anything using this. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 22 14:51:17 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Sep 2021 18:51:17 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1632336436.28.0.83896636757.issue45020@roundup.psfhosted.org> Message-ID: <6c8d6b13-0673-014f-b2fd-2720bbb4073d@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On 22.09.2021 20:47, Brett Cannon wrote: > What about if there isn't a pre-computed location for __file__? I could imagine a self-contained CPython build where there is no concept of a file location on disk for anything using this. This does work and is enough to make most code out there happy. I use e.g. "<pyrun>/os.py" in PyRun. There is no os.py file to load, but tracebacks and inspection tools work just fine with this. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 22 15:02:33 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 22 Sep 2021 19:02:33 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1632337353.9.0.484296096357.issue40116@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: > Overall, I expect the improved sharing to more than > compensate for the disadvantages. I expect the opposite. This makes all dicts pay a price (in space, initialization time, and complexity) for a micro-optimization of an uncommon case (the normal case is for __init__ to run and set all the keys in a consistent order). It is unlikely that the "benefits" to never be felt in real-word applications, but "disadvantages" would affect every Python program. > The language specification says that the dicts maintain insertion > order, but the wording implies that this only to explicit > dictionaries, not instance attribute or other namespace dicts. That is a quite liberal reading of the spec. I would object to making instance and namespace dicts behave differently. That would be a behavior regression and we would forever have to wrestle with the difference. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Wed Sep 22 15:16:19 2021 From: report at bugs.python.org (Victor Milovanov) Date: Wed, 22 Sep 2021 19:16:19 +0000 Subject: [issue45266] subtype_clear can not be called from derived types Message-ID: <1632338179.69.0.00198937271084.issue45266@roundup.psfhosted.org> New submission from Victor Milovanov <lostfreeman at gmail.com>: I am trying to define a type in C, that derives from PyTypeObject. I want to override tp_clear. To do so properly, I should call base type's tp_clear and have it perform its cleanup steps. PyTypeObject has a tp_clear implementation: subtype_clear. Problem is, it assumes the instance it gets is of a type, that does not override PyTypeObject's tp_clear, and behaves incorrectly in 2 ways: 1) it does not perform the usual cleanup, because in this code base = type; while ((baseclear = base->tp_clear) == subtype_clear) the loop condition is immediately false, as my types overrode tp_clear 2) later on it calls baseclear on the same object. But because of the loop above baseclear actually points to my type's custom tp_clear implementation, which leads to reentry to that function (basically a stack overflow, unless there's a guard against it). ---------- components: C API messages: 402466 nosy: Victor Milovanov priority: normal severity: normal status: open title: subtype_clear can not be called from derived types type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45266> _______________________________________ From report at bugs.python.org Wed Sep 22 15:18:47 2021 From: report at bugs.python.org (Victor Milovanov) Date: Wed, 22 Sep 2021 19:18:47 +0000 Subject: [issue45266] subtype_clear can not be called from derived types In-Reply-To: <1632338179.69.0.00198937271084.issue45266@roundup.psfhosted.org> Message-ID: <1632338327.54.0.00831227124768.issue45266@roundup.psfhosted.org> Victor Milovanov <lostfreeman at gmail.com> added the comment: To put it differently, if you think in terms of MRO, my custom type's MRO is my_type_clear (from my type), subtype_clear (from PyTypeObject), etc And subtype_clear incorrectly assumes that it is the first entry in the object's MRO list for tp_clear. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45266> _______________________________________ From report at bugs.python.org Wed Sep 22 15:46:34 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Sep 2021 19:46:34 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1632337353.9.0.484296096357.issue40116@roundup.psfhosted.org> Message-ID: <3db39bbf-ba98-b802-2a0a-b923e8cefaf3@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On 22.09.2021 21:02, Raymond Hettinger wrote: >> The language specification says that the dicts maintain insertion >> order, but the wording implies that this only to explicit >> dictionaries, not instance attribute or other namespace dicts. > > That is a quite liberal reading of the spec. I would object to making instance and namespace dicts behave differently. That would be a behavior regression and we would forever have to wrestle with the difference. I agree. Keeping the insertion order is essential for many common use cases, including those where a class or instance dict is used, e.g. namespaces used for data records, data caches, field definitions in data records, etc. (and yes, those often can be dynamically extended as well :-)). I think for the case you mention, a documentation patch would be better and more helpful for the programmers. Point them to slots and the sharing problem should go away in most cases :-) ---------- nosy: +lemburg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Wed Sep 22 15:57:30 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 22 Sep 2021 19:57:30 +0000 Subject: [issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application In-Reply-To: <1632299546.72.0.498896278525.issue45262@roundup.psfhosted.org> Message-ID: <1632340650.84.0.579583846451.issue45262@roundup.psfhosted.org> Andrew Svetlov <andrew.svetlov at gmail.com> added the comment: I guess the fix requires switching C Extension types from static to heap for _asyncio module. It is possible for sure but requires a non-trivial amount of work. We need a champion for the issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45262> _______________________________________ From report at bugs.python.org Wed Sep 22 16:40:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 22 Sep 2021 20:40:21 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1632343221.12.0.438839474724.issue43976@roundup.psfhosted.org> Jason R. Coombs <jaraco at jaraco.com> added the comment: Here's what I propose: 1. In pypa/distutils, add support for honoring the proposed install schemes (based on PR 25718). Merge with Setuptools. 2. Add whatever ugly hacks are needed to pypa/distutils to honor other Debian-specific behaviors (revive https://github.com/pypa/distutils/pull/4 but properly match Debian expectations). Mark these ugly hacks as deprecated. 3. In Debian, Fedora, etc, provide patches that configure the install schemes. Test with latest Setuptools and SETUPTOOLS_USE_DISTUTILS=local. 4. Formalize the install schemes support in CPython (as in PR 25718). 5. Ask Debian to propose more a cleaner interface for Debian-specific needs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43976> _______________________________________ From report at bugs.python.org Wed Sep 22 16:46:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 22 Sep 2021 20:46:07 +0000 Subject: =?utf-8?q?=5Bissue39549=5D_The_reprlib=2ERepr_type_should_permit_the_?= =?utf-8?q?=E2=80=9Cfillvalue=E2=80=9D_to_be_set_by_the_user?= In-Reply-To: <1580778450.13.0.746492669497.issue39549@roundup.psfhosted.org> Message-ID: <1632343567.28.0.244120280461.issue39549@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: New changeset 8c21941ddafdf4925170f9cea22e2382dd3b0184 by Alexander B?hn in branch 'main': bpo-39549: reprlib.Repr uses a ?fillvalue? attribute (GH-18343) https://github.com/python/cpython/commit/8c21941ddafdf4925170f9cea22e2382dd3b0184 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39549> _______________________________________ From report at bugs.python.org Wed Sep 22 16:46:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 22 Sep 2021 20:46:31 +0000 Subject: =?utf-8?q?=5Bissue39549=5D_The_reprlib=2ERepr_type_should_permit_the_?= =?utf-8?q?=E2=80=9Cfillvalue=E2=80=9D_to_be_set_by_the_user?= In-Reply-To: <1580778450.13.0.746492669497.issue39549@roundup.psfhosted.org> Message-ID: <1632343591.2.0.204188864904.issue39549@roundup.psfhosted.org> Change by Raymond Hettinger <raymond.hettinger at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39549> _______________________________________ From report at bugs.python.org Wed Sep 22 17:22:04 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Wed, 22 Sep 2021 21:22:04 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632345724.96.0.342145212311.issue42969@roundup.psfhosted.org> Change by Jeremy Maitin-Shepard <jeremy at jeremyms.com>: ---------- keywords: +patch pull_requests: +26916 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28525 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Wed Sep 22 18:21:45 2021 From: report at bugs.python.org (Paul Broe) Date: Wed, 22 Sep 2021 22:21:45 +0000 Subject: [issue45267] New install Python 3.9.7 install of Sphinx Document Generator fails Message-ID: <1632349305.85.0.928032648736.issue45267@roundup.psfhosted.org> New submission from Paul Broe <pcbroe at gmail.com>: Brand new build of Python 3.9.7 on RHEL 7. Placed in /usr/local/python3 Created new python environment cd /usr/opt/oracle/ python3 -m venv py3-sphinx source /usr/opt/oracle/py3-sphinx/bin/activate Now verify that python is now linked to Python 3. In this virtual environment python ? python3 python -V Python 3.9.7 I installed all the pre-requisites correctly for Sphinx 4.2.0 See the output of the command in the attached file command: pip install -vvv --no-index --find-link=/usr/opt/oracle/downloads/python-addons sphinx ---------- components: Demos and Tools files: Sphinx install output.txt messages: 402472 nosy: pcbroe priority: normal severity: normal status: open title: New install Python 3.9.7 install of Sphinx Document Generator fails versions: Python 3.9 Added file: https://bugs.python.org/file50295/Sphinx install output.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45267> _______________________________________ From report at bugs.python.org Wed Sep 22 18:42:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Sep 2021 22:42:32 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632350552.91.0.583348189908.issue45234@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Cherry-picked! ---------- priority: release blocker -> stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Wed Sep 22 19:38:52 2021 From: report at bugs.python.org (=?utf-8?q?Benjamin_Sz=C5=91ke?=) Date: Wed, 22 Sep 2021 23:38:52 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632353932.91.0.503734952113.issue21302@roundup.psfhosted.org> Change by Benjamin Sz?ke <egyszeregy at freemail.hu>: ---------- pull_requests: +26917 pull_request: https://github.com/python/cpython/pull/28526 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Wed Sep 22 21:43:45 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 23 Sep 2021 01:43:45 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632361425.98.0.978954106541.issue42969@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: I believe jbms is right that pausing the threads is the only right thing to do when they see tstate_must_exit. The PR is likely correct. ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Wed Sep 22 22:04:33 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Thu, 23 Sep 2021 02:04:33 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632362673.08.0.875403105837.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: I suppose calling `Py_Initialize`, `Py_FinalizeEx`, then `Py_Initialize` again, then `Py_FinalizeEx` again in an embedding application, was already not particularly well supported, since it would leak memory. However, with this change it also leaks threads. That is a bit unfortunate, but I suppose it is just another form of memory leak, and the user can avoid it by ensuring there are no daemon threads (of course even previously, the presence of any daemon threads meant additional memory leaking). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Wed Sep 22 22:27:46 2021 From: report at bugs.python.org (Gregory Szorc) Date: Thu, 23 Sep 2021 02:27:46 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632364066.22.0.546669885041.issue45020@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: I'll throw out that __file__ is strictly optional, per https://docs.python.org/3/reference/datamodel.html. IMO it is more important to define importlib.abc.InspectLoader than __file__ (so tracebacks have source context). Given that __file__ is optional, I'll throw out the idea of shipping modules without __file__/__cached__ and see what issues/pushback occurs. I anticipate this will likely result in having to restore advertising __file__ in frozen modules in 3.11 due to popular demand. But we /could/ use this as an opportunity to start attempting to ween people off __file__ and onto more appropriate APIs, like importlib.resources. (importlib.resources was introduced in 3.7 and I'm not sure that's old enough to force people onto without relying on a shim like https://pypi.org/project/importlib-resources/.) Alternatively, defining a path hook referencing the python executable that knows how to service frozen modules could also work. zipimporter does this (__file__ is <zip_path>/<virtual_module_path>) and it is surprisingly not as brittle as one would think. It might be a good middle ground. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 22 23:19:36 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 23 Sep 2021 03:19:36 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632367176.91.0.997931741015.issue45026@roundup.psfhosted.org> Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment: I benchmarked GH-27986 and GH-28176 on "for i in range(10000): pass" and found that GH-27986 was faster for this (likely most common) case of relatively small integers. Mean +- std dev: [main] 204 us +- 5 us -> [GH-27986] 194 us +- 4 us: 1.05x faster Mean +- std dev: [main] 204 us +- 5 us -> [GH-28176] 223 us +- 6 us: 1.09x slower It's possible to have different implementations for small/large integers, but IMO it's probably best to keep consistency and go with GH-27986. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Thu Sep 23 00:37:19 2021 From: report at bugs.python.org (zeroswan) Date: Thu, 23 Sep 2021 04:37:19 +0000 Subject: [issue45268] use multiple "in" in one expression? Message-ID: <1632371839.56.0.25067525558.issue45268@roundup.psfhosted.org> New submission from zeroswan <zeroswan at outlook.com>: I find it's a valid expression: `1 in [1, 2, 3] in [4, 5, 6]` `a in b in c` is equivalent to `a in b and b in c` but this expression seems useless, and easy to confused with (a in b) in c . in this program, what I originally want is `if a in b and a in c` , But it was mistakenly written as `a in b in c` This expression is similar to `a<b<c` ? But it seems very unreasonable here, is this a bug ? ---------- components: Parser messages: 402478 nosy: lys.nikolaou, pablogsal, weditor priority: normal severity: normal status: open title: use multiple "in" in one expression? type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45268> _______________________________________ From report at bugs.python.org Thu Sep 23 02:19:24 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 23 Sep 2021 06:19:24 +0000 Subject: [issue45268] use multiple "in" in one expression? In-Reply-To: <1632371839.56.0.25067525558.issue45268@roundup.psfhosted.org> Message-ID: <1632377964.66.0.353670732774.issue45268@roundup.psfhosted.org> Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment: This is the expected behavior, documented here: https://docs.python.org/3/reference/expressions.html#comparisons That page says: * The comparison operators are "<" | ">" | "==" | ">=" | "<=" | "!=" | "is" ["not"] | ["not"] "in" * "Comparisons can be chained arbitrarily" * "Note that a op1 b op2 c doesn?t imply any kind of comparison between a and c, so that, e.g., x < y > z is perfectly legal (though perhaps not pretty)." So I'll close this for now. I think it would be hard to change this behavior without introducing a needless backwards-incompatibility, but if you have a proposal, you could bring it up on the Python-Ideas mailing list. ---------- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45268> _______________________________________ From report at bugs.python.org Thu Sep 23 03:35:57 2021 From: report at bugs.python.org (neonene) Date: Thu, 23 Sep 2021 07:35:57 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632382557.47.0.390123916177.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: 3.10rc2 Python/ceval.c 1306: #define DISPATCH() \ 1307: { \ 1308: if (trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE) { \ 1309: goto tracing_dispatch; \ Among the 44 pgo-tests, only test_patma.TestTracing hits the condition above. On Windows, it seems that skipping it tightens the profile of PR28475 a bit. Additional tests such as test_threading(.ThreadTests.test_frame_tstate_tracing) might also cause some amount of variation or vice versa. 3.10rc2 x64 PGO : 1.00 + PR28475 with TestTracing : 1.05x faster (slow 3, fast 46, same 9) without : 1.06x faster (slow 5, fast 52, same 1) with TestTracing : 1.00 without : 1.01x faster (slow 19, fast 27, same 12) (Details: PR28475_skip1test_bench.txt) Does test_patma.TestTracing need training for match-case performance? ---------- Added file: https://bugs.python.org/file50296/PR28475_skip1test_bench.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 23 05:02:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 09:02:49 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632387769.34.0.262231674868.issue43760@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26918 pull_request: https://github.com/python/cpython/pull/28527 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Thu Sep 23 05:04:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 09:04:17 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632387857.19.0.17898343361.issue43760@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created PR 28527 to document PyThreadState.use_tracing removal and explain how to port existing code to Python 3.10. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Thu Sep 23 05:32:38 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 23 Sep 2021 09:32:38 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" Message-ID: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: Looks like we never test error that `markers` are limited to `None` and `dict` types. Here: https://github.com/python/cpython/blob/main/Modules/_json.c#L1252-L1255 Coverage report: https://app.codecov.io/gh/python/cpython/blob/master/Modules/_json.c line: 1252 I will submit a unit test for it today. Related: https://bugs.python.org/issue6986 ---------- components: Tests messages: 402482 nosy: sobolevn priority: normal severity: normal status: open title: c_make_encoder() has uncovered error: "argument 1 must be dict or None" type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Thu Sep 23 05:36:36 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 23 Sep 2021 09:36:36 +0000 Subject: [issue45267] New install Python 3.9.7 install of Sphinx Document Generator fails In-Reply-To: <1632349305.85.0.928032648736.issue45267@roundup.psfhosted.org> Message-ID: <1632389796.83.0.577117895268.issue45267@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: The error in the attached file says that one of the dependencies could not be found, in particular the "packaging" library. This doesn't look like a bug in CPython or pip, but more a general support question. I kindly ask you to visit one of the python forums or mail lists (for example https://discuss.python.org). ---------- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> pending type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45267> _______________________________________ From report at bugs.python.org Thu Sep 23 05:38:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 09:38:02 +0000 Subject: [issue41137] pdb uses the locale encoding for .pdbrc In-Reply-To: <1593242595.67.0.594029276449.issue41137@roundup.psfhosted.org> Message-ID: <1632389882.96.0.433960899871.issue41137@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset ec7ffa4b5b262369f726a54e145e9c03eaeb4c1a by Victor Stinner in branch 'main': bpo-41137: Reorganize What's New in Python 3.11 (GH-28518) https://github.com/python/cpython/commit/ec7ffa4b5b262369f726a54e145e9c03eaeb4c1a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41137> _______________________________________ From report at bugs.python.org Thu Sep 23 05:39:02 2021 From: report at bugs.python.org (Christian Tismer) Date: Thu, 23 Sep 2021 09:39:02 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632389942.24.0.545189632721.issue45256@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: Hey guys, you know that you are about to implement the core idea of Stackless Python, right? :-D ---------- nosy: +Christian.Tismer _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Thu Sep 23 06:04:34 2021 From: report at bugs.python.org (Patrick Decat) Date: Thu, 23 Sep 2021 10:04:34 +0000 Subject: [issue29921] datetime validation is stricter in 3.6.1 than previous versions In-Reply-To: <1490622527.46.0.936939014549.issue29921@psf.upfronthosting.co.za> Message-ID: <1632391474.24.0.542559331197.issue29921@roundup.psfhosted.org> Patrick Decat <pdecat at gmail.com> added the comment: pywin32 project has moved from sourceforge to github. https://sourceforge.net/p/pywin32/bugs/748/ is now at https://github.com/mhammond/pywin32/issues/748 pywin32 issue is supposed to be resolved since pywin32 b222 See: https://github.com/mhammond/pywin32/issues/748#issuecomment-359223029 https://github.com/mhammond/pywin32/commit/07202650d21e8fa7f3053ff1d4665363315cefce https://github.com/mhammond/pywin32/blob/b222/CHANGES.txt#L24-L26 ---------- nosy: +Patrick Decat _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29921> _______________________________________ From report at bugs.python.org Thu Sep 23 06:07:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 10:07:23 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632391643.77.0.739328800832.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not comfortable with PR 28525 which always hang threads which attempt to acquire the GIL after Python exited. I would prefer to keep the current behavior by default, but give the ability to applications embedding Python to decide what to do. With my Py_SetThreadExitCallback(func) idea, PyThread_exit_thread() would call func() and then pthread_exit(0). Applications can hang threads, log a message, call abort(), or whatever else. I'm not comfortable with writing a portable function to "hang a thread". For example, I don't understand why PR 28525 processes Windows messages on hang threads. Well, it's a complex problem :-( ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 23 06:25:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 10:25:35 +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: <1632392735.2.0.475950723476.issue41203@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 1493e1a40d04a048cce9c5080ec47478a4941054 by Miss Islington (bot) in branch '3.10': bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28523) https://github.com/python/cpython/commit/1493e1a40d04a048cce9c5080ec47478a4941054 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Thu Sep 23 06:26:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 10:26:01 +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: <1632392761.59.0.609440027797.issue41203@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset f1d5cdef57fea961646c52db7a60d1f110e0eaa6 by Miss Islington (bot) in branch '3.9': bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28524) https://github.com/python/cpython/commit/f1d5cdef57fea961646c52db7a60d1f110e0eaa6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Thu Sep 23 06:51:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 23 Sep 2021 10:51:33 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632394293.95.0.586295367931.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: Explicitly resetting statements when we're done with them removes the performance regression; SQLite works more efficient when we keep the number of non-reset statements low. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Thu Sep 23 07:05:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 11:05:44 +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: <1632395144.38.0.439100374614.issue41203@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Thank you Patrick. We had several PRs for fixing macOS references here and there, they were closed in favor of this larger PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41203> _______________________________________ From report at bugs.python.org Thu Sep 23 07:05:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 23 Sep 2021 11:05:30 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632395130.42.0.951295332048.issue45256@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: I've trying to do this since about 2011 :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Thu Sep 23 08:24:38 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 23 Sep 2021 12:24:38 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1632399878.0.0.242282672878.issue40116@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: Raymond, Only split dicts need the extra field. Classes where many instances do not have exactly the same set of attributes may be more common than you think. There are many reasons why some attributes may be added conditionally. PR 28520 actually makes the dictionary code a bit simpler, as we don't need to maintain the invariant that value arrays cannot have holes. Maintaining an order is simple and cheap: order = (order<<4) | insertion_index There are pros and cons to both schemes: PR 28520 and the current implementation. The problem with the current scheme is that it only works well for classes where all instances are initialized with exactly the same attributes, and in the same order. The PR 28520 scheme can handle those cases where order and key set differ a bit, but has a maximum size of 16 before the dict must be combined. We need as many instances as possible to have split dictionaries, to get https://github.com/faster-cpython/ideas/issues/72 working well as it will make the cost of not sharing even greater, relatively. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Thu Sep 23 08:36:30 2021 From: report at bugs.python.org (Marc Mueller) Date: Thu, 23 Sep 2021 12:36:30 +0000 Subject: [issue41629] __class__ not set defining 'X' as <class '__main__.X'> In-Reply-To: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> Message-ID: <1632400590.14.0.334632731481.issue41629@roundup.psfhosted.org> Change by Marc Mueller <cdce8p at gmail.com>: ---------- nosy: +cdce8p _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41629> _______________________________________ From report at bugs.python.org Thu Sep 23 08:50:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 12:50:08 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1632401408.39.0.102710647871.issue40116@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: There are several common idioms which do not work well with shared dictionaries. 1. Class attributes as defaults. If most instances of the class have the default value for some attribute, it can be set as the class attribute. It saves memory because most instances will have smaller dict. But if the first instance has such attribute, it cancels shared dict for all following instances without this attribute. 2. cached_property (and analogs). The cached instance attributes can be added in arbitrary order, canceling shared dict for this instance and maybe for all instances created later. 3. Some classes delete attributes in close() or __exit__() methods to avoid reference loops and to release resources earlier. Since shared dicts do not support deletion, such closed objects have now larger size than non-closed objects. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40116> _______________________________________ From report at bugs.python.org Thu Sep 23 10:09:31 2021 From: report at bugs.python.org (Matt Bogosian) Date: Thu, 23 Sep 2021 14:09:31 +0000 Subject: [issue40346] Add random.BaseRandom to ease implementation of subclasses In-Reply-To: <1587419589.68.0.186666450831.issue40346@roundup.psfhosted.org> Message-ID: <1632406171.9.0.578525802857.issue40346@roundup.psfhosted.org> Matt Bogosian <eb3f73+python+org at yaymail.com> added the comment: I landed here after investigating this surprising result: # test_case.py from random import Random from typing import Sequence, Union _RandSeed = Union[None, int, Sequence[int]] class MyRandom(Random): def __init__( self, seed: _RandSeed = None, ): if seed is not None and not isinstance(seed, int): seed = sum(seed) super().__init__(seed) MyRandom([1, 2]) Output: python ./test_case.py Traceback (most recent call last): File "/?/./test_case.py", line 16, in <module> MyRandom([1, 2]) TypeError: unhashable type: 'list' In my observation, the Random class aspires to be an interface (and default implementation), but doesn't really live up to those aspirations. (See also https://github.com/python/typeshed/issues/6063.) I suspect nudging Random closer to its claims was the point of this proposal. I'm kind of sad it (or something like it) was rejected in favor of a process that will probably take years. Is there a reason not to do both, meaning heal what lives in the standard library now to live up to its own marketing *and* work toward a better interface in the future? ---------- nosy: +posita _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40346> _______________________________________ From report at bugs.python.org Thu Sep 23 10:38:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 14:38:38 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632407918.7.0.195269467498.issue43760@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset f4ccb79d52ee726d58bbb038ea98b4deec52001d by Victor Stinner in branch 'main': bpo-43760: Document PyThreadState.use_tracing removal (GH-28527) https://github.com/python/cpython/commit/f4ccb79d52ee726d58bbb038ea98b4deec52001d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Thu Sep 23 10:38:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 23 Sep 2021 14:38:51 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632407931.7.0.436261879549.issue43760@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +26919 pull_request: https://github.com/python/cpython/pull/28529 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Thu Sep 23 11:01:31 2021 From: report at bugs.python.org (Pramod) Date: Thu, 23 Sep 2021 15:01:31 +0000 Subject: [issue45270] Clicking "Add to Custom C Message-ID: <1632409291.23.0.352696604895.issue45270@roundup.psfhosted.org> Change by Pramod <pramodsarathy17 at gmail.com>: ---------- nosy: pramodsarathy17 priority: normal severity: normal status: open title: Clicking "Add to Custom C _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:05:06 2021 From: report at bugs.python.org (=?utf-8?q?D=C3=A1vid_Nemeskey?=) Date: Thu, 23 Sep 2021 15:05:06 +0000 Subject: [issue45271] Add a 'find' method (a'la str) to list Message-ID: <1632409506.27.0.197043194996.issue45271@roundup.psfhosted.org> New submission from D?vid Nemeskey <nemeskeyd at gmail.com>: There is an unjustified asymmetry between `str` and `list`, as far as lookup goes. Both have an `index()` method that returns the first index of a value, or raises a `ValueError` if it doesn't exist. However, only `str` has the `find` method, which returns -1 if the value is not in the string. I think it would make sense to add `find` to `list` as well. For starters, it would make the API between the two sequence types more consistent. More importantly (though it depends on the use-case), `find` is usually more convenient than `index`, as one doesn't have to worry about handling an exception. As a bonus, since `list` is mutable, it allows one to write code such as if (idx := lst.find(value)) == -1: lst.append(value) call_some_function(lst[idx]) , making the method even more useful as it is in `str`. ---------- messages: 402497 nosy: nemeskeyd priority: normal severity: normal status: open title: Add a 'find' method (a'la str) to list _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45271> _______________________________________ From report at bugs.python.org Thu Sep 23 11:05:23 2021 From: report at bugs.python.org (=?utf-8?q?D=C3=A1vid_Nemeskey?=) Date: Thu, 23 Sep 2021 15:05:23 +0000 Subject: [issue45271] Add a 'find' method (a'la str) to list In-Reply-To: <1632409506.27.0.197043194996.issue45271@roundup.psfhosted.org> Message-ID: <1632409523.48.0.385171609132.issue45271@roundup.psfhosted.org> Change by D?vid Nemeskey <nemeskeyd at gmail.com>: ---------- type: -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45271> _______________________________________ From report at bugs.python.org Thu Sep 23 11:20:55 2021 From: report at bugs.python.org (Pramod) Date: Thu, 23 Sep 2021 15:20:55 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times Message-ID: <1632410455.7.0.839472827353.issue45270@roundup.psfhosted.org> New submission from Pramod <pramodsarathy17 at gmail.com>: When customising my Python IDLE (in Options>Configure IDLE>Highlights>Choose color for:), if I choose a color from the palette and click on the button "Add to Custom Colors" multiple times, all my existing colors are replaced by a single color one by one, instead I feel it would be better if Python gave a popup saying something like "the selected color already exists in Custom colors". ---------- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy title: Clicking "Add to Custom C -> Clicking "Add to Custom Colors" adds same colour multiple times type: -> behavior versions: +Python 3.9 Added file: https://bugs.python.org/file50297/python bug 1.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:23:27 2021 From: report at bugs.python.org (Pramod) Date: Thu, 23 Sep 2021 15:23:27 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632410455.7.0.839472827353.issue45270@roundup.psfhosted.org> Message-ID: <1632410607.43.0.0230551538574.issue45270@roundup.psfhosted.org> Change by Pramod <pramodsarathy17 at gmail.com>: Added file: https://bugs.python.org/file50298/python bug 1.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:27:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Sep 2021 15:27:31 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632410455.7.0.839472827353.issue45270@roundup.psfhosted.org> Message-ID: <1632410851.3.0.731475527936.issue45270@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: Removed file: https://bugs.python.org/file50297/python bug 1.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:38:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Sep 2021 15:38:02 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632410455.7.0.839472827353.issue45270@roundup.psfhosted.org> Message-ID: <1632411482.42.0.461198215772.issue45270@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: IDLE has nothing to do with the operation of the color chooser. IDLE calls a tkinter function that calls a tk functions that calls the OS Window Manager color chooser. The choice you make is returned to IDLE as a color string that IDLE can later pass to tkinter and tk. What you see on Windows, in your image is the MS Windows 10 color chooser. The macOS color chooser is *completely* different. The Windows Custom Color bar presumes that you make a small set of distinguishable custom colors. The main use in IDLE would be if you create a custom backgound color that you want to use for multiple foreground/background pairs. The use in Windows would be if you have a custom palette that you want to use for multiple applications. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:38:31 2021 From: report at bugs.python.org (Pramod) Date: Thu, 23 Sep 2021 15:38:31 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632410851.34.0.0930483376168.issue45270@roundup.psfhosted.org> Message-ID: <CAL-6SPatOeT37_EURoQZnCPQsn3pDtyuszacNfjv0SX2nTp_bw@mail.gmail.com> Pramod <pramodsarathy17 at gmail.com> added the comment: Sorry for adding my file again. Can you please state the reason for removing the file Mr. Terry J Reedy , was it because I haven't signed the Contributor Agreement at that time? But now that I have signed it, can I add the https://bugs.python.org/file50298/python bug 1.png file again? On Thu, 23 Sept 2021 at 20:58, Terry J. Reedy <report at bugs.python.org> wrote: > > Change by Terry J. Reedy <tjreedy at udel.edu>: > > > Removed file: https://bugs.python.org/file50297/python bug 1.png > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue45270> > _______________________________________ > ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:46:23 2021 From: report at bugs.python.org (Pramod) Date: Thu, 23 Sep 2021 15:46:23 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632411482.42.0.461198215772.issue45270@roundup.psfhosted.org> Message-ID: <CAL-6SPYXwBA7v4w45_MFWKv9DzRNoC5=uZiUpKnMKRTWHLLDPg@mail.gmail.com> Pramod <pramodsarathy17 at gmail.com> added the comment: I understand that, but is it possible to keep only unique colors in the Custom Color palette, and when user chooses the exact same color to be in the Custom Color palette it would return a pop up like "Color already in Custom Color palette". It would be better if the color strings which IDLE receives, are checked if present already in Custom Colors, if not it then passes it to tkinter and tk. On Thu, 23 Sept 2021 at 21:08, Terry J. Reedy <report at bugs.python.org> wrote: > > Terry J. Reedy <tjreedy at udel.edu> added the comment: > > IDLE has nothing to do with the operation of the color chooser. IDLE > calls a tkinter function that calls a tk functions that calls the OS Window > Manager color chooser. The choice you make is returned to IDLE as a color > string that IDLE can later pass to tkinter and tk. What you see on > Windows, in your image is the MS Windows 10 color chooser. The macOS color > chooser is *completely* different. > > The Windows Custom Color bar presumes that you make a small set of > distinguishable custom colors. The main use in IDLE would be if you create > a custom backgound color that you want to use for multiple > foreground/background pairs. The use in Windows would be if you have a > custom palette that you want to use for multiple applications. > > ---------- > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker <report at bugs.python.org> > <https://bugs.python.org/issue45270> > _______________________________________ > ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:55:31 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 15:55:31 +0000 Subject: [issue45271] Add a 'find' method (a'la str) to list In-Reply-To: <1632409506.27.0.197043194996.issue45271@roundup.psfhosted.org> Message-ID: <1632412531.48.0.826578916656.issue45271@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Strings are already special in that str.index() and str.find() both find substrings, while list.index() only finds a single element. If .find() also searched for a substring of the list, I think this could be helpful. Even more so if it used an efficient algorithm (bearing in mind that the arbitrary comparisons between elements - something else that doesn't exist in strings - would make this complicated). This is probably something to bring up on the python-ideas mailing list first, anyway. Symmetry is not a sufficient reason in itself to add new APIs - often the asymmetry exists because the "missing" one is only there for legacy/compatibility reasons, not because it is a good API. ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45271> _______________________________________ From report at bugs.python.org Thu Sep 23 11:57:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Sep 2021 15:57:14 +0000 Subject: [issue45270] Clicking "Add to Custom Colors" adds same colour multiple times In-Reply-To: <1632410455.7.0.839472827353.issue45270@roundup.psfhosted.org> Message-ID: <1632412634.4.0.637566961884.issue45270@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: You added the same file twice. Once was enough. To repeat: IDLE has no knowledge of color chooser. The Custom Colors bar is Windows specific. There is no such thing on macOS. PS: when responding by email, please delete the quoted message. It is redundant and therefore noise when posted on the web page. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45270> _______________________________________ From report at bugs.python.org Thu Sep 23 11:59:03 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 15:59:03 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632412743.66.0.229567755842.issue45256@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: I fully support implementing the core idea of Stackless Python :) I spent a whole EuroPython a couple of years back discussing the idea with (apparently) everyone except Mark. Though I wouldn't like to lose the ability to extract the Python stack by inspecting native memory alone. That is very useful for debugging, particularly when you've only got a crash dump. So provided all the code objects are only an indirection or two away from a local (or better yet, parameter) value, it should be fine. ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Thu Sep 23 12:21:43 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 16:21:43 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1632414103.62.0.776917867037.issue45213@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Could we add a compile-time requirement (most likely checked in tests, rather than at build) that _PyImport_FrozenModules be sorted? Then we can at least bail out of the loop early, and one day someone could make it a binary search. ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Thu Sep 23 12:24:55 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 16:24:55 +0000 Subject: [issue45272] 'os.path' should not be a frozen module Message-ID: <1632414295.46.0.740648553614.issue45272@roundup.psfhosted.org> New submission from Steve Dower <steve.dower at python.org>: I noticed that Python/frozen.c includes posixpath as 'os.path'. This is not correct, and shouldn't be necessary anyway, because os.path is just an attribute in "os" and not a concrete module (see Lib/os.py#L95 for the bit that makes it importable, and Lib/os.py#L61 and Lib/os.py#L81 for the imports). ---------- assignee: eric.snow messages: 402506 nosy: eric.snow, steve.dower priority: normal severity: normal stage: needs patch status: open title: 'os.path' should not be a frozen module type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45272> _______________________________________ From report at bugs.python.org Thu Sep 23 12:32:08 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 16:32:08 +0000 Subject: [issue45244] pip not installed with fresh python3.8.10 installation In-Reply-To: <1632119366.31.0.964394896374.issue45244@roundup.psfhosted.org> Message-ID: <1632414728.15.0.537103733249.issue45244@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Can you attach the log files stored in your %TEMP% as a zip file? They should all start with "Python". Be aware that they may contain personal information, such as usernames or machine names. Feel free to scrub those first if necessary. ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45244> _______________________________________ From report at bugs.python.org Thu Sep 23 12:40:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 16:40:20 +0000 Subject: [issue40346] Add random.BaseRandom to ease implementation of subclasses In-Reply-To: <1587419589.68.0.186666450831.issue40346@roundup.psfhosted.org> Message-ID: <1632415220.18.0.614103340248.issue40346@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Matt, your example works in 3.11. In earlier versions you need to override the __new__ method. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40346> _______________________________________ From report at bugs.python.org Thu Sep 23 12:47:40 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 23 Sep 2021 16:47:40 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632415660.6.0.952745505529.issue42969@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: A PR adding a `Py_SetThreadExitCallback(func)` API guaranteeing the callback is called before `pthread_exit()` would allow anyone wanting to deal with their deadlocks to register `abort()` or `while(1) pause();` as their exit callback. I'd be okay with that. Anyone care to make a PR for that? What should it do when SetThreadExitCallback has already been called? Is that an error? Are the callbacks chained? In which order? If someone passes nullptr does that undo it (please no!). It is process global state that many things could wind up having an opinion on each with their own reason to require theirs to be the only one. I vote for returning an error if a callback has already been set. And not allowing unsetting a callback. What we'd do internally at work is always guarantee our codebase's early application startup code (because we have such a thing) calls that to setup whichever exit callback we deem appropriate for everyone instead of today's default deadlock potential. On pausing... agreed, it doesn't feel _comfortable_. To me when faced with a known potential deadlock situation the only comfortable thing is to abort() as a process dying is always more useful than process hanging (or worse, partially hanging). Sleeping on the problem, I don't really understand how `while(1) pause();` is significantly different than `pthread_exit()` when it comes to deadlocks, as it seems like an instantly terminated thread having state that needs cleanup should lead to a similar outcome as a thread with stuff needing cleanup that is now stuck in an infinite pause loop. Neither of them is going to cleanup whatever (presumably a lock they hold) that leads something else to deadlock? I guess the difference is that the thread stack memory is at least not released back for potential reuse while other threads and pointers could still be referring to it when pausing as opposed to a pthread_exit? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 23 12:49:06 2021 From: report at bugs.python.org (Matt Bogosian) Date: Thu, 23 Sep 2021 16:49:06 +0000 Subject: [issue40346] Add random.BaseRandom to ease implementation of subclasses In-Reply-To: <1587419589.68.0.186666450831.issue40346@roundup.psfhosted.org> Message-ID: <1632415746.28.0.658966195413.issue40346@roundup.psfhosted.org> Matt Bogosian <eb3f73+python+org at yaymail.com> added the comment: Thanks! Where's that documented? (Apologies if I missed it.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40346> _______________________________________ From report at bugs.python.org Thu Sep 23 13:08:06 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 17:08:06 +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: <1632416886.82.0.335007996556.issue15870@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Passing the metaclass as a slot seems like the right idea for this API, though I recall there being some concern about the API (IIRC, mixing function pointers and data pointers doesn't work on some platforms?) that mean it'll be deprecated in the future. ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 13:17:09 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 17:17:09 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations In-Reply-To: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> Message-ID: <1632417429.1.0.200568228405.issue44687@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Seems like it would be better to not check the file open/closed state on peek/read when there is still buffered data? ---------- nosy: +steve.dower _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44687> _______________________________________ From report at bugs.python.org Thu Sep 23 13:25:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Sep 2021 17:25:31 +0000 Subject: [issue45271] Add a 'find' method (a'la str) to list In-Reply-To: <1632409506.27.0.197043194996.issue45271@roundup.psfhosted.org> Message-ID: <1632417931.48.0.119292836358.issue45271@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: This is one bit of symmetry that we shouldn't pursue. The find() methods have been a recurring source of bugs because of failing to check for a -1 result but having that be a valid index into the sequence. Also, the sequence APIs are long established. If find() were really needed, we would have felt the pain and added it long ago. As Steve says, you can take this to python-ideas, but my recommendation is to not do it all. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45271> _______________________________________ From report at bugs.python.org Thu Sep 23 13:31:45 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 23 Sep 2021 17:31:45 +0000 Subject: [issue45273] OS-specific frozen modules are built, even on other OSes. Message-ID: <1632418305.93.0.879771690458.issue45273@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: The list of frozen modules in Python/frozen.c is generated by Tools/scripts/freeze_modules.py. Currently we freeze both posixpath and ntpath, even though for startup we only need one of the two (depending on the OS). In this case both modules are available on all platforms (and only os.path differs), so we might be okay to leave both frozen. The cost isn't high. However, we may need to accommodate freezing a module only on a subset of supported OSes: * if the extra cost (to the size of the executable) is too high * if there's an OS-specific module that is only available on that OS In that case, we'd need to generate the appropriate ifdefs in Python/frozen.c. We can't just exclude the module during generation since frozen.c is committed to the repo. ---------- assignee: eric.snow components: Interpreter Core messages: 402514 nosy: eric.snow, steve.dower priority: normal severity: normal stage: needs patch status: open title: OS-specific frozen modules are built, even on other OSes. type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45273> _______________________________________ From report at bugs.python.org Thu Sep 23 13:32:16 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 23 Sep 2021 17:32:16 +0000 Subject: [issue45273] OS-specific frozen modules are built, even on other OSes. In-Reply-To: <1632418305.93.0.879771690458.issue45273@roundup.psfhosted.org> Message-ID: <1632418336.59.0.979121745552.issue45273@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: FYI, currently os.path is also frozen and *is* OS-specific. However, that's a separate matter. See bpo-45272. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45273> _______________________________________ From report at bugs.python.org Thu Sep 23 13:52:38 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 23 Sep 2021 17:52:38 +0000 Subject: [issue45272] 'os.path' should not be a frozen module In-Reply-To: <1632414295.46.0.740648553614.issue45272@roundup.psfhosted.org> Message-ID: <1632419558.76.0.409970109494.issue45272@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: The matter here boils down to the design of _imp.is_frozen() [1]. It only checks to see if the given module name shows up in the list of frozen modules in Python/frozen.c. This broke things when I froze os and posixpath/ntpath. The simplest solution was to include os.path in the list of modules in frozen.c. The better solution would be to have _imp.is_frozen() check the module in sys.modules. [1] see find_frozen() in Python/import.c ---------- nosy: +barry, brett.cannon, jaraco, ncoghlan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45272> _______________________________________ From report at bugs.python.org Thu Sep 23 13:58:27 2021 From: report at bugs.python.org (Sebastian Berg) Date: Thu, 23 Sep 2021 17:58:27 +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: <1632419907.83.0.887542831426.issue15870@roundup.psfhosted.org> Sebastian Berg <sebastian at sipsolutions.net> added the comment: I can make a PR from the patch (and add the `Py_tp_metaclass` slot if desired) with a basic test here, if that is what is blocking things. Fixing the type and size of the allocation (as the patch does) would allow me to give people a way to create a new NumPy DType dynamically. I only need the user to call my initialization function as soon as the type was created (with `PyType_FromSpec` or otherwise). (And I can avoid any internal acrobatics creating the type for the user; this stuff tends to be super confusing even if the principles are fairly straight forward...) Happy to pursue other avenues, but I am not clear which... > IIRC, mixing function pointers and data pointers doesn't work on some platforms? ... I guess it is too late to do some weird thing like (not sure it would be reasonable or is valid anyway though): typedef union { void *pdata; void (*pfunc)(void); } slot_value; I am a bit interested in it, because I want to use a `FromSpec` API in NumPy and it would be nice to be sure I can grow it to include data without too much hassle. But the easier thing may just be to add one or two `void *reserved` slot to the spec struct that must be NULL for now... ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 14:01:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 23 Sep 2021 18:01:17 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632420077.84.0.135555009883.issue45256@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Though I wouldn't like to lose the ability to extract the Python stack by inspecting native memory alone. Don't worry about it, I am personally making sure that keeps being possible. it will need some changes in the tools, but not any more that any other changes between minor versions of the interpreter ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Thu Sep 23 14:29:24 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Thu, 23 Sep 2021 18:29:24 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632421764.79.0.247253148846.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: In general, I view hanging threads as the least bad thing to do when faced with either acquiring the GIL or not returning at all. There is a lot of existing usage of Python that currently poses a risk of random crashes and memory corruption while Python is exiting, and I would like to fix that. However, I would certainly recommend that code using the Python C API attempt to avoid threads getting to that state in the first place. I added a "finalize block" mechanism to that PR which is intended to provide a way to attempt to acquire the GIL in a way that ensures the GIL won't get hung. I would welcome feedback on that. A common use case for that API might be a non-Python created thread that wants to invoke some sort of asynchronous callback handler via Python APIs. For Python daemon threads that you control, you can avoid them hanging by registering an atexit function that signals them to exit and then waits until they do. vsteinner: Regarding processing the Windows messages, I updated the PR to include a link to the MSDN documentation that led me to think it was a good idea. vstinner: As for random code outside of Python itself that is using `PyThread_exit_thread`: although I suppose there are legitimate use cases for `pthread_exit` and `_endthreadex`, these functions are only safe with the cooperation of the entire call stack of the thread. Additionally, while `pthread_exit` and `_endthreadex` have similar behavior for C code, they don't have the same behavior for C++ code, and that difference seems like a likely source of problems. Finally, I would say Python itself does not guarantee that its call stacks safely cooperate with `pthread_exit` (at the very least, there are sure to be memory leaks). Therefore, I think Python should not encourage its use by leaving it as a non-deprecated public API. If a user wishes to terminate a thread, they can invoke `pthread_exit` or `_endthreadex` directly, ideally without any Python functions in the call stack, and can refer to the documentation of those functions to understand the implications. gps: The reasons I believe hanging the thread is better than `pthread_exit`: - `pthread_exit` essentially throws an exception. In theory that means you could do proper cleanup via C++ destructors and/or re-throwing catch blocks. But in practice existing extension code is not designed to do that, and it would be quite a complex task to modify it to do proper cleanup, and on Windows the cleanup wouldn't run anyway. - Additionally, throwing an exception means if there is a `noexcept` function in the call stack, the program terminates. We would need to document that you aren't allowed to call Python APIs if there is a `noexcept` function in the call stack. If you have a `catch(...)` in the call stack, then you may inadvertently catch the exception and return control back to Python at a point that assumes it owns the GIL, which will cause all sorts of havoc. We would likewise need to document that you can't have a non-rethrowing `catch(...)` block in the call stack (I believe pybind11 has some of those). - Throwing an exception also means C++ destructors run. pybind11 has a smart pointer type that holds a `PyObject` and whose destructor calls `Py_DECREF`. That causes a crash when `pthread_exit` unwinds the stack, since the thread doesn't own the GIL. Those are the additional problems specific to `pthread_exit`. As gps noted, there is the additional problem of memory corruption common to both `pthread_exit` and `_endthreadex`: - Data structures that are accessible from other threads may contain pointers to data on the thread's stack. For example, with certain types of locks/signalling mechanisms it is common to store a linked list node on the stack that as then added to a list of waiting threads. If we destroy the thread stack without proper cleanup (and that proper cleanup definitely won't happen with `_endthreadex`, and probably in most cases still won't happen with `pthread_exit`), the data structure has now become corrupted. I don't think hanging the thread really increases the risk of deadlock over the status quo. In theory someone could have a C++ destructor that does some cleanup that safely pevents deadlock, but that is not portable to Windows, and I expect that properly implemented `pthread_exit`-safe code is extremely rare. I think we would want to ensure that Python itself is implemented in such a way as to not deadlock if Python-created threads with only Python functions in the call stack hang. Mostly that would amount to not holding mutexes while calling functions that may transitively attempt to acquire the GIL (or release and then re-acquire the GIL). That is probably a good practice for avoiding deadlock even when not finalizing. We would also want to document that external code using the Python API should be safe from deadlock if a thread hangs, or should use the new "finalize block" mechanism to ensure that it doesn't hang, but I would say that is much easier to achieve than `pthread_exit`/`_endthreadex` safety, and I expect is already satisfied by most code. Regarding vstinner's point that we would leak hung threads in an application that embeds Python and keeps running after `Py_FinalizeEx`: What are the existing use cases for initializing/finalizing the interpreter multiple times? Under the status quo we leak a bunch of memory when finalizing, e.g. because any Python object references held by the threads that are killed will be leaked, among many other things. That would seem to rule out its suitability for use in production code. At best it might be suitable for test code. Leaking a hung thread basically just amounts to leaking the thread stack. Additionally, if the thread is not created by Python, and the application is not exiting, then only the application should decide whether to kill one of its threads. Adding a `Py_SetThreadExitCallback(func)` function seems reasonable, but I would propose that the only acceptable behaviors are: abort, quick exit, and hang. I don't think we should promise that Python's own code base is safe for use with `pthread_exit` / `_endthreadex`, nor should we require that extension code is safe for that. Furthermore, `abort` would seem to only be useful if you have already taken measures (such as signaling daemon threads to exit and using the "finalize block" mechanism) to ensure it is never reached, and it just serves as an additional sanity check. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Thu Sep 23 14:53:55 2021 From: report at bugs.python.org (Josh Haberman) Date: Thu, 23 Sep 2021 18:53: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: <1632423235.85.0.87090505493.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > Passing the metaclass as a slot seems like the right idea for this API, though I recall there being some concern about the API (IIRC, mixing function pointers and data pointers doesn't work on some platforms?) PyType_Slot is defined as a void* (not a function pointer): https://github.com/python/cpython/blob/8492b729ae97737d22544f2102559b2b8dd03a03/Include/object.h#L223-L226 So putting a PyTypeObject* into a slot would appear to be more kosher than function pointers. Overall, a slot seems like a great first approach. It doesn't require any new functions, which seems like a plus. If the any linking issues a la tp_base are seen, a new function could be added later. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 15:43:10 2021 From: report at bugs.python.org (David Mandelberg) Date: Thu, 23 Sep 2021 19:43:10 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1632426190.79.0.692633018813.issue44309@roundup.psfhosted.org> Change by David Mandelberg <david at mandelberg.org>: ---------- nosy: +dseomn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44309> _______________________________________ From report at bugs.python.org Thu Sep 23 15:43:09 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 23 Sep 2021 19:43:09 +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: <1632426189.06.0.307431910019.issue15870@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: - specs/slots are (usually) constant & static; pointers to types are not always C constant expressions (on Windows, if they come from a different DLL) - specs/slots are (usually) shared across all subinterpreters; types are specific to a single interpreter It's better to pass the metaclass as a function argument, as with bases. I'd prefer adding a new function that using a slot. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 15:59:08 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 23 Sep 2021 19:59:08 +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: <1632427148.56.0.5535660691.issue15870@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: But at least if it's available as a slot then a module is *able* to use it with limited ABI going backwards. A new function doesn't allow that. And yeah, it means they have to write more complex code than just a static array definition, but people are willing and able to do it. I don't think there's anything about the current FromSpec that suggests all the parameters have to be interpreter-agnostic. And the design does suggest that we'll add more later without having to break the ABI (otherwise it would be a regular struct). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 16:13:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 20:13:09 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() Message-ID: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: Bern?t G?bor found an interesting bug on Windows. Sometimes, when a process is interrupted on Windows with CTRL+C, its parent process hangs in thread.join(): https://twitter.com/gjbernat/status/1440949682759426050 Reproducer: * Install https://github.com/gaborbernat/tox/tree/2159 * Make an empty folder and put the above tox.ini in it * Invoke python -m tox and once that command is sleeping press CTRL+C (the app should lock there indefinitely). tox.ini: --- [testenv] skip_install = true commands = python -c 'import os; print(f"start {os.getpid()}"); import time; time.sleep(100); print("end");' --- Source: https://gist.github.com/gaborbernat/f1e1aff0f2ee514b50a92a4d019d4d13 I tried to attach the Python process in Python: there is a single thread, the main thread which is blocked in thread.join(). You can also see it in the faulthandler traceback. I did a long analysis of the _tstate_lock and I checked that thread really completed. Raw debug traces: == thread 6200 exit == thread_run[pid=3984, thread_id=6200]: clear PyThreadState_Clear[pid=3984, thread_id=6200]: on_delete() release_sentinel[pid=3984, thread_id=6200]: enter release_sentinel[pid=3984, thread_id=6200]: release(obj=000001C1122669C0, lock=000001C110BBDA00) release_sentinel[pid=3984, thread_id=6200]: exit PyThreadState_Clear[pid=3984, thread_id=6200]: on_delete()-- == main thread is calling join() but gets a KeyboardInterrupt == [pid=3984, thread_id=8000] Lock<obj=000001C1122669C0>.acquire() -> ACQUIRED Current thread 0x00001f40 (most recent call first): File "C:\vstinner\python\3.10\lib\threading.py", line 1118 in _wait_for_tstate_lock File "C:\vstinner\python\3.10\lib\threading.py", line 1092 in join File "C:\vstinner\env\lib\site-packages\tox\session\cmthread_run[pid=3984, thread_id=6200]: exit d\run\common.py", line 203 in execute File "C:\vstinner\env\lib\site-packages\tox\session\cmd\run\sequential.py", line 20 in run_sequential File "C:\vstinner\env\lib\site-packages\tox\session\cmd\legacy.py", line 104 in legacy File "C:\vstinner\env\lib\site-packages\tox\run.py", line 49 in main File "C:\vstinner\env\lib\site-packages\tox\run.py", line 23 in run File "C:\vstinner\env\lib\site-packages\tox\__main__.py", line 4 in <module> File "C:\vstinner\python\3.10\lib\runpy.py", line 86 in _run_code File "C:\vstinner\python\3.10\lib\runpy.py", line 196 in _run_module_as_main _wait_for_tstate_lock[pid=3984, current thread_id=8000, self thread_id=6200]: EXC: KeyboardInterrupt(); acquired? None == main thread calls repr(thread) == ROOT: [3984] KeyboardInterrupt - teardown started _wait_for_tstate_lock[pid=3984, current thread_id=8000, self thread_id=6200]: acquire(block=False, timeout=-1): lock obj= 0x1c1122669c0 File "C:\vstinner\python\3.10\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\vstinner\python\3.10\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\vstinner\env\lib\site-packages\tox\__main__.py", line 4, in <module> run() File "C:\vstinner\env\lib\site-packages\tox\run.py", line 23, in run result = main(sys.argv[1:] if args is None else args) File "C:\vstinner\env\lib\site-packages\tox\run.py", line 49, in main result = handler(state) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\legacy.py", line 104, in legacy return run_sequential(state) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\run\sequential.py", line 20, in run_sequential return execute(state, max_workers=1, has_spinner=False, live=True) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\run\common.py", line 217, in execute print(f'join {thread}') File "C:\vstinner\python\3.10\lib\threading.py", line 901, in __repr__ self.is_alive() # easy way to get ._is_stopped set when appropriate File "C:\vstinner\python\3.10\lib\threading.py", line 1181, in is_alive self._wait_for_tstate_lock(False) File "C:\vstinner\python\3.10\lib\threading.py", line 1113, in _wait_for_tstate_lock traceback.print_stack() _wait_for_tstate_lock[pid=3984, current thread_id=8000, self thread_id=6200]: failed to acquire 0x1c1122669c0 _wait_for_tstate_lock[pid=3984, current thread_id=8000, self thread_id=6200]: exit 0x1c1122669c0 join <Thread(tox-interrupt, started 6200)> == main thread calls thread.join()... which hangs == _wait_for_tstate_lock[pid=3984, current thread_id=8000, self thread_id=6200]: acquire(block=True, timeout=-1): lock obj= 0x1c1122669c0 File "C:\vstinner\python\3.10\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\vstinner\python\3.10\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\vstinner\env\lib\site-packages\tox\__main__.py", line 4, in <module> run() File "C:\vstinner\env\lib\site-packages\tox\run.py", line 23, in run result = main(sys.argv[1:] if args is None else args) File "C:\vstinner\env\lib\site-packages\tox\run.py", line 49, in main result = handler(state) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\legacy.py", line 104, in legacy return run_sequential(state) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\run\sequential.py", line 20, in run_sequential return execute(state, max_workers=1, has_spinner=False, live=True) File "C:\vstinner\env\lib\site-packages\tox\session\cmd\run\common.py", line 218, in execute thread.join() File "C:\vstinner\python\3.10\lib\threading.py", line 1092, in join self._wait_for_tstate_lock() File "C:\vstinner\python\3.10\lib\threading.py", line 1113, in _wait_for_tstate_lock traceback.print_stack() Explanation: * Context: The main thread is waiting on thread.join() * The thread 6200 completes: release_sentinel() is called to to release _tstate_lock * The main thread succeed to acquire _tstate_lock (of the thread 6200) since it was just release * Ooops oops oops, the main thread gets KeyboardInterrupt in Thread._wait_for_tstate_lock() before being able to release the lock. As if the function if interrupted here: def _wait_for_tstate_lock(self, block=True, timeout=-1): lock = self._tstate_lock if lock is None: assert self._is_stopped elif lock.acquire(block, timeout): # -- got KeyboardInterrupt here --- lock.release() self._stop() * (tox does something in the main thread) * (there are only one remaining thread: the main thread) * tox catchs KeyboardInterrupt and calls thread.join() again * thread.join() hangs because the _tstate_lock was already acquire, so lock.acquire() hangs forever => NOT GOOD You can reproduce the issue on Linux with attached patch and script: * Apply threading_bug.patch on Python * Run threading_bug.py * See that the script hangs forever Example: --- $ git apply threading_bug.patch $ ./python threading_bug.py join... join failed with: KeyboardInterrupt() join again... --- I'm now working on a PR to fix the race condition. ---------- components: Library (Lib) files: threading_bug.patch keywords: patch messages: 402523 nosy: vstinner priority: normal severity: normal status: open title: Race condition in Thread._wait_for_tstate_lock() versions: Python 3.11 Added file: https://bugs.python.org/file50299/threading_bug.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 16:13:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 20:13:16 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632427996.65.0.22713792204.issue45274@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: Added file: https://bugs.python.org/file50300/threading_bug.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 16:21:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 20:21:39 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632428499.86.0.641260340683.issue45274@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: For curious people, see also bpo-44422 "Fix threading.enumerate() reentrant call": another example of race condition recently fixed in the threading module. But it's unrelated to this bug ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 16:22:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 20:22:50 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632428570.33.0.775405556279.issue45274@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26920 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28532 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 16:27:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Sep 2021 20:27:19 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632428839.15.0.552409364106.issue45274@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +pablogsal stage: patch review -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 16:40:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 20:40:19 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632429619.66.0.190619148864.issue43760@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 55576893b31452ba739e01189424cd62cf11ed20 by Miss Islington (bot) in branch '3.10': bpo-43760: Document PyThreadState.use_tracing removal (GH-28527) (GH-28529) https://github.com/python/cpython/commit/55576893b31452ba739e01189424cd62cf11ed20 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Thu Sep 23 16:57:44 2021 From: report at bugs.python.org (Kien Dang) Date: Thu, 23 Sep 2021 20:57:44 +0000 Subject: [issue45101] Small inconsistency in usage message between the python and shell script versions of python-config In-Reply-To: <1630780332.11.0.126671398839.issue45101@roundup.psfhosted.org> Message-ID: <1632430664.52.0.399694818405.issue45101@roundup.psfhosted.org> Kien Dang <mail at kien.ai> added the comment: Thanks. I didn't know about the `pkg-config` thing. I just checked with pkg-config on macOS `pkg-config --help` prints usage instructions to stdout pkg-config followed by invalid options prints output to stderr, for example `pkg-config --asdf` prints `Unknown option --asdf` to stderr. The PR I submitted does something similar, making both python and shell script versions of `python-config` to print out the usage instruction message to stdout when --help is provided and stderr when given invalid arguments. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45101> _______________________________________ From report at bugs.python.org Thu Sep 23 17:26:50 2021 From: report at bugs.python.org (Josh Haberman) Date: Thu, 23 Sep 2021 21:26:50 +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: <1632432410.82.0.384900504153.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > It's better to pass the metaclass as a function argument, as with bases. I'd prefer adding a new function that using a slot. Bases are available both as a slot (Py_tp_bases) and as an argument (PyType_FromSpecWithBases). I don't see why this has to be an either/or proposition. Both can be useful. Either would satisfy my use case. I'm constructing N such classes, so the spec won't be statically initialized anyway and the initialization issues on Windows don't apply. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Thu Sep 23 17:36:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:36:10 +0000 Subject: [issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager In-Reply-To: <1570567549.28.0.993731185011.issue38415@roundup.psfhosted.org> Message-ID: <1632432970.13.0.0907070521093.issue38415@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 86b833badd3d6864868404ead2f8c7994d24f85c by Jason Fried in branch 'main': bpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators (GH-16667) https://github.com/python/cpython/commit/86b833badd3d6864868404ead2f8c7994d24f85c ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38415> _______________________________________ From report at bugs.python.org Thu Sep 23 17:37:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:37:12 +0000 Subject: [issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager In-Reply-To: <1570567549.28.0.993731185011.issue38415@roundup.psfhosted.org> Message-ID: <1632433032.45.0.08809069346.issue38415@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Look, not even 23 months to land this thing! Thanks, Jason! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38415> _______________________________________ From report at bugs.python.org Thu Sep 23 17:37:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:37:57 +0000 Subject: [issue39359] zipfile: add missing "pwd: expected bytes, got str" exception message In-Reply-To: <1579180814.8.0.49279033626.issue39359@roundup.psfhosted.org> Message-ID: <1632433077.64.0.0047234179519.issue39359@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 91099e25446b214725f8e2ffffbec6f90553260c by Daniel Hillier in branch 'main': bpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception (GH-18031) https://github.com/python/cpython/commit/91099e25446b214725f8e2ffffbec6f90553260c ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39359> _______________________________________ From report at bugs.python.org Thu Sep 23 17:38:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:38:18 +0000 Subject: [issue39359] zipfile: add missing "pwd: expected bytes, got str" exception message In-Reply-To: <1579180814.8.0.49279033626.issue39359@roundup.psfhosted.org> Message-ID: <1632433098.72.0.695574539868.issue39359@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Daniel! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39359> _______________________________________ From report at bugs.python.org Thu Sep 23 17:39:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Sep 2021 21:39:41 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632433181.18.0.129692829919.issue45274@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I am not sure that it can be solved at Python level. Possible solutions: * Add a Lock method (or just a builtin function) which acquires and immediately releases the lock, without possibility to interrupt. if lock._blink(block, timeout): self._stop() * Add a context manager which suppresses keyboard interruption. with suppress_interrupt(): if not lock._blink(block, timeout): return self._stop() ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 17:40:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 23 Sep 2021 21:40:11 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632433211.01.0.588250804457.issue38623@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26922 pull_request: https://github.com/python/cpython/pull/28537 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 17:40:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:40:02 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632433202.42.0.312877357763.issue38623@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 55b45bf707c6c8084db259fe2f8aa08e84ea0d99 by Peter Bittner in branch 'main': bpo-38623: Add note about site module (site-packages) (GH-16974) https://github.com/python/cpython/commit/55b45bf707c6c8084db259fe2f8aa08e84ea0d99 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 17:40:07 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 23 Sep 2021 21:40:07 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632433207.41.0.542388558573.issue38623@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26921 pull_request: https://github.com/python/cpython/pull/28536 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 17:44:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 21:44:02 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632433442.98.0.744098832969.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Good point benchmarking small iterations too, Dennis. I missed that. Agreed then, GH-27986 looks like a winner. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Thu Sep 23 17:59:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 23 Sep 2021 21:59:53 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632434393.59.0.0999640979088.issue45274@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Add a context manager which suppresses keyboard interruption. That's not enough technically. This can be any signal handler that raises an exception, no? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 18:40:44 2021 From: report at bugs.python.org (gaborjbernat) Date: Thu, 23 Sep 2021 22:40:44 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632436844.27.0.308902181909.issue45274@roundup.psfhosted.org> Change by gaborjbernat <gaborjbernat at gmail.com>: ---------- nosy: +gaborjbernat _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 18:48:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 22:48:13 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632437293.0.0.465741166918.issue38623@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 87f97fe5e6434da51246d70af9e2cd7d63c29fba by Miss Islington (bot) in branch '3.10': bpo-38623: Add note about site module (site-packages) (GH-16974) (GH-28536) https://github.com/python/cpython/commit/87f97fe5e6434da51246d70af9e2cd7d63c29fba ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 18:48:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 22:48:59 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632437339.39.0.44708285271.issue38623@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Peter! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 18:48:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 23 Sep 2021 22:48:29 +0000 Subject: [issue38623] Python documentation should mention how to find site-packages In-Reply-To: <1572302365.38.0.0160311403424.issue38623@roundup.psfhosted.org> Message-ID: <1632437309.66.0.612013384095.issue38623@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d672dd34f0bc3addeaf1789d4183e3a37ab110d5 by Miss Islington (bot) in branch '3.9': bpo-38623: Add note about site module (site-packages) (GH-16974) (GH-28537) https://github.com/python/cpython/commit/d672dd34f0bc3addeaf1789d4183e3a37ab110d5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue38623> _______________________________________ From report at bugs.python.org Thu Sep 23 19:01:06 2021 From: report at bugs.python.org (Daniel Hillier) Date: Thu, 23 Sep 2021 23:01:06 +0000 Subject: [issue39359] zipfile: add missing "pwd: expected bytes, got str" exception message In-Reply-To: <1579180814.8.0.49279033626.issue39359@roundup.psfhosted.org> Message-ID: <1632438066.6.0.830367411982.issue39359@roundup.psfhosted.org> Daniel Hillier <daniel.hillier at gmail.com> added the comment: Thanks ?ukasz! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39359> _______________________________________ From report at bugs.python.org Thu Sep 23 19:03:20 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 23 Sep 2021 23:03:20 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632438200.99.0.240672327861.issue45274@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: See bpo-21822 from 2014, which I think was the first report of this issue. ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Thu Sep 23 20:36:24 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 24 Sep 2021 00:36:24 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632443784.84.0.434964932156.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26923 pull_request: https://github.com/python/cpython/pull/28538 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 24 00:32:20 2021 From: report at bugs.python.org (Chuanlong Du) Date: Fri, 24 Sep 2021 04:32:20 +0000 Subject: [issue45275] Make argparse print description of subcommand when invoke help doc on subcommand Message-ID: <1632457940.29.0.512184786201.issue45275@roundup.psfhosted.org> New submission from Chuanlong Du <longendu at gmail.com>: I have command-line script `blog` written using argparse. It supports subcommands. When I check the help doc of a subcommand, e.g., using `blog convert -h`, it prints the help doc of the subcommand `blog convert` but doesn't print the description of the subcommand `blog convert`. A screenshot is attached. It is quite often that I know a command-line application have certain subcommands but I forget exactly what they do. It would be very helpful if `blog subcmd -h` prints the description of the subcmd so that users do not have to call `blog -h` again to check exactly what the subcommand does. ---------- components: Library (Lib) files: Selection_011.png messages: 402541 nosy: longendu priority: normal severity: normal status: open title: Make argparse print description of subcommand when invoke help doc on subcommand type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50301/Selection_011.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45275> _______________________________________ From report at bugs.python.org Fri Sep 24 02:56:23 2021 From: report at bugs.python.org (gaborjbernat) Date: Fri, 24 Sep 2021 06:56:23 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632466583.25.0.0447208081222.issue45274@roundup.psfhosted.org> gaborjbernat <gaborjbernat at gmail.com> added the comment: I just want to note that my maximal reproducer moved to https://github.com/tox-dev/tox/commit/e5d1a439be0790c8104d4caf943b3d82f23a0039 (that has been merged on the branch, so should be now stable). ---------- nosy: -eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Fri Sep 24 03:01:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Sep 2021 07:01:34 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632466894.46.0.419538859673.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I do not see any difference in iterating small integers: $ ./python -m pyperf timeit -s 'r = range(10000)' 'for i in r: pass' PR 27986: Mean +- std dev: 174 us +- 9 us PR 28176: Mean +- std dev: 172 us +- 10 us ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Fri Sep 24 03:43:34 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 24 Sep 2021 07:43:34 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632469414.31.0.700598642626.issue45269@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26924 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28540 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Fri Sep 24 04:10:36 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 24 Sep 2021 08:10:36 +0000 Subject: [issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic Message-ID: <1632471036.7.0.15153501951.issue45276@roundup.psfhosted.org> New submission from Thomas Grainger <tagrain at gmail.com>: the weak collections should have the same threadsafe/thread unsafe guarantees as their strong reference counterparts - eg dict.copy and set.copy are atomic and so the weak versions should be atomic also ---------- components: Interpreter Core, asyncio messages: 402544 nosy: asvetlov, graingert, yselivanov priority: normal severity: normal status: open title: avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45276> _______________________________________ From report at bugs.python.org Fri Sep 24 04:16:32 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 24 Sep 2021 08:16:32 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632471392.95.0.904780492715.issue45274@roundup.psfhosted.org> Change by Eryk Sun <eryksun at gmail.com>: ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Fri Sep 24 04:17:16 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 24 Sep 2021 08:17:16 +0000 Subject: [issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic In-Reply-To: <1632471036.7.0.15153501951.issue45276@roundup.psfhosted.org> Message-ID: <1632471436.05.0.0721985308376.issue45276@roundup.psfhosted.org> Change by Thomas Grainger <tagrain at gmail.com>: ---------- keywords: +patch pull_requests: +26925 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28541 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45276> _______________________________________ From report at bugs.python.org Fri Sep 24 04:52:55 2021 From: report at bugs.python.org (HugoThiolliere) Date: Fri, 24 Sep 2021 08:52:55 +0000 Subject: [issue45277] typo in codecs documentation Message-ID: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> New submission from HugoThiolliere <hugo.thiolliere at hotmail.fr>: There is a typo in https://docs.python.org/3/library/codecs.html#encodings-and-unicode The first sentence in the last paragraph before the table reads : "There?s another encoding that is able to encoding the full range of Unicode characters" When it should read "There?s another encoding that is able to encode the full range of Unicode characters" ---------- assignee: docs at python components: Documentation messages: 402545 nosy: Gronahak, docs at python priority: normal severity: normal status: open title: typo in codecs documentation type: enhancement versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 05:16:19 2021 From: report at bugs.python.org (Christian Tismer) Date: Fri, 24 Sep 2021 09:16:19 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632474979.43.0.894052559624.issue45256@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: FYI., in Stackless Python I built a chain of frames by a double linked list. This was the replacement for the current frame/stack mix. Debugging was still quite easy, following this frame chain. Note that it is a rather easy step to add the capability to squirrel the whole current chain away and replace it by another one. Add some header to such a chain, and you can call it "Tasklet". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Fri Sep 24 05:27:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 09:27:01 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632475621.74.0.678915800177.issue43760@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26926 pull_request: https://github.com/python/cpython/pull/28542 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Fri Sep 24 06:05:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 10:05:40 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632477940.42.0.0645629772754.issue30951@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 3f8b23f8ddab75d9b77a3997d54e663187e12cc8 by Alex Vig in branch 'main': bpo-30951: Correct co_names docstring in inspect module (GH-2743) https://github.com/python/cpython/commit/3f8b23f8ddab75d9b77a3997d54e663187e12cc8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:05:47 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 24 Sep 2021 10:05:47 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632477947.92.0.858932548879.issue30951@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26928 pull_request: https://github.com/python/cpython/pull/28544 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:05:43 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 24 Sep 2021 10:05:43 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632477943.24.0.552710525259.issue30951@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26927 pull_request: https://github.com/python/cpython/pull/28543 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:38:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 10:38:54 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632479934.3.0.357461512444.issue30951@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 91a5ba1bcb24c87a82c1417b1e5df57c89cbd3e0 by Miss Islington (bot) in branch '3.9': bpo-30951: Correct co_names docstring in inspect module (GH-2743) (GH-28544) https://github.com/python/cpython/commit/91a5ba1bcb24c87a82c1417b1e5df57c89cbd3e0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:38:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 10:38:59 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632479939.08.0.264081691893.issue30951@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 402d5f3d77684c91ad02a2ab5223673bec5f1602 by Miss Islington (bot) in branch '3.10': bpo-30951: Correct co_names docstring in inspect module (GH-2743) (GH-28543) https://github.com/python/cpython/commit/402d5f3d77684c91ad02a2ab5223673bec5f1602 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:39:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 10:39:41 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1632479981.81.0.806333931319.issue30951@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Alex! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10, Python 3.11 -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue30951> _______________________________________ From report at bugs.python.org Fri Sep 24 06:43:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 24 Sep 2021 10:43:25 +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: <1632480205.1.0.670718890837.issue15870@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: > But at least if it's available as a slot then a module is *able* to use it with limited ABI going backwards. A new function doesn't allow that. I think you're confusing PyType_Slot with the tp_* members of type structures. If a Py_tp_meta is added, it won't appear in past versions. See the end of Include/typeslots.h. (Sadly, they're both called "slots".) > Bases are available both as a slot (Py_tp_bases) and as an argument (PyType_FromSpecWithBases). I don't see why this has to be an either/or proposition. Both can be useful. I consider Py_tp_bases to be a mistake: it's an extra way of doing things that doesn't add any extra functionality, but is sometimes not correct (and it might not be obvious when it's not correct). > Either would satisfy my use case. So let's go for the one that isn't a trap in the other use cases :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Fri Sep 24 06:59:10 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 24 Sep 2021 10:59:10 +0000 Subject: [issue45213] Frozen modules are looked up using a linear search. In-Reply-To: <1631727732.79.0.742484624179.issue45213@roundup.psfhosted.org> Message-ID: <1632481150.25.0.989262134979.issue45213@roundup.psfhosted.org> Dong-hee Na <donghee.na at python.org> added the comment: > Then we can at least bail out of the loop early, and one day someone could make it a binary search. I like this idea if we can guarantee the order :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45213> _______________________________________ From report at bugs.python.org Fri Sep 24 07:01:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 11:01:19 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632481279.67.0.484666486529.issue21302@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26929 pull_request: https://github.com/python/cpython/pull/28545 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Fri Sep 24 07:03:08 2021 From: report at bugs.python.org (Ben) Date: Fri, 24 Sep 2021 11:03:08 +0000 Subject: [issue45278] RuntimeError on race on weakset concurrent iteration Message-ID: <1632481388.9.0.303284230953.issue45278@roundup.psfhosted.org> New submission from Ben <benjsimner at gmail.com>: This is a very subtle race WeakSet uses _weakrefset.py's _IterationGuard structure to protect against the case where the elements the WeakSet refers to get cleaned up while a thread is iterating over the WeakSet. It defers the actual removal of any elements which get gc'd during iteration until the end of the iteration. the WeakSet keeps track of all the iterators, and waits until there are no more threads iterating over the set before it does the removal: https://github.com/python/cpython/blob/main/Lib/_weakrefset.py#L30 However there is a race, if another thread begins iterating after the `if s:` check but before the _commit_removals call has ended, that iteration can get a RuntimeError. attached is an example script that can generate such RuntimeError's, although the race window here is very small and so to observe yourself you may have to tweak the magic constants around. As far as I'm aware nobody has reported seeing this bug happen in production, but some libraries (e.g. asyncio) do currently rely on concurrently iterating a weakset, so it's not implausible. ---------- files: weakset_concurrent_iter_runtimeerror.py messages: 402553 nosy: bjs priority: normal severity: normal status: open title: RuntimeError on race on weakset concurrent iteration type: behavior Added file: https://bugs.python.org/file50302/weakset_concurrent_iter_runtimeerror.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45278> _______________________________________ From report at bugs.python.org Fri Sep 24 07:06:08 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 24 Sep 2021 11:06:08 +0000 Subject: [issue45278] RuntimeError on race on weakset concurrent iteration In-Reply-To: <1632481388.9.0.303284230953.issue45278@roundup.psfhosted.org> Message-ID: <1632481568.24.0.566406836164.issue45278@roundup.psfhosted.org> Change by Thomas Grainger <tagrain at gmail.com>: ---------- nosy: +graingert _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45278> _______________________________________ From report at bugs.python.org Fri Sep 24 07:06:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Sep 2021 11:06:46 +0000 Subject: [issue45278] RuntimeError on race on weakset concurrent iteration In-Reply-To: <1632481388.9.0.303284230953.issue45278@roundup.psfhosted.org> Message-ID: <1632481606.37.0.277970244172.issue45278@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- components: +Library (Lib) nosy: +fdrake, pitrou, serhiy.storchaka versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45278> _______________________________________ From report at bugs.python.org Fri Sep 24 07:07:20 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 24 Sep 2021 11:07:20 +0000 Subject: [issue45279] avoid redundant _commit_removals pending_removals guard Message-ID: <1632481640.03.0.970036840438.issue45279@roundup.psfhosted.org> New submission from Thomas Grainger <tagrain at gmail.com>: refactor to avoid redundant _commit_removals pending_removals guard ---------- components: Library (Lib) messages: 402554 nosy: graingert priority: normal severity: normal status: open title: avoid redundant _commit_removals pending_removals guard versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45279> _______________________________________ From report at bugs.python.org Fri Sep 24 07:07:45 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 24 Sep 2021 11:07:45 +0000 Subject: [issue45279] avoid redundant _commit_removals pending_removals guard In-Reply-To: <1632481640.03.0.970036840438.issue45279@roundup.psfhosted.org> Message-ID: <1632481665.97.0.833774140867.issue45279@roundup.psfhosted.org> Change by Thomas Grainger <tagrain at gmail.com>: ---------- keywords: +patch pull_requests: +26930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28546 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45279> _______________________________________ From report at bugs.python.org Fri Sep 24 07:12:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 11:12:48 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632481968.64.0.401404252779.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Serhiy, right: looks like the difference stems from recreating the range objects, not from iteration. But Dennis' observation still stands: using `for i in range(...):` is a very popular idiom. If that becomes slower than the status quo, we will be making existing Python programs slower as well. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Fri Sep 24 07:20:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 11:20:42 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632482442.46.0.122541402799.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > In this case that unexpected thread simply disappearing can lead to a deadlock in our process. This problem also remains me the very complex case of bpo-6721: "Locks in the standard library should be sanitized on fork". The issue title looks simple, but 12 years after the issue was created, it's still open. This issue is being solved by adding atfork callbacks to modules which must do something at fork in the child process (sometimes also in the parent process). I added threading.Lock._at_fork_reinit() private method to simplify the implementation of these callbacks. Such problem has no silver bullet solution, so it's better to let developers design their own solution with their specific requirements. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Fri Sep 24 07:23:41 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 24 Sep 2021 11:23:41 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested Message-ID: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: While working on `mypy` support of `NamedTuple`s (https://github.com/python/mypy/issues/11047), I've noticed that currently when testing `typing.NamedTuple` cases like: 1. `N = NamedTuple('N')` and 2. ```python class N(NamedTuple): ... ``` are ignored. However, this is an important corner-cases, we need to be sure that use can create empty named tuples if needed. Related position in code: https://github.com/python/cpython/blob/3f8b23f8ddab75d9b77a3997d54e663187e12cc8/Lib/test/test_typing.py#L4102-L4114 I will send a PR add these two cases. ---------- components: Tests messages: 402557 nosy: sobolevn priority: normal severity: normal status: open title: Empty typing.NamedTuple creation is not tested type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Fri Sep 24 07:27:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 11:27:45 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632482865.19.0.756989389657.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Gregory P. Smith: Python has many API using callbacks: PEP 445 added PyMem_SetAllocator() to set memory allocator. Adding PyMem_GetAllocator() also made possible to chain allocators and to "hook" into an existing allocator to execute code before and after it's called (the PEP contains an example). I'm not sure if it's important or useless to chain callbacks with Py_SetThreadExitCallback(). I suggest to always override the previously set callback. It would matter if library A sets a callback to emit log and library B sets a callback to hang threads. It maybe be nice to first emit a log and then hang the thread. But then the order in which callbacks are set starts to matter a lot :-) I'm fine with adding Py_GetThreadExitCallback() if you consider that it matters. > If someone passes nullptr does that undo it (please no!). I don't think that we should bother with adding a special case. I prefer to consider developers as adults and let them make their own mistakes if they consider that they understand the code well enough ;-) _PyEval_SetTrace() allows to remove the current trace function. It's a legit use case. If library C is annoyed by library A and library B installed annoying callbacks, IMO it's also ok to let it "remove" the previously set callback, no? IMO Py_SetThreadExitCallback(NULL) should simply set the callback to NULL, so restore the default behavior: call pthread_exit(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Fri Sep 24 07:31:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 11:31:28 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632483088.03.0.57730043918.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Another example where a developer asks to call abort() to notice bugs, whereas Python previously silently ignored it: bpo-36829. Calling abort() is a legit use case, but not really the best default behavior. Again, the problem was solved by letting developers setting their own callback: sys.unraisablehook. If I understood correctly, pytest doesn't override it but "took" into the default implementation: it chains its own code with the default implementation. It's possible because there is a way to "get" the current hook: just read sys.unraisablehook ;-) Another argument in favor of also adding Py_GetThreadExitCallback() ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Fri Sep 24 07:35:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 11:35:39 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632483339.79.0.65415526704.issue42969@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Jeremy Maitin-Shepard: "In general, I view hanging threads as the least bad thing to do when faced with either acquiring the GIL or not returning at all. There is a lot of existing usage of Python that currently poses a risk of random crashes and memory corruption while Python is exiting, and I would like to fix that." Showing warnings by default or not was discussed many times in Python. It was decided to *hide* DeprecationWarning by default. The PEP 565 is a minor trade-off to show them in the __main__ module. For me, more generally, Python default behavior is designed for *users* who don't want to be annoyed by warnings or anything which would make sense for *developers*. That's why I designed a new "Python Development Mode" (-X dev): https://docs.python.org/dev/library/devmode.html Maybe in development mode, the behavior could be changed to call abort(). But honestly, I'm not really excited by that. I'm not embedding Python in a C++ application. I'm almot only use Python directly: the Unix command "python3". For this use case, IMO it's fine to call pthread_exit() by default. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Fri Sep 24 08:11:27 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 24 Sep 2021 12:11:27 +0000 Subject: [issue45281] Make `is_attribute` and `module` arguments to `ForwardRef` kw-only Message-ID: <1632485487.21.0.977020306746.issue45281@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: After https://github.com/python/cpython/pull/28279 and https://bugs.python.org/issue45166 `ForwardRef` and `_type_check` now have `is_class` kw-only argument. It is now inconsistent with `is_argument` and `module` arguments. It would be quite nice to make them all kw-only. Quoting @ambv: > _type_check we can just change in Python 3.11 without any further ado. ForwardRef() will need a deprecation period when the users is calling is_argument= and module= as non-keyword arguments ---------- components: Library (Lib) messages: 402561 nosy: sobolevn priority: normal severity: normal status: open title: Make `is_attribute` and `module` arguments to `ForwardRef` kw-only type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45281> _______________________________________ From report at bugs.python.org Fri Sep 24 09:25:15 2021 From: report at bugs.python.org (Daisuke Takahashi) Date: Fri, 24 Sep 2021 13:25:15 +0000 Subject: [issue45282] isinstance(x, typing.Protocol-class) unexpectedly evaluates properties Message-ID: <1632489914.89.0.766542444973.issue45282@roundup.psfhosted.org> New submission from Daisuke Takahashi <dtakahashi42 at gmail.com>: Because __instancecheck__ of _ProtocolMeta uses hasattr() and getattr(), both of which evaluate property attributes, calling isinstance() with an object and a class that inherits typing.Protocol evaluates the input object's properties in some cases. The attached testcases include three cases of checking subtype relationship of an instance (having a property "x" that may raise RuntimeError on evaluation) and following three protocol classes; (1) a protocol class having "x" as a property, (2) a protocol class having "x" as a data attribute, and (3) a protocol class having "x" as a class property that raises RuntimeError on evaluation (>= python 3.9 only). Expected behavior: 1. The isinstance(obj, Protocol_class) does not evaluate anything but just checks existence of attribute names. 2. All cases in the attached testcases run without any error Thank you very much in advance. ---------- files: test_protocol_property.py messages: 402562 nosy: daitakahashi priority: normal severity: normal status: open title: isinstance(x, typing.Protocol-class) unexpectedly evaluates properties type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50303/test_protocol_property.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45282> _______________________________________ From report at bugs.python.org Fri Sep 24 09:44:07 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 24 Sep 2021 13:44:07 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` Message-ID: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> New submission from Nikita Sobolev <mail at sobolevn.me>: This code currently does not raise any issues: ```python # contents of `ex.py` from typing import ClassVar a: ClassVar[int] = 1 def b(c: ClassVar[int]): ... ``` And then: 1. Module: `python -c 'import ex; from typing import get_type_hints; print(get_type_hints(ex))'` 2. Function argument: `python -c 'import ex; from typing import get_type_hints; print(get_type_hints(ex.b))'` It should not be allowed. Currently, the same with `from __future__ import annotations` does correctly raise `TypeError: typing.ClassVar[int] is not valid as type argument` Related: https://github.com/python/cpython/pull/28279 I will send a PR with the fix shortly. ---------- components: Library (Lib) messages: 402563 nosy: sobolevn priority: normal severity: normal status: open title: Top / function argument level ClassVar should not be allowed during `get_type_hints()` type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Fri Sep 24 09:46:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 13:46:10 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632491170.16.0.853348834731.issue41299@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26931 pull_request: https://github.com/python/cpython/pull/28548 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 09:49:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 13:49:15 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632491355.04.0.700245558365.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I created PR #28548 to remove the Py_FatalError() code path. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 09:52:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 13:52:22 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632491542.05.0.958540641883.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Calling Py_FatalError() must be avoided by any mean. I spent significant time to remove Py_FatalError() at Python startup in my PEP 587 implementation: https://www.python.org/dev/peps/pep-0587/ I also removed Py_FatalError() calls to report errors to the caller: https://bugs.python.org/issue38631 Calling Py_FatalError() is really bad when Python is embedded in an application. It kills the whole process, the caller has no way to catch the error. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 10:21:11 2021 From: report at bugs.python.org (Paul Broe) Date: Fri, 24 Sep 2021 14:21:11 +0000 Subject: [issue45267] New install Python 3.9.7 install of Sphinx Document Generator fails In-Reply-To: <1632349305.85.0.928032648736.issue45267@roundup.psfhosted.org> Message-ID: <01b801d7b14f$6b863810$4292a830$@gmail.com> Paul Broe <pcbroe at gmail.com> added the comment: Good Morning: I was able to resolve the issue based on your assistance. I created this topic at github.com https://github.com/sphinx-doc/sphinx/issues/9669 Someone answered it and it was simple: Thank you so much. That was it. I thought it was looking for a package but I completely missed the fact that the package name was package. I can't connect to the internet from my machines. So, I have to download everything manually from PyPI. I added packages pyparsing and packaging ... And Building wheels for collected packages: sphinx Building wheel for sphinx (setup.py) ... done Created wheel for sphinx: filename=Sphinx-4.2.0-py3-none-any.whl size=3061858 sha256=c5b28f87749557dc8c06b9820c748d6c5e764e32f2f25620d08b3259993ea90a Stored in directory: /usr/opt/oracle/.cache/pip/wheels/31/d2/bc/aa1cbddf1cd38373f4632ab20b0e3400f 037bcf271b50b2397 Successfully built sphinx Installing collected packages: sphinx Successfully installed sphinx-4.2.0 You can close the issue.. It was not a python bug ---------- status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45267> _______________________________________ From report at bugs.python.org Fri Sep 24 10:52:18 2021 From: report at bugs.python.org (Alex Waygood) Date: Fri, 24 Sep 2021 14:52:18 +0000 Subject: [issue45282] isinstance(x, typing.Protocol-class) unexpectedly evaluates properties In-Reply-To: <1632489914.89.0.766542444973.issue45282@roundup.psfhosted.org> Message-ID: <1632495138.55.0.342591164499.issue45282@roundup.psfhosted.org> Alex Waygood <Alex.Waygood at Gmail.com> added the comment: Related: https://bugs.python.org/issue44904 ---------- nosy: +AlexWaygood _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45282> _______________________________________ From report at bugs.python.org Fri Sep 24 11:18:13 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 24 Sep 2021 15:18:13 +0000 Subject: [issue20524] format error messages should provide context information In-Reply-To: <1391642595.93.0.722493013717.issue20524@psf.upfronthosting.co.za> Message-ID: <1632496693.13.0.803219583146.issue20524@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: New changeset 8d8729146f21f61af66e70d3ae9501ea6bdccd09 by Nikita Sobolev in branch 'main': bpo-20524: adds better error message for `.format()` (GH-28310) https://github.com/python/cpython/commit/8d8729146f21f61af66e70d3ae9501ea6bdccd09 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20524> _______________________________________ From report at bugs.python.org Fri Sep 24 11:19:16 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 24 Sep 2021 15:19:16 +0000 Subject: [issue20524] format error messages should provide context information In-Reply-To: <1391642595.93.0.722493013717.issue20524@psf.upfronthosting.co.za> Message-ID: <1632496756.18.0.708880075954.issue20524@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Thanks for the improvement, @sobolevn! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20524> _______________________________________ From report at bugs.python.org Fri Sep 24 11:22:52 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 24 Sep 2021 15:22:52 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1632496972.75.0.656354027399.issue44019@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: New changeset 6587fc60d447603fb8c631d81d9bb379f53c39ab by Antony Lee in branch 'main': bpo-44019: Implement operator.call(). (GH-27888) https://github.com/python/cpython/commit/6587fc60d447603fb8c631d81d9bb379f53c39ab ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44019> _______________________________________ From report at bugs.python.org Fri Sep 24 11:24:27 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Fri, 24 Sep 2021 15:24:27 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632497067.59.0.160724376888.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: To be clear, the problem I'm trying to address here is not specific to embedding Python in a C++ application. In fact the issue came to my attention while using Python directly, but loading an extension module that was written in C++ using the popular pybind11 library. If we continue having Python call `pthread_exit` and `_endthreadex`, we are imposing strong constraints on call stacks that call the Python API. Granted, hanging a thread is also not something a well-behaved library should do, but it is at least slightly better than killing the thread. In a sense hanging is also logical, since the thread has requested to block until the GIL can be acquired, and the GIL cannot be acquired. I have described a number of problems caused by `pthread_exit`/`_endthreadex` that are fixed by hanging. Can you help me understand what problems caused by hanging are fixed by `pthread_exit`/`_endthreadex`, that leads you to think it is a better default? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Fri Sep 24 11:26:49 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 24 Sep 2021 15:26:49 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1632497209.95.0.0764888414092.issue44019@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: Thanks for the contribution! ---------- stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44019> _______________________________________ From report at bugs.python.org Fri Sep 24 11:30:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 15:30:26 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632497426.28.0.328951980078.issue1596321@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch nosy: +vstinner nosy_count: 14.0 -> 15.0 pull_requests: +26932 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28549 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Fri Sep 24 11:33:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 15:33:38 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632497618.63.0.227461774006.issue1596321@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I proposed PR 28549 to fix this very old threading issue. A C extension can spawn threads without using the threading module and then then run Python code which imports the threading module. In this case, threading._main_thread is the thread which imported first the threading module. My PR changes so threading._shutdown() simply ignores _main_thread when it happens. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Fri Sep 24 11:51:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 15:51:58 +0000 Subject: [issue43050] threading timer memory leak In-Reply-To: <1611800643.13.0.196440440542.issue43050@roundup.psfhosted.org> Message-ID: <1632498718.77.0.189923182595.issue43050@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I cannot reproduce the issue. IMO it has been fixed. Moreover, you must join timers using timer.join(): a timer remains a thread. Code: --- import os import threading os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") # warmup for n in range(10): timer = threading.Timer(5, None) timer.start() timer.cancel() timer.join() os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") for n in range(1000): timer = threading.Timer(5, None) timer.start() timer.cancel() timer.join() os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") --- Output on Linux with the main branch of Python (3.11): --- VmRSS: 10924 kB VmRSS: 11104 kB VmRSS: 11104 kB --- ---------- nosy: +vstinner resolution: duplicate -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43050> _______________________________________ From report at bugs.python.org Fri Sep 24 11:53:53 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 24 Sep 2021 15:53:53 +0000 Subject: [issue45272] 'os.path' should not be a frozen module In-Reply-To: <1632414295.46.0.740648553614.issue45272@roundup.psfhosted.org> Message-ID: <1632498833.25.0.0778607067508.issue45272@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45272> _______________________________________ From report at bugs.python.org Fri Sep 24 11:55:05 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 24 Sep 2021 15:55:05 +0000 Subject: [issue45218] cmath.log has an invalid signature In-Reply-To: <1631783340.74.0.420089493101.issue45218@roundup.psfhosted.org> Message-ID: <1632498905.79.0.465644514434.issue45218@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45218> _______________________________________ From report at bugs.python.org Fri Sep 24 11:59:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 15:59:35 +0000 Subject: [issue40657] Resource leaks with threading.Thread In-Reply-To: <1589702871.42.0.415645279958.issue40657@roundup.psfhosted.org> Message-ID: <1632499175.19.0.138635749929.issue40657@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: You must join thread using thread.join(). If I add .join() calls, threading.active_count() stays around 2, it doesn't grow. It's not a bug in Python. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40657> _______________________________________ From report at bugs.python.org Fri Sep 24 12:04:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 16:04:39 +0000 Subject: [issue40699] Memory leak in threading library with Python 3.6-3.8 In-Reply-To: <1589974548.09.0.894000250375.issue40699@roundup.psfhosted.org> Message-ID: <1632499479.46.0.759863988749.issue40699@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I fail to reproduce the leak using attached script. I close the issue. I get constant memory usage on Linux with the main branch of Python (future 3.11): (...) VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB VmRSS: 11344 kB (...) ---------- nosy: +vstinner resolution: -> not a bug stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file50304/script.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40699> _______________________________________ From report at bugs.python.org Fri Sep 24 12:28:01 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 24 Sep 2021 16:28:01 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632500881.48.0.118354041181.issue45211@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- keywords: +patch pull_requests: +26933 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28550 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Fri Sep 24 12:33:24 2021 From: report at bugs.python.org (Ganesh Kumar) Date: Fri, 24 Sep 2021 16:33:24 +0000 Subject: [issue45284] Better `TypeError` message when a string is indexed using a string Message-ID: <1632501204.02.0.12612984159.issue45284@roundup.psfhosted.org> New submission from Ganesh Kumar <ganesh-kumar at live.com>: The `TypeError` message when a string is indexed using a string should be similar to the `TypeError` message when a list or tuple is indexed using a string. >>> my_str = 'Rin' >>> my_str[1:3] # works 'in' >>> my_str['no'] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: string indices must be integers >>> my_str[slice(1, 3)] # works with slices 'in' Certainly it does work with slice as intended but the error message should explain that, as seen in the following >>> my_list = [1, 2, 3] >>> my_list['no'] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: list indices must be integers or slices, not str >>> my_tuple = (1, 2, 3) >>> my_tuple['no'] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: tuple indices must be integers or slices, not str The error message shows `slices` are indeed an option to use when indexing a list or tuple. Would be happy to submit a documentation PR if this minor change would be accepted. ---------- components: Library (Lib) messages: 402577 nosy: Rin priority: normal severity: normal status: open title: Better `TypeError` message when a string is indexed using a string type: enhancement versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45284> _______________________________________ From report at bugs.python.org Fri Sep 24 12:33:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 16:33:56 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1632501236.1.0.453313504799.issue44019@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- nosy: +terry.reedy nosy_count: 6.0 -> 7.0 pull_requests: +26934 pull_request: https://github.com/python/cpython/pull/28551 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44019> _______________________________________ From report at bugs.python.org Fri Sep 24 12:36:34 2021 From: report at bugs.python.org (Rin RIn) Date: Fri, 24 Sep 2021 16:36:34 +0000 Subject: [issue45284] Better `TypeError` message when a string is indexed using a non int In-Reply-To: <1632501204.02.0.12612984159.issue45284@roundup.psfhosted.org> Message-ID: <1632501394.09.0.119240053448.issue45284@roundup.psfhosted.org> Change by Rin RIn <ganesh-kumar at live.com>: ---------- title: Better `TypeError` message when a string is indexed using a string -> Better `TypeError` message when a string is indexed using a non int _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45284> _______________________________________ From report at bugs.python.org Fri Sep 24 13:28:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 24 Sep 2021 17:28:19 +0000 Subject: [issue45284] Better `TypeError` message when a string is indexed using a non int In-Reply-To: <1632501204.02.0.12612984159.issue45284@roundup.psfhosted.org> Message-ID: <1632504499.5.0.446232184194.issue45284@roundup.psfhosted.org> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment: See also https://bugs.python.org/issue44110 . This looks like a duplicate. Also https://bugs.python.org/issue35077 ---------- nosy: +xtreak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45284> _______________________________________ From report at bugs.python.org Fri Sep 24 13:31:16 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 24 Sep 2021 17:31:16 +0000 Subject: [issue35077] Make TypeError message less ambiguous In-Reply-To: <1540569163.5.0.788709270274.issue35077@psf.upfronthosting.co.za> Message-ID: <1632504676.61.0.410713956705.issue35077@roundup.psfhosted.org> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment: https://bugs.python.org/issue44110 did some improvements to error message to include type. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35077> _______________________________________ From report at bugs.python.org Fri Sep 24 13:40:51 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 24 Sep 2021 17:40:51 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1632505251.85.0.990492279337.issue44019@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: New changeset bfe26bbad787c124f0ce144cff1b513ef9d2dc9c by Terry Jan Reedy in branch 'main': bpo-44019: Add missing comma to operator.call doc (GH-28551) https://github.com/python/cpython/commit/bfe26bbad787c124f0ce144cff1b513ef9d2dc9c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44019> _______________________________________ From report at bugs.python.org Fri Sep 24 15:04:07 2021 From: report at bugs.python.org (Jun De) Date: Fri, 24 Sep 2021 19:04:07 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations In-Reply-To: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> Message-ID: <1632510247.58.0.0390441964743.issue44687@roundup.psfhosted.org> Jun De <solsticedante at gmail.com> added the comment: Yeap Steve, I was thinking the same thing. I've taken the buffered data into consideration when checking if the file is closed in my fix, feel free to take a look and let me know what you think :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44687> _______________________________________ From report at bugs.python.org Fri Sep 24 15:23:45 2021 From: report at bugs.python.org (CireSnave) Date: Fri, 24 Sep 2021 19:23:45 +0000 Subject: [issue45285] c_char incorrectly treated as bytes in Structure Message-ID: <1632511425.07.0.917515072933.issue45285@roundup.psfhosted.org> New submission from CireSnave <ciresnave at yahoo.com>: When dealing with a Structure containing c_char variables, the variables are incorrectly being typed as bytes. As a result, a pointer to those c_char variables can not be created because bytes is not a ctypes type. from ctypes import ( Structure, c_char, pointer, ) class MyStruct(Structure): _fields_ = [("a", c_char), ("b", c_char), ("c", c_char)] x: MyStruct = MyStruct(98, 99, 100) print(type(x.a)) # Prints <class 'bytes'> ??? Both mypy and PyRight agree that x.a is a c_char. some_variable = pointer(x.a) # Traceback (most recent call last): # File "C:\Users\cires\ctypes_test.py", line 23, in <module> # some_variable = pointer(x.a) # TypeError: _type_ must have storage info ---------- components: ctypes messages: 402582 nosy: ciresnave priority: normal severity: normal status: open title: c_char incorrectly treated as bytes in Structure type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45285> _______________________________________ From report at bugs.python.org Fri Sep 24 16:06:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 20:06:44 +0000 Subject: [issue45240] Add +REPORT_NDIFF option to pdb tests that use doctest In-Reply-To: <1632013131.74.0.0677212065076.issue45240@roundup.psfhosted.org> Message-ID: <1632514004.23.0.598505925175.issue45240@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Lukasz, there is no current doctest expert and I think that this is something you could either accept or reject fairly quickly. Since the enhancement is to the tests, it could be backported. ---------- nosy: +lukasz.langa, terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45240> _______________________________________ From report at bugs.python.org Fri Sep 24 16:09:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 20:09:24 +0000 Subject: [issue45242] test_pdb fails In-Reply-To: <1632079561.91.0.535286155641.issue45242@roundup.psfhosted.org> Message-ID: <1632514164.21.0.229559534952.issue45242@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_pdb fails _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45242> _______________________________________ From report at bugs.python.org Fri Sep 24 16:14:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 20:14:41 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1632514481.18.0.757493851894.issue41914@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: L?on's message from #45242, which I closed as a duplicate of this. Leon: please try with 3.11 (best, repository main), 3.10, or at least 3.9. 3.8 and before only get security fixes. --- Building Python 3.7, I ran into the same issue reported [here] (only line numbers differ): ====================================================================== FAIL: test_errors_in_command (__main__.PdbTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_pdb.py", line 1535, in test_errors_in_command '(Pdb) ', AssertionError: Lists differ: ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ', '\x1b[?1034h'] != ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) '] First list contains 1 additional elements. First extra element 9: '\x1b[?1034h' ['(Pdb) *** SyntaxError: unexpected EOF while parsing', '(Pdb) ENTERING RECURSIVE DEBUGGER', '*** SyntaxError: unexpected EOF while parsing', 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ENTERING RECURSIVE DEBUGGER', '> <string>(1)<module>()', "((Pdb)) *** NameError: name 'doesnotexist' is not defined", 'LEAVING RECURSIVE DEBUGGER', - '(Pdb) ', ? ^ + '(Pdb) '] ? ^ - '\x1b[?1034h'] ---------------------------------------------------------------------- Ran 39 tests in 1.024s FAILED (failures=1) I have also managed to determine the cause. As can be seen, the output from this pdb invocation contains an extraneous ANSI control sequence ("interpret "meta" key, set eighth bit"). This happens when running the test inside the GNU `screen` environment. Run the test outside `screen`, and the problem goes away. (By the way, this was the only test that failed when running `make test` inside the `screen` environment.) ---------- nosy: +terry.reedy resolution: works for me -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41914> _______________________________________ From report at bugs.python.org Fri Sep 24 16:19:04 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 24 Sep 2021 20:19:04 +0000 Subject: [issue45285] c_char incorrectly treated as bytes in Structure In-Reply-To: <1632511425.07.0.917515072933.issue45285@roundup.psfhosted.org> Message-ID: <1632514744.34.0.42687227853.issue45285@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: A simple ctypes type implements a get function that's called when its value is returned as an attribute of struct/union, index of an array/pointer, or result of a function pointer. For example: >>> a = (ctypes.c_char * 1)(97) >>> a[0] b'a' >>> p = ctypes.POINTER(ctypes.c_char)(a) >>> p[0] b'a' This behavior can't be changed. However, using a subclass of c_char works around it. For example: >>> class my_char(ctypes.c_char): pass ... >>> a = (my_char * 1)(97) >>> a[0] <my_char object at 0x7f007dadf640> >>> a[0].value b'a' >>> p = ctypes.POINTER(my_char)(a) >>> p[0] <my_char object at 0x7f007dadf6c0> >>> p[0].value b'a' ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45285> _______________________________________ From report at bugs.python.org Fri Sep 24 16:19:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 20:19:50 +0000 Subject: [issue45244] pip not installed with fresh python3.8.10 installation In-Reply-To: <1632119366.31.0.964394896374.issue45244@roundup.psfhosted.org> Message-ID: <1632514790.57.0.623568172302.issue45244@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: If you installed 'py' (the default), you should be able to install pip with 'py -3.8 -m ensurepip'. (I had to do this once. I wrote the failure off as a random glitch and did not think to open an issue.) ---------- nosy: +terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45244> _______________________________________ From report at bugs.python.org Fri Sep 24 16:35:50 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 24 Sep 2021 20:35:50 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632515750.44.0.451531638016.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 7c801e0fa603b155eab3fd19698aa90854ac5a7b by Eric Snow in branch 'main': bpo-45020: Fix some corner cases for frozen module generation. (gh-28538) https://github.com/python/cpython/commit/7c801e0fa603b155eab3fd19698aa90854ac5a7b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 24 17:15:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 24 Sep 2021 21:15:25 +0000 Subject: [issue35921] Use ccache by default In-Reply-To: <1549481125.53.0.646421596529.issue35921@roundup.psfhosted.org> Message-ID: <1632518125.25.0.940354349773.issue35921@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: It seems to me like the consensus is to not alter CPython's build files because ccache is supposed to be used through its `cc`/`gcc` compiler wrappers. Those can be provided to a ./configure run either by modifying PATH to include the directory with the wrappers or by specifying the CC env var directly to point to the ccache wrapper (or "ccache gcc"). Therefore, I'm closing the issue. Antoine, this sat for 2.5 years without activity but if you feel strongly about reintroducing the idea, feel free to reopen. ---------- nosy: +lukasz.langa resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35921> _______________________________________ From report at bugs.python.org Fri Sep 24 17:54:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 21:54:43 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632520483.09.0.104243698457.issue41299@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26935 pull_request: https://github.com/python/cpython/pull/28552 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 18:13:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 22:13:12 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632521592.62.0.571122051707.issue45249@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: In 3.10+, end_lineno and end_offset fields were added to SyntaxError objects and the args tuple. >>> try: compile('1 1', '', 'single') ... except SyntaxError as e: print(e.args) ... ('invalid syntax. Perhaps you forgot a comma?', ('', 1, 1, '1 1', 1, 4)) Here, line 1, offset 4 is the first 1-based column not part of the error. The builtin default sys.excepthook was modified to read and use this new information and mark (end_offset - offset) columns with '^'s. This default prints what it does to sys.stderr. The syntax error formatting in the traceback module was not altered. However, a new method, TracebackException._format_syntax_error, was extracted from TracebackException.format_exception_only so that the former could be overridden by software that simulates interaction. The printed traceback does not come from line 1348. That *executes* the user code, but all Exceptions, including SyntaxError, are caught. If the exception is not expected and the run is not quiet, the exception is output by report_unexpected_exception(), as seen above as 'OUTPUT' and the lines that follows. https://github.com/python/cpython/blob/5846c9b71ee9277fe866b1bdee4cc6702323fe7e/Lib/doctest.py#L1264 This calls _exception_traceback(exc_info). https://github.com/python/cpython/blob/5846c9b71ee9277fe866b1bdee4cc6702323fe7e/Lib/doctest.py#L244 This calls traceback.print_exception, which I believe, for syntax errors, ultimately calls TracebackException._format_syntax_error. I believe that the options for a fix are either 1. Call default sys.excepthook while capturing its output into a StringIO instance. 2. Assuming I am correct above about _format_syntax_error being called, monkeypatch it. In line 779, https://github.com/python/cpython/blob/5846c9b71ee9277fe866b1bdee4cc6702323fe7e/Lib/traceback.py#L779 replace '^' with a field with a calculated number of ^s. I need to do one of these two for IDLE, and may try both. ---------- components: +Library (Lib) -Interpreter Core, Tests nosy: +terry.reedy stage: -> needs patch title: SyntaxError location range indicator does not work in doctests -> Update doctect SyntaxErrors for location range _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Fri Sep 24 18:16:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 22:16:46 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632521806.9.0.75568814188.issue41299@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26936 pull_request: https://github.com/python/cpython/pull/28553 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 18:18:26 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 24 Sep 2021 22:18:26 +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: <1632521906.91.0.179396608406.issue44603@roundup.psfhosted.org> Filipe La?ns <lains at riseup.net> added the comment: One technical argument on why it would be beneficial to have custom handling like this for exit is that exit is a site-builtin, not a builtin. $ python -S Python 3.9.7 (default, Aug 31 2021, 13:28:12) [GCC 11.1.0] on linux >>> exit() Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'exit' is not defined >>> import sys >>> sys.exit() ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Fri Sep 24 18:19:23 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 24 Sep 2021 22:19:23 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations In-Reply-To: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> Message-ID: <1632521963.5.0.999682247764.issue44687@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: That change makes me much happier :) Do you think we need a specific test added for this case? I'd guess we have plenty of coverage for the changed macro already, but clearly nothing that showed the issue before. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44687> _______________________________________ From report at bugs.python.org Fri Sep 24 18:32:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 22:32:04 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632522724.01.0.014071717824.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset f35ddf24227e834c9b6b39ad23a0ec382b4de48b by Victor Stinner in branch 'main': bpo-41299: QueryPerformanceFrequency() cannot fail (GH-28552) https://github.com/python/cpython/commit/f35ddf24227e834c9b6b39ad23a0ec382b4de48b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 18:40:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 22:40:24 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632523224.92.0.967014552411.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset d639e3170506a1a80c4b2f1b3a6250bb95ff190a by Victor Stinner in branch 'main': bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548) https://github.com/python/cpython/commit/d639e3170506a1a80c4b2f1b3a6250bb95ff190a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 19:12:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 23:12:48 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632525168.39.0.603533494246.issue43760@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Analysis use use_tracing usage in 3rd part code. I see two main ways to add C API functions covering these use cases: * Provide high-level functions like "call a trace function" (disable tracing, call trace function, reenable tracing, increment/decrement tstate->tracing) * Provide low-level functions just to control use_tracing: make PyThreadState structure opaque, but stil make the assumption that it is possible to disable temporarily tracing and profiling (in practice, it's implemented as use_tracing=0). (*) greenlet greenlet disables temporarily tracing in g_calltrace(), and then restore it, to call a "tracing" function: --- tstate->tracing++; TSTATE_USE_TRACING(tstate) = 0; retval = PyObject_CallFunction(tracefunc, "O(OO)", event, origin, target); tstate->tracing--; TSTATE_USE_TRACING(tstate) = (tstate->tracing <= 0 && ((tstate->c_tracefunc != NULL) || (tstate->c_profilefunc != NULL))); --- It also saves and then restores use_tracing value: --- ts__g_switchstack_use_tracing = tstate->cframe->use_tracing; (...) tstate->cframe->use_tracing = ts__g_switchstack_use_tracing; --- => it can use PyThreadState_IsTracing(), PyThreadState_DisableTracing() and PyThreadState_ResetTracing(). These functions don't handle "tstate->tracing++;" and "tstate->tracing--;" which is also used by greenlet. greenlet also saves and restores tstate->cframe: https://github.com/python-greenlet/greenlet/blob/master/src/greenlet/greenlet.c (*) dipy Code generated by Cython. (*) smartcols Code generated by Cython. (*) yappi yappi is Python profiler. yappi sets use_tracing to 1 when it sets its profile function: "ts->c_profilefunc = _yapp_callback;". It sets use_tracing to 0 when it clears the profile function: "ts->c_profilefunc = NULL;". That's wrong, it ignores the trace function. PyEval_SetProfile() cannot be used because yappi works on a PyThreadState (ts). Code: https://github.com/sumerc/yappi/blob/master/yappi/_yappi.c It can use PyThreadState_DisableTracing() and PyThreadState_ResetTracing(). Maybe a PyThreadState_SetProfile(tstate, func) function would fit better yappi's use case. (*) Cython Cython defines 2 compatibility functions: * __Pyx_IsTracing(tstate, check_tracing, check_funcs): it can check c_profilefunc and c_tracefunc * __Pyx_SetTracing(tstate, enable) Code: https://github.com/cython/cython/blob/0.29.x/Cython/Utility/Profile.c The code is quite complicated. In short, it checks if tracing and/or profiling is enabled. If it's enabled, it disables temporarily tracing (use_tracing=0) while calling trace and profile functions. => it requires PyThreadState_IsTracing(), PyThreadState_DisableTracing() and PyThreadState_ResetTracing(). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Fri Sep 24 19:14:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 23:14:17 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632525257.5.0.769266178932.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 6bc89116cb121c176453b9745e3daa2cc5df43ab by Victor Stinner in branch 'main': bpo-41299: Mark private thread_nt.h functions as static (GH-28553) https://github.com/python/cpython/commit/6bc89116cb121c176453b9745e3daa2cc5df43ab ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 19:17:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 23:17:07 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1632525427.3.0.232077877315.issue41299@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I close the issue. > bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548) I don't think that it's worth it to backport this change to 3.9 and 3.10. In practice, Py_FatalError() will never be called, and _PyTime_GetMonotonicClock() result must always be greater than 0. But I wanted to remove it in the main branch to reduce the number of functions calling Py_FatalError(). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41299> _______________________________________ From report at bugs.python.org Fri Sep 24 19:40:59 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 23:40:59 +0000 Subject: [issue45251] signal.SIGCLD alias is not available on OSX In-Reply-To: <1632176842.25.0.412458705067.issue45251@roundup.psfhosted.org> Message-ID: <1632526859.31.0.997875484281.issue45251@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45251> _______________________________________ From report at bugs.python.org Fri Sep 24 19:41:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 23:41:45 +0000 Subject: [issue45252] Missing support for Source Specific Multicast In-Reply-To: <1632183964.66.0.836467478723.issue45252@roundup.psfhosted.org> Message-ID: <1632526905.39.0.984837904.issue45252@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45252> _______________________________________ From report at bugs.python.org Fri Sep 24 19:42:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Sep 2021 23:42:10 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632526930.37.0.135022912449.issue45274@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I am not sure that it can be solved at Python level. Right. In pure Python, we cannot write code which works in all cases. My PR 28532 fix the most common case: application interrupted by a single CTRL+C. > with suppress_interrupt(): (...) It's important to be able to interrupt acquire() which can be called in blocking mode with no timeout: it's exactly what tox does, and users expect to be able to interrupt tox in this case. > * Add a Lock method (or just a builtin function) which acquires and immediately releases the lock, without possibility to interrupt. The acquire()+release() sequence can be made atomic in C, but it doesn't solve the problem of _stop() which can be interrupted by a second exception. This bug is likely as old as Python. I don't think that we should attempt to design a perfect solution. I only propose to make the race condition (way) less likely. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Fri Sep 24 19:42:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Sep 2021 23:42:36 +0000 Subject: [issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests In-Reply-To: <1632210576.65.0.316213829461.issue45254@roundup.psfhosted.org> Message-ID: <1632526956.08.0.0801347922955.issue45254@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- nosy: +davin, pitrou versions: -Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45254> _______________________________________ From report at bugs.python.org Fri Sep 24 19:46:46 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 24 Sep 2021 23:46:46 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632527206.01.0.647916947073.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26937 pull_request: https://github.com/python/cpython/pull/28554 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Fri Sep 24 20:05:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 00:05:43 +0000 Subject: [issue45267] New install Python 3.9.7 install of Sphinx Document Generator fails In-Reply-To: <1632349305.85.0.928032648736.issue45267@roundup.psfhosted.org> Message-ID: <1632528343.91.0.204889224536.issue45267@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45267> _______________________________________ From report at bugs.python.org Fri Sep 24 20:09:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 00:09:00 +0000 Subject: [issue45275] Make argparse print description of subcommand when invoke help doc on subcommand In-Reply-To: <1632457940.29.0.512184786201.issue45275@roundup.psfhosted.org> Message-ID: <1632528540.61.0.201523237222.issue45275@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45275> _______________________________________ From report at bugs.python.org Fri Sep 24 20:13:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 00:13:31 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632528811.32.0.420956740203.issue45277@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Thanks for the report. I will fix this. ---------- nosy: +terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 20:23:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 00:23:47 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632529427.31.0.192299366765.issue45277@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- keywords: +patch pull_requests: +26938 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28555 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 21:56:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 01:56:17 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632534977.01.0.642452364255.issue45277@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: New changeset 4c0fc65cd8a6d4c18330505576ccd4b46abeec1c by Terry Jan Reedy in branch 'main': bpo-45277: Fix typo in codecs doc (GH-28555) https://github.com/python/cpython/commit/4c0fc65cd8a6d4c18330505576ccd4b46abeec1c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 21:56:39 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 25 Sep 2021 01:56:39 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632534999.34.0.831506029228.issue45277@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26940 pull_request: https://github.com/python/cpython/pull/28557 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 21:56:34 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 25 Sep 2021 01:56:34 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632534994.83.0.702652841593.issue45277@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26939 pull_request: https://github.com/python/cpython/pull/28556 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 22:16:56 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 25 Sep 2021 02:16:56 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632536216.18.0.718878227957.issue45277@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 371ca3b54d355476cc735cb932e80f5cd16310da by Miss Islington (bot) in branch '3.10': bpo-45277: Fix typo in codecs doc (GH-28555) https://github.com/python/cpython/commit/371ca3b54d355476cc735cb932e80f5cd16310da ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 22:22:58 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 25 Sep 2021 02:22:58 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632536578.58.0.82190716779.issue45277@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 2a7d985bb3a1d85d63f135956750b330408702e6 by Miss Islington (bot) in branch '3.9': bpo-45277: Fix typo in codecs doc (GH-28555) https://github.com/python/cpython/commit/2a7d985bb3a1d85d63f135956750b330408702e6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 22:33:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 02:33:44 +0000 Subject: [issue45277] typo in codecs documentation In-Reply-To: <1632473575.85.0.482002410759.issue45277@roundup.psfhosted.org> Message-ID: <1632537224.54.0.304772103581.issue45277@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45277> _______________________________________ From report at bugs.python.org Fri Sep 24 23:12:53 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 03:12:53 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632539573.41.0.725435912441.issue43914@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- pull_requests: +26941 pull_request: https://github.com/python/cpython/pull/28558 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Fri Sep 24 23:17:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 03:17:19 +0000 Subject: [issue45279] avoid redundant _commit_removals pending_removals guard In-Reply-To: <1632481640.03.0.970036840438.issue45279@roundup.psfhosted.org> Message-ID: <1632539839.41.0.00203519625239.issue45279@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Antoine, git blame says you added at least many of the lines Thomas proposes to remove. ---------- nosy: +pitrou, terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45279> _______________________________________ From report at bugs.python.org Sat Sep 25 00:00:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 25 Sep 2021 04:00:35 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1632542435.31.0.927340141401.issue43760@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Ah, I think the docs need to be clarified a bit. Here's what I was missing: The key thing to know here is that there are *three* state variables; `c_tracefunc`, `c_profilefunc` (on the thread state), and `use_tracing` (on the C frame). Normally `use_tracing` is initialized to false if both functions are NULL, and true otherwise (if at least one of the functions is set). *Disabling* means setting `use_tracing` to false regardless. *Resetting* means setting `use_tracing` to the value computed above. There's also a fourth variable, `tstate->tracing`, which indicates whether a tracing function is active (i.e., it has been called and hasn't exited yet). This can be incremented and decremented. But none of the proposed APIs affect it. Would it be reasonable to just put these APIs in pythoncapi_compat, instead of in the stdlib? (It would be yet one more selling point for people to start using that. :-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43760> _______________________________________ From report at bugs.python.org Sat Sep 25 00:58:31 2021 From: report at bugs.python.org (Jun De) Date: Sat, 25 Sep 2021 04:58:31 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations In-Reply-To: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> Message-ID: <1632545911.79.0.418936380998.issue44687@roundup.psfhosted.org> Jun De <solsticedante at gmail.com> added the comment: Awesome! To be honest I was very inclined to add test cases for this edge case, but while some existing test cases use native objects like io.BytesIO, the one that our edge case uses is HTTPResponse from `urllib3.response.py`. Should I still go ahead with writing the test cases in this case? I worry about creating new dependencies for the python repository. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44687> _______________________________________ From report at bugs.python.org Sat Sep 25 01:44:59 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 25 Sep 2021 05:44:59 +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: <1632548699.08.0.27178701459.issue44603@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: > why it would be beneficial to have custom handling like this for exit is that exit is a site-builtin, not a builtin. In my view, that's exactly why it _shouldn't_ have a special treatment. After all, site can add many more builtins. Do you want all of them to have autocall? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sat Sep 25 03:23:46 2021 From: report at bugs.python.org (Hai Shi) Date: Sat, 25 Sep 2021 07:23:46 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1632554626.56.0.372042753228.issue45113@roundup.psfhosted.org> Hai Shi <shihai1991 at 126.com> added the comment: > More generally, this would need solving one of the remaining limitations of the limited API (PEPs 489, 630): type-specific data. Agree. We can't track and destroy the memory block created from the heap now. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Sat Sep 25 03:43:05 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 25 Sep 2021 07:43:05 +0000 Subject: [issue45275] Make argparse print description of subcommand when invoke help doc on subcommand In-Reply-To: <1632457940.29.0.512184786201.issue45275@roundup.psfhosted.org> Message-ID: <1632555785.87.0.145021528065.issue45275@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Hi! >From your description it is not clear how exactly you create your subcommand. >From my experience, it works. Demo: ``` import argparse parser = argparse.ArgumentParser(description='Process some integers.') subparsers = parser.add_subparsers() # create the parser for the "a" command parser_a = subparsers.add_parser('a', help='a help', description='test me') parser_a.add_argument('bar', type=int, help='bar help') print(parser.parse_args()) ``` Here's the output of `python script.py a -h`: ``` usage: ex.py a [-h] bar test me positional arguments: bar bar help options: -h, --help show this help message and exit ``` Do you have the same setup? Or is there anything else that needs to be fixed? ---------- nosy: +sobolevn _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45275> _______________________________________ From report at bugs.python.org Sat Sep 25 04:06:20 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 25 Sep 2021 08:06:20 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632557180.61.0.55777593128.issue45280@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26942 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28559 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sat Sep 25 04:13:16 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 25 Sep 2021 08:13:16 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632557596.53.0.514101799291.issue42969@roundup.psfhosted.org> Gregory P. Smith <greg at krypto.org> added the comment: **If** we add a callback API for this, I agree with vstinner's https://bugs.python.org/issue42969#msg402558 commentary on the other callback APIs. We can do this one similarly and keep it simple. - Why? It's the initial simplicity that provides those running into this problem a way to solve their problem today. Without getting hung up on the details of the new default behavior. **That said** the only conclusion I'm coming to for what the safest behavior of Python is in this situation is to hang the threads, effectively as PR 28525 is proposing. So even if we added the callback API, I'd expect code using Python with C++ where these issues might ever crop up to always register a thread hanging callback. Which really suggests it is the good default. So do we even need the callback? ...But lets put the default behavior choice aside for a moment, there's something valuable regardless... There are **New C APIs to enhance PyGILState_Ensure** proposed in PR 28525 to do with GIL acquisition from threads. These appear useful as is. They provide a way for threads to discover that they will never be able to get the GIL and re-enter the Python interpreter. Rather than today's unexpected behavior of PyGILState_Ensure mercilessly terminating their thread, or given a Callback API whatever effect such a Callback API would have. That allows code to be written with pre-problem-detection that avoids entering this point of no return state. That is good for everyone. **We should add those "GIL-curious" APIs no matter what.** This bit could become its own PR separate from the other parts. If we cannot agree that blocking a non-main daemon-or-C/C++ thread forever that is guaranteed to not acquire the GIL because the Python interpreter is going away is the right default behavior instead of blindly killing it under the unsupportable assumption that it has nothing to clean up: We can proceed with such a callback API. I'm having a hard time imagining any other behavior that makes sense, so I'd expect lots of Python extension interface code to start carrying a copy of an implementation of a hang callback and sporting a Py_SetThreadExitCallback(xxx) call in their module Init function. (especially if pybind11 finds needs to generate this as boilerplate) I think the pthread_exit() call added in issue1856's https://hg.python.org/cpython/rev/c892b0321d23 were well intentioned, but not aware of the full unsupportable ramifications of that API call. That the attempt at releasing a backport of the pthread_exit call to 2.7.8 broke an application (that was admittedly doing something unwise) and had to be reverted as 2.7.9 was a sign for us to revisit this in 3.x releases as well. Which we're finally doing here. ---------- nosy: +pitrou _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Sat Sep 25 04:36:21 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 25 Sep 2021 08:36:21 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1632515750.44.0.451531638016.issue45020@roundup.psfhosted.org> Message-ID: <e92bad96-36c0-bad0-f145-d914df8e2454@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: Eric, I noticed that you are freezing os.py. Please be aware that this module is often being used as indicator for where the stdlib was installed (the stdlib itself does this in site.py to read the LICENSE and the test suite also uses os.__file__ in a couple of places). It may be worth changing the stdlib to pick a different module as landmark for this purpose. Also: Unless you have added the .__file__ attribute to frozen modules, much of this landmark checking code will fail... which is the reason I added the attribute to frozen modules in PyRun. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 25 04:56:31 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 25 Sep 2021 08:56:31 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632560191.66.0.0188181470988.issue45166@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26943 pull_request: https://github.com/python/cpython/pull/28560 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 04:56:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 08:56:39 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632560199.3.0.529171267889.issue45166@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 784905dbeff68cf788bbeefe0a675af1af04affc by Nikita Sobolev in branch 'main': bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279) https://github.com/python/cpython/commit/784905dbeff68cf788bbeefe0a675af1af04affc ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 04:58:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 08:58:28 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632560308.35.0.919914365706.issue45166@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26944 pull_request: https://github.com/python/cpython/pull/28561 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 05:04:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:04:16 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632560656.59.0.213907454328.issue43914@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 71f8ff45c62bd6b792919ac7c3804a8628ae12cb by Terry Jan Reedy in branch 'main': bpo-43914: Whats New 310: add new SyntaxError attributes (GH-28558) https://github.com/python/cpython/commit/71f8ff45c62bd6b792919ac7c3804a8628ae12cb ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Sat Sep 25 05:05:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:05:28 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632560728.59.0.339335301548.issue43914@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26945 pull_request: https://github.com/python/cpython/pull/28562 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Sat Sep 25 05:21:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:21:17 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632561677.78.0.981269572611.issue45166@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d312b8516e11027ce97897d39764e242f0f57087 by Miss Islington (bot) in branch '3.10': bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279) (GH-28560) https://github.com/python/cpython/commit/d312b8516e11027ce97897d39764e242f0f57087 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 05:30:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:30:50 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632562250.51.0.505971548941.issue45166@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 1f08d16c90b6619607fe0656328062ab986cce29 by ?ukasz Langa in branch '3.9': [3.9] bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279) (GH-28561) https://github.com/python/cpython/commit/1f08d16c90b6619607fe0656328062ab986cce29 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 05:32:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:32:02 +0000 Subject: [issue45166] get_type_hints + Final + future annotations = TypeError In-Reply-To: <1631290789.33.0.47825654034.issue45166@roundup.psfhosted.org> Message-ID: <1632562322.82.0.996660726448.issue45166@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the report Timothee, and Nikita for the fix! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45166> _______________________________________ From report at bugs.python.org Sat Sep 25 05:32:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:32:33 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632562353.48.0.317060425258.issue43914@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset c523022ba8f81a3661b4ac8be81706ed095d5769 by ?ukasz Langa in branch '3.10': [3.10] bpo-43914: What's New 3.10: add new SyntaxError attributes (GH-28558) (GH-28562) https://github.com/python/cpython/commit/c523022ba8f81a3661b4ac8be81706ed095d5769 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Sat Sep 25 05:33:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 25 Sep 2021 09:33:00 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632562380.13.0.901758041954.issue43914@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: This is complete now. Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Sat Sep 25 06:35:53 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 25 Sep 2021 10:35:53 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632566153.48.0.0449694073286.issue45283@roundup.psfhosted.org> Change by Nikita Sobolev <mail at sobolevn.me>: ---------- keywords: +patch pull_requests: +26946 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28563 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 08:27:00 2021 From: report at bugs.python.org (mxmlnkn) Date: Sat, 25 Sep 2021 12:27:00 +0000 Subject: [issue45286] zipfile missing API for links Message-ID: <1632572820.24.0.376186028462.issue45286@roundup.psfhosted.org> New submission from mxmlnkn <maxinator333 at googlemail.com>: When using zipfile as a library to get simple files, there is no way to method to determine whether a ZipInfo object is a link or not. Moreover, links can be simply opened and read like normal files and will contain the link path, which is unexpected in most cases, I think. ZipInfo already has an `is_dir` getter. It would be nice if there also was an `is_link` getter. Note that `__repr__` actually shows the filemode, which is `lrwxrwxrwx`. But there is not even a getter for the file mode. For now, I can try to use the code from `__repl__` to extract the file mode from the `external_attr` member but the contents of that member are not documented in zipfile and assuming it is the same as in the ZIP file format specification, it's OS-dependent. Additionally to `is_link` some getter like `linkname` or so would be nice. As to how it should behave when calling `open` or `read` on a link, I'm not sure. ---------- messages: 402617 nosy: mxmlnkn priority: normal severity: normal status: open title: zipfile missing API for links _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45286> _______________________________________ From report at bugs.python.org Sat Sep 25 08:36:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Sep 2021 12:36:35 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632573395.17.0.0210480722883.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 7834ff26cbcd4d8394d64d80d9f51a364d38b1c6 by Victor Stinner in branch 'main': bpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545) https://github.com/python/cpython/commit/7834ff26cbcd4d8394d64d80d9f51a364d38b1c6 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Sat Sep 25 08:37:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Sep 2021 12:37:55 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632573475.43.0.179472669528.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Thanks Livius for all these nice enhancements! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Sat Sep 25 09:18:16 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 25 Sep 2021 13:18:16 +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: <1632575896.34.0.617902800802.issue44603@roundup.psfhosted.org> Filipe La?ns <lains at riseup.net> added the comment: > In my view, that's exactly why it _shouldn't_ have a special treatment. After all, site can add many more builtins. Do you want all of them to have autocall? No, and I did not suggest anything of the sort. I just want the exit because of its integral job of... exiting the REPL. Typing `import sys; sys.exit()` every time I want to test something quick on the REPL is awful UX. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sat Sep 25 09:37:12 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sat, 25 Sep 2021 13:37:12 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains comments In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1632577032.29.0.653149652626.issue44892@roundup.psfhosted.org> Diego Ramirez <dr01191115 at gmail.com> added the comment: Hi Terry, I didn't see your response. I think this won't be possible, taking in count the comment that Serhiy posted: > By default configparser does not support inline comments. "# percentage sign '%'" is a part of value. If you want to support inline comments you should pass the inline_comment_prefixes argument. Maybe this is a reasonable behavior. What do you think about it? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sat Sep 25 09:44:13 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sat, 25 Sep 2021 13:44:13 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1632577453.62.0.410313919199.issue41914@roundup.psfhosted.org> L?on Planken <python.org at oliphaunt.nl> added the comment: Here's the issue again when running test_pdb.py for 3.11 (repository main). The same problem now occurs twice, and only inside the `screen` environment. ----- 8< ----- ~/Temp/cpython> ./python Lib/test/test_pdb.py .....F.........F........................................ ====================================================================== FAIL: test_errors_in_command (__main__.PdbTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/leon/Temp/cpython/Lib/test/test_pdb.py", line 1847, in test_errors_in_command self.assertEqual(stdout.splitlines()[1:], [ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Lists differ: ['-> [278 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ', '\x1b[?1034h'] != ['-> [278 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) '] First list contains 1 additional elements. First extra element 10: '\x1b[?1034h' ['-> pass', "(Pdb) *** SyntaxError: '(' was never closed", '(Pdb) ENTERING RECURSIVE DEBUGGER', "*** SyntaxError: '(' was never closed", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ENTERING RECURSIVE DEBUGGER', '> <string>(1)<module>()', "((Pdb)) *** NameError: name 'doesnotexist' is not defined", 'LEAVING RECURSIVE DEBUGGER', - '(Pdb) ', ? ^ + '(Pdb) '] ? ^ - '\x1b[?1034h'] ====================================================================== FAIL: test_issue34266 (__main__.PdbTestCase) do_run handles exceptions from parsing its arg ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/leon/Temp/cpython/Lib/test/test_pdb.py", line 1875, in test_issue34266 check('\\', 'No escaped character') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/leon/Temp/cpython/Lib/test/test_pdb.py", line 1870, in check self.assertEqual(stdout.splitlines()[1:], [ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Lists differ: ['-> [13 chars] *** Cannot run \\: No escaped character', '(Pdb) \x1b[?1034h'] != ['-> [13 chars] *** Cannot run \\: No escaped character', '(Pdb) '] First differing element 2: '(Pdb) \x1b[?1034h' '(Pdb) ' - ['-> pass', - '(Pdb) *** Cannot run \\: No escaped character', + ['-> pass', '(Pdb) *** Cannot run \\: No escaped character', '(Pdb) '] ? +++++++++++ ++++++++++ - '(Pdb) \x1b[?1034h'] ---------------------------------------------------------------------- Ran 56 tests in 2.850s FAILED (failures=2) ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41914> _______________________________________ From report at bugs.python.org Sat Sep 25 09:56:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 13:56: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: <1632578197.99.0.905379043388.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Typing `import sys; sys.exit()` every time I want to test something quick on the REPL is awful UX. Without disagreeing with the general sentiment, just note that you can always do Ctrl-D. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sat Sep 25 10:20:18 2021 From: report at bugs.python.org (mxmlnkn) Date: Sat, 25 Sep 2021 14:20:18 +0000 Subject: [issue45287] zipfile.is_zipfile returns true for a rar file containing zips Message-ID: <1632579618.64.0.52405699789.issue45287@roundup.psfhosted.org> New submission from mxmlnkn <maxinator333 at googlemail.com>: I have created a RAR file containing two zip files like this: zip bag.zip README.md CHANGELOG.md zip bag1.zip CHANGELOG.md rar a zips.rar bag.zip bag1.zip And when calling `zipfile.is_zipfile` on zips.rar, it returns true even though it obviously is not a zip. The zips.rar file doesn't even begin with the magic bytes `PK` for zip but with `Rar!`. ---------- files: zips.rar messages: 402624 nosy: mxmlnkn priority: normal severity: normal status: open title: zipfile.is_zipfile returns true for a rar file containing zips Added file: https://bugs.python.org/file50305/zips.rar _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45287> _______________________________________ From report at bugs.python.org Sat Sep 25 10:24:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 14:24:07 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains comments In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1632579847.78.0.478959181934.issue44892@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Please report back on the pip issue to read more of the doc, about inline comments in https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour like I should have before writing what I did. ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sat Sep 25 10:24:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Sep 2021 14:24:42 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains inline 'comments' In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1632579882.94.0.0540789592172.issue44892@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- title: Configparser fails when the .cfg file contains comments -> Configparser fails when the .cfg file contains inline 'comments' _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sat Sep 25 10:28:24 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Sat, 25 Sep 2021 14:28:24 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. Message-ID: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> New submission from Cristobal Riaga <cristobalriaga at gmail.com>: Added `sort_result` parameter (`bool=True`) on `getmembers` function inside `Lib/inspect.py`, that, as it name says, allows you to `getmembers` result without sorting it. I'm needed of this and it seems impossible to achieve because of [`367` line](https://github.com/python/cpython/blob/3.9/Lib/inspect.py#L367): ```py results.sort(key=lambda pair: pair[0]) ``` Any other solution is very welcomed. (I need it because I'm working on an [API Reference creator](https://github.com/Patitotective/PyAPIReference) and I think it would be better if it the members are ordered in the same order you define them.) ---------- components: Library (Lib) messages: 402626 nosy: Patitotective priority: normal pull_requests: 26947 severity: normal status: open title: Inspect - Added sort_result parameter on getmembers function. versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Sat Sep 25 10:29:12 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Sat, 25 Sep 2021 14:29:12 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632580152.8.0.0880924690281.issue45288@roundup.psfhosted.org> Cristobal Riaga <cristobalriaga at gmail.com> added the comment: Added sort_result parameter (bool=True) on getmembers function inside Lib/inspect.py, that, as it name says, allows you to getmembers result without sorting it. I'm needed of this and it seems impossible to achieve because of 367 line: results.sort(key=lambda pair: pair[0]) Any other solution is very welcomed. (I need it because I'm working on an API Reference creator and I think it would be better if it the members are ordered in the same order you define them.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Sat Sep 25 10:51:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 25 Sep 2021 14:51:15 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632581475.32.0.56481841241.issue45283@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Hm. IMO it is up to static type checkers to reject bad use of types. The runtime should be relaxed so type checkers can develop new features assigning new semantics to such constructs. ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 10:56:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 25 Sep 2021 14:56:32 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632581792.75.0.815568730276.issue45020@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: The plan is to add __file__ back, based on where the stdlib lives (we won?t do any stat() calls for frozen files). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 25 11:36:20 2021 From: report at bugs.python.org (=?utf-8?q?Benjamin_Sz=C5=91ke?=) Date: Sat, 25 Sep 2021 15:36:20 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632584180.9.0.763217295517.issue21302@roundup.psfhosted.org> Benjamin Sz?ke <egyszeregy at freemail.hu> added the comment: Do you have any information about when will be it released in 3.11? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Sat Sep 25 11:37:16 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 25 Sep 2021 15:37:16 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632584236.3.0.752422323738.issue45283@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: This makes ``get_type_hints`` quite opinionated and backwards incompatible. The first line the docs says "This is often the same as obj.__annotations__". I also agree with Guido. FYI, we've tried to *reduce* usage of `_type_check` in new features since version 3.10. We've found that they make `typing_extensions` operability with `typing` worse. For example, the whole of PEP 612 in `typing_extensions` required lots of hacks to work with typing's Callable. If you're really vouching for this change. We probably need a 2 major version deprecation period (with warnings telling the user their current type hints are invalid) *plus* asking typing-sig/python-dev if the runtime type hints users will be affected. See [PEP 387](https://www.python.org/dev/peps/pep-0387/) for more info. On the other hand, we now have a less-opinionated alternative to ``get_type_hints`` with ``inspect.get_annotations``, but it can't do as much (like resolving ForwardRef). ---------- nosy: +kj _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 12:18:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Sep 2021 16:18:40 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1632586720.15.0.300255735383.issue21302@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Do you have any information about when will be it released in 3.11? Here is a schedule of Python 3.11 releases: https://www.python.org/dev/peps/pep-0664/ In the meanwhile, you can develop a C extension to get the feature. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21302> _______________________________________ From report at bugs.python.org Sat Sep 25 12:20:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Sep 2021 16:20:53 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632586853.61.0.34746758589.issue45020@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Marc-Andre: I suppose that you're talking about LANDMARK in Modules/getpath.c and PC/getpathp.c. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 25 12:29:19 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 25 Sep 2021 16:29:19 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1632586853.61.0.34746758589.issue45020@roundup.psfhosted.org> Message-ID: <f1d35359-0d55-0def-ba86-4614890860fc@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On 25.09.2021 18:20, STINNER Victor wrote: > > STINNER Victor <vstinner at python.org> added the comment: > > Marc-Andre: I suppose that you're talking about LANDMARK in Modules/getpath.c and PC/getpathp.c. Now that you mention it: yes, that as well :-) But os.py is used in the Python stdlib code as well, just search for "os.__file__" to see a few such uses. If you search for ".__file__" you'll find that there are quite a few cases in the test suite expecting that attribute on other stdlib modules as well. The attribute may officially be optional, but in reality a lot of code expects to find it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Sat Sep 25 12:46:34 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sat, 25 Sep 2021 16:46:34 +0000 Subject: [issue44892] Configparser fails when the .cfg file contains inline 'comments' In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1632588394.63.0.874727100937.issue44892@roundup.psfhosted.org> Diego Ramirez <dr01191115 at gmail.com> added the comment: Sure, thanks! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44892> _______________________________________ From report at bugs.python.org Sat Sep 25 13:30:55 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 25 Sep 2021 17:30:55 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632591055.47.0.31732193108.issue45283@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Just to bring in some context for this discussion: https://github.com/python/cpython/pull/28279 We have dicussed in the PR above that current implementation depends on existing of `__future__` import of `annotations`. With `from __future__ import annotations`: 1. Top level class var will be raise `TypeError` 2. Final and ClassVar function arguments will raise `TypeError` 3. Annotations like `x: 1` will raise `TypeError: Forward references must evaluate to types. Got 1.` Without `from __future import annotations`it accepts all the cases above. I share two opposite views on this change: 1. By adding the same `_type_check` logic we can reduce the inconsitency between two versions. It would be easier for users to migrate from one version to another. 2. By adding this feature, we would more aggresively force some specific semantics for builtin types. Which can possibly be problematic, for example I've tried to add `Final` annotations to function arguments in my own type checker. It is something current semantics does not support. Moreover, it can cause incompatibility to existing users. My opinion is that consitency is more important here. Because I received quite a lot of bug reports from users involving different behavior with / without `__future__` import of `annotations`. But, I understand that it is not up to me to decide :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 13:31:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Sep 2021 17:31:49 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632591109.65.0.97464343441.issue45288@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: But you will not get them in creation order, even if omit the final sort, because: 1. dir() returns names sorted alphabetically, not in order of creation. 2. Dynamic class attributes are added at the end, and inherited attributes follow attributes defined in that class. So adding this parameter will not help you. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Sat Sep 25 13:47:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Sep 2021 17:47:38 +0000 Subject: [issue37921] Improve zipfile: add support for symlinks In-Reply-To: <1566508476.42.0.582332769766.issue37921@roundup.psfhosted.org> Message-ID: <1632592058.2.0.955663076098.issue37921@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Adding support of symlinks in ZIP files will make the zipfile module vulnerable to symlink attacks like like with TAR files (see https://en.wikipedia.org/wiki/Tar_(computing)#Duplicates). Until we find a solution to this, adding support of symlinks is dangerous. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37921> _______________________________________ From report at bugs.python.org Sat Sep 25 13:48:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Sep 2021 17:48:49 +0000 Subject: [issue45286] zipfile missing API for links In-Reply-To: <1632572820.24.0.376186028462.issue45286@roundup.psfhosted.org> Message-ID: <1632592129.71.0.634448953516.issue45286@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Improve zipfile: add support for symlinks _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45286> _______________________________________ From report at bugs.python.org Sat Sep 25 13:50:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Sep 2021 17:50:27 +0000 Subject: [issue45287] zipfile.is_zipfile returns true for a rar file containing zips In-Reply-To: <1632579618.64.0.52405699789.issue45287@roundup.psfhosted.org> Message-ID: <1632592227.77.0.438324889573.issue45287@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> is_zipfile false positives _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45287> _______________________________________ From report at bugs.python.org Sat Sep 25 14:00:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Sep 2021 18:00:25 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632592825.08.0.188852642605.issue45026@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: There is nothing in code that could explain a measureable difference in creating the range objects or the range object iterators. And indeed, it is in the range of the standard deviation, so it is non-existent. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sat Sep 25 14:16:03 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 25 Sep 2021 18:16:03 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632593763.87.0.390543438216.issue45283@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: > 1. By adding the same `_type_check` logic we can reduce the inconsistency between two versions. It would be easier for users to migrate from one version to another. That's definitely a plus. But please consider this hypothetical scenario: - Let's say some typing code has _type_check in 3.8 - In 3.12, we decide to give type hinting with ints (like `x: 1`) some meaning (this has been proposed before in typing-sig). - The new construct arrives in 3.12. We backport to typing_extensions, which *must* support 3.8's typing module. - Now the new addition to 3.12 typing_extensions doesn't work with 3.8 typing because of _type_check, and we need to hack around it. - The hacks may eventually lead to real behavioral inconsistencies between typing_extensions and typing. If this sounds familiar, that's because something similar has already happened! Callable and Generic had too strict checking in typing (requiring Callable's args to be a tuple of types always) before 3.10. So typing_extensions doesn't support the full PEP 612 syntax :( https://github.com/python/typing/tree/master/typing_extensions#other-notes-and-limitations. Stricter runtime type checking makes growing the typing syntax harder. For the newer types, we try to defer checking to 3rd-party libraries. > Because I received quite a lot of bug reports from users involving different behavior with / without `__future__` import of `annotations`. Your perspective as a runtime typing library dev is very valuable. Thank you for your feedback! IMO, `from __future__ import annotations` becoming the default in 3.11 is still undecided. It was yanked from 3.10 for breaking pydantic and FastAPI, and I doubt it will land in 3.11 for the same reasons. It seems the current consensus is to use that import for code with purely static typing, and not use it with runtime typing libraries. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 14:39:40 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 25 Sep 2021 18:39:40 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632595180.51.0.422830920693.issue45283@roundup.psfhosted.org> Nikita Sobolev <mail at sobolevn.me> added the comment: Thank you, Ken Jin! Very clear explanation! > It seems the current consensus is to use that import for code with purely static typing, and not use it with runtime typing libraries. Is it an official position? Or just a common usage pattern? What can we do to make this more widely known? Maybe we can formulate something like "When to use: raw, string, future annotations" in the typing docs (https://docs.python.org/3/library/typing.html)? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sat Sep 25 14:53:23 2021 From: report at bugs.python.org (CireSnave) Date: Sat, 25 Sep 2021 18:53:23 +0000 Subject: [issue45285] c_char incorrectly treated as bytes in Structure In-Reply-To: <1632511425.07.0.917515072933.issue45285@roundup.psfhosted.org> Message-ID: <1632596003.19.0.551798516891.issue45285@roundup.psfhosted.org> CireSnave <ciresnave at yahoo.com> added the comment: Wow. Thank you Eryk Sun. While that seems like a convoluted way to make a type act like the type it is...it works. Verified it with the following code: from ctypes import POINTER, c_char, sizeof, Structure class char_from_c(c_char): pass print("Size of c_char vs size of char_from_c:") print(sizeof(c_char)) print(sizeof(char_from_c)) class my_structure(Structure): _fields_ = [ ("first_char", char_from_c), ("second_char", char_from_c), ("third_char", char_from_c), ] my_structure_object: my_structure = my_structure(97, 98, 99) pointer_to_char_from_c_in_my_structure = POINTER(c_char)(my_structure_object.first_char) print("\nContents of pointer_to_char_from_c_in_my_structure:") print(pointer_to_char_from_c_in_my_structure.contents) print("\npointer_to_char_from_c_in_my_Structure[0]:") print(pointer_to_char_from_c_in_my_structure[0]) print("\nValues from my_structure_object:") character_counter = 0 while character_counter < sizeof(my_structure_object): print(pointer_to_char_from_c_in_my_structure[character_counter]) character_counter += 1 ...which gave me the following results: Size of c_char vs size of char_from_c: 1 1 Contents of pointer_to_char_from_c_in_my_structure: c_char(b'a') pointer_to_char_from_c_in_my_Structure[0]: b'a' Values from my_structure_object: b'a' b'b' b'c' Again...Thank you. Closing this "bug" as it is weird...but not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45285> _______________________________________ From report at bugs.python.org Sat Sep 25 15:56:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 19:56:32 +0000 Subject: [issue45289] test_gdbm segfaults in M1 Mac Message-ID: <1632599792.09.0.486120515403.issue45289@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: 0:04:14 load avg: 3.86 [141/427/1] test_dbm crashed (Exit code -11) Fatal Python error: Segmentation fault Current thread 0x0000000102e2bd40 (most recent call first): File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_dbm.py", line 58 in keys_helper File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_dbm.py", line 143 in read_helper File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_dbm.py", line 74 in test_anydbm_creation File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 547 in _callTestMethod File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 591 in run File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 646 in __call__ File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122 in run File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122 in run File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122 in run File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 197 in run File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/__init__.py", line 992 in _run_suite File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/__init__.py", line 1118 in run_unittest File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest.py", line 261 in _test_module File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest.py", line 297 in _runtest_inner2 File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest.py", line 340 in _runtest_inner File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest.py", line 202 in _runtest File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest.py", line 245 in runtest File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/runtest_mp.py", line 83 in run_tests_worker File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/main.py", line 678 in _main File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/main.py", line 658 in main File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/main.py", line 736 in main File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/regrtest.py", line 43 in _main File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/regrtest.py", line 47 in <module> File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/runpy.py", line 86 in _run_code File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi (total: 1) 0:04:15 load avg: 3.87 [142/427/1] test_c_ The backtrace according to lldb: (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10365c000) * frame #0: 0x0000000182bc6994 libsystem_platform.dylib`_platform_memmove + 84 frame #1: 0x00000001000b71d0 python.exe`PyBytes_FromStringAndSize(str="c", size=4294967297) at bytesobject.c:165:5 frame #2: 0x000000010360b234 _dbm.cpython-311d-darwin.so`_dbm_dbm_keys_impl(self=0x00000001034b3ca0, cls=0x000000010088a580) at _dbmmodule.c:249:16 frame #3: 0x000000010360af34 _dbm.cpython-311d-darwin.so`_dbm_dbm_keys(self=0x00000001034b3ca0, cls=0x000000010088a580, args=0x00000001007991d8, nargs=0, kwnames=0x0000000000000000) at _dbmmodule.c.h:46:20 frame #4: 0x00000001000dca8c python.exe`method_vectorcall_FASTCALL_KEYWORDS_METHOD(func=0x00000001034db290, args=0x00000001007991d0, nargsf=9223372036854775809, kwnames=0x0000000000000000) at descrobject.c:367:24 frame #5: 0x0000000100252374 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100808b30, callable=0x00000001034db290, args=0x00000001007991d0, nargsf=9223372036854775809, kwnames=0x0000000000000000) at abstract.h:114:11 frame #6: 0x000000010024fc10 python.exe`PyObject_Vectorcall(callable=0x00000001034db290, args=0x00000001007991d0, nargsf=9223372036854775809, kwnames=0x0000000000000000) at abstract.h:123:12 frame #7: 0x000000010024fd70 python.exe`call_function(tstate=0x0000000100808b30, pp_stack=0x000000016fdc8aa0, oparg=1, kwnames=0x0000000000000000, use_tracing=0) at ceval.c:6418:13 frame #8: 0x000000010024a518 python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100808b30, frame=0x0000000100799150, throwflag=0) at ceval.c:4568:19 frame #9: 0x000000010023a0f0 python.exe`_PyEval_EvalFrame(tstate=0x0000000100808b30, frame=0x0000000100799150, throwflag=0) at pycore_ceval.h:46:12 frame #10: 0x000000010023a00c python.exe`_PyEval_Vector(tstate=0x0000000100808b30, con=0x00000001034e0320, locals=0x0000000000000000, args=0x0000000100799118, argcount=2, kwnames=0x0000000000000000) at ceval.c:5609:24 frame #11: 0x00000001000ccbe4 python.exe`_PyFunction_Vectorcall(func=0x00000001034e0310, stack=0x0000000100799118, nargsf=9223372036854775810, kwnames=0x0000000000000000) at call.c:342:16 frame #12: 0x0000000100252374 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100808b30, callable=0x00000001034e0310, args=0x0000000100799118, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:114:11 frame #13: 0x000000010024fc10 python.exe`PyObject_Vectorcall(callable=0x00000001034e0310, args=0x0000000100799118, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:123:12 frame #14: 0x000000010024fd70 python.exe`call_function(tstate=0x0000000100808b30, pp_stack=0x000000016fdca950, oparg=2, kwnames=0x0000000000000000, use_tracing=0) at ceval.c:6418:13 frame #15: 0x000000010024a518 python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100808b30, frame=0x00000001007990a8, throwflag=0) at ceval.c:4568:19 frame #16: 0x000000010023a0f0 python.exe`_PyEval_EvalFrame(tstate=0x0000000100808b30, frame=0x00000001007990a8, throwflag=0) at pycore_ceval.h:46:12 frame #17: 0x000000010023a00c python.exe`_PyEval_Vector(tstate=0x0000000100808b30, con=0x00000001034e0c10, locals=0x0000000000000000, args=0x0000000100799080, argcount=2, kwnames=0x0000000000000000) at ceval.c:5609:24 frame #18: 0x00000001000ccbe4 python.exe`_PyFunction_Vectorcall(func=0x00000001034e0c00, stack=0x0000000100799080, nargsf=9223372036854775810, kwnames=0x0000000000000000) at call.c:342:16 frame #19: 0x0000000100252374 python.exe`_PyObject_VectorcallTstate(tstate=0x0000000100808b30, callable=0x00000001034e0c00, args=0x0000000100799080, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:114:11 frame #20: 0x000000010024fc10 python.exe`PyObject_Vectorcall(callable=0x00000001034e0c00, args=0x0000000100799080, nargsf=9223372036854775810, kwnames=0x0000000000000000) at abstract.h:123:12 frame #21: 0x000000010024fd70 python.exe`call_function(tstate=0x0000000100808b30, pp_stack=0x000000016fdcc800, oparg=2, kwnames=0x0000000000000000, use_tracing=0) at ceval.c:6418:13 frame #22: 0x000000010024a518 python.exe`_PyEval_EvalFrameDefault(tstate=0x0000000100808b30, frame=0x0000000100799018, throwflag=0) at ceval.c:4568:19 frame #23: 0x000000010023a0f0 python.exe`_PyEval_EvalFrame(tstate=0x0000000100808b30, frame=0x0000000100799018, throwflag=0) at pycore_ceval.h:46:12 frame #24: 0x000000010023a00c python.exe`_PyEval_Vector(tstate=0x0000000100808b30, con=0x00000001034e0530, locals=0x0000000000000000, args=0x0000000100798ff0, argcount=1, kwnames=0x0000000000000000) at ceval.c:5609:24 ...... The last 3 frames: frame #1: 0x00000001000b71d0 python.exe`PyBytes_FromStringAndSize(str="c", size=4294967297) at bytesobject.c:165:5 162 if (str == NULL) 163 return (PyObject *) op; 164 -> 165 memcpy(op->ob_sval, str, size); 166 /* share short strings */ 167 if (size == 1) { 168 struct _Py_bytes_state *state = get_bytes_state(); (lldb) frame #2: 0x000000010360b234 _dbm.cpython-311d-darwin.so`_dbm_dbm_keys_impl(self=0x00000001034b3ca0, cls=0x000000010088a580) at _dbmmodule.c:249:16 246 } 247 for (key = dbm_firstkey(self->di_dbm); key.dptr; 248 key = dbm_nextkey(self->di_dbm)) { -> 249 item = PyBytes_FromStringAndSize(key.dptr, key.dsize); 250 if (item == NULL) { 251 Py_DECREF(v); 252 return NULL; (lldb) frame #3: 0x000000010360af34 _dbm.cpython-311d-darwin.so`_dbm_dbm_keys(self=0x00000001034b3ca0, cls=0x000000010088a580, args=0x00000001007991d8, nargs=0, kwnames=0x0000000000000000) at _dbmmodule.c.h:46:20 43 )) { 44 goto exit; 45 } -> 46 return_value = _dbm_dbm_keys_impl(self, cls); 47 48 exit: 49 return return_value; The segfault happens here: frame #0: 0x0000000182bc6994 libsystem_platform.dylib`_platform_memmove + 84 libsystem_platform.dylib`_platform_memmove: -> 0x182bc6994 <+84>: ldnp q0, q1, [x1] 0x182bc6998 <+88>: add x1, x1, #0x20 ; =0x20 0x182bc699c <+92>: subs x2, x2, #0x20 ; =0x20 0x182bc69a0 <+96>: b.hi 0x182bc698c ; <+76> ---------- components: Tests messages: 402643 nosy: pablogsal priority: normal severity: normal status: open title: test_gdbm segfaults in M1 Mac type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45289> _______________________________________ From report at bugs.python.org Sat Sep 25 15:56:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 19:56:49 +0000 Subject: [issue45289] test_gdbm segfaults in M1 Mac In-Reply-To: <1632599792.09.0.486120515403.issue45289@roundup.psfhosted.org> Message-ID: <1632599809.23.0.614880353331.issue45289@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- components: +macOS -Tests nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45289> _______________________________________ From report at bugs.python.org Sat Sep 25 16:00:38 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 25 Sep 2021 20:00: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: <1632600038.02.0.0728474333168.issue44603@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: Running the REPL with -S is unusual, so having to use sys.exit() or `raise SystemExit` in that case shouldn't be an issue. A user who wants custom behavior for `exit` could override sys.displayhook() in the PYTHONSTARTUP file. For example: import sys import builtins def displayhook(obj, prev_displayhook=sys.displayhook): exit = getattr(builtins, 'exit', None) if obj is exit and callable(exit): exit() else: prev_displayhook(obj) sys.displayhook = displayhook > just note that you can always do Ctrl-D. For the Windows console, Ctrl-D is not usually supported. It's supported when pyreadline is installed. Otherwise one has to type Ctrl-Z and enter. In IDLE it's Ctrl-D even in Windows, in which case the `exit` repr is wrong, as determined by setquit() in Lib/site.py. ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sat Sep 25 16:05:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 20:05:13 +0000 Subject: [issue45289] test_gdbm segfaults in M1 Mac In-Reply-To: <1632599792.09.0.486120515403.issue45289@roundup.psfhosted.org> Message-ID: <1632600313.95.0.403494258236.issue45289@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: See https://buildbot.python.org/all/#/builders/725/builds/4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45289> _______________________________________ From report at bugs.python.org Sat Sep 25 16:05:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 20:05:33 +0000 Subject: [issue45289] test_dbm and test_dbm_ndbm segfaults in M1 Mac In-Reply-To: <1632599792.09.0.486120515403.issue45289@roundup.psfhosted.org> Message-ID: <1632600333.47.0.2594220816.issue45289@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- title: test_gdbm segfaults in M1 Mac -> test_dbm and test_dbm_ndbm segfaults in M1 Mac _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45289> _______________________________________ From report at bugs.python.org Sat Sep 25 16:47:08 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sat, 25 Sep 2021 20:47:08 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1632602828.92.0.22252499148.issue41914@roundup.psfhosted.org> Change by L?on Planken <python.org at oliphaunt.nl>: ---------- pull_requests: +26948 pull_request: https://github.com/python/cpython/pull/28564 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41914> _______________________________________ From report at bugs.python.org Sat Sep 25 17:01:07 2021 From: report at bugs.python.org (=?utf-8?q?L=C3=A9on_Planken?=) Date: Sat, 25 Sep 2021 21:01:07 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1632603667.53.0.773338944892.issue41914@roundup.psfhosted.org> L?on Planken <python.org at oliphaunt.nl> added the comment: So I went ahead to fix the issue and created a PR. I also signed the CLA, but I understand that needs a little time to process. I was bold/forward enough to add myself to the ACKS. Please feel remove me if this contribution is too trivial. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41914> _______________________________________ From report at bugs.python.org Sat Sep 25 17:27:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 21:27:51 +0000 Subject: [issue45290] test_multiprocessing_pool_circular_import fails in M1 mac Message-ID: <1632605271.03.0.63095371582.issue45290@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: ====================================================================== FAIL: test_multiprocessing_pool_circular_import (test.test_importlib.test_threaded_import.ThreadedImportTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/pablogsal/github/cpython/Lib/test/test_importlib/test_threaded_import.py", line 258, in test_multiprocessing_pool_circular_import script_helper.assert_python_ok(fn) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/test/support/script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/test/support/script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/test/support/script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 1 command line: ['/Users/pablogsal/github/cpython/python.exe', '-X', 'faulthandler', '-I', '/Users/pablogsal/github/cpython/Lib/test/test_importlib/partial/pool_in_threads.py'] stdout: --- --- stderr: --- Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): File "/Users/pablogsal/github/cpython/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/context.py", line 119, in Pool File "/Users/pablogsal/github/cpython/Lib/multiprocessing/pool.py", line 212, in __init__ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool File "/Users/pablogsal/github/cpython/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static File "/Users/pablogsal/github/cpython/Lib/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/multiprocessing/popen_spawn_posix.py", line 53, in _launch parent_r, child_w = os.pipe() ^^^^^^^^^ File "/Users/pablogsal/github/cpython/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 24] Too many open files /Users/pablogsal/github/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 65 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' /Users/pablogsal/github/cpython/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-m8lbung6': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/pablogsal/github/cpython/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-w8c_ci83': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/pablogsal/github/cpython/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-yzcaa23b': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/pablogsal/github/cpython/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-vgij30u5': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) --- ---------------------------------------------------------------------- Ran 1428 tests in 2.752s FAILED (failures=1, skipped=6, expected failures=1) test test_importlib failed test_importlib failed (1 failure) == Tests result: FAILURE == 6 tests OK. ---------- components: Tests, macOS messages: 402648 nosy: ned.deily, pablogsal, ronaldoussoren priority: normal severity: normal status: open title: test_multiprocessing_pool_circular_import fails in M1 mac versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45290> _______________________________________ From report at bugs.python.org Sat Sep 25 17:32:28 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 25 Sep 2021 21:32:28 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632605548.19.0.808696312694.issue45026@roundup.psfhosted.org> Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment: I did more benchmarks on my Windows laptop, and it seems the difference goes away after using PGO. The benchmarking program: ################################# from pyperf import Runner runner = Runner() for n in [10, 100, 1000, 10_000, 100_000]: runner.timeit(f"for i in range({n}): pass", stmt=f"for i in range({n}): pass") runner.timeit(f"for i in it_{n}: pass", setup=f"it = iter(range({n}))", stmt="for i in it: pass") runner.timeit(f"deque(it_{n})", setup=(f"from collections import deque; " f"it = iter(range({n}))"), stmt="deque(it, maxlen=0)") runner.timeit(f"list(iter(range({n})))", stmt=f"list(iter(range({n})))") ################################### The results (without PGO): PS C:\Users\sween\Source\Repos\cpython2\cpython> .\python.bat -m pyperf compare_to .\20e3149c175a24466c7d1c352f8ff2c11effc489.json .\cffa90a8b0057d7e7456571045f2fb7b9ceb426f.json -G Running Release|x64 interpreter... Slower (15): - list(iter(range(100))): 741 ns +- 13 ns -> 836 ns +- 11 ns: 1.13x slower - for i in range(100000): pass: 2.05 ms +- 0.05 ms -> 2.26 ms +- 0.06 ms: 1.10x slower - list(iter(range(1000))): 12.2 us +- 0.1 us -> 13.2 us +- 0.2 us: 1.08x slower - for i in range(10000): pass: 203 us +- 4 us -> 219 us +- 4 us: 1.08x slower - for i in range(100): pass: 1.18 us +- 0.02 us -> 1.27 us +- 0.03 us: 1.08x slower - for i in range(1000): pass: 18.1 us +- 0.3 us -> 19.5 us +- 0.3 us: 1.07x slower - list(iter(range(10000))): 145 us +- 7 us -> 152 us +- 2 us: 1.05x slower - list(iter(range(100000))): 1.98 ms +- 0.06 ms -> 2.06 ms +- 0.05 ms: 1.04x slower - for i in range(10): pass: 265 ns +- 9 ns -> 272 ns +- 8 ns: 1.03x slower - deque(it_1000): 324 ns +- 4 ns -> 332 ns +- 8 ns: 1.02x slower - deque(it_100000): 327 ns +- 5 ns -> 333 ns +- 7 ns: 1.02x slower - list(iter(range(10))): 357 ns +- 7 ns -> 363 ns +- 3 ns: 1.02x slower - deque(it_10): 325 ns +- 5 ns -> 330 ns +- 5 ns: 1.01x slower - deque(it_100): 325 ns +- 6 ns -> 329 ns +- 4 ns: 1.01x slower - deque(it_10000): 326 ns +- 7 ns -> 330 ns +- 4 ns: 1.01x slower Faster (2): - for i in it_10: pass: 26.0 ns +- 1.4 ns -> 25.3 ns +- 0.3 ns: 1.03x faster - for i in it_1000: pass: 25.7 ns +- 0.7 ns -> 25.3 ns +- 0.4 ns: 1.02x faster Benchmark hidden because not significant (3): for i in it_100: pass, for i in it_10000: pass, for i in it_100000: pass Geometric mean: 1.03x slower ################################### The results (with PGO): PS C:\Users\sween\Source\Repos\cpython2\cpython> .\python.bat -m pyperf compare_to .\PGO-20e3149c175a24466c7d1c352f8ff2c11effc489.json .\PGO-cffa90a8b0057d7e7456571045f2fb7b9ceb426f.json -G Running PGUpdate|x64 interpreter... Slower (7): - for i in it_100: pass: 20.3 ns +- 0.5 ns -> 21.3 ns +- 0.7 ns: 1.05x slower - for i in it_10000: pass: 20.4 ns +- 0.6 ns -> 21.4 ns +- 0.8 ns: 1.05x slower - for i in it_100000: pass: 20.5 ns +- 0.5 ns -> 21.4 ns +- 0.6 ns: 1.05x slower - for i in it_1000: pass: 20.3 ns +- 0.5 ns -> 21.2 ns +- 0.5 ns: 1.05x slower - for i in it_10: pass: 20.3 ns +- 0.5 ns -> 21.1 ns +- 0.5 ns: 1.04x slower - for i in range(10): pass: 214 ns +- 3 ns -> 219 ns +- 11 ns: 1.03x slower - deque(it_100000): 288 ns +- 5 ns -> 291 ns +- 12 ns: 1.01x slower Faster (7): - list(iter(range(10000))): 112 us +- 3 us -> 96.4 us +- 3.4 us: 1.16x faster - list(iter(range(1000))): 9.69 us +- 0.15 us -> 8.39 us +- 0.26 us: 1.15x faster - list(iter(range(100000))): 1.65 ms +- 0.04 ms -> 1.48 ms +- 0.04 ms: 1.11x faster - list(iter(range(100))): 663 ns +- 11 ns -> 623 ns +- 12 ns: 1.06x faster - for i in range(1000): pass: 14.6 us +- 0.5 us -> 14.2 us +- 0.3 us: 1.03x faster - for i in range(10000): pass: 162 us +- 2 us -> 159 us +- 3 us: 1.02x faster - for i in range(100000): pass: 1.64 ms +- 0.03 ms -> 1.62 ms +- 0.04 ms: 1.01x faster Benchmark hidden because not significant (6): deque(it_10), list(iter(range(10))), for i in range(100): pass, deque(it_100), deque(it_1000), deque(it_10000) Geometric mean: 1.01x faster ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Sat Sep 25 17:49:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 21:49:43 +0000 Subject: [issue45290] test_multiprocessing_pool_circular_import fails in M1 mac In-Reply-To: <1632605271.03.0.63095371582.issue45290@roundup.psfhosted.org> Message-ID: <1632606583.4.0.294111642069.issue45290@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: The same test sometimes hangs forever ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45290> _______________________________________ From report at bugs.python.org Sat Sep 25 17:54:33 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 25 Sep 2021 21:54:33 +0000 Subject: [issue45290] test_multiprocessing_pool_circular_import fails in M1 mac In-Reply-To: <1632605271.03.0.63095371582.issue45290@roundup.psfhosted.org> Message-ID: <1632606873.83.0.719934352942.issue45290@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: As a first step, try adding: ulimit -n 1000 to the buildbot test step. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45290> _______________________________________ From report at bugs.python.org Sat Sep 25 18:09:13 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 25 Sep 2021 22:09:13 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632607753.91.0.674263891316.issue45249@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Terry: I got it mostly working using your 2nd suggestion, I will do some testing and should be able to put up a PR in the next couple of days. Thanks for looking at this and explaining! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Sat Sep 25 18:12:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 25 Sep 2021 22:12:24 +0000 Subject: [issue45290] test_multiprocessing_pool_circular_import fails in M1 mac In-Reply-To: <1632605271.03.0.63095371582.issue45290@roundup.psfhosted.org> Message-ID: <1632607944.26.0.8545459215.issue45290@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > ulimit -n 1000 If i do this, the test hangs some times instead of crashing ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45290> _______________________________________ From report at bugs.python.org Sat Sep 25 21:57:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 26 Sep 2021 01:57:00 +0000 Subject: [issue45290] test_multiprocessing_pool_circular_import fails in M1 mac In-Reply-To: <1632605271.03.0.63095371582.issue45290@roundup.psfhosted.org> Message-ID: <1632621420.43.0.804662261812.issue45290@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Seems that the issue went away when configuring the maxfiles with $ launchctl limit maxfiles instead of with "ulimit -n" ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45290> _______________________________________ From report at bugs.python.org Sun Sep 26 00:49:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 26 Sep 2021 04:49:25 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1632575896.34.0.617902800802.issue44603@roundup.psfhosted.org> Message-ID: <20210926044454.GM11377@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: > Typing `import sys; sys.exit()` every time I want to test something > quick on the REPL is awful UX. It truly is awful. So why do you do it that way? There are at least four other ways to cleanly exit the REPL. 1. raise SystemExit 2. exit() 3. quit() 4. Ctrl-D (posix systems) or Ctrl-Z ENTER (Windows systems) Even if you are running the REPL without the site module (so that exit and quit are not available) the import sys solution is surely the worst of the lot, UX-wise. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sun Sep 26 01:38:13 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 26 Sep 2021 05:38:13 +0000 Subject: [issue45289] test_dbm and test_dbm_ndbm segfaults in M1 Mac In-Reply-To: <1632599792.09.0.486120515403.issue45289@roundup.psfhosted.org> Message-ID: <1632634693.64.0.265191807181.issue45289@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45289> _______________________________________ From report at bugs.python.org Sun Sep 26 06:24:38 2021 From: report at bugs.python.org (Dima Tisnek) Date: Sun, 26 Sep 2021 10:24:38 +0000 Subject: [issue41271] Add support for io_uring to cpython In-Reply-To: <1594410846.99.0.0025674439126.issue41271@roundup.psfhosted.org> Message-ID: <1632651878.04.0.993083111053.issue41271@roundup.psfhosted.org> Dima Tisnek <dimaqq at gmail.com> added the comment: Would now, a year later, be a good time to consider io_uring? ---------- nosy: +Dima.Tisnek _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41271> _______________________________________ From report at bugs.python.org Sun Sep 26 06:58:45 2021 From: report at bugs.python.org (Yiyang Zhan) Date: Sun, 26 Sep 2021 10:58:45 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 Message-ID: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> New submission from Yiyang Zhan <pon.zhan at gmail.com>: The instructions in "Custom OpenSSL" section of "Using Python on Unix platforms" do not work on CentOS 7: https://github.com/python/cpython/blob/v3.10.0rc2/Doc/using/unix.rst#custom-openssl. CPython's ./configure script assumes the OpenSSL's library resides in "$ssldir/lib". This isn't guaranteed with the current instruction, because OpenSSL might create for example lib64 for the .so files. See https://github.com/openssl/openssl/blob/openssl-3.0.0/INSTALL.md#libdir: > Some build targets have a multilib postfix set in the build configuration. For these targets the default libdir is lib<multilib-postfix>. Please use --libdir=lib to override the libdir if adding the postfix is undesirable. Therefore it's better to explicitly set --libdir=lib. ---------- assignee: docs at python components: Documentation messages: 402657 nosy: docs at python, zhanpon priority: normal severity: normal status: open title: Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 type: enhancement versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Sun Sep 26 07:04:10 2021 From: report at bugs.python.org (Yiyang Zhan) Date: Sun, 26 Sep 2021 11:04:10 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632654250.94.0.132342497888.issue45291@roundup.psfhosted.org> Change by Yiyang Zhan <pon.zhan at gmail.com>: ---------- keywords: +patch pull_requests: +26950 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28566 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Sun Sep 26 08:07:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 26 Sep 2021 12:07:11 +0000 Subject: [issue45292] Implement PEP 654 Message-ID: <1632658031.68.0.457473173232.issue45292@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- assignee: iritkatriel components: Documentation, Interpreter Core, Library (Lib) nosy: iritkatriel priority: normal severity: normal status: open title: Implement PEP 654 type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45292> _______________________________________ From report at bugs.python.org Sun Sep 26 08:13:59 2021 From: report at bugs.python.org (Kapil Bansal) Date: Sun, 26 Sep 2021 12:13:59 +0000 Subject: [issue45293] List inplace addition different from normal addition Message-ID: <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org> New submission from Kapil Bansal <kapilbansal.gbpecdelhi at gmail.com>: Hi, I tried addition and in-place addition on a list. >>> l = ['a', 'b', 'c'] >>> l = l + 'de' (raises an error) >>> l += 'de' >>> print(l) ['a', 'b' , 'c', 'd', 'e'] I want to ask why the behaviour of both these are different?? If it is done intentionally, then it should be there in the documentation but I am not able to find any reference. ---------- messages: 402658 nosy: KapilBansal320 priority: normal severity: normal status: open title: List inplace addition different from normal addition type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45293> _______________________________________ From report at bugs.python.org Sun Sep 26 08:34:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 26 Sep 2021 12:34:08 +0000 Subject: [issue45293] List inplace addition different from normal addition In-Reply-To: <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org> Message-ID: <1632659648.5.0.581139478055.issue45293@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: For those not in front of a computer, the error is: >>> l = l + 'de' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate list (not "str") to list ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45293> _______________________________________ From report at bugs.python.org Sun Sep 26 08:54:50 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 26 Sep 2021 12:54:50 +0000 Subject: [issue45293] List inplace addition different from normal addition In-Reply-To: <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org> Message-ID: <1632660890.24.0.778673414928.issue45293@roundup.psfhosted.org> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment: https://docs.python.org/3/faq/programming.html#faq-augmented-assignment-tuple-error > for lists, __iadd__ is equivalent to calling extend on the list and returning the list. That?s why we say that for lists, += is a ?shorthand? for list.extend This example is calling extend on list of strings with another string as argument. Hence the target string is iterated and each character is added as an element. __add__ is different compared __iadd__. For += __iadd__ is called if defined and falls back to __add__ ---------- nosy: +xtreak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45293> _______________________________________ From report at bugs.python.org Sun Sep 26 10:10:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 26 Sep 2021 14:10:12 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632665412.41.0.978022113445.issue45249@roundup.psfhosted.org> Change by Andrei Kulakov <andrei.avk at gmail.com>: ---------- keywords: +patch pull_requests: +26951 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28567 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Sun Sep 26 10:32:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 26 Sep 2021 14:32:29 +0000 Subject: [issue45292] Implement PEP 654 Message-ID: <1632666749.04.0.351198708079.issue45292@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- keywords: +patch pull_requests: +26952 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28569 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45292> _______________________________________ From report at bugs.python.org Sun Sep 26 10:37:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 26 Sep 2021 14:37:30 +0000 Subject: [issue45292] Implement PEP 654 Message-ID: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org> New submission from Irit Katriel <iritkatriel at gmail.com>: We will implement Exception Groups and except* in a series of PRs: 1. Add the ExceptionGroup and BaseExceptionGroup classes 2. Update traceback rendering code (python and C) for exception groups. 3. Implement except* 4. Write documentation sections. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45292> _______________________________________ From report at bugs.python.org Sun Sep 26 10:37:48 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 26 Sep 2021 14:37:48 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632667068.6.0.590902413254.issue45249@roundup.psfhosted.org> Andrei Kulakov <andrei.avk at gmail.com> added the comment: Terry: please take a look - https://github.com/python/cpython/pull/28567/files . ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Sun Sep 26 11:25:13 2021 From: report at bugs.python.org (arts stars) Date: Sun, 26 Sep 2021 15:25:13 +0000 Subject: [issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before Message-ID: <1632669913.29.0.580043897174.issue45294@roundup.psfhosted.org> New submission from arts stars <stars-of-stras at mediapromo.be>: Hello, I have this situation: ---------------- def test(): if True : print("Exception"+DiaObjectFactoryHelper) else: from . import DiaObjectFactoryHelper pass test() --------------- it generates instead of (like the the line 'from . import' is commented) : "NameError: name 'DiaObjectFactoryHelper' is not defined" this: UnboundLocalError: local variable 'DiaObjectFactoryHelper' referenced before assignment PS: The github authentificatiion did not work, did not manage to grab email even if set public ---------- messages: 402663 nosy: stars-of-stras priority: normal severity: normal status: open title: Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45294> _______________________________________ From report at bugs.python.org Sun Sep 26 11:58:29 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 26 Sep 2021 15:58:29 +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: <1632671909.07.0.74816677954.issue44603@roundup.psfhosted.org> Filipe La?ns <lains at riseup.net> added the comment: > Without disagreeing with the general sentiment, just note that you can always do Ctrl-D. That is true, but there are a couple setups where that doesn't work (those keypresses are consumed by something else). I may not be a good data point though. > Running the REPL with -S is unusual, so having to use sys.exit() or `raise SystemExit` in that case shouldn't be an issue. Yes, it is unusual, however I have found myself asking people to do that when debugging, and I always have to tell people "oh, btw, exit() doesn't work, you have to do ...", which is not nice. > Even if you are running the REPL without the site module (so that exit and quit are not available) the import sys solution is surely the worst of the lot, UX-wise. Two of the solutions you gave (exit and quit) don't work with -S, and Ctrl-D/Ctrl-Z doesn't work in all setups. raise SystemExit is the only real alternative I would consider when I am explaining things to people and want to avoid issues. I standardized in `import sys; sys.exit()` as it's generally easier for people starting out, even though it's 5 more keypresses. --- Anyway, my point is simply that exiting on python -S does not have a great UX, something that I think should be considered when looking at this proposal. If you think the use-case is relevant enough to not warrant a change like this, that is a valid opinion. My personal opinion is that we should optimize the UX for the people who are not that knowledgeable, as those are the ones that will have most trouble, while keeping it usable for the rest of users. I think this change is a net positive considering those parameters, and I think the arguments against this proposal have not properly taken them into account. FWIW, I consider myself a reasonably knowledgeable user, but still end up making this mistake myself a staggering amount of times. $ rg 'exit\(\)$' ~/.python_history | wc -l 553 $ rg 'exit$' ~/.python_history | wc -l 132 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sun Sep 26 11:59:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 26 Sep 2021 15:59:21 +0000 Subject: [issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before In-Reply-To: <1632669913.29.0.580043897174.issue45294@roundup.psfhosted.org> Message-ID: <1632671961.14.0.745112053124.issue45294@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: This is not a bug, you are trying to print the value of the local variable DiaObjectFactoryHelper before you have defined the variable. UnboundLocalError is a subclass of NameError that is used when the undefined name is a local variable instead of a global. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45294> _______________________________________ From report at bugs.python.org Sun Sep 26 12:05:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 26 Sep 2021 16:05:58 +0000 Subject: [issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before In-Reply-To: <1632669913.29.0.580043897174.issue45294@roundup.psfhosted.org> Message-ID: <1632672358.22.0.553585241753.issue45294@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: In the future, please remember that this is not a help desk for getting help with your code, it is for reporting bugs. There are many forums that are happy to help you understand why your code is not working as you expect (if you are a beginner to Python, the answer is *almost never* "a bug in Python"). You can find help at Reddit's r/learnpython, or at the forums and mailing lists here: https://www.python.org/community/forums/ https://www.python.org/community/lists/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45294> _______________________________________ From report at bugs.python.org Sun Sep 26 12:24:28 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 26 Sep 2021 16:24:28 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1632671909.07.0.74816677954.issue44603@roundup.psfhosted.org> Message-ID: <20210926161951.GQ11377@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: > That is true, but there are a couple setups where that doesn't work > (those keypresses are consumed by something else). I may not be a good > data point though. Can you give an example of a setup where Ctrl-D is consumed but "import sys ENTER sys.exit() ENTER" is not? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Sun Sep 26 12:29:41 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 26 Sep 2021 16:29:41 +0000 Subject: [issue45295] _PyObject_GetMethod/LOAD_METHOD for C classmethods Message-ID: <1632673781.3.0.384078877149.issue45295@roundup.psfhosted.org> New submission from Ken Jin <kenjin4096 at gmail.com>: LOAD_METHOD + CALL_METHOD currently doesn't work for Python @classmethod and C classmethod (METH_CLASS). They still create bound classmethods which are fairly expensive. I propose supporting classmethods. I have an implementation for C classmethods. It passes most of the test suite, and I've also got it to play along with PEP 659 specialization. Some numbers from Windows release build (PGO build will likely be less favorable): python.exe -m timeit "int.from_bytes(b'')" Main: 2000000 loops, best of 5: 107 nsec per loop Patched: 5000000 loops, best of 5: 72.4 nsec per loop Funnily enough, `(1).from_bytes()` still needs a bound classmethod, but I think people usually use the other form. A toy PR will be up for review. I will then split the change into two parts (one for _PyObject_GetMethod changes, another for PEP 659 specialization) to help decide if the maintenance-perf ratio is worth it. ---------- components: Interpreter Core messages: 402668 nosy: kj priority: normal severity: normal status: open title: _PyObject_GetMethod/LOAD_METHOD for C classmethods type: performance versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45295> _______________________________________ From report at bugs.python.org Sun Sep 26 12:32:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 26 Sep 2021 16:32:26 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632673946.2.0.504789154869.issue45280@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset f56268a2cd38b3fe2be1e4361d3d8b581e73559b by Nikita Sobolev in branch 'main': bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) https://github.com/python/cpython/commit/f56268a2cd38b3fe2be1e4361d3d8b581e73559b ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 12:32:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 26 Sep 2021 16:32:50 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632673970.57.0.512703436185.issue45280@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26953 pull_request: https://github.com/python/cpython/pull/28570 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 12:32:54 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 26 Sep 2021 16:32:54 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632673974.55.0.66076631741.issue45280@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26954 pull_request: https://github.com/python/cpython/pull/28571 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 12:58:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 26 Sep 2021 16:58:33 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632675513.74.0.145549410072.issue45249@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: One important thing is that "traceback.print_exception" should correctly print syntax errors . ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Sun Sep 26 13:09:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 26 Sep 2021 17:09:09 +0000 Subject: [issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()` In-Reply-To: <1632491047.59.0.655973158516.issue45283@roundup.psfhosted.org> Message-ID: <1632676149.79.0.674086571907.issue45283@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: > Is it an official position? No, we need to decide what will happen to PEP 563 and PEP 649 in Python 3.11. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45283> _______________________________________ From report at bugs.python.org Sun Sep 26 13:09:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 26 Sep 2021 17:09:33 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632676173.49.0.873484016094.issue45280@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 08e387ab82331230d7f6608e949723d8a8e09229 by Miss Islington (bot) in branch '3.9': bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) (GH-28570) https://github.com/python/cpython/commit/08e387ab82331230d7f6608e949723d8a8e09229 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 13:09:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 26 Sep 2021 17:09:54 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632676193.99.0.838927021866.issue45280@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d452b2963ba91d6bce29bb96733ed8bd1c0448b0 by Miss Islington (bot) in branch '3.10': bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) (GH-28571) https://github.com/python/cpython/commit/d452b2963ba91d6bce29bb96733ed8bd1c0448b0 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 13:10:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 26 Sep 2021 17:10:10 +0000 Subject: [issue45280] Empty typing.NamedTuple creation is not tested In-Reply-To: <1632482621.54.0.232905456931.issue45280@roundup.psfhosted.org> Message-ID: <1632676210.84.0.247389598951.issue45280@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Nikita! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45280> _______________________________________ From report at bugs.python.org Sun Sep 26 13:15:34 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Sun, 26 Sep 2021 17:15:34 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632676534.17.0.358651152504.issue45288@roundup.psfhosted.org> Cristobal Riaga <cristobalriaga at gmail.com> added the comment: So there is no way to get the members in order? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Sun Sep 26 13:16:14 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Sun, 26 Sep 2021 17:16:14 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632676574.01.0.605632655647.issue45288@roundup.psfhosted.org> Cristobal Riaga <cristobalriaga at gmail.com> added the comment: So there is no way to get members in the order you defined them? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Sun Sep 26 13:35:26 2021 From: report at bugs.python.org (Hai Shi) Date: Sun, 26 Sep 2021 17:35:26 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1632677726.2.0.679042863619.issue45113@roundup.psfhosted.org> Change by Hai Shi <shihai1991 at 126.com>: ---------- keywords: +patch pull_requests: +26955 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28573 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45113> _______________________________________ From report at bugs.python.org Sun Sep 26 16:11:03 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 26 Sep 2021 20:11:03 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632687063.19.0.557406512887.issue44958@roundup.psfhosted.org> Erlend E. Aasland <erlend.aasland at innova.no> added the comment: I'll revert PR 27844 for now (except the tests). Since SQLite works better when we keep the number of non-reset statements to a minimum, we need to ensure that we reset statements when we're done with them (sqlite3_step() returns SQLITE_DONE or an error). Before doing such a change, we should clean up _pysqlite_query_execute() so we don't need to sprinkle that function with pysqlite_statement_reset's. I plan to do this before attempting to clean up reset usage again. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Sun Sep 26 16:23:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 26 Sep 2021 20:23:16 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632687796.09.0.572638885502.issue44958@roundup.psfhosted.org> Change by Erlend E. Aasland <erlend.aasland at innova.no>: ---------- pull_requests: +26956 pull_request: https://github.com/python/cpython/pull/28574 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Sun Sep 26 16:52:27 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 26 Sep 2021 20:52:27 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows Message-ID: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> New submission from Terry J. Reedy <tjreedy at udel.edu>: On Windows: >>> exit 'Use exit() or Ctrl-Z plus Return to exit' >>> quit 'Use quit() or Ctrl-Z plus Return to exit' >>> exit.eof 'Ctrl-Z plus Return' On *nix, 'Ctrl-Z plus Return' is 'Ctrl-D (i.e, EOF)' IDLE uses the latter even on Windows, and Ctrl-Z does not work. Both exit and quit are instances of _sitebuiltins.Quitter https://github.com/python/cpython/blob/e14d5ae5447ae28fc4828a9cee8e9007f9c30700/Lib/_sitebuiltins.py#L13-L26 class Quitter(object): def __init__(self, name, eof): self.name = name self.eof = eof def __repr__(self): return 'Use %s() or %s to exit' % (self.name, self.eof) def __call__ [not relevant here] We just need to replace current exit/quit.eof as indicated above on startup. ---------- messages: 402678 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE: Change Ctrl-Z note in exit/quit repr on Windows _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Sun Sep 26 16:58:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 26 Sep 2021 20:58:22 +0000 Subject: [issue45293] List inplace addition different from normal addition In-Reply-To: <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org> Message-ID: <1632689902.13.0.294819169882.issue45293@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Kapil, this behavior was intentional (not a bug), but later regarded as a design mistake. GvR has said that if he had to do it over again list.__iadd__ would only accept other lists. The problem arises when people write "somelist += 'hello'" and expect it to add a single string with one word rather than five one letter strings. That said, the current behavior is guaranteed, people rely on it, and we cannot change it. As Karthikeyan points out, this is documented. However since the docs have grown so voluminous, it is often difficult to find any one particular fact. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45293> _______________________________________ From report at bugs.python.org Sun Sep 26 17:04:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 26 Sep 2021 21:04:04 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632690244.59.0.669557919587.issue45261@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Given that there isn't an actual bug here, please move this discussion to python-ideas. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Sun Sep 26 17:13:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Sep 2021 21:13:14 +0000 Subject: [issue45292] Implement PEP 654: Exception Groups In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org> Message-ID: <1632690794.57.0.899832736557.issue45292@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: Implement PEP 654 -> Implement PEP 654: Exception Groups _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45292> _______________________________________ From report at bugs.python.org Sun Sep 26 17:17:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Sep 2021 21:17:13 +0000 Subject: [issue1736792] dict reentrant/threading request Message-ID: <1632691033.11.0.0393485142313.issue1736792@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > As I first mentioned in my post[1] on comp.lang.python, it seems possible to modify a dict while a lookup is ongoing, without causing the lookup to restart. That's a bad practice. Python dict raises an exception in some cases: RuntimeError("dict mutated during update"). Detecting any change during a lookup would slow down, whereas dict performance is key in Python performance in general, since dict is used everywhere for Python namespaces. I close the issue as "wont fix". ---------- nosy: +vstinner resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1736792> _______________________________________ From report at bugs.python.org Sun Sep 26 17:19:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Sep 2021 21:19:09 +0000 Subject: [issue27978] concurrent.futures.threading: Add a timeout to Executor shutdown() method In-Reply-To: <1473187779.38.0.526925636347.issue27978@psf.upfronthosting.co.za> Message-ID: <1632691149.93.0.610152713402.issue27978@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: [threading] Executor#shutdown with timeout -> concurrent.futures.threading: Add a timeout to Executor shutdown() method _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27978> _______________________________________ From report at bugs.python.org Sun Sep 26 17:21:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Sep 2021 21:21:37 +0000 Subject: [issue36717] Allow retrieval of return value from the target of a threading.Thread In-Reply-To: <1556151774.22.0.129640685398.issue36717@roundup.psfhosted.org> Message-ID: <1632691297.09.0.63620735928.issue36717@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Storing the result of Thread.run() can keep Python objects alive longer than expected and it may require a lock on it. I don't think that the additional complexity is worth it. I suggest to reorganize your code to pass the result differently to the caller thread. You can use a queue, a variable, whatever works. ---------- nosy: +vstinner resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36717> _______________________________________ From report at bugs.python.org Sun Sep 26 17:24:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 26 Sep 2021 21:24:25 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1632691465.67.0.213304262077.issue44958@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 7b88f63e1dd4006b1a08b9c9f087dd13449ecc76 by Erlend Egeberg Aasland in branch 'main': bpo-44958: Revert GH-27844 (GH-28574) https://github.com/python/cpython/commit/7b88f63e1dd4006b1a08b9c9f087dd13449ecc76 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44958> _______________________________________ From report at bugs.python.org Sun Sep 26 17:42:04 2021 From: report at bugs.python.org (Jeremy Maitin-Shepard) Date: Sun, 26 Sep 2021 21:42:04 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1632692524.73.0.135454840625.issue42969@roundup.psfhosted.org> Jeremy Maitin-Shepard <jeremy at jeremyms.com> added the comment: Yes, I would agree that the new APIs are a useful addition regardless of the PyThread_exit_thread change. As far as the proposed `Py_SetThreadExitCallback` that seems like a fine thing for applications to use, as long as it doesn't impact how extensions need to be written to be safe from crashes/memory corruption. So for example if the default is to hang, then changing it to log and then hang, or optionally log and terminate the program, would be fine, since extensions aren't affected either way. Conversely, if one of the possible behaviors may be `_endthreadex` or `pthread_exit`, then libraries must be written to be safe under that behavior anyway, which is unfortunate. Furthermore, say for a library that only supports POSIX, maybe it is written to be safe under `pthread_exit` because it uses destructors to do cleanup, but then it will cause deadlock if the callback chooses to hang the thread instead. Thus, I think allowing the callback to change the behavior in a way that could impact extensions is not a great idea. The callback also doesn't seem like a very good mechanism for an extension that is incompatible with `pthread_exit` or `_endthreadex`, such as one using pybind11, to try to mitigate that problem, since an individual library shouldn't be changing application-wide behavior unless the library is specifically being used by the application for that purpose. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42969> _______________________________________ From report at bugs.python.org Sun Sep 26 17:51:49 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 26 Sep 2021 21:51:49 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1632693109.22.0.797386003466.issue44493@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- resolution: fixed -> versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44493> _______________________________________ From report at bugs.python.org Sun Sep 26 18:26:46 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 26 Sep 2021 22:26:46 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1632695206.48.0.802918727916.issue44933@roundup.psfhosted.org> Ned Deily <nad at python.org> added the comment: > the "reliable way to run under rosetta" is using "arch -x86_64 python3". I don't particularly like having another executable to accomplish the same goal. Unfortunately, using "arch" is *not* a reliable way in general. It works fine for the initial invocation of the interpreter but things fall apart when a Python program tries to invoke another Python interpreter in a subprocess. The standard idiom for finding the location of the running interpreter is to use the contents of sys.executable. But that merely contains the name of the interpreter file, thus the additional "arch" arguments are lost and the interpreter will launch in the subprocess using the default arch, which may result in a failure (if you are lucky) or, worse, will silently run under the wrong architecture potentially giving misleading results. The most notable example of this is while running the python test suite. We ran into this same issue years ago with the "intel" universal-arch build option which is why we added a "python3-32" executable to provide a reliable way to force 32-bit execution on a 64-bit-capable Mac. The need for "python3-intel64" will eventually go away once Rosetta2 is no longer supported. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44933> _______________________________________ From report at bugs.python.org Sun Sep 26 18:59:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 26 Sep 2021 22:59:15 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632697155.85.0.0636665752245.issue45249@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26958 pull_request: https://github.com/python/cpython/pull/28575 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Sun Sep 26 19:15:47 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 26 Sep 2021 23:15:47 +0000 Subject: [issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i In-Reply-To: <1630466357.81.0.93174296975.issue45069@roundup.psfhosted.org> Message-ID: <1632698147.1.0.614409433539.issue45069@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- stage: -> resolved status: pending -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45069> _______________________________________ From report at bugs.python.org Sun Sep 26 20:12:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 27 Sep 2021 00:12:51 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632701571.96.0.380216025359.issue43914@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26959 pull_request: https://github.com/python/cpython/pull/28576 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Sun Sep 26 20:28:07 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 27 Sep 2021 00:28:07 +0000 Subject: [issue45297] Improve the IDLE shell save command Message-ID: <1632702487.28.0.152974990593.issue45297@roundup.psfhosted.org> New submission from Steven D'Aprano <steve+python at pearwood.info>: See this question on Discuss: https://discuss.python.org/t/what-is-this-syntax-i-dont-know-how-to-fix-it/10844 It seems that IDLE allows you to save the shell output, complete with welcome message and prompts, as a .py file, and then reopen it and attempt to run it, which obviously fails. When it does fail, it is confusing. Suggested enhancements: - When saving the complete shell session, save it to a text file, not .py. That would be useful for anyone wanting a full record of the interpreter session. - When saving the shell session as a .py file, strip out the welcome message, the prompts, and any output, leaving only what will hopefully be runnable code. I don't know what sort of UI this should have. Two different menu commands? A checkbox in the Save dialog? My thoughts are that the heuristic to reconstruct runnable code from the interpreter session may not be foolproof, but better than nothing. Something like the doctest rules might work reasonably well. - strip the welcome message; - any line (or block) starting with the prompt >>> that is followed by a traceback should be thrown out; - any other text not starting with the prompt >>> is interpreter output and should be thrown out; - you should be left with just blocks starting with the prompt, so remove the prompt, adjust the indents, and hopefully you're left with valid runnable code. ---------- assignee: terry.reedy components: IDLE messages: 402686 nosy: steven.daprano, terry.reedy priority: normal severity: normal status: open title: Improve the IDLE shell save command type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45297> _______________________________________ From report at bugs.python.org Sun Sep 26 21:33:14 2021 From: report at bugs.python.org (Keming) Date: Mon, 27 Sep 2021 01:33:14 +0000 Subject: [issue45298] SIGSEGV when access a fork Event in a spawn Process Message-ID: <1632706394.95.0.366136047801.issue45298@roundup.psfhosted.org> New submission from Keming <kemingy94 at gmail.com>: Code to trigger this problem: ```python import multiprocessing as mp from time import sleep def wait_for_event(event): while not event.is_set(): sleep(0.1) def trigger_segment_fault(): event = mp.get_context("fork").Event() p = mp.get_context("spawn").Process(target=wait_for_event, args=(event,)) p.start() # this will show the exitcode=-SIGSEGV sleep(1) print(p) event.set() p.terminate() if __name__ == "__main__": trigger_segment_fault() ``` Accessing this forked event in a spawned process will result in a segment fault. I have found a related report: https://bugs.python.org/issue43832. But I think it's not well documented in the Python 3 multiprocessing doc. Will it be better to explicit indicate that the event is related to the start method context in the documentation? ---------- assignee: docs at python components: Documentation messages: 402687 nosy: docs at python, kemingy priority: normal severity: normal status: open title: SIGSEGV when access a fork Event in a spawn Process type: crash _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45298> _______________________________________ From report at bugs.python.org Sun Sep 26 21:57:19 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Sep 2021 01:57:19 +0000 Subject: [issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i In-Reply-To: <1630466357.81.0.93174296975.issue45069@roundup.psfhosted.org> Message-ID: <1632707839.58.0.589027866918.issue45069@roundup.psfhosted.org> Change by Ned Deily <nad at python.org>: ---------- status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45069> _______________________________________ From report at bugs.python.org Sun Sep 26 23:43:15 2021 From: report at bugs.python.org (Gregory Szorc) Date: Mon, 27 Sep 2021 03:43:15 +0000 Subject: [issue41994] Refcount issues in import In-Reply-To: <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org> Message-ID: <1632714195.07.0.550415352724.issue41994@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: While testing 3.10.0rc2, I noticed that commit 4db8988420e0a122d617df741381b0c385af032c removed _PyImport_FindExtensionObject() from libpython. This breaks both PyOxidizer and py2exe, which rely on this function for a custom implementation of Loader.create_module() to enable loading Windows DLLs from memory. It can probably be worked around. But I wanted to note it here in case it was an unwanted regression. ---------- nosy: +indygreg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41994> _______________________________________ From report at bugs.python.org Mon Sep 27 00:45:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 04:45:25 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632717925.26.0.091461617773.issue45296@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- assignee: -> terry.reedy components: +IDLE type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Mon Sep 27 00:49:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 04:49:24 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632718164.81.0.760632642098.issue45296@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Tal, Paine: should be use exactly the raw REPL message or something that might be clearer to beginners, like 'Ctrl-D (end-of-file)'? ---------- nosy: +epaine, taleinat _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Mon Sep 27 01:02:29 2021 From: report at bugs.python.org (Grant Edwards) Date: Mon, 27 Sep 2021 05:02:29 +0000 Subject: [issue45299] SMTP.send_message() does from mangling when it should not Message-ID: <1632718949.8.0.657238158075.issue45299@roundup.psfhosted.org> New submission from Grant Edwards <grant.b.edwards at gmail.com>: SMTP.send_message() does from mangling even when the message's policy has that disabled. The problem is in the send_messsage() function shown below: 912 def send_message(self, msg, from_addr=None, to_addrs=None, 913 mail_options=(), rcpt_options=()): 914 """Converts message to a bytestring and passes it to sendmail. ... 963 # Make a local copy so we can delete the bcc headers. 964 msg_copy = copy.copy(msg) ... 977 with io.BytesIO() as bytesmsg: 978 if international: 979 g = email.generator.BytesGenerator( 980 bytesmsg, policy=msg.policy.clone(utf8=True)) 981 mail_options = (*mail_options, 'SMTPUTF8', 'BODY=8BITMIME') 982 else: 983 g = email.generator.BytesGenerator(bytesmsg) 984 g.flatten(msg_copy, linesep='\r\n') 985 flatmsg = bytesmsg.getvalue() If 'international' is True, then the BytesGenerator is passed msg.policy with utf8 added, and from mangling is only done if the message's policy has from mangling enabled. This is correct behavior. If 'international' is False, then the generator always does from mangling regardless of the message'spolicy. From mangling is only used when writing message to mbox format files. When sending a message via SMTP It is wrong to do it when the message's policy says not to. This needs to be fixed by passing the message's policy to BytesGenerator() in the 'else' clause also. I would suggest changing 983 g = email.generator.BytesGenerator(bytesmsg) to 983 g = email.generator.BytesGenerator(bytesmsg, policy=msg.policy) The problem is that if neither mangle_from_ nor policy arguments are passed to email.generator.BytesGenerator(), then mangle_from_ defaults to True, and the mangle_from_ setting in the message is ignored. This is not really documented: https://docs.python.org/3/library/email.generator.html#email.generator.BytesGenerator If optional mangle_from_ is True, put a > character in front of any line in the body that starts with the exact string "From ", that is From followed by a space at the beginning of a line. mangle_from_ defaults to the value of the mangle_from_ setting of the policy. Where "the policy" refers to the one passed to BytesGenerator(). Note that this section does _not_ state what happens if neither mangle_from_ nor policy are passed to BytesGenerator(). What actually happens is that in that case mangle_from_ defaults to True. (Not a good choice for default, since that's only useful for the one case where you're writing to an mbox file.) However, there is also a misleading sentence later in that same section: If policy is None (the default), use the policy associated with the Message or EmailMessage object passed to flatten to control the message generation. That's only partially true. If you don't pass a policy to BytesGenerator(), only _some_ of the settings from the message's policy will be used. Some policy settings (e.g. mangle_from_) are obeyed when passed to BytesGenerator(), but ignored in the message's policy even if there was no policy passed to BytesGenerator(). The documentation needs to be changed to state that mangle_from_ defaults to True if neitehr mangle_from_ nor policy are passed to BytesGenerator(), and that last sentence needs to be changed to state that when no policy is passed to BytesGenerator() only _some_ of the fields in the message's policy are used to control the message generation. (An actual list of policy fields are obeyed from the message's policy would be nice.) ---------- components: Library (Lib) messages: 402690 nosy: grant.b.edwards priority: normal severity: normal status: open title: SMTP.send_message() does from mangling when it should not versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45299> _______________________________________ From report at bugs.python.org Mon Sep 27 01:27:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 05:27:08 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632720428.72.0.51448402474.issue45296@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- keywords: +patch pull_requests: +26960 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28577 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Mon Sep 27 01:30:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 05:30:30 +0000 Subject: [issue41271] Add support for io_uring to cpython In-Reply-To: <1594410846.99.0.0025674439126.issue41271@roundup.psfhosted.org> Message-ID: <1632720630.05.0.619255946474.issue41271@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- nosy: -terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41271> _______________________________________ From report at bugs.python.org Mon Sep 27 01:49:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 05:49:26 +0000 Subject: [issue11838] IDLE: make interactive code savable as a runnable script In-Reply-To: <1302631389.12.0.305553029462.issue11838@psf.upfronthosting.co.za> Message-ID: <1632721766.27.0.903549950186.issue11838@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: This should be easier to do with the new shell with indents fixed. ---------- nosy: -roger.serwy, tlesher versions: +Python 3.11 -Python 3.6, Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue11838> _______________________________________ From report at bugs.python.org Mon Sep 27 01:51:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 05:51:23 +0000 Subject: [issue11838] IDLE: make interactive code savable as a runnable script In-Reply-To: <1302631389.12.0.305553029462.issue11838@psf.upfronthosting.co.za> Message-ID: <1632721883.78.0.752500006693.issue11838@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- priority: normal -> high _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue11838> _______________________________________ From report at bugs.python.org Mon Sep 27 02:07:06 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 06:07:06 +0000 Subject: [issue21140] Idle: saving Shell or an OutputWindow should default to .txt In-Reply-To: <1396493259.83.0.13428125931.issue21140@psf.upfronthosting.co.za> Message-ID: <1632722826.72.0.273221342214.issue21140@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: >From #45297, closed as duplicate. https://discuss.python.org/t/what-is-this-syntax-i-dont-know-how-to-fix-it/10844 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21140> _______________________________________ From report at bugs.python.org Mon Sep 27 02:24:16 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 27 Sep 2021 06:24:16 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632723856.83.0.593874904325.issue45296@roundup.psfhosted.org> Tal Einat <taleinat+python at gmail.com> added the comment: How about "Control-D (end-of-file, a.k.a. EOF)" or even just "Control-D"? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Mon Sep 27 02:31:28 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 06:31:28 +0000 Subject: [issue11838] IDLE: make interactive code savable as a runnable script In-Reply-To: <1302631389.12.0.305553029462.issue11838@psf.upfronthosting.co.za> Message-ID: <1632724288.44.0.76338200217.issue11838@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: In #45297, Steven D'Aprano suggests deleting code immediately followed by traceback. (SyntaxErrors should not be there at all -- another issue.) But should NameError, for instance, be ignore, just because user printed something? Or block removed just because it comes before print statement? Without more feedback, I believe most would want all code actually run. If there is a Traceback, Add comment with error and message. UI is a tough issue. I don't want to add more File menu entries and hot keys. We can add to shell context menu as have already done. Maybe this: after getting the save name, branch on type: .py, code only; anything else, full log. Subsequent ^S saves use last save-as name to decide. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue11838> _______________________________________ From report at bugs.python.org Mon Sep 27 02:58:23 2021 From: report at bugs.python.org (Tim Holy) Date: Mon, 27 Sep 2021 06:58:23 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632725903.45.0.743224812288.issue45261@roundup.psfhosted.org> Change by Tim Holy <tim.holy at gmail.com>: ---------- resolution: not a bug -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Mon Sep 27 04:24:47 2021 From: report at bugs.python.org (Andreas Skaar) Date: Mon, 27 Sep 2021 08:24:47 +0000 Subject: [issue41021] ctypes callback with structure crashes in Python 3.8 on Windows x86 In-Reply-To: <1592472376.78.0.985098642017.issue41021@roundup.psfhosted.org> Message-ID: <1632731087.36.0.946603249208.issue41021@roundup.psfhosted.org> Andreas Skaar <andreas.skaar at no.abb.com> added the comment: What is the next steps on this bug? Have you created a bug with libffi if this is not working correctly eryksun? Sounds like you understand what the bug report need to contain. On implementing a workaround in ctypes. Is this possible? ---------- nosy: +xs_iceman _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41021> _______________________________________ From report at bugs.python.org Mon Sep 27 04:55:14 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 27 Sep 2021 08:55:14 +0000 Subject: [issue41994] Refcount issues in import In-Reply-To: <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org> Message-ID: <1632732914.44.0.604328592823.issue41994@roundup.psfhosted.org> Petr Viktorin <encukou at gmail.com> added the comment: Please don't use private API. The underscore at the beginning marks the function as private. (This has been the case for a long time; in 3.10 it is finally officially documented: https://docs.python.org/3.10/c-api/stable.html#stable ) It has been removed in alpha5; I'm afraid rc2 is too late to put it back. (Especially since we'd need to put it back as public API, as CPython doesn't need it any more.) Please, if you see the need for any other private APIs, could you file bugs to make them public (or better, to support the use case they're needed for)? If they are useful, they should have documentation, tests, and better backwards compatibility expecations. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41994> _______________________________________ From report at bugs.python.org Mon Sep 27 05:00:30 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 27 Sep 2021 09:00:30 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632733230.63.0.656541164772.issue45296@roundup.psfhosted.org> E. Paine <xepaine13 at gmail.com> added the comment: > How about "Control-D (end-of-file, a.k.a. EOF)" I doubt beginners care that it's EOF. > or even just "Control-D" I'd be a lot more inclined towards this. > IDLE uses the latter [Ctrl-D] even on Windows, and Ctrl-Z does not work. Is it worth considering changing this behaviour? IMO Ctrl-D is better for consistency between platforms, but wanted to throw the idea out there for discussion. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Mon Sep 27 05:59:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 09:59:02 +0000 Subject: [issue41994] Refcount issues in import In-Reply-To: <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org> Message-ID: <1632736742.84.0.391844721289.issue41994@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: _PyImport_FindExtensionObject is a private API. It was added in 3.3 because import.c and importdl.c needed to share code. Since 3.5 it was only used in import.c, so there is no longer need to expose it. It was removed in 3.10 because there was an issue with this API: it returned a borroved reference which could be invalid at the time of returning. I can restore and fix _PyImport_FindExtensionObject in 3.10, but is not it too later to do after 3.10.0rc2? If it is essential to you, propose to add a new public API (perhaps better designed). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41994> _______________________________________ From report at bugs.python.org Mon Sep 27 06:06:03 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 27 Sep 2021 10:06:03 +0000 Subject: [issue45295] _PyObject_GetMethod/LOAD_METHOD for C classmethods In-Reply-To: <1632673781.3.0.384078877149.issue45295@roundup.psfhosted.org> Message-ID: <1632737163.41.0.996649476835.issue45295@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- keywords: +patch pull_requests: +26961 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28572 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45295> _______________________________________ From report at bugs.python.org Mon Sep 27 07:28:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 11:28:18 +0000 Subject: [issue24391] Better repr for threading objects In-Reply-To: <1433586102.76.0.662503832113.issue24391@psf.upfronthosting.co.za> Message-ID: <1632742098.19.0.401206549606.issue24391@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: In the last version of PR 20534, the reprs will be similar to proposed by Larry in msg244958, except that a colon is used to separate an address from status, and keyword names are used for values. <threading.Semaphore at 0xb710ec8c: value=10> <threading.BoundedSemaphore at 0xb6ff1d6c: value=7/10> <threading.Event at 0xb710ec8c: unset> <threading.Event at 0xb710ec8c: set> <threading.Barrier at 0xb6ff1d6c: waiters=0/10> <threading.Barrier at 0xb6ff1d6c: waiters=3/10> <threading.Barrier at 0xb6ff1d6c: broken> It is closer to existing reprs, I'm going to rewrite reprs of locks, conditions and synchronization primitives in asyncio and multiprocessing to match this style: move status after type and address, remove parenthesis, brackets and commas, use "=" instead of ":" for named values, use "/" with maximal values, etc. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24391> _______________________________________ From report at bugs.python.org Mon Sep 27 07:28:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 11:28:25 +0000 Subject: [issue24391] Better repr for threading objects In-Reply-To: <1433586102.76.0.662503832113.issue24391@psf.upfronthosting.co.za> Message-ID: <1632742105.73.0.135602901694.issue24391@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24391> _______________________________________ From report at bugs.python.org Mon Sep 27 07:45:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 11:45:15 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632743115.53.0.957215317032.issue45288@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It depends on what you want to get. In general, it is difficult if interpret your request literally. For example, if you define class A in module a, class B in module b, and class C which inherits from classes A and B in module c, then what members of C are defined first: inherited from A or inherited from B? Oh, and some members can be defined in a metaclass of A, B or C. And what order of members inherited from the object class or other builtin classes? And what to do with members excluded from __dir__()? And dynamic members provided by __getattr__() or __getattribute__()? You need to specify in more detail what you want to get a meaningful answer. It may be that you actually do not need all these details and can just look in type's dicts in the mro order. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Mon Sep 27 07:54:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 11:54:15 +0000 Subject: [issue45261] Unreliable (?) results from timeit (cache issue?) In-Reply-To: <1632298555.06.0.822450771823.issue45261@roundup.psfhosted.org> Message-ID: <1632743655.36.0.424104428179.issue45261@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> not a bug _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45261> _______________________________________ From report at bugs.python.org Mon Sep 27 07:58:22 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 27 Sep 2021 11:58: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: <1632743902.5.0.711165434876.issue44603@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: Just wanted to say that "raise SystemExit" is shorter than "import sys; sys.exit()", has no special characters (just letters and space) and is really much quicker to write. Yes, it doesn't work if someone rebound SystemExit, but if that's your problem, you have weird coworkers. ;-) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44603> _______________________________________ From report at bugs.python.org Mon Sep 27 08:00:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 12:00:29 +0000 Subject: [issue39359] zipfile: add missing "pwd: expected bytes, got str" exception message In-Reply-To: <1579180814.8.0.49279033626.issue39359@roundup.psfhosted.org> Message-ID: <1632744029.29.0.483192489821.issue39359@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Why do you set the ZipFile.pwd attribute directly? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39359> _______________________________________ From report at bugs.python.org Mon Sep 27 08:13:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 12:13:16 +0000 Subject: [issue40346] Add random.BaseRandom to ease implementation of subclasses In-Reply-To: <1587419589.68.0.186666450831.issue40346@roundup.psfhosted.org> Message-ID: <1632744796.51.0.0294155534048.issue40346@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: That you need to override the __new__ method? I don't know whether it is documented specially. But the constructor calls __new__() and then __init__(). If changing the argument in __init__ does not help, it is because it was already proceeded in __new__. If you ask about changes in 3.11, it is a side effect of issue44260. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40346> _______________________________________ From report at bugs.python.org Mon Sep 27 08:20:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 12:20:35 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632745235.07.0.700297581077.issue45274@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset a22be4943c119fecf5433d999227ff78fc2e5741 by Victor Stinner in branch 'main': bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532) https://github.com/python/cpython/commit/a22be4943c119fecf5433d999227ff78fc2e5741 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 08:21:21 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 12:21:21 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632745281.28.0.403320668905.issue45274@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26962 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28579 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 08:21:25 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 12:21:25 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632745285.67.0.463050079902.issue45274@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26963 pull_request: https://github.com/python/cpython/pull/28580 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 08:45:59 2021 From: report at bugs.python.org (Daniel Hillier) Date: Mon, 27 Sep 2021 12:45:59 +0000 Subject: [issue39359] zipfile: add missing "pwd: expected bytes, got str" exception message In-Reply-To: <1579180814.8.0.49279033626.issue39359@roundup.psfhosted.org> Message-ID: <1632746759.83.0.206443000439.issue39359@roundup.psfhosted.org> Daniel Hillier <daniel.hillier at gmail.com> added the comment: I agree it is bad form but I would accidentally do it when I couldn't remember the proper API and took a stab in the dark without looking up the docs. I unfortunately used it in an example in the docs for pyzipper and started getting a few bug reports even after fixing my docs. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39359> _______________________________________ From report at bugs.python.org Mon Sep 27 08:49:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 12:49:39 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632746979.19.0.624611969105.issue45274@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 1ecb641b887af2feb026a266e2fceedee0815ca8 by Miss Islington (bot) in branch '3.9': bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532) https://github.com/python/cpython/commit/1ecb641b887af2feb026a266e2fceedee0815ca8 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 08:53:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 12:53:37 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632747217.42.0.650431196529.issue45274@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset fae2694bea5e9e5a114af8cb40b60e7131a6340c by Miss Islington (bot) in branch '3.10': bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532) (GH-28580) https://github.com/python/cpython/commit/fae2694bea5e9e5a114af8cb40b60e7131a6340c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 08:53:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 12:53:47 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632747227.98.0.900580066451.issue45274@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 09:25:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 27 Sep 2021 13:25:07 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632749107.18.0.727625155293.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Dennis, run your benchmarks with --rigorous to avoid "Benchmark hidden because not significant". I note that the second and third benchmarks aren't useful as written because the iterators are exhausted after first repetition. I could see this in my results, note how the values don't rise with the iterator size: for i in it_10: pass: Mean +- std dev: 25.0 ns +- 0.3 ns for i in it_100: pass: Mean +- std dev: 25.1 ns +- 0.5 ns for i in it_1000: pass: Mean +- std dev: 25.0 ns +- 0.3 ns for i in it_10000: pass: Mean +- std dev: 25.0 ns +- 0.3 ns for i in it_100000: pass: Mean +- std dev: 25.6 ns +- 0.5 ns deque(it_10): Mean +- std dev: 334 ns +- 8 ns deque(it_100): Mean +- std dev: 338 ns +- 9 ns deque(it_1000): Mean +- std dev: 335 ns +- 9 ns deque(it_10000): Mean +- std dev: 336 ns +- 10 ns deque(it_100000): Mean +- std dev: 338 ns +- 11 ns When I modified those to recreate the iterator on every run, the story was much different. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Mon Sep 27 09:29:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 13:29:57 +0000 Subject: [issue45300] Building Python documentation with doctest logs a ResourceWarning in Doc/library/nntplib.rst Message-ID: <1632749397.21.0.680115205063.issue45300@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: Build Python documentatioin with: make -C Doc/ PYTHON=../python venv LANG= PYTHONTRACEMALLOC=10 make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j10" doctest 2>&1|tee log See the logs: /home/vstinner/python/main/Lib/socket.py:776: ResourceWarning: unclosed <socket.socket fd=9, family=AF_INET, type=SOCK_STREAM, proto=6, laddr=('192.168.1.6', 42216), raddr=('116.202.254.214', 119)> self._sock = None Object allocated at (most recent call last): File "/home/vstinner/python/main/Doc/venv/lib/python3.11/site-packages/sphinx/builders/__init__.py", lineno 361 self.write(docnames, list(updated_docnames), method) File "/home/vstinner/python/main/Doc/venv/lib/python3.11/site-packages/sphinx/ext/doctest.py", lineno 366 self.test_doc(docname, doctree) File "/home/vstinner/python/main/Doc/venv/lib/python3.11/site-packages/sphinx/ext/doctest.py", lineno 470 self.test_group(group) File "/home/vstinner/python/main/Doc/venv/lib/python3.11/site-packages/sphinx/ext/doctest.py", lineno 554 self.test_runner.run(test, out=self._warn_out, clear_globs=False) File "/home/vstinner/python/main/Lib/doctest.py", lineno 1495 return self.__run(test, compileflags, out) File "/home/vstinner/python/main/Lib/doctest.py", lineno 1348 exec(compile(example.source, filename, "single", File "<doctest default[0]>", lineno 1 File "/home/vstinner/python/main/Lib/nntplib.py", lineno 334 self.sock = self._create_socket(timeout) File "/home/vstinner/python/main/Lib/nntplib.py", lineno 399 return socket.create_connection((self.host, self.port), timeout) File "/home/vstinner/python/main/Lib/socket.py", lineno 828 sock = socket(af, socktype, proto) ---------- assignee: docs at python components: Documentation messages: 402709 nosy: docs at python, vstinner priority: normal severity: normal status: open title: Building Python documentation with doctest logs a ResourceWarning in Doc/library/nntplib.rst versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45300> _______________________________________ From report at bugs.python.org Mon Sep 27 09:34:32 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 27 Sep 2021 13:34:32 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632749672.4.0.18469948838.issue45274@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: This is the same as bpo-21822, so I suppose it should be closed as well with a reference to this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 09:37:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 13:37:56 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632749876.61.0.436081177508.issue43914@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26964 pull_request: https://github.com/python/cpython/pull/28582 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Mon Sep 27 09:37:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 27 Sep 2021 13:37:51 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632749871.64.0.165650206859.issue43914@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset e5f13ce5b48b551c09fdd0faeafa6ecf860de51c by Pablo Galindo Salgado in branch 'main': bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576) https://github.com/python/cpython/commit/e5f13ce5b48b551c09fdd0faeafa6ecf860de51c ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Mon Sep 27 09:55:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 27 Sep 2021 13:55:09 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632750909.31.0.841045341031.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Benchmarks for PGO builds on macOS 10.15 Catalina, Intel MBP 2018. Like in Dennis' case, 20e3149c175a24466c7d1c352f8ff2c11effc489 is GH-27986 and cffa90a8b0057d7e7456571045f2fb7b9ceb426f is GH-28176. The difference is that `it_` benchmarks create the iterator on each execution. In this case the explicit iterator versions of the for-loop are indistinguishable from the ones using `range()` directly. ################ ? python -m pyperf compare_to /tmp/20e3149c175a24466c7d1c352f8ff2c11effc489-2.json /tmp/cffa90a8b0057d7e7456571045f2fb7b9ceb426f-2.json -G Slower (11): - deque(it_100): 886 ns +- 22 ns -> 944 ns +- 12 ns: 1.07x slower - list(iter(range(100))): 856 ns +- 17 ns -> 882 ns +- 17 ns: 1.03x slower - for i in range(100000): pass: 2.20 ms +- 0.02 ms -> 2.26 ms +- 0.03 ms: 1.02x slower - for i in range(10000): pass: 219 us +- 1 us -> 223 us +- 5 us: 1.02x slower - for i in it_10000: pass: 219 us +- 1 us -> 223 us +- 5 us: 1.02x slower - for i in it_100000: pass: 2.20 ms +- 0.03 ms -> 2.24 ms +- 0.04 ms: 1.02x slower - for i in it_1000: pass: 20.1 us +- 0.1 us -> 20.4 us +- 0.4 us: 1.02x slower - for i in range(1000): pass: 20.2 us +- 0.4 us -> 20.5 us +- 0.3 us: 1.02x slower - for i in range(100): pass: 1.50 us +- 0.03 us -> 1.52 us +- 0.03 us: 1.01x slower - list(iter(range(10))): 317 ns +- 9 ns -> 320 ns +- 6 ns: 1.01x slower - for i in it_100: pass: 1.53 us +- 0.01 us -> 1.54 us +- 0.02 us: 1.01x slower Faster (8): - list(iter(range(100000))): 2.25 ms +- 0.05 ms -> 2.12 ms +- 0.03 ms: 1.06x faster - deque(it_10000): 145 us +- 2 us -> 142 us +- 1 us: 1.03x faster - list(iter(range(1000))): 12.6 us +- 0.2 us -> 12.3 us +- 0.1 us: 1.02x faster - deque(it_100000): 1.47 ms +- 0.01 ms -> 1.45 ms +- 0.02 ms: 1.02x faster - for i in it_10: pass: 309 ns +- 6 ns -> 304 ns +- 3 ns: 1.02x faster - list(iter(range(10000))): 147 us +- 2 us -> 145 us +- 2 us: 1.01x faster - deque(it_10): 544 ns +- 19 ns -> 537 ns +- 10 ns: 1.01x faster - deque(it_1000): 12.6 us +- 0.2 us -> 12.5 us +- 0.2 us: 1.01x faster Benchmark hidden because not significant (1): for i in range(10): pass Geometric mean: 1.00x slower ################ The results look like a wash here. Let me compare both to `main`. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Mon Sep 27 10:07:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:07:51 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1632751671.81.0.818329241075.issue29971@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Copy of Antoine Pitrou's msg316024 (bpo-21822): multiprocessing semaphores support Ctrl-C under Windows, so it should be doable for regular locks as well (notice the `sigint_event`): https://github.com/python/cpython/blob/master/Modules/_multiprocessing/semaphore.c#L109-L146 ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29971> _______________________________________ From report at bugs.python.org Mon Sep 27 10:05:28 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 14:05:28 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1632751528.61.0.05400856949.issue43914@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 9e209d48cac35108f3955d3f610b6ce60b574ecc by Miss Islington (bot) in branch '3.10': bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576) https://github.com/python/cpython/commit/9e209d48cac35108f3955d3f610b6ce60b574ecc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43914> _______________________________________ From report at bugs.python.org Mon Sep 27 10:07:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:07:11 +0000 Subject: [issue21822] [Windows] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1632751631.19.0.604725211467.issue21822@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I am having the same blocked signal issue on Windows when using Thread.join. This program does not print "interrupted" after pressing Ctrl+C: This is a different issue: bpo-29971. Currently, threading.Lock.acquire() cannot be interrupted by CTRL+C. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21822> _______________________________________ From report at bugs.python.org Mon Sep 27 10:11:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:11:30 +0000 Subject: [issue21822] [Windows] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1632751890.24.0.128386551014.issue21822@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I mark this issue as a duplicate of bpo-45274. -- I fixed bpo-45274 with this change: New changeset a22be4943c119fecf5433d999227ff78fc2e5741 by Victor Stinner in branch 'main': bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532) https://github.com/python/cpython/commit/a22be4943c119fecf5433d999227ff78fc2e5741 I tested join.py with the fix. It nows displays: --- vstinner at DESKTOP-DK7VBIL C:\vstinner\python\main>python x.py Running Debug|x64 interpreter... started. Press Ctrl-C now Ctrl-C [2.99] done=True alive=False finish [2.99] done=True alive=False Terminate batch job (Y/N)? n --- The script no longer hangs. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Race condition in Thread._wait_for_tstate_lock() _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21822> _______________________________________ From report at bugs.python.org Mon Sep 27 10:11:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:11:56 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1632751916.48.0.699435586349.issue45274@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > This is the same as bpo-21822, so I suppose it should be closed as well with a reference to this issue. You're right. I marked bpo-21822 as a duplicate of this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45274> _______________________________________ From report at bugs.python.org Mon Sep 27 10:12:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:12:51 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1632751971.49.0.30907890665.issue29971@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-21822: some comments are about this issue. It's a duplicate of bpo-45274 "Race condition in Thread._wait_for_tstate_lock()". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29971> _______________________________________ From report at bugs.python.org Mon Sep 27 10:09:33 2021 From: report at bugs.python.org (arts stars) Date: Mon, 27 Sep 2021 14:09:33 +0000 Subject: [issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before In-Reply-To: <1632669913.29.0.580043897174.issue45294@roundup.psfhosted.org> Message-ID: <1632751773.69.0.135627051862.issue45294@roundup.psfhosted.org> arts stars <stars-of-stras at mediapromo.be> added the comment: It is not for debuging my code. your answer is really middleclass sorry to say that. you admit its a due the undefined name of var DiaObjectFactoryHelper that is exactly I wanted to point out. I solved my issue not having answer like in the FAQ like you simply repeated here. This is a parsing issue error I revealed here. The if... should pe PRIORITARIZED before checking what it is said in the FAQ. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45294> _______________________________________ From report at bugs.python.org Mon Sep 27 10:26:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:26:34 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1632752794.28.0.656334133879.issue29971@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-45301 "pycore_condvar.h: remove Windows conditonal variable emulation". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29971> _______________________________________ From report at bugs.python.org Mon Sep 27 10:26:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:26:03 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation Message-ID: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: I recently worked on time.sleep() enhancement (bpo-21302) and threading bugfixes (bpo-45274, bpo-1596321). I saw one more time that Python emulates conditional variables to support Windows XP and older. But Python 3.11 requires Windows 8.1 or newer. IMO it's time to remove _PY_EMULATED_WIN_CV code path from pycore_condvar.h. ---------- components: Library (Lib) messages: 402720 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: pycore_condvar.h: remove Windows conditonal variable emulation versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Mon Sep 27 10:26:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 14:26:22 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation In-Reply-To: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> Message-ID: <1632752782.88.0.613660111918.issue45301@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-29971 "Lock.acquire() not interruptible on Windows". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Mon Sep 27 10:28:29 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 27 Sep 2021 14:28:29 +0000 Subject: [issue45295] Speed up classmethod calls via LOAD_METHOD In-Reply-To: <1632673781.3.0.384078877149.issue45295@roundup.psfhosted.org> Message-ID: <1632752909.51.0.130421116619.issue45295@roundup.psfhosted.org> Change by Ken Jin <kenjin4096 at gmail.com>: ---------- title: _PyObject_GetMethod/LOAD_METHOD for C classmethods -> Speed up classmethod calls via LOAD_METHOD _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45295> _______________________________________ From report at bugs.python.org Mon Sep 27 10:44:24 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 27 Sep 2021 14:44:24 +0000 Subject: [issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before In-Reply-To: <1632751773.69.0.135627051862.issue45294@roundup.psfhosted.org> Message-ID: <20210927143938.GV11377@ando.pearwood.info> Steven D'Aprano <steve+python at pearwood.info> added the comment: I'm glad that you fixed the bug in your code, but this is not a bug in Python. It isn't "a parsing issue", the code is parsed fine. What you did was no different from: def func(): print(x) x = 1 except that the binding operation was an import, not an assignment. You get exactly the same error here: def func(): print(math) import math That's the way the language is defined. Imports and assignments are both binding operations and are treated the same by the interpreter. It's not an accident or a mistake or a parsing issue or a bug, it is the way the language is supposed to work. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45294> _______________________________________ From report at bugs.python.org Mon Sep 27 10:46:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 27 Sep 2021 14:46:46 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1632754006.5.0.50319643922.issue45026@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Well, this is kind of disappointing on my end. I attach the full result of a three-way comparison between `main` at the time of Serhiy's last merge (3f8b23f8ddab75d9b77a3997d54e663187e12cc8) with GH-27986 (20e3149c175a24466c7d1c352f8ff2c11effc489) and GH-28176 (cffa90a8b0057d7e7456571045f2fb7b9ceb426f). The gist is this: Geometric mean ============== 20e3149c175a24466c7d1c352f8ff2c11effc489-2: 1.01x slower cffa90a8b0057d7e7456571045f2fb7b9ceb426f-2: 1.01x slower At least on my Macbook Pro, all PGO builds, looks like the status quo is on average faster than any of the candidate PRs. ---------- Added file: https://bugs.python.org/file50306/three-way-comparison.log _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45026> _______________________________________ From report at bugs.python.org Mon Sep 27 10:48:59 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 27 Sep 2021 14:48:59 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation In-Reply-To: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> Message-ID: <1632754139.18.0.867485566569.issue45301@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: > IMO it's time to remove _PY_EMULATED_WIN_CV code path from > pycore_condvar.h. SleepConditionVariableSRW() can't be interrupted in PyCOND_WAIT() and PyCOND_TIMEDWAIT(). Maybe a hybrid solution could be adopted. Use native condition variables for the GIL, where performance matters and the ability to interrupt the wait doesn't matter. Otherwise use the semaphore implementation, for which the wait implementation can be modified to use WaitForMultipleObjects(), and include the Ctrl+C event. ---------- nosy: +eryksun _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Mon Sep 27 11:02:43 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 27 Sep 2021 15:02:43 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632754963.47.0.432846751719.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26965 pull_request: https://github.com/python/cpython/pull/28583 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 27 11:02:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 15:02:52 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632754972.66.0.0623653314448.issue36819@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I am working on it, since it is more complex issue, and PR 13134 does not solve it. 1. This bug affects also other codecs implemented in C: ASCII, Latin1, UTF-8, etc. 2. It still crashes in UTF-16/32 encoders if the error handler returns a position less than the current position. 3. Incorrect exception can be raised if the error handler returns invalid string/bytes: a non-ASCII string or a bytes object consisting of not a whole number of units. 4. The code for standard error handlers and for decoders needs a revision too. I have some suspects. We could just forbid error handlers returning position not in the range (start , end], but it can break some code, so it is better to do this only in a new release. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Mon Sep 27 11:40:46 2021 From: report at bugs.python.org (Sebastian Koslowski) Date: Mon, 27 Sep 2021 15:40:46 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1632757246.19.0.0826684113604.issue40059@roundup.psfhosted.org> Change by Sebastian Koslowski <sebastian.koslowski at gmail.com>: ---------- nosy: +skoslowski _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40059> _______________________________________ From report at bugs.python.org Mon Sep 27 11:46:25 2021 From: report at bugs.python.org (xloem) Date: Mon, 27 Sep 2021 15:46:25 +0000 Subject: [issue45302] basic builtin functions missing __text_signature__ attributes Message-ID: <1632757585.5.0.650553887806.issue45302@roundup.psfhosted.org> New submission from xloem <0xloem at gmail.com>: As there is no __text_signature__ nor __signature__ attribute on basic builtin functions such as print or open, inspect.signature() cannot enumerate their parameters. It seems adding these might not be a complex task for somebody familiar with the code. ---------- components: Argument Clinic, Interpreter Core messages: 402727 nosy: larry, xloem priority: normal severity: normal status: open title: basic builtin functions missing __text_signature__ attributes type: enhancement versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45302> _______________________________________ From report at bugs.python.org Mon Sep 27 11:48:54 2021 From: report at bugs.python.org (Josh Haberman) Date: Mon, 27 Sep 2021 15:48:54 +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: <1632757734.47.0.602166565039.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > I consider Py_tp_bases to be a mistake: it's an extra way of doing things that doesn't add any extra functionality I think it does add one extra bit of functionality: Py_tp_bases allows the bases to be retrieved with PyType_GetSlot(). This isn't quite as applicable to the metaclass, since that can easily be retrieved with Py_TYPE(type). > but is sometimes not correct (and it might not be obvious when it's not correct). Yes I guess that most all slots are ok to share across sub-interpreters. I can see the argument for aiming to keep slots sub-interpreter-agnostic. As a tangential point, I think that the DLL case on Windows may be a case where Windows is not compliant with the C standard: https://mail.python.org/archives/list/python-dev at python.org/thread/2WUFTVQA7SLEDEDYSRJ75XFIR3EUTKKO/ Practically speaking this doesn't change anything (extensions that want to be compatible with Windows DLLs will still want to avoid this kind of initialization) but I think the docs may be incorrect on this point when they describe Windows as "strictly standard conforming in this particular behavior." ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 11:48:43 2021 From: report at bugs.python.org (xloem) Date: Mon, 27 Sep 2021 15:48:43 +0000 Subject: [issue45303] ast module classes missing __text_signature__ attribute Message-ID: <1632757723.33.0.590596255222.issue45303@roundup.psfhosted.org> New submission from xloem <0xloem at gmail.com>: The ast module has no signature information on its types. The types are generated in a uniform way, so it should be reasonable to add __text_signature__ or __signature__ fields to all of them at once. ---------- components: Argument Clinic, Interpreter Core, Library (Lib) messages: 402728 nosy: larry, xloem priority: normal severity: normal status: open title: ast module classes missing __text_signature__ attribute type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45303> _______________________________________ From report at bugs.python.org Mon Sep 27 12:00:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 27 Sep 2021 16:00:06 +0000 Subject: [issue16974] when "python -c command" does a traceback, it open the file "<string>" In-Reply-To: <1358286006.48.0.232332339533.issue16974@psf.upfronthosting.co.za> Message-ID: <1632758406.39.0.59915946728.issue16974@roundup.psfhosted.org> Change by Irit Katriel <iritkatriel at gmail.com>: ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Traceback display code can attempt to open a file named "<stdin>" _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue16974> _______________________________________ From report at bugs.python.org Mon Sep 27 12:00:41 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 27 Sep 2021 16:00:41 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632758441.21.0.474078850892.issue45211@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset ae7839bbe817329dd015f9195da308a0f3fbd3e2 by Eric Snow in branch 'main': bpo-45211: Move helpers from getpath.c to internal API. (gh-28550) https://github.com/python/cpython/commit/ae7839bbe817329dd015f9195da308a0f3fbd3e2 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Mon Sep 27 12:09:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 16:09:07 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1632758947.83.0.285474650585.issue29971@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: time.sleep() is now implemented with a waitable timer and WaitForMultipleObjects() on Windows. It uses _PyOS_SigintEvent() so it can be interrupted with CTRL+C. commit 58f8adfda3c2b42f654a55500e8e3a6433cb95f2 Author: Victor Stinner <vstinner at python.org> Date: Wed Sep 22 16:09:30 2021 +0200 bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483) On Windows, time.sleep() now uses a waitable timer which has a resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms (10^-3 sec). * On Windows, time.sleep() now calls PyErr_CheckSignals() before resetting the SIGINT event. * Add _PyTime_As100Nanoseconds() function. * Complete and update time.sleep() documentation. Co-authored-by: Livius <egyszeregy at freemail.hu> ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29971> _______________________________________ From report at bugs.python.org Mon Sep 27 12:24:06 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 27 Sep 2021 16:24:06 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632759846.79.0.536572864365.issue45211@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26966 pull_request: https://github.com/python/cpython/pull/28584 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Mon Sep 27 12:42:33 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 16:42:33 +0000 Subject: [issue17838] Can't assign a different value for sys.stdin in IDLE In-Reply-To: <1366872984.94.0.234893757031.issue17838@psf.upfronthosting.co.za> Message-ID: <1632760953.81.0.20967081304.issue17838@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> fixed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17838> _______________________________________ From report at bugs.python.org Mon Sep 27 12:45:41 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 27 Sep 2021 16:45:41 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation In-Reply-To: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> Message-ID: <1632761141.67.0.293441028458.issue45301@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > SleepConditionVariableSRW() can't be interrupted in PyCOND_WAIT() and PyCOND_TIMEDWAIT() This was my immediate reaction as well. Unfortunately, we keep seeing that all waits need to be interruptible, so either a WaitForMultipleObjects or a slow spinlock. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Mon Sep 27 12:59:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 16:59:57 +0000 Subject: [issue2821] IDLE: unittest.py sys.exit error In-Reply-To: <1210532457.78.0.053406582463.issue2821@psf.upfronthosting.co.za> Message-ID: <1632761997.03.0.971325640418.issue2821@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- title: unittest.py sys.exit error -> IDLE: unittest.py sys.exit error _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue2821> _______________________________________ From report at bugs.python.org Mon Sep 27 13:03:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 17:03:18 +0000 Subject: [issue41468] IDLE: "Unrecoverable server exiting" message In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1632762198.47.0.479012376912.issue41468@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- title: Unrecoverable server exiting -> IDLE: "Unrecoverable server exiting" message _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41468> _______________________________________ From report at bugs.python.org Mon Sep 27 13:05:52 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 27 Sep 2021 17:05:52 +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: <1632762352.85.0.174960105427.issue15870@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > As a tangential point, I think that the DLL case on Windows may be a case where Windows is not compliant with the C standard I wasn't aware the C standard covered dynamic symbol resolution? "static" anything in C is completely irrelevant to how symbols are looked up and resolved between modules, and how addresses are relocated in PE binaries, by the Windows loader. So this point isn't even tangential - it's nowhere near the surface ;) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 13:06:50 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 27 Sep 2021 17:06:50 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632762410.26.0.957229998157.issue45211@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26967 pull_request: https://github.com/python/cpython/pull/28585 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Mon Sep 27 13:22:37 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Sep 2021 17:22:37 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632763357.51.0.97097889515.issue45020@roundup.psfhosted.org> Change by Barry A. Warsaw <barry at python.org>: ---------- nosy: +barry _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 27 13:39:46 2021 From: report at bugs.python.org (Josh Haberman) Date: Mon, 27 Sep 2021 17:39:46 +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: <1632764386.72.0.393707687089.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > "static" anything in C is completely irrelevant to how symbols are looked up and resolved between modules That is not true. On ELF/Mach-O the "static" storage-class specifier in C will prevent a symbol from being added to the dynamic symbol table, which will make it unavailable for use across modules. > I wasn't aware the C standard covered dynamic symbol resolution? Well the Python docs invoke the C standard to justify the behavior of DLL symbol resolution on Windows, using incorrect arguments about what the standard says: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_base Fixing those docs would be a good first step. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 13:53:06 2021 From: report at bugs.python.org (Josh Haberman) Date: Mon, 27 Sep 2021 17:53:06 +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: <1632765186.95.0.138057307387.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > On ELF/Mach-O... nvm, I just realized that you were speaking about Windows specifically here. I believe you that on Windows "static" makes no difference in this case. The second point stands: if you consider LoadLibrary()/dlopen() to be outside the bounds of what the C standard speaks to, then the docs shouldn't invoke the C standard to explain the behavior. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 15:04:19 2021 From: report at bugs.python.org (jakirkham) Date: Mon, 27 Sep 2021 19:04:19 +0000 Subject: [issue45304] Supporting out-of-band buffers (pickle protocol 5) in multiprocessing Message-ID: <1632769459.32.0.297800730758.issue45304@roundup.psfhosted.org> New submission from jakirkham <jakirkham at gmail.com>: In Python 3.8+, pickle protocol 5 ( PEP<574> ) was added, which supports out-of-band buffer collection[1]. The idea being that when pickling an object with a large amount of data attached to it (like an array, dataframe, etc.) one could collect this large amount of data alongside the normal pickled data without causing a copy. This is important in particular when serializing data for communication between two python instances. IOW this is quite valuable when using a `multiprocessing.pool.Pool`[2] or a `concurrent.futures.ProcessPoolExecutor`[3]. However AFAICT neither of these leverage this functionality[4][5]. To ensure zero-copy processing of large data, it would be helpful for pickle protocol 5 to be used in both of these pools. [1] https://docs.python.org/3/library/pickle.html#pickle-oob [2] https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool [3] https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor [4] https://github.com/python/cpython/blob/16b5bc68964c6126845f4cdd54b24996e71ae0ba/Lib/multiprocessing/queues.py#L372 [5] https://github.com/python/cpython/blob/16b5bc68964c6126845f4cdd54b24996e71ae0ba/Lib/multiprocessing/queues.py#L245 ---------- components: IO, Library (Lib) messages: 402736 nosy: jakirkham priority: normal severity: normal status: open title: Supporting out-of-band buffers (pickle protocol 5) in multiprocessing type: performance versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45304> _______________________________________ From report at bugs.python.org Mon Sep 27 15:07:40 2021 From: report at bugs.python.org (jakirkham) Date: Mon, 27 Sep 2021 19:07:40 +0000 Subject: [issue41226] Supporting `strides` in `memoryview.cast` In-Reply-To: <1594087287.71.0.356108904694.issue41226@roundup.psfhosted.org> Message-ID: <1632769660.13.0.0558998652532.issue41226@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41226> _______________________________________ From report at bugs.python.org Mon Sep 27 15:08:01 2021 From: report at bugs.python.org (jakirkham) Date: Mon, 27 Sep 2021 19:08:01 +0000 Subject: [issue43096] Adding `read_into` method to `asyncio.StreamReader` In-Reply-To: <1612214054.71.0.664238583626.issue43096@roundup.psfhosted.org> Message-ID: <1632769681.72.0.418187198541.issue43096@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43096> _______________________________________ From report at bugs.python.org Mon Sep 27 15:08:25 2021 From: report at bugs.python.org (jakirkham) Date: Mon, 27 Sep 2021 19:08:25 +0000 Subject: [issue41223] `object`-backed `memoryview`'s `tolist` errors In-Reply-To: <1594070396.59.0.711560769808.issue41223@roundup.psfhosted.org> Message-ID: <1632769705.23.0.185392283002.issue41223@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41223> _______________________________________ From report at bugs.python.org Mon Sep 27 15:08:47 2021 From: report at bugs.python.org (jakirkham) Date: Mon, 27 Sep 2021 19:08:47 +0000 Subject: [issue40718] Support out-of-band pickling for builtin types In-Reply-To: <1590089154.09.0.42583865069.issue40718@roundup.psfhosted.org> Message-ID: <1632769727.55.0.568302608446.issue40718@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40718> _______________________________________ From report at bugs.python.org Mon Sep 27 15:16:29 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 27 Sep 2021 19:16:29 +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: <1632770189.96.0.927150535524.issue15870@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The section of documentation you reference explains that this behaviour is not covered by the standard ("applied to a non-static variable like PyBaseObject_Type() is not required to produce an address constant"), and so static addresses of exported symbols do not have to be supported. It also says that gcc supports it (I assume by generating dynamic code for getting the address) while MSVC does not (requiring you to write your own dynamic code). The conclusion, "tp_base should be set in the extension module?s init function," is exactly the right conclusion if you want your code to work across all the supported compilers. Invoking the C standard to explain why this looks similar to standard code but actually is not is totally fine. Though I do note that the text can obviously be clearer. I assume it was written this way because of a discussion that started "but the C standard says ..." and so it was clarified to point out that this isn't actually the part of the spec that someone thought it was. If we can make it clearer, happy to, but it's certainly not incorrect as it stands. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 15:23:47 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 27 Sep 2021 19:23:47 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632770627.03.0.632117658657.issue45211@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26968 pull_request: https://github.com/python/cpython/pull/28586 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Mon Sep 27 16:38:34 2021 From: report at bugs.python.org (Josh Haberman) Date: Mon, 27 Sep 2021 20:38:34 +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: <1632775114.1.0.979208858986.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: This behavior is covered by the standard. The following C translation unit is valid according to C99: struct PyTypeObject; extern struct PyTypeObject Foo_Type; struct PyTypeObject *ptr = &Foo_Type; Specifically, &Foo_Type is an "address constant" per the standard because it is a pointer to an object of static storage duration (6.6p9). The Python docs contradict this with the following incorrect statement: > However, the unary ?&? operator applied to a non-static variable like PyBaseObject_Type() is not required to produce an address constant. This statement is incorrect: 1. PyBaseObject_Type is an object of static storage duration. (Note, this is true even though it does not use the "static" keyword -- the "static" storage-class specifier and "static storage duration" are separate concepts). 2. It follows that &PyBaseObject_Type is required to produce an address constant. because it is a pointer to an object of static storage duration. MSVC rejects this standard-conforming TU when __declspec(dllimport) is added: https://godbolt.org/z/GYrfTqaGn I am pretty sure this is out of compliance with C99. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 16:44:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 27 Sep 2021 20:44:36 +0000 Subject: [issue45234] copy_file raises FileNotFoundError when src is a directory In-Reply-To: <1631887457.05.0.0932118278478.issue45234@roundup.psfhosted.org> Message-ID: <1632775476.08.0.386376367556.issue45234@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> fixed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45234> _______________________________________ From report at bugs.python.org Mon Sep 27 16:59:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 27 Sep 2021 20:59:26 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632776366.12.0.575468181348.issue45249@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 20f439b6b9e1032930a31b88694ab9f37a09e6b4 by Pablo Galindo Salgado in branch 'main': bpo-45249: Ensure the traceback module prints correctly syntax errors with ranges (GH-28575) https://github.com/python/cpython/commit/20f439b6b9e1032930a31b88694ab9f37a09e6b4 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 27 16:59:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 20:59:14 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632776354.85.0.685637425464.issue45249@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26969 pull_request: https://github.com/python/cpython/pull/28587 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 27 17:09:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 21:09:12 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632776952.08.0.136836495886.issue1596321@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 95d31370829b7d729667588e0a9943217401ea5b by Victor Stinner in branch 'main': bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) https://github.com/python/cpython/commit/95d31370829b7d729667588e0a9943217401ea5b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 17:09:26 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 21:09:26 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632776966.17.0.336415914093.issue1596321@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 15.0 -> 16.0 pull_requests: +26970 pull_request: https://github.com/python/cpython/pull/28588 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 17:12:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 21:12:05 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632777125.85.0.62867131129.issue1596321@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26971 pull_request: https://github.com/python/cpython/pull/28589 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 17:24:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 21:24:49 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation, use Windows native conditional variable In-Reply-To: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> Message-ID: <1632777889.72.0.288438744014.issue45301@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Eryk: > SleepConditionVariableSRW() can't be interrupted in PyCOND_WAIT() and PyCOND_TIMEDWAIT(). Oh. A comment on StackOverlow says: "The WaitForXxx functions accept parameters of the generic HANDLE type, which represents a handle to a kernel object. Condition variables are user-mode objects, not kernel objects, so you cannot use them with these functions, since they work only with kernel objects." https://stackoverflow.com/questions/37522108/can-you-really-wait-on-condition-variable-with-waitfor-objects I only created this issue because of this comment in pycore_condvar.h: --- /* non-emulated condition variables are provided for those that want * to target Windows Vista. Modify this macro to enable them. */ #ifndef _PY_EMULATED_WIN_CV #define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */ #endif --- ---------- title: pycore_condvar.h: remove Windows conditonal variable emulation -> pycore_condvar.h: remove Windows conditonal variable emulation, use Windows native conditional variable _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Mon Sep 27 17:26:47 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 21:26:47 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632778007.33.0.541836952503.issue45249@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset c7fdd6879b5c8447ee65b1bec95a1db43837a7a5 by Miss Islington (bot) in branch '3.10': bpo-45249: Ensure the traceback module prints correctly syntax errors with ranges (GH-28575) https://github.com/python/cpython/commit/c7fdd6879b5c8447ee65b1bec95a1db43837a7a5 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Mon Sep 27 17:28:08 2021 From: report at bugs.python.org (Dave McNulla) Date: Mon, 27 Sep 2021 21:28:08 +0000 Subject: [issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch Message-ID: <1632778088.54.0.273231089693.issue45305@roundup.psfhosted.org> New submission from Dave McNulla <mcnulla at gmail.com>: https://gist.github.com/dmcnulla/ecec8fc96a2fd07082f240eeff6888d9 I'm trying to reproduce an error in a call to a method, forcing a second call to the method. In my test, the call_args_list is showing incorrectly (both in debugging or running unittest normally). I am not certain what other circumstances this is happening or not happening. I was able to reduce the code to reproduce it quite a bit. I am certain that the first call to the method is not matching correctly in my criteria to what I expect based on my debugging. I am using python 3.7. I can reproduce in IntelliJ or by commandline `python3 -m pytest test_multiple_side_effect.py` ---------- components: Tests messages: 402743 nosy: dmcnulla priority: normal severity: normal status: open title: Incorrect record of call_args_list when using multiple side_effect in mock.patch versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45305> _______________________________________ From report at bugs.python.org Mon Sep 27 17:39:50 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 27 Sep 2021 21:39:50 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632778790.39.0.889962649988.issue1596321@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 38c67738c64304928c68d5c2bd78bbb01d979b94 by Miss Islington (bot) in branch '3.10': bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) https://github.com/python/cpython/commit/38c67738c64304928c68d5c2bd78bbb01d979b94 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 17:40:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 21:40:26 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632778826.28.0.481390242759.issue1596321@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 94d19f606fa18a1c4d2faca1caf2f470a8ce6d46 by Victor Stinner in branch '3.9': bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589) https://github.com/python/cpython/commit/94d19f606fa18a1c4d2faca1caf2f470a8ce6d46 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 17:41:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Sep 2021 21:41:30 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632778890.25.0.295543951298.issue1596321@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Better late than never. I only took 15 years to fix this old bug :-D ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Mon Sep 27 18:03:52 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Mon, 27 Sep 2021 22:03:52 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632780232.78.0.801215351793.issue45288@roundup.psfhosted.org> Cristobal Riaga <cristobalriaga at gmail.com> added the comment: I'm don't really need inherit order, neither built-in members. e.g.: ```py a = 3 # First class B: # Second pass def foo(): # Third pass ``` Or in a more complex module: ```py class A: # First pass class B: # Second pass class C(A, B): # Third pass ``` The order should be: - A (class) - B (class) - C (class): inherited from A and B. Here is the link to the script I'm using to inspect a module: https://github.com/Patitotective/PyAPIReference/blob/main/PyAPIReference/inspect_object.py. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Mon Sep 27 18:04:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 22:04:27 +0000 Subject: [issue29971] threading.Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1632780267.82.0.688658975681.issue29971@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- title: Lock.acquire() not interruptible on Windows -> threading.Lock.acquire() not interruptible on Windows _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue29971> _______________________________________ From report at bugs.python.org Mon Sep 27 18:06:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Sep 2021 22:06:50 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632780410.81.0.0899409764119.issue45288@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Ah, if you only need a module, then just use its __dict__ (or vars()). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Mon Sep 27 18:07:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 27 Sep 2021 22:07:28 +0000 Subject: [issue41214] -O0: Segmentation fault in _PyArg_UnpackStack In-Reply-To: <1593946467.6.0.0689011340862.issue41214@roundup.psfhosted.org> Message-ID: <1632780448.73.0.818269584703.issue41214@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Python 3.7 is no longer maintained. Please create a new issue if you see this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41214> _______________________________________ From report at bugs.python.org Mon Sep 27 18:32:05 2021 From: report at bugs.python.org (Cristobal Riaga) Date: Mon, 27 Sep 2021 22:32:05 +0000 Subject: [issue45288] Inspect - Added sort_result parameter on getmembers function. In-Reply-To: <1632580104.8.0.617180207375.issue45288@roundup.psfhosted.org> Message-ID: <1632781925.86.0.272799642073.issue45288@roundup.psfhosted.org> Cristobal Riaga <cristobalriaga at gmail.com> added the comment: That worked ?, thank you for your time and answer. I will keep working on PyAPIReference. Also I will close the pull request I created on GitHub. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45288> _______________________________________ From report at bugs.python.org Mon Sep 27 19:24:57 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 27 Sep 2021 23:24:57 +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: <1632785097.92.0.522200850683.issue15870@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: > MSVC rejects this standard-conforming TU when __declspec(dllimport) is added: https://godbolt.org/z/GYrfTqaGn I am pretty sure this is out of compliance with C99. Windows/MSVC defines DLLs as separate programs, with their own lifetime and entry point (e.g. you can reload a DLL multiple times and it will be reinitialised each time). So there's no conflict with the standard here, and certainly nothing that affects the real discussion. If you'd like to continue this sideline, feel free to take it elsewhere - I'm done with it. Let's keep the focus on making sure the added feature is useful for users. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 20:16:04 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 28 Sep 2021 00:16:04 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632788164.42.0.437874520047.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +26972 pull_request: https://github.com/python/cpython/pull/28590 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Mon Sep 27 20:24:44 2021 From: report at bugs.python.org (Josh Haberman) Date: Tue, 28 Sep 2021 00:24:44 +0000 Subject: [issue45306] Docs are incorrect re: constant initialization in the C99 standard Message-ID: <1632788684.07.0.376752176258.issue45306@roundup.psfhosted.org> New submission from Josh Haberman <jhaberman at gmail.com>: I believe the following excerpt from the docs is incorrect (https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_base): > Slot initialization is subject to the rules of initializing > globals. C99 requires the initializers to be ?address > constants?. Function designators like PyType_GenericNew(), > with implicit conversion to a pointer, are valid C99 address > constants. > > However, the unary ?&? operator applied to a non-static > variable like PyBaseObject_Type() is not required to produce > an address constant. Compilers may support this (gcc does), > MSVC does not. Both compilers are strictly standard > conforming in this particular behavior. > > Consequently, tp_base should be set in the extension module?s init function. I explained why in https://mail.python.org/archives/list/python-dev at python.org/thread/2WUFTVQA7SLEDEDYSRJ75XFIR3EUTKKO/ and on https://bugs.python.org/msg402738. The short version: &foo is an "address constant" according to the standard whenever "foo" has static storage duration. Variables declared "extern" have static storage duration. Therefore strictly conforming implementations should accept &PyBaseObject_Type as a valid constant initializer. I believe the text above could be replaced by something like: > MSVC does not support constant initialization of of an address > that comes from another DLL, so extensions should be set in the > extension module's init function. ---------- assignee: docs at python components: Documentation messages: 402752 nosy: docs at python, jhaberman priority: normal severity: normal status: open title: Docs are incorrect re: constant initialization in the C99 standard _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45306> _______________________________________ From report at bugs.python.org Mon Sep 27 20:26:56 2021 From: report at bugs.python.org (Josh Haberman) Date: Tue, 28 Sep 2021 00:26:56 +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: <1632788816.49.0.79510963277.issue15870@roundup.psfhosted.org> Josh Haberman <jhaberman at gmail.com> added the comment: > Windows/MSVC defines DLLs as separate programs, with their own lifetime and entry point (e.g. you can reload a DLL multiple times and it will be reinitialised each time). All of this is true of so's in ELF also. It doesn't mean that the implementation needs to reject standards-conforming programs. I still think the Python documentation is incorrect on this point. I filed https://bugs.python.org/issue45306 to track this separately. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Mon Sep 27 21:01:15 2021 From: report at bugs.python.org (Gregory Szorc) Date: Tue, 28 Sep 2021 01:01:15 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders Message-ID: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> New submission from Gregory Szorc <gregory.szorc at gmail.com>: https://bugs.python.org/issue41994 / commit 4db8988420e0a122d617df741381b0c385af032c removed _PyImport_FindExtensionObject() from the C API and it is no longer available in CPython 3.10 after alpha 5. At least py2exe and PyOxidizer rely on this API for implementing a custom module loader for extension modules. Essentially, both want to implement a custom Loader.create_module() so they can use a custom mechanism for injecting a shared library into the process. While the details shouldn't be important beyond "they can't use imp.create_dynamic()," both use a similar technique that hooks LoadLibrary() on Windows to enable them to load a DLL from memory (as opposed to a file). While I don't have the extension module loading mechanism fully paged in to my head at the moment, I believe the reason that _PyImport_FindExtensionObject() (now effectively import_find_extension()) is important for py2exe and PyOxidizer is because they need to support at most once initialization, including honoring the multi-phase initialization semantics. Since the state of extension modules is stored in `static PyObject *extensions` and the thread state (which are opaque to the C API), the loss of _PyImport_FindExtensionObject() means there is no way to check for and use an existing extension module module object from the bowels of the importer machinery. And I think this means it isn't possible to implement well-behaved alternate extension module loaders any more. I'm aware the deleted API was "private" and probably shouldn't have been used in the first place. And what py2exe and PyOxidizer are doing here is rather unorthodox. In my mind the simplest path forward is restoring _PyImport_FindExtensionObject(). But a properly designed public API is probably a better solution. Until 3.10 makes equivalent functionality available or another workaround is supported, PyOxidizer won't be able to support loading extension modules from memory on Windows on Python 3.10. This is unfortunate. But probably not a deal breaker and I can probably go several months shipping PyOxidizer with this regression without too many complaints. ---------- components: C API messages: 402754 nosy: indygreg, petr.viktorin, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders type: enhancement versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Mon Sep 27 21:02:00 2021 From: report at bugs.python.org (Gregory Szorc) Date: Tue, 28 Sep 2021 01:02:00 +0000 Subject: [issue41994] Refcount issues in import In-Reply-To: <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org> Message-ID: <1632790920.41.0.366186044853.issue41994@roundup.psfhosted.org> Gregory Szorc <gregory.szorc at gmail.com> added the comment: I didn't want to derail this old issue too much. So I filed issue45307 to track a solution. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41994> _______________________________________ From report at bugs.python.org Mon Sep 27 23:08:59 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 28 Sep 2021 03:08:59 +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: <1632798539.18.0.789123584437.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: Mark, would you take a look, please? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Tue Sep 28 02:30:07 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 28 Sep 2021 06:30:07 +0000 Subject: [issue45301] pycore_condvar.h: remove Windows conditonal variable emulation, use Windows native conditional variable In-Reply-To: <1632752763.53.0.87370368586.issue45301@roundup.psfhosted.org> Message-ID: <1632810607.88.0.303623573124.issue45301@roundup.psfhosted.org> Eryk Sun <eryksun at gmail.com> added the comment: FYI, waiting for a condition variable can cause a thread to enter a wait state that's interruptible, in theory, but the mechanism is different since condition variables and SRW locks are pointer-sized values in user space, instead of NT objects in kernel space. The current implementation is based on the system call NtWaitForAlertByThreadId(address, timeout), which enters the "WrAlertByThreadId" wait state. The address parameter is that of the SRW lock. The kernel sets this as the 'object' for the wait, but the wait is actually satisfied by alerting the thread directly via NtAlertThreadByThreadId(tid). ISTM, they could have added a function that calls the latter to cancel a wait on a given thread. That would have been useful for Ctrl+C since the handler executes on a new thread. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45301> _______________________________________ From report at bugs.python.org Tue Sep 28 03:57:03 2021 From: report at bugs.python.org (eleven xiang) Date: Tue, 28 Sep 2021 07:57:03 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process Message-ID: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> New submission from eleven xiang <eleven.xiang at gmail.com>: Hi, Here I did an experiment, and detail as below 1. There is library, which has global object and has its class method 2. Use multiprocessing module to fork the child process, parent process call the global object's method first, and then child process called the global object method again to modify it 3. After that when script exit, parent will free the object, but child process will not free it. 4. if we change the start method to 'spawn', the child process will free it ---------- components: Library (Lib) files: test.py messages: 402758 nosy: eleven.xiang priority: normal severity: normal status: open title: multiprocessing default fork child process will not free object, which is inherited from parent process type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50307/test.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 03:57:49 2021 From: report at bugs.python.org (eleven xiang) Date: Tue, 28 Sep 2021 07:57:49 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632815869.22.0.30681953024.issue45308@roundup.psfhosted.org> Change by eleven xiang <eleven.xiang at gmail.com>: Added file: https://bugs.python.org/file50308/test1.cpp _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 04:00:54 2021 From: report at bugs.python.org (eleven xiang) Date: Tue, 28 Sep 2021 08:00:54 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632816054.01.0.412908499111.issue45308@roundup.psfhosted.org> eleven xiang <eleven.xiang at gmail.com> added the comment: you could use below command to build test.so from test1.cpp g++ test1.cpp -shared -fPIC --std=c++11 -o test.so ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 04:03:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Sep 2021 08:03:48 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632816228.26.0.326381987303.issue36819@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26973 pull_request: https://github.com/python/cpython/pull/28593 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Tue Sep 28 04:15:30 2021 From: report at bugs.python.org (eleven xiang) Date: Tue, 28 Sep 2021 08:15:30 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632816930.48.0.276942343786.issue45308@roundup.psfhosted.org> eleven xiang <eleven.xiang at gmail.com> added the comment: update test platform Ubuntu 16.04 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 05:04:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Sep 2021 09:04:37 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632819877.23.0.325871148881.issue45307@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch pull_requests: +26974 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28594 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 05:15:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Sep 2021 09:15:01 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632820501.87.0.784958219832.issue45307@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Gregory, could you please build Python 3.10 with PR 28594 applied and test whether py2exe and PyOxidizer work well with it? The restored function no longer used in the CPython code, so it is not tested now. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 05:15:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Sep 2021 09:15:26 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632820526.97.0.76691432511.issue45307@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 05:54:32 2021 From: report at bugs.python.org (=?utf-8?b?56mG5YWw?=) Date: Tue, 28 Sep 2021 09:54:32 +0000 Subject: [issue45309] asyncio task can not be used to open_connection and read data. Message-ID: <1632822872.87.0.0190246614717.issue45309@roundup.psfhosted.org> New submission from ?? <whitestockingirl at gmail.com>: The server code: import asyncio import struct counter = 0 async def on_connection(r: asyncio.StreamReader, w: asyncio.StreamWriter): msg = struct.pack("HB", 3, 0) w.write(msg) await w.drain() global counter counter += 1 print(counter, "client") async def main(): server = await asyncio.start_server(on_connection, '0.0.0.0', 12345) await server.serve_forever() if __name__ == "__main__": asyncio.run(main()) The client code: import asyncio loop = asyncio.get_event_loop() counter = 0 c_counter = 0 async def connection_to(): r, w = await asyncio.open_connection('192.168.3.2', 12345) global c_counter c_counter += 1 print(c_counter, "connected") await r.readexactly(3) global counter counter += 1 print(counter, "get_msg") async def main(): for i in range(7000): t = loop.create_task(connection_to()) try: loop.run_until_complete(main()) loop.run_forever() except Exception as e: print(e.with_traceback(None)) I open the server on wsl debian and run the client on host windows. Try start more client at once, Then you will find that counter is not equal to c_counter. It nearly always happend. Now I can not trust create_task any more. ---------- components: asyncio messages: 402762 nosy: asvetlov, whitestockingirl, yselivanov priority: normal severity: normal status: open title: asyncio task can not be used to open_connection and read data. type: crash versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45309> _______________________________________ From report at bugs.python.org Tue Sep 28 06:03:21 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 28 Sep 2021 10:03:21 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632823401.96.0.158651333108.issue45256@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: PR 28488 has no NEWS entry, or What's New entry. However, adding multiple entries will be confusing, so that's best left until all calls to Python functions and method don't use the C stack. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 28 06:04:06 2021 From: report at bugs.python.org (=?utf-8?b?56mG5YWw?=) Date: Tue, 28 Sep 2021 10:04:06 +0000 Subject: [issue45309] asyncio task can not be used to open_connection and read data. In-Reply-To: <1632822872.87.0.0190246614717.issue45309@roundup.psfhosted.org> Message-ID: <1632823446.75.0.665514311887.issue45309@roundup.psfhosted.org> ?? <whitestockingirl at gmail.com> added the comment: Hope some one could fix it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45309> _______________________________________ From report at bugs.python.org Tue Sep 28 06:15:16 2021 From: report at bugs.python.org (Gabor Rakosy) Date: Tue, 28 Sep 2021 10:15:16 +0000 Subject: [issue44841] ZipInfo crashes on filemode In-Reply-To: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org> Message-ID: <1632824116.71.0.26918344993.issue44841@roundup.psfhosted.org> Gabor Rakosy <g.rakosy at graafschapcollege.nl> added the comment: Like Ronald Oussoren wrote "ZipInfo does not have a filemode attribute, that's why it is not in ZipInfo.__slots__." ---------------- import zipfile file_zip = zipfile.ZipFile("test-one-dir.zip", mode='r') for info in file_zip.infolist(): print(info) --------------- In the print, it shows the option 'filemode'. And that option is not accessible. That's the reason why i made this issue. ---------- Added file: https://bugs.python.org/file50309/test-zip.zip _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44841> _______________________________________ From report at bugs.python.org Tue Sep 28 06:20:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 28 Sep 2021 10:20:11 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632824411.26.0.143211325742.issue35606@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26975 pull_request: https://github.com/python/cpython/pull/28595 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 07:11:32 2021 From: report at bugs.python.org (Christian Tismer) Date: Tue, 28 Sep 2021 11:11:32 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632827492.08.0.442607827933.issue45256@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: FWIW, getting all function to avoid the C stack will most probably take a long time, if it happens at all. Especially functions which might call into Python multiple times must be re-designed heavily, turned into multiple pieces to be in tail position. Been there, long ago... :) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 28 07:41:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 28 Sep 2021 11:41:33 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632829293.31.0.104254248405.issue45256@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: We are starting to optimize first the easy cases of CALL_FUNCTION and move slowly to add more and more calls into it. This approach has the advantage that allow us to take it in small increments. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 28 08:06:05 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 12:06:05 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632830765.86.0.652009122791.issue45296@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26976 pull_request: https://github.com/python/cpython/pull/28600 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:06:10 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 12:06:10 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632830770.21.0.467055134993.issue45296@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26977 pull_request: https://github.com/python/cpython/pull/28601 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:06:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 12:06:05 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632830765.16.0.995058446.issue45296@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e649e0658ff2af87b07d994c05ae048e16e31aae by Terry Jan Reedy in branch 'main': bpo-45296: Fix exit/quit message on Windows (GH-28577) https://github.com/python/cpython/commit/e649e0658ff2af87b07d994c05ae048e16e31aae ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:17:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Sep 2021 12:17:43 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632831463.56.0.153578017429.issue45308@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: That's the principle of fork. You should use a different spawn method if you don't want to inherit resources inherited from the parent process, like spawn or forkserver: https://docs.python.org/dev/library/multiprocessing.html#contexts-and-start-methods ---------- nosy: +vstinner resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 08:22:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Sep 2021 12:22:19 +0000 Subject: [issue45310] test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb' Message-ID: <1632831738.98.0.525271172358.issue45310@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: AMD64 Fedora Stable LTO + PGO 3.10 (build 357): https://buildbot.python.org/all/#/builders/651/builds/357 First test_multiprocessing_forkserver failed, then test_multiprocessing_spawn, then test_multiprocessing_fork. I confirm that these tests fail if the /test01_tsmb shared memory exists. The test is supposed to unlink the shared memory once the test completes: def test_shared_memory_basics(self): sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512) self.addCleanup(sms.unlink) Maybe the whole process was killed while the test was running. I removed it manually: sudo ./python -c "import _posixshmem; _posixshmem.shm_unlink('/test01_tsmb')" Logs: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 209, in main cache[rtype].remove(name) KeyError: '/psm_49a93592' (...) ====================================================================== ERROR: test_shared_memory_basics (test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/test/_test_multiprocessing.py", line 3777, in test_shared_memory_basics sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__ self._fd = _posixshmem.shm_open( FileExistsError: [Errno 17] File exists: '/test01_tsmb' ---------- components: Tests messages: 402770 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb' versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45310> _______________________________________ From report at bugs.python.org Tue Sep 28 08:32:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 12:32:24 +0000 Subject: [issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests In-Reply-To: <1632210576.65.0.316213829461.issue45254@roundup.psfhosted.org> Message-ID: <1632832344.68.0.22124256957.issue45254@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: The logic is currently duplicated because trying to import `shared_memory` is how support discovery is supposed to work in user code. `multiprocessing.managers` doesn't export HAS_SHMEM (it's not in `__all__` and it's not documented). Making tests rely on it feels wrong to me. It might change in the future. ---------- nosy: +lukasz.langa resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45254> _______________________________________ From report at bugs.python.org Tue Sep 28 08:32:50 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 12:32:50 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632832370.85.0.25338403945.issue35606@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +26978 pull_request: https://github.com/python/cpython/pull/28603 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 08:32:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 28 Sep 2021 12:32:51 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632832371.94.0.980734339933.issue35606@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 84975146a7ce64f1d50dcec8311b7f7188a5c962 by Pablo Galindo Salgado in branch 'main': bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595) https://github.com/python/cpython/commit/84975146a7ce64f1d50dcec8311b7f7188a5c962 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 08:32:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 12:32:55 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632832375.55.0.142302353283.issue35606@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26979 pull_request: https://github.com/python/cpython/pull/28604 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 08:35:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 12:35:08 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632832508.3.0.183626263861.issue45296@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 813fbba4cab4556e55d6044c05725a26ec20b648 by Miss Islington (bot) in branch '3.9': bpo-45296: Fix exit/quit message on Windows (GH-28577) (GH-28601) https://github.com/python/cpython/commit/813fbba4cab4556e55d6044c05725a26ec20b648 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:35:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 12:35:27 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632832527.92.0.720266578804.issue45296@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset acd46feff3c06d3f1d00ab850e530c519445a737 by Miss Islington (bot) in branch '3.10': bpo-45296: Fix exit/quit message on Windows (GH-28577) (GH-28600) https://github.com/python/cpython/commit/acd46feff3c06d3f1d00ab850e530c519445a737 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:38:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 12:38:37 +0000 Subject: [issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632832717.63.0.0817288195681.issue45296@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: The wording chosen by Terry, i.e. "Ctrl-D (end-of-file)", is pretty clear. Merged and fixed. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Tue Sep 28 08:39:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Sep 2021 12:39:38 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632832778.69.0.669525396512.issue45307@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Until 3.10 makes equivalent functionality available or another workaround is supported, I don't understand which long term solution do you propose. > a properly designed public API is probably a better solution Can you propose a public API? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 08:48:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 28 Sep 2021 12:48:34 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632833314.75.0.339237017401.issue45307@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I don't understand which long term solution do you propose. A kind reminder that for 3.10 we cannot add new APIs so this proposal still *makes sense* for the short term (3.10). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 08:56:59 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 12:56:59 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632833819.55.0.691865989972.issue35606@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset fd52afd1928643a715202147b1ce5b0d130ec252 by Miss Islington (bot) in branch '3.10': bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595) https://github.com/python/cpython/commit/fd52afd1928643a715202147b1ce5b0d130ec252 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 09:32:03 2021 From: report at bugs.python.org (Besart Dollma) Date: Tue, 28 Sep 2021 13:32:03 +0000 Subject: [issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement Message-ID: <1632835923.15.0.15993520004.issue45311@roundup.psfhosted.org> New submission from Besart Dollma <besi7dollma at gmail.com>: Hi, I was looking at the implementation of Semaphore and BoundedSemaphore in threading.py and I saw that `notify` is called on a loop n times while it supports an n parameter. https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/threading.py#L479 Unless I am missing something, removing the loop and replacing it with self._cond.notify(n) will slightly improve performance by avoiding the function call overhead. I can prepare a Pool Request if the change is acceptable. Thanks, ---------- components: Library (Lib) messages: 402779 nosy: besi7dollma priority: normal severity: normal status: open title: Threading Semaphore and BoundedSemaphore release method implementation improvement type: enhancement versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45311> _______________________________________ From report at bugs.python.org Tue Sep 28 10:28:54 2021 From: report at bugs.python.org (Hinrich Mahler) Date: Tue, 28 Sep 2021 14:28:54 +0000 Subject: [issue28206] signal.Signals not documented In-Reply-To: <1474297204.47.0.613989661481.issue28206@psf.upfronthosting.co.za> Message-ID: <1632839334.41.0.329065154252.issue28206@roundup.psfhosted.org> Change by Hinrich Mahler <hinrich.mahler at freenet.de>: ---------- nosy: +Bibo-Joshi _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28206> _______________________________________ From report at bugs.python.org Tue Sep 28 10:57:25 2021 From: report at bugs.python.org (Christian Tismer) Date: Tue, 28 Sep 2021 14:57:25 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632841045.79.0.27948333596.issue45256@roundup.psfhosted.org> Christian Tismer <tismer at stackless.com> added the comment: Very much appreciated approach. Too bad that things stop when people are writing extensions as usual. Or do you think we can teach them how to avoid the C stack? Anyway, good luck! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 28 10:59:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 14:59:25 +0000 Subject: [issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+ In-Reply-To: <1629030216.33.0.128972085225.issue44919@roundup.psfhosted.org> Message-ID: <1632841165.57.0.0287128254785.issue44919@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: The change to disallow this in Python 3.9 was deliberate, see BPO-40187 and its description. Your attempt to make `isinstance()` work with TypedDict subclasses goes directly against this design. In fact, PEP 589 explicitly says that: - Methods are not allowed, since the runtime type of a TypedDict object will always be just dict (it is never a subclass of dict). - Specifying a metaclass is not allowed. I'm -1 to allow this but I'll also wait for Serhiy to voice his opinion. ---------- nosy: +lukasz.langa, serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44919> _______________________________________ From report at bugs.python.org Tue Sep 28 11:39:05 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:39:05 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632843545.02.0.855938470849.issue35665@roundup.psfhosted.org> Change by Dimitrije Milovi? <dmilovic at sbb.rs>: Added file: https://bugs.python.org/file50310/Untitled.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 11:36:59 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:36:59 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632843419.46.0.412118916099.issue35665@roundup.psfhosted.org> Dimitrije Milovi? <dmilovic at sbb.rs> added the comment: Just to ad to the issue, and to further update the importance of those certificates... I came to this issue (still persistent with all python versions since 3.6) while using yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/1060 I obviously have the SAME problem than the guy in your link since I am from Serbia too, and those certificates "MUPCA Root" are (unfortunately-badly executed) crucial (issued by the ministry of interior - police ?) ones to be able too read ID cards and use personal signing certificates, and they're are all valid... So the option to remove the faulty certificates, is a no go to me (or anyone in Serbia using their ID card - individuals, companies and entrepreneurs like me)... Please help! ---------- nosy: +MDM-1 versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 11:39:57 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:39:57 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632843597.0.0.0336828470368.issue35665@roundup.psfhosted.org> Change by Dimitrije Milovi? <dmilovic at sbb.rs>: Added file: https://bugs.python.org/file50311/Untitled.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 11:41:47 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:41:47 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632843707.23.0.818775113904.issue35665@roundup.psfhosted.org> Change by Dimitrije Milovi? <dmilovic at sbb.rs>: Removed file: https://bugs.python.org/file50310/Untitled.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 11:43:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 28 Sep 2021 15:43:45 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632843825.27.0.794189551752.issue44394@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: The backport to 3.8 broke 3.8.12 in AIX: 0/Modules/_decimal/libmpdec/sixstep.o build/temp.aix-7.1-3.8/tmp/python3.8-3.8.12-0/Modules/_decimal/libmpdec/transpose.o -L. -L/opt/bb/lib -L/opt/bb/lib64 -R/opt/bb/lib64 -lm -o build/lib.aix-7.1-3.8/_decimal.cpython-38.so *** WARNING: renaming "pyexpat" since importing it failed: rtld: 0712-001 Symbol _isnanf was referenced from module build/lib.aix-7.1-3.8/pyexpat.cpython-38.so(), but a runtime definition of the symbol was not found. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Tue Sep 28 11:49:22 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:49:22 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary Message-ID: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> New submission from Dimitrije Milovi? <dmilovic at sbb.rs>: I just commented to the issue here https://bugs.python.org/issue35665?@ok_message=issue%2035665%20files%20edited%20ok&@template=item, but noticed "closed" so better start a new one issue, and to further update the importance of those certificates... I came to this issue (still persistent with all python versions since 3.6) while using yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/1060 I obviously have the SAME problem than the guys in your link since I am from Serbia too, and those certificates "MUPCA Root" are (unfortunately-badly executed) crucial (issued by the ministry of interior - police ?) ones to be able too read ID cards and use personal signing certificates, and they're are all valid... So the option to remove the faulty certificates, is a no go to me (or anyone in Serbia using their ID card - individuals, companies and entrepreneurs like me)... Please help! ---------- components: Windows files: Untitled.png messages: 402784 nosy: MDM-1, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50312/Untitled.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 11:58:15 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:58:15 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632844695.34.0.282511002577.issue45312@roundup.psfhosted.org> Change by Dimitrije Milovi? <dmilovic at sbb.rs>: Added file: https://bugs.python.org/file50313/135081521-83d466d9-c71d-465c-96a2-652c2549c461.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 11:58:23 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 15:58:23 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632844703.72.0.506874786257.issue45312@roundup.psfhosted.org> Change by Dimitrije Milovi? <dmilovic at sbb.rs>: Added file: https://bugs.python.org/file50314/135087546-e6fd1b05-6858-4e0f-ad3f-857c614bb15b.png _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:09:12 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 28 Sep 2021 16:09:12 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1632845352.6.0.331988141553.issue45256@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: The goal is reduced stack depth, not reframing the entire call model around not having a C stack. We can't even reasonably rewrite getattr() without supporting callbacks from C into Python, so further generalisation is very unlikely. But if you inspect the native stack of most Python programs, you'll see that it's mostly taken up with calls within Python code. Compressing all of those is a significant advantage, akin to inlining the Python code at compile time, even if it doesn't see "through" native calls. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45256> _______________________________________ From report at bugs.python.org Tue Sep 28 12:11:10 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 28 Sep 2021 16:11:10 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632845470.27.0.930576090207.issue45312@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: This needs to be a feature request against the script that you're running. They have the option of not verifying TLS certificates if they choose not to, but they are explicitly enabling the checks right now. We can't add a command line option to disable it for them. You'll need to find the place where they work and request it there. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:26:14 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 16:26:14 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632846374.63.0.14768002059.issue45312@roundup.psfhosted.org> Dimitrije Milovi? <dmilovic at sbb.rs> added the comment: OK, will let the yt-dlp author pukkandan on GitHub know. Thanks for the quick answer. The only downside in this will be that this will have to be donne for many programs and scripts in the future; and for more and more persons (using our ID certificate will be only more preponderant as time passes). So is it impossible to just somehow circumvent or add as exclusions those certificates? I could send them all to you..? ---------- resolution: third party -> remind _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:29:26 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 28 Sep 2021 16:29:26 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632846566.12.0.479831186788.issue45312@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Python doesn't include any trusted certificates - it reads them from the operating system. So you'll need to get the operating system vendors to include it if you want it to be trusted by default. Additionally, some libraries include a copy of Mozilla's bundle (usually via the certifi package) and override the operating system. You'd need them to also include it. ---------- resolution: remind -> third party _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:38:28 2021 From: report at bugs.python.org (pukkandan) Date: Tue, 28 Sep 2021 16:38:28 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632847108.44.0.892147255433.issue45312@roundup.psfhosted.org> pukkandan <pukkandan at gmail.com> added the comment: Hi, I am the maintainer of the above mentioned project. I was planning to implement a patch for this. But I asked OP to report the issue here anyway since I do not believe this is the intended behavior. For context, the issue is occurring when using the `ssl.create_default_context` function and not by manually adding the verify flag. For this, the default (in my opinion) should be to ignore any invalid certificates. Even the comment in the relevent code (https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/ssl.py#L772-L774) seem to agree with my sentiment. I ask that you please reconsider your stance on this issue. Thanks ---------- nosy: +pukkandan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:42:09 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 28 Sep 2021 16:42:09 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632847329.51.0.338274622605.issue45312@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Adding Christian, as he's our expert in this area, and was also driving the other bug. ---------- assignee: -> christian.heimes components: +SSL nosy: +christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:49:28 2021 From: report at bugs.python.org (pukkandan) Date: Tue, 28 Sep 2021 16:49:28 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632847768.3.0.595635165951.issue45312@roundup.psfhosted.org> pukkandan <pukkandan at gmail.com> added the comment: Also, the pictures uploaded by the OP are misleading since they are from a version of the code that was specifically intended for debugging the issue. the problem can be better seen in this comment https://github.com/yt-dlp/yt-dlp/issues/1060#issuecomment-925843378 ```py C:\Windows\system32>py Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> len(ssl.enum_certificates('ROOT')) 68 >>> len(ssl.enum_certificates('CA')) 39 >>> ssl.create_default_context() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\Python39\lib\ssl.py", line 750, in create_default_context context.load_default_certs(purpose) File "C:\Program Files\Python39\lib\ssl.py", line 574, in load_default_certs self._load_windows_store_certs(storename, purpose) File "C:\Program Files\Python39\lib\ssl.py", line 566, in _load_windows_store_certs self.load_verify_locations(cadata=certs) ssl.SSLError: not enough data: cadata does not contain a certificate (_ssl.c:4159) >>> exit() ``` ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:54:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Sep 2021 16:54:09 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632848049.38.0.787802468792.issue45312@roundup.psfhosted.org> Change by Christian Heimes <lists at cheimes.de>: ---------- dependencies: +Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute superseder: -> Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 12:57:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Sep 2021 16:57:43 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632848263.99.0.327855750875.issue35665@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: We cannot fix the issue in Python. Please report the problem to OpenSSL and to your government. Either OpenSSL needs to relax its cert parser again or your government has to replace the broken certificates with correct certificates. ---------- assignee: christian.heimes -> resolution: -> third party _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 13:01:34 2021 From: report at bugs.python.org (Sebastian Berg) Date: Tue, 28 Sep 2021 17:01:34 +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: <1632848494.89.0.0703628309502.issue15870@roundup.psfhosted.org> Sebastian Berg <sebastian at sipsolutions.net> added the comment: Just to note, that there are two ? somewhat distinct ? issues here in my opinion: 1. `FromSpec` does not scan `bases` for the correct metaclass, which it could; this could even be considered a bug? 2. You cannot pass in a desired metaclass, which may require a new API function. My patch tries to address the first (the class creator has to take care that this is reasonable for the metaclass). I had hoped the `slot` mechanism can avoid the API discussion for the second one, but I guess not. On the discussion on `tp_type/meta` being incorrect usage: I am slightly surprised we actually care about static C-definitions? There is no reason that a `spec` should be declared static (aside that you have to move it into the function otherwise)? Everything is copied by `_FromSpec` after all. However, I suppose that would replace a safe-by-design API with a "best practice" to never define the spec/slots statically (a best practice that is probably not generally followed or even advertised currently, I guess). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Tue Sep 28 13:17:29 2021 From: report at bugs.python.org (=?utf-8?q?Dimitrije_Milovi=C4=87?=) Date: Tue, 28 Sep 2021 17:17:29 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632849449.34.0.636697127836.issue35665@roundup.psfhosted.org> Dimitrije Milovi? <dmilovic at sbb.rs> added the comment: Maybe better to continue in my newly opened tread https://bugs.python.org/issue45312 since I suppose I wasn't correctly specific (read I am a noob!), and pukkandan was more so. And my government fixing their certificates?! No chance i hell, they are like this for more of a decade! :smirk: ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 13:26:47 2021 From: report at bugs.python.org (bytebites) Date: Tue, 28 Sep 2021 17:26:47 +0000 Subject: [issue45313] Counter.elements() wrong error message Message-ID: <1632850007.37.0.962387512154.issue45313@roundup.psfhosted.org> New submission from bytebites <artopoi at gmail.com>: aCounter.elements(1) gives wrong error message: TypeError: Counter.elements() takes 1 positional argument but 2 were given ---------- messages: 402795 nosy: bytebites priority: normal severity: normal status: open title: Counter.elements() wrong error message type: behavior versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45313> _______________________________________ From report at bugs.python.org Tue Sep 28 13:53:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 28 Sep 2021 17:53:01 +0000 Subject: [issue45313] Counter.elements() wrong error message In-Reply-To: <1632850007.37.0.962387512154.issue45313@roundup.psfhosted.org> Message-ID: <1632851581.75.0.146464992487.issue45313@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: When reporting a bug, please give a full example that we can run. I assume aCounter is of type collections.Counter? Assuming so, the "1 positional argument" is "self". The second argument is the number 1, which is an error. So the error is correct. ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45313> _______________________________________ From report at bugs.python.org Tue Sep 28 13:56:52 2021 From: report at bugs.python.org (sping) Date: Tue, 28 Sep 2021 17:56:52 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632851812.42.0.6559118957.issue44394@roundup.psfhosted.org> sping <sebastian at pipping.org> added the comment: For the AIX link error that Pablo brought up, there is merged pull request https://github.com/libexpat/libexpat/pull/510 upstream. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Tue Sep 28 14:18:41 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 28 Sep 2021 18:18:41 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632853121.54.0.405323936119.issue45211@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 0c50b8c0b8274d54d6b71ed7bd21057d3642f138 by Eric Snow in branch 'main': bpo-45211: Remember the stdlib dir during startup. (gh-28586) https://github.com/python/cpython/commit/0c50b8c0b8274d54d6b71ed7bd21057d3642f138 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Tue Sep 28 14:20:08 2021 From: report at bugs.python.org (Frans) Date: Tue, 28 Sep 2021 18:20:08 +0000 Subject: [issue45314] Using target python while cross-building Message-ID: <1632853208.74.0.704194556945.issue45314@roundup.psfhosted.org> New submission from Frans <frans at fransdb.nl>: While trying to cross-compile Python-3.9.7, I came across the next error report: i586-cross-linux-gcc -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.9 -lcrypt -ldl -lpthread -lm -lm _PYTHON_PROJECT_BASE=/mnt/lfs/sources-base/Python-3.9.7 _PYTHON_HOST_PLATFORM=linux-i586 PYTHONPATH=./Lib _PYTHON_SYSCONFIGDATA_NAME=_sys configdata__linux_i386-linux-gnu python -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi /bin/sh: line 1: python: command not found generate-posix-vars failed make: *** [Makefile:619: pybuilddir.txt] Error 1 ----------------------------------------------------------- Strange, because Python configure/Makefile known that we are cross-compiling, but still try to execute a program with the target architecture, which is not the same as the architecture of the build machine. Of course it fails. ---------- components: Cross-Build messages: 402799 nosy: Alex.Willmer, fransdb priority: normal severity: normal status: open title: Using target python while cross-building versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45314> _______________________________________ From report at bugs.python.org Tue Sep 28 15:11:53 2021 From: report at bugs.python.org (Josh Haberman) Date: Tue, 28 Sep 2021 19:11:53 +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: <1632856313.7.0.644032533887.issue15870@roundup.psfhosted.org> Josh Haberman <haberman at google.com> added the comment: > Everything is copied by `_FromSpec` after all. One thing I noticed isn't copied is the string pointed to by tp_name: https://github.com/python/cpython/blob/0c50b8c0b8274d54d6b71ed7bd21057d3642f138/Objects/typeobject.c#L3427 This isn't an issue if tp_name is initialized from a string literal. But if tp_name is created dynamically, it could lead to a dangling pointer. If the general message is that "everything is copied by _FromSpec", it might make sense to copy the tp_name string too. > However, I suppose that would replace a safe-by-design API with a "best practice" to never define the spec/slots statically (a best practice that is probably not generally followed or even advertised currently, I guess). Yes that seems reasonable. I generally prefer static declarations, since they will end up in .data instead of .text and will avoid a copy to the stack at runtime. But these are very minor differences, especially for code that only runs once at startup, and a safe-by-default recommendation of always initializing PyType_* on the stack makes sense. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Tue Sep 28 15:42:15 2021 From: report at bugs.python.org (Pedjas) Date: Tue, 28 Sep 2021 19:42:15 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632858135.52.0.563413993369.issue45312@roundup.psfhosted.org> Pedjas <pedja at supurovic.net> added the comment: This hurts number of Python applications, even those published by large players. Basically, any attempt to read any certificate (for example to load any https url) fails due to this issue. For example: - QGIS fails to load map tiles on https links. Python issue with certificates. - AutoDesk Fusion 360 cannot be installed. On install, it requires online activation. Activation is done using https link. That does not work as Python fails on certificates. And that is a bug of Python. If you check code that causes this issue you will notice problem in code. 1. When some certificate is needed Python loops and tries to load each and every certificate installed instead of loading only certificate that is actually needed and skip others. 2. No exception handling. When trying to load "bad" certificate, Python just crashes instead of graciously handle (skip) issue. This problem occurs only with Python. No other application has such issue when handling certificates. MUPCA certificate works fine with every other application. This issue can be easily solved with one simple if and one simple exception handler: loop through certificate. Only if certificate is the one needed try to load it. Enclose loading code within exception, if it fails, report descriptive error, and skip further. Do not allow Python to crash. ---------- nosy: +Pedjas _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 15:42:33 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 28 Sep 2021 19:42:33 +0000 Subject: [issue41223] `object`-backed `memoryview`'s `tolist` errors In-Reply-To: <1594070396.59.0.711560769808.issue41223@roundup.psfhosted.org> Message-ID: <1632858153.98.0.860987251955.issue41223@roundup.psfhosted.org> Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment: Can you describe your use-case more? In particular, why use memoryview(a).tolist() instead of a.tolist()? Or some other numpy operations like a.flat or a.view()? Or even numpy.array(memoryview(a)) to recover a numpy array from a memoryview? If this were implemented and stdlib memoryview objects supported some kind of object 'O' format, would list(memoryview(b"\0\0\0\0\0\0\0\0").cast('O')) dereference a null pointer and segfault? ---------- components: +Interpreter Core nosy: +Dennis Sweeney type: -> enhancement versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41223> _______________________________________ From report at bugs.python.org Tue Sep 28 16:19:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 20:19:11 +0000 Subject: [issue35606] Add prod() function to the math module In-Reply-To: <1546025352.75.0.868813504694.issue35606@roundup.psfhosted.org> Message-ID: <1632860351.7.0.941468876189.issue35606@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset cd00fee8dd63bc3a1360280f55640409cb579a05 by Miss Islington (bot) in branch '3.9': bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595) (GH-28604) https://github.com/python/cpython/commit/cd00fee8dd63bc3a1360280f55640409cb579a05 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35606> _______________________________________ From report at bugs.python.org Tue Sep 28 16:22:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Sep 2021 20:22:48 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632860568.18.0.207823896438.issue45312@roundup.psfhosted.org> Change by Christian Heimes <lists at cheimes.de>: ---------- assignee: christian.heimes -> nosy: -christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 16:45:06 2021 From: report at bugs.python.org (Sebastian Berg) Date: Tue, 28 Sep 2021 20:45:06 +0000 Subject: [issue45315] `PyType_FromSpec` does not copy the name Message-ID: <1632861906.82.0.496996210358.issue45315@roundup.psfhosted.org> New submission from Sebastian Berg <sebastian at sipsolutions.net>: As noted in the issue: https://bugs.python.org/issue15870#msg402800 `PyType_FromSpec` assumes that the `name` passed is persistent for the program lifetime. This seems wrong/unnecessary: We are creating a heap-type, a heap-type's name is stored as a unicode object anyway! So, there is no reason to require the string be persistent, and a program that decides to build a custom name dynamically (for whatever reasons) would run into a crash when the name is accessed. The code: https://github.com/python/cpython/blob/0c50b8c0b8274d54d6b71ed7bd21057d3642f138/Objects/typeobject.c#L3427 Should be modified to point to to the `ht_name` (utf8) data instead. My guess is, the simplest solution is calling `type_set_name`, even if that runs some unnecessary checks. I understand that the FromSpec API is mostly designed to replace the static type definition rather than extend it, but it seems an unintentional/strange requirement. ---------- components: Interpreter Core messages: 402804 nosy: seberg priority: normal severity: normal status: open title: `PyType_FromSpec` does not copy the name type: crash versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45315> _______________________________________ From report at bugs.python.org Tue Sep 28 16:49:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Sep 2021 20:49:29 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632862169.75.0.43555392543.issue35665@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Could you please open an OpenSSL bug on the projects bug tracker https://github.com/openssl/openssl/ and explain the issue there? They might be able to implement a workaround for the broken certificates or advise you how to handle the invalid certificates. A workaround for Python would require a major rewrite of the Windows CA store integration. We don't have any capacity to work on that area. Even if we had capacity, a workaround would land in Python 3.11 earliest (October 2022). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 16:58:43 2021 From: report at bugs.python.org (Sebastian Berg) Date: Tue, 28 Sep 2021 20:58:43 +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: <1632862723.47.0.675400733757.issue15870@roundup.psfhosted.org> Sebastian Berg <sebastian at sipsolutions.net> added the comment: > But if tp_name is created dynamically, it could lead to a dangling pointer. I will guess this is probably just an oversight/bug since the main aim was to move towards heap-types, and opened an issue: https://bugs.python.org/issue45315 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue15870> _______________________________________ From report at bugs.python.org Tue Sep 28 17:12:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 21:12:57 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632863577.34.0.0777650314539.issue45307@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset ec4e2ec241acb3bf4e04a351c06c0b05a1e4b7d2 by Serhiy Storchaka in branch '3.10': [3.10] bpo-45307: Restore private C API function _PyImport_FindExtensionObject() (GH-28594) https://github.com/python/cpython/commit/ec4e2ec241acb3bf4e04a351c06c0b05a1e4b7d2 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Tue Sep 28 17:18:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 21:18:15 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632863895.38.0.313405767944.issue45269@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26981 pull_request: https://github.com/python/cpython/pull/28610 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 17:18:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 28 Sep 2021 21:18:11 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632863891.08.0.436897514294.issue45269@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26980 pull_request: https://github.com/python/cpython/pull/28609 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 17:18:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 21:18:08 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632863888.29.0.639361405685.issue45269@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset e046aabbe386fdf32bae6ffb7fae5ce479fd10c6 by Nikita Sobolev in branch 'main': bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) https://github.com/python/cpython/commit/e046aabbe386fdf32bae6ffb7fae5ce479fd10c6 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 17:47:58 2021 From: report at bugs.python.org (pukkandan) Date: Tue, 28 Sep 2021 21:47:58 +0000 Subject: [issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute In-Reply-To: <1546691085.37.0.66333867377.issue35665@roundup.psfhosted.org> Message-ID: <1632865678.91.0.414908853142.issue35665@roundup.psfhosted.org> pukkandan <pukkandan at gmail.com> added the comment: > A workaround for Python would require a major rewrite of the Windows CA store integration. We don't have any capacity to work on that area In theory, the issue can be worked around by simply loading each certificate separately. See https://github.com/yt-dlp/yt-dlp/pull/1118/commits/599ca418ac75ab1c0baf97f184f32ac48aa759ed ---------- nosy: +pukkandan _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35665> _______________________________________ From report at bugs.python.org Tue Sep 28 17:52:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 21:52:09 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632865929.04.0.370382780954.issue45269@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset c6b5ceae3475d7782ed88f4e54bdb2232a8eb088 by Miss Islington (bot) in branch '3.9': bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28610) https://github.com/python/cpython/commit/c6b5ceae3475d7782ed88f4e54bdb2232a8eb088 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 17:56:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 21:56:59 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632866219.92.0.295394519273.issue45269@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 1cb17be3e6a4d94629606a613acd07f78d50348b by Miss Islington (bot) in branch '3.10': bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28609) https://github.com/python/cpython/commit/1cb17be3e6a4d94629606a613acd07f78d50348b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 17:57:36 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 28 Sep 2021 21:57:36 +0000 Subject: [issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary In-Reply-To: <1632844162.48.0.609560888074.issue45312@roundup.psfhosted.org> Message-ID: <1632866256.26.0.532865560078.issue45312@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Looks like you should take the discussion to issue35665, and this one can stay closed. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45312> _______________________________________ From report at bugs.python.org Tue Sep 28 17:57:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 28 Sep 2021 21:57:29 +0000 Subject: [issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None" In-Reply-To: <1632389558.47.0.504504996183.issue45269@roundup.psfhosted.org> Message-ID: <1632866249.07.0.844176998434.issue45269@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Nikita! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45269> _______________________________________ From report at bugs.python.org Tue Sep 28 18:07:39 2021 From: report at bugs.python.org (Rob Moore) Date: Tue, 28 Sep 2021 22:07:39 +0000 Subject: [issue22239] asyncio: nested event loop In-Reply-To: <1408557830.66.0.604610139339.issue22239@psf.upfronthosting.co.za> Message-ID: <1632866859.18.0.487065329576.issue22239@roundup.psfhosted.org> Change by Rob Moore <rob.moore at gmail.com>: ---------- nosy: +rob.moore _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue22239> _______________________________________ From report at bugs.python.org Tue Sep 28 18:50:50 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 28 Sep 2021 22:50:50 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632869450.62.0.370477297909.issue45211@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: I have what I need for now (stdlib dir). There may be more info to preserve, but I'll leave it others to pursue that. ---------- assignee: eric.snow -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Tue Sep 28 19:12:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 28 Sep 2021 23:12:15 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632870735.57.0.394215029815.issue45211@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Shouldn't we just close the issue and the unused PR? Otherwise we'll just have yet another vague bpo issue that doesn't have anything particularly actionable -- "there's some code that could be refactored" is not enough of a reason to have a bpo issue open, unless it's either a recurring maintenance chore (doesn't seem to be the case here) or something that a beginner could easily scoop up (definitely not the case here, there are subtleties lurking around every corner). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Tue Sep 28 20:01:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 00:01:08 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1632873668.62.0.48681956199.issue42972@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- Removed message: https://bugs.python.org/msg394832 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42972> _______________________________________ From report at bugs.python.org Tue Sep 28 20:43:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 29 Sep 2021 00:43:03 +0000 Subject: [issue45313] Counter.elements() wrong error message In-Reply-To: <1632850007.37.0.962387512154.issue45313@roundup.psfhosted.org> Message-ID: <1632876183.06.0.235125356557.issue45313@roundup.psfhosted.org> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: The elements() method is working correctly: >>> from collections import Counter >>> aCounter = Counter('abracadabra') >>> list(aCounter.elements()) ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'r', 'r', 'c', 'd'] No arguments should be passed into elements, so this code is incorrect: aCounter.elements(1) You may have expected that the error message would say: TypeError: Counter.elements() takes 0 positional argument but 1 was given Instead, you observed the counts were one higher than you expected. This is due to how Python implements object oriented programming. The call: aCounter.elements(1) is effectively translated to: Counter.elements(aCounter, 1) which does in fact have two arguments. No one really likes the error message, but it has been deemed hard to fix and we just live with it. Note, this isn't specific to Counter. All pure python classes work this way: >>> class A: def m(self, x): pass >>> a = A() >>> a.m(10, 20) Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> a.m(10, 20) TypeError: m() takes 2 positional arguments but 3 were given ---------- nosy: +rhettinger resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45313> _______________________________________ From report at bugs.python.org Tue Sep 28 22:44:31 2021 From: report at bugs.python.org (Roland Crosby) Date: Wed, 29 Sep 2021 02:44:31 +0000 Subject: [issue40321] urllib.request does not support HTTP response status code 308 In-Reply-To: <1587232058.85.0.573866772263.issue40321@roundup.psfhosted.org> Message-ID: <1632883471.55.0.868118890173.issue40321@roundup.psfhosted.org> Roland Crosby <roland at rolandcrosby.com> added the comment: Hi, wanted to ping those watching this issue - there is a complete PR on GitHub, and all contributors have signed the CLA, but the bot hasn't updated the CLA status on the PR so it's still shown as blocking. Would appreciate if someone could manually fix the status and help get this merged. ---------- nosy: +rolandcrosby _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40321> _______________________________________ From report at bugs.python.org Tue Sep 28 22:56:18 2021 From: report at bugs.python.org (eleven xiang) Date: Wed, 29 Sep 2021 02:56:18 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632884178.9.0.985009138374.issue45308@roundup.psfhosted.org> eleven xiang <eleven.xiang at gmail.com> added the comment: I still have some questions about is, so re-open it. You mean it is the fork principle, but if change the script to use os.fork(), the child process will inherit from parent, and also free it. You could refer below change: from ctypes import cdll import multiprocessing as mp import os def foo(): handle = cdll.LoadLibrary("./test.so") handle.IncA() if __name__ == '__main__': foo() #p = mp.Process(target = foo, args = ()) #p.start() #print(p.pid) #p.join() pid = os.fork() if pid == 0: foo() else: os.waitpid(pid, 0) ---------- status: closed -> open _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 23:00:02 2021 From: report at bugs.python.org (eleven xiang) Date: Wed, 29 Sep 2021 03:00:02 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632884402.06.0.636042013403.issue45308@roundup.psfhosted.org> eleven xiang <eleven.xiang at gmail.com> added the comment: Below is the log: // parent process call and increase it from 10 to 11. process 71481, this = 0x7f4f271b5054, m_val = 10, A constructor called!!! process 71481, this = 0x7f4f271b5054, m_val = 11, INC called!!! // child process inherit with 11, and then also increase from 11 to 12 process 71482, this = 0x7f4f271b5054, m_val = 12, INC called!!! // child process free it. process 71482, this = 0x7f4f271b5054, m_val = 12, A destructor called!!! // parent process free it. process 71481, this = 0x7f4f271b5054, m_val = 11, A destructor called!!! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Tue Sep 28 23:01:01 2021 From: report at bugs.python.org (eleven xiang) Date: Wed, 29 Sep 2021 03:01:01 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632884461.49.0.087683863964.issue45308@roundup.psfhosted.org> Change by eleven xiang <eleven.xiang at gmail.com>: ---------- resolution: not a bug -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Wed Sep 29 01:36:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Sep 2021 05:36:00 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1632893760.07.0.96689720503.issue45296@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Unfortunately, I have discovered, the new wording is better but only correct for IDLE when Shell is the only window. On the file menu, I want to: A. Change 'Close' to 'Close Window', so it is clear that 'Close'/Alt-F4 only close the window and not IDLE. B. Also change 'Exit' to 'Exit IDLE' or maybe 'Quit IDLE', so it is clearer that this and Ctrl-Q close all windows and exit IDLE. Ctrl-Q is the default binding for 'close-all-windows', which users can configure. Also, add a little in the doc entry for these choices. Or maybe open a separate issue to add the option name for all menu entry hotkeys that can be rebound. I don't know how many that is. For a single window app, like the REPL, when not running in Command Prompt or the equivalent, closing the window and exiting the application are the same thing. The same is true when Shell is the only IDLE window. Closing Shell exits IDLE. After submitting the PR, I discovered that exit() and quit() only close Shell but do not exit IDLE if there are other windows. So the message should really be something like the following: To close Shell, enter 'exit()', 'quit()', or 'Alt-F4'. To exit IDLE, hit 'Ctrl-Q', hotkey for 'File >= Exit IDLE'. This requires replacing the __repr__ method. Someone who rebinds either hotkey option, which I expect is rare, will have to remember that they did so if that happen to enter either 'exit' or 'quit' without parens. -- The question of IDLE on Windows and <^Z Return> was discussed some years ago on an issue a vaguely remember but could not find. It was decided to either not add it or maybe to remove it, and key cross-platform ^D for closing Shell (and only Shell as it does nothing in Editor). I don't want to change that decision. ---------- nosy: -miss-islington resolution: fixed -> stage: resolved -> status: closed -> open title: IDLE: Change Ctrl-Z note in exit/quit repr on Windows -> IDLE: Better document close and exit. _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45296> _______________________________________ From report at bugs.python.org Wed Sep 29 03:16:49 2021 From: report at bugs.python.org (wombat) Date: Wed, 29 Sep 2021 07:16:49 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632899809.51.0.290118555849.issue1170@roundup.psfhosted.org> wombat <jewett.aij at gmail.com> added the comment: The error messages may have gone away, but the underlying unicode limitations I mentioned remain: Suppose you wanted to use shlex to build a parser for Chinese text. Would you have to set "wordchars" to a string containing every possible Chinese character? I myself wrote a parser for a crude language where words can contain any character except for whitespace and parenthesis. I needed a way to specify the characters which cannot belong to a word. (That's how I solved the problem. I modified shlex.py and added a "wordterminators" member. If "wordterminators" was left blank, then "wordchars" were used instead. This was a trivial change to "shlex.py" and it added a lot of functionality.) I would like to suggest making this change (or something similar) to the official version of "shlex.py". Would sending an email to "python-ideas at python.org" be a good place to make this proposal? ---------- nosy: +jewett-aij _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Wed Sep 29 03:26:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 07:26:20 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632900380.87.0.0772916321668.issue1170@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I would like to suggest making this change (or something similar) to the official version of "shlex.py". Would sending an email to "python-ideas at python.org" be a good place to make this proposal? Yes, python-ideas is a good place to start discussion such idea. This issue is closed, if you discuss it here, you will get a limited audience. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Wed Sep 29 03:27:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 07:27:56 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632900476.63.0.0227789819067.issue45308@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I still have some questions about is The Python bug tracker is not a forum for asking help how to use Python. Please stop reopening this issue. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Wed Sep 29 03:32:02 2021 From: report at bugs.python.org (Andrew Jewett) Date: Wed, 29 Sep 2021 07:32:02 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632900721.99.0.483817583426.issue1170@roundup.psfhosted.org> Andrew Jewett <jewett.aij at gmail.com> added the comment: After posting that, I noticed that the second example I listed in my previous post (a language where words contain any non-whitespace, non-parenthesis character) can now be implemented in the current version of shlex.py by setting ?"whitespace_true" and "punctuation". (Sorry, it's been a while since I looked at shlex.py, and it's had some usefl new features.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Wed Sep 29 03:33:59 2021 From: report at bugs.python.org (Andrew Jewett) Date: Wed, 29 Sep 2021 07:33:59 +0000 Subject: [issue1170] shlex have problems with parsing unicode In-Reply-To: <1190045833.27.0.172281845017.issue1170@psf.upfronthosting.co.za> Message-ID: <1632900839.41.0.151045307228.issue1170@roundup.psfhosted.org> Andrew Jewett <jewett.aij at gmail.com> added the comment: Alright. I'll think about it a little more and post my suggestion there, perhaps. Thanks Victor. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1170> _______________________________________ From report at bugs.python.org Wed Sep 29 03:35:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 07:35:23 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632900923.07.0.337098959902.issue36819@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > We could just forbid error handlers returning position not in the range (start , end] Yeah, that sounds like a reasonable solution. I don't see the point of returning a position outside this range. What would be the use case? For me, the only corner case is the "ignore" error handler which returns an empty string, but it returns a position in this range, no? > it can break some code, so it is better to do this only in a new release. Implementing custom error handlers is a rare use case, so it should only affect a minority of users. Moreover, IMO returning a position outside the valid range is a bug. It's common that security fixes change the behavior, like rejecting values which were previously acceptd, to prevent a Python crash. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 04:18:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 08:18:06 +0000 Subject: [issue45316] [C API] Functions not exported with PyAPI_FUNC() Message-ID: <1632903484.87.0.875373224779.issue45316@roundup.psfhosted.org> New submission from STINNER Victor <vstinner at python.org>: The Python C API contains multiple functions which are not exported with PyAPI_FUNC() and so are not usable. Public functions: --- void PyLineTable_InitAddressRange(const char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range); int PyLineTable_NextAddressRange(PyCodeAddressRange *range); int PyLineTable_PreviousAddressRange(PyCodeAddressRange *range); --- => Either make this functions private ("_Py" prefix) and move them to the internal C API, or add PyAPI_FUNC(). Private functions: --- int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds); int _PyCode_InitEndAddressRange(PyCodeObject* co, PyCodeAddressRange* bounds); PyDictKeysObject *_PyDict_NewKeysForClass(void); Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); uint32_t _PyDictKeys_GetVersionForCurrentState(PyDictKeysObject *dictkeys); Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key); PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); Py_ssize_t _PyDict_GetItemHint(PyDictObject *, PyObject *, Py_ssize_t, PyObject **); PyFrameObject* _PyFrame_New_NoTrack(struct _interpreter_frame *, int); int PySignal_SetWakeupFd(int fd); uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func); PyObject *_PyGen_yf(PyGenObject *); PyObject *_PyCoro_GetAwaitableIter(PyObject *o); PyObject *_PyAsyncGenValueWrapperNew(PyObject *); void _PyArg_Fini(void); int _Py_CheckPython3(void); --- => I suggest to move all these declarations to the internal C API. Moreover, Include/moduleobject.h contains: --- #ifdef Py_BUILD_CORE extern int _PyModule_IsExtension(PyObject *obj); #endif --- IMO this declaration should be moved to the internal C API. See also bpo-45201 about PySignal_SetWakeupFd(). ---------- components: C API messages: 402827 nosy: vstinner priority: normal severity: normal status: open title: [C API] Functions not exported with PyAPI_FUNC() versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45316> _______________________________________ From report at bugs.python.org Wed Sep 29 04:18:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 08:18:20 +0000 Subject: [issue45201] API function PySignal_SetWakeupFd is not exported and unusable In-Reply-To: <1631685795.19.0.380145753565.issue45201@roundup.psfhosted.org> Message-ID: <1632903500.54.0.440614712217.issue45201@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: See also bpo-45316: [C API] Functions not exported with PyAPI_FUNC(). ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45201> _______________________________________ From report at bugs.python.org Wed Sep 29 04:20:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 08:20:36 +0000 Subject: [issue40642] Cpython "pystate.h" subdirectory wrong In-Reply-To: <1589614857.55.0.73631693439.issue40642@roundup.psfhosted.org> Message-ID: <1632903636.67.0.580975519286.issue40642@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Having two header files with the same name in two directories which are part of the include directories is causing issues like this one :-( For the internal C API, I solve the issue by adding "pycore_" prefix to filenames. Maybe pystate.h should be renamed to cpython_pystate.h to avoid to fix the issue. It would include cpython_initconfig.h. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40642> _______________________________________ From report at bugs.python.org Wed Sep 29 04:23:45 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 29 Sep 2021 08:23:45 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632903825.77.0.226091931508.issue36819@roundup.psfhosted.org> Marc-Andre Lemburg <mal at egenix.com> added the comment: Looking at the specs in PEP 293 (https://www.python.org/dev/peps/pep-0293/), it is certainly possible for the error handler to return a newpos outside the range start - end, meaning in most cases: a value >= end. There's a good reason for this: the codec may not be able to correctly determine the end of the sequence and so the end value presented by the codec is not necessarily a valid start to continue encoding/decoding. The error handler can e.g. choose to skip more input characters by trying to find the next valid sequence. In the example script, the handler returns start, so the value is within the range. A limit would not solve the problem. It seems that the reallocation logic of the codecs is the main problem here. ---------- nosy: +lemburg _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 04:29:15 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 29 Sep 2021 08:29:15 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632904155.68.0.424050037521.issue36819@roundup.psfhosted.org> Change by Marc-Andre Lemburg <mal at egenix.com>: ---------- components: +Unicode nosy: +ezio.melotti _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 04:30:18 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 29 Sep 2021 08:30:18 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632904218.5.0.499400991719.issue36819@roundup.psfhosted.org> Change by Marc-Andre Lemburg <mal at egenix.com>: ---------- nosy: +doerwalter _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 04:36:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 08:36:54 +0000 Subject: [issue45316] [C API] Functions not exported with PyAPI_FUNC() In-Reply-To: <1632903484.87.0.875373224779.issue45316@roundup.psfhosted.org> Message-ID: <1632904614.05.0.487142205925.issue45316@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Agree. We should also review all recently added functions with PyAPI_FUNC(). If they are not intended to be public API, PyAPI_FUNC() should be removed and declarations moved. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45316> _______________________________________ From report at bugs.python.org Wed Sep 29 04:41:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 08:41:29 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632904889.64.0.334821237214.issue36819@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Restricting the returned position to be strictly larger than start would solve the problem with infinite loop and OOM. But this is a different issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 04:49:15 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 29 Sep 2021 08:49:15 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1632904889.64.0.334821237214.issue36819@roundup.psfhosted.org> Message-ID: <5703cf85-bf25-f149-e8e2-a876f0cd35ac@egenix.com> Marc-Andre Lemburg <mal at egenix.com> added the comment: On 29.09.2021 10:41, Serhiy Storchaka wrote: > > Restricting the returned position to be strictly larger than start would solve the problem with infinite loop and OOM. But this is a different issue. Yes, this would make sense, since having the codec process the same error location over and over again will not resolve the error, so it's clearly a bug in the error handler. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 05:25:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 09:25:52 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632907552.11.0.145945291967.issue39039@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset b6fe8572509b77d2002eaddf99d718e9b4835684 by Jack DeVries in branch 'main': bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766) https://github.com/python/cpython/commit/b6fe8572509b77d2002eaddf99d718e9b4835684 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 05:27:47 2021 From: report at bugs.python.org (eleven xiang) Date: Wed, 29 Sep 2021 09:27:47 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632907667.81.0.9285130012.issue45308@roundup.psfhosted.org> eleven xiang <eleven.xiang at gmail.com> added the comment: I am not asking for your help to use python. What I post here is to want to report a potential issue about multiprocessing module. This issue is the default start method fork will not free the object, but other methods works normally. When I change to use os.fork() APIs, it also could free object in child process. So I think it is a bug that multiprocessing fork method doesn't free object in child process. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Wed Sep 29 05:27:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:27:52 +0000 Subject: [issue40642] Cpython "pystate.h" subdirectory wrong In-Reply-To: <1589614857.55.0.73631693439.issue40642@roundup.psfhosted.org> Message-ID: <1632907672.29.0.764933435809.issue40642@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I mark this issue as a duplicate of bpo-39026. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40642> _______________________________________ From report at bugs.python.org Wed Sep 29 05:28:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:28:17 +0000 Subject: [issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure In-Reply-To: <1576078444.86.0.577960577024.issue39026@roundup.psfhosted.org> Message-ID: <1632907697.08.0.606192473783.issue39026@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I marked bpo-40642 as a duplicate of this issue. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39026> _______________________________________ From report at bugs.python.org Wed Sep 29 05:28:40 2021 From: report at bugs.python.org (Frans) Date: Wed, 29 Sep 2021 09:28:40 +0000 Subject: [issue45314] Using target python while cross-building In-Reply-To: <1632853208.74.0.704194556945.issue45314@roundup.psfhosted.org> Message-ID: <1632907720.17.0.855824459479.issue45314@roundup.psfhosted.org> Frans <frans at fransdb.nl> added the comment: Update: I came to realize that the command 'python' is without './', so it will search using PATH for python. Which - on my system Opensuse TW - does not exist, since there we have 'python3'. So, I made a softlink python->python3. Alas, I noticed that when I made the softlink python to python3 before starting configure, configure stops and complains that python3.9 is not found. Sure, TW has python3.8. But why check for previous/current versions, when making a new python binary? Ok, made the link after configure was done, which ended in: ---------------------------------- i586-cross-linux-gcc -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.9 -lcrypt -ldl -lpthread -lm -lm _PYTHON_PROJECT_BASE=/mnt/lfs/sources-base/Python-3.9.7 _PYTHON_HOST_PLATFORM=linux-i586 PYTHONPATH=./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_i386-linux-gnu python -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Could not import runpy module Traceback (most recent call last): File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/runpy.py", line 14, in <module> import importlib.machinery # importlib first so we can test #15386 via -m File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/importlib/__init__.py", line 57, in <module> import types File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/types.py", line 296, in <module> GenericAlias = type(list[int]) TypeError: 'type' object is not subscriptable generate-posix-vars failed make: *** [Makefile:619: pybuilddir.txt] Error 1 ------------------------------------- Complete native compile functions as expected. Maybe the reason that TW is still using 3.8? Shall try that next. ---------- type: -> compile error _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45314> _______________________________________ From report at bugs.python.org Wed Sep 29 05:29:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:29:12 +0000 Subject: [issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure In-Reply-To: <1576078444.86.0.577960577024.issue39026@roundup.psfhosted.org> Message-ID: <1632907752.85.0.301965780042.issue39026@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +26982 pull_request: https://github.com/python/cpython/pull/28612 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39026> _______________________________________ From report at bugs.python.org Wed Sep 29 05:30:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:30:51 +0000 Subject: [issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure In-Reply-To: <1576078444.86.0.577960577024.issue39026@roundup.psfhosted.org> Message-ID: <1632907851.75.0.690447204775.issue39026@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- title: pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure -> Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39026> _______________________________________ From report at bugs.python.org Wed Sep 29 05:31:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:31:53 +0000 Subject: [issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process In-Reply-To: <1632815823.67.0.320448602992.issue45308@roundup.psfhosted.org> Message-ID: <1632907913.31.0.737547340361.issue45308@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45308> _______________________________________ From report at bugs.python.org Wed Sep 29 05:35:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 09:35:13 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632908113.7.0.960257158887.issue39039@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26983 pull_request: https://github.com/python/cpython/pull/28613 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 05:36:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:36:53 +0000 Subject: [issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure In-Reply-To: <1576078444.86.0.577960577024.issue39026@roundup.psfhosted.org> Message-ID: <1632908213.82.0.0206934139207.issue39026@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I'm not sure why Include/cpython/ is part of the compiler include directories. I am not sure why Include/ is *not* part of the compiler include directory. Anyway, it's hard to control how people build Python and there are always legit use cases where you fall into such issue. That's why I suggest to fix any risk of confusion by renaming Include/cpython/ header files to add a "cpython_" prefix. For example, rename Include/cpython/pystate.h to Include/cpython/cpython_pystate.h. In the Include/internal/ directory, header files already have a prefix for the exact same reason. For example, there is a pycore_pystate.h file there. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39026> _______________________________________ From report at bugs.python.org Wed Sep 29 05:38:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 09:38:47 +0000 Subject: [issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure In-Reply-To: <1576078444.86.0.577960577024.issue39026@roundup.psfhosted.org> Message-ID: <1632908327.05.0.152961664998.issue39026@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I propose to only rename header files in Python 3.11. For Python 3.9 and 3.10, I suggest to modify Include/cpython/pystate.h by replacing: #include "cpython/initconfig.h" with: #include "initconfig.h" Like the PR 20181. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39026> _______________________________________ From report at bugs.python.org Wed Sep 29 05:39:19 2021 From: report at bugs.python.org (Frans) Date: Wed, 29 Sep 2021 09:39:19 +0000 Subject: [issue45314] Using target python while cross-building In-Reply-To: <1632853208.74.0.704194556945.issue45314@roundup.psfhosted.org> Message-ID: <1632908359.06.0.196899220597.issue45314@roundup.psfhosted.org> Frans <frans at fransdb.nl> added the comment: Update 2: Using the python-3.8.12 source....no problem! All functions well. So, 3.9 has some issues i guess ;) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45314> _______________________________________ From report at bugs.python.org Wed Sep 29 05:42:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 09:42:37 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632908557.45.0.354119726359.issue39039@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26984 pull_request: https://github.com/python/cpython/pull/28614 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 05:42:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 09:42:37 +0000 Subject: [issue39717] Fix exception causes in tarfile module In-Reply-To: <1582315232.59.0.621263718222.issue39717@roundup.psfhosted.org> Message-ID: <1632908557.57.0.861364200223.issue39717@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- nosy: +lukasz.langa nosy_count: 5.0 -> 6.0 pull_requests: +26985 pull_request: https://github.com/python/cpython/pull/28614 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39717> _______________________________________ From report at bugs.python.org Wed Sep 29 05:51:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 09:51:46 +0000 Subject: [issue45316] [C API] Functions not exported with PyAPI_FUNC() In-Reply-To: <1632903484.87.0.875373224779.issue45316@roundup.psfhosted.org> Message-ID: <1632909106.94.0.563915404708.issue45316@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- nosy: +Mark.Shannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45316> _______________________________________ From report at bugs.python.org Wed Sep 29 06:04:53 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 29 Sep 2021 10:04:53 +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: <1632909893.2.0.814323024925.issue36521@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: There is a clear disadvantage in moving the docstring from the function's code object to the enclosing code object: Docstrings are rarely looked at (relative to other operations on functions). Inner functions and comprehensions are created many times for the same code object, and their docstring are (almost) never inspected. Given that, the obvious enhancement is to create docstrings lazily to reduce the overhead of creating a function. This change would prevent that enhancement. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Wed Sep 29 06:08:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 10:08:23 +0000 Subject: [issue24391] Better repr for threading objects In-Reply-To: <1433586102.76.0.662503832113.issue24391@psf.upfronthosting.co.za> Message-ID: <1632910103.07.0.468544331583.issue24391@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset eed32df5b6b989caf125d829301546db58b529dd by Serhiy Storchaka in branch 'main': bpo-24391: Better reprs for threading objects. (GH-20534) https://github.com/python/cpython/commit/eed32df5b6b989caf125d829301546db58b529dd ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue24391> _______________________________________ From report at bugs.python.org Wed Sep 29 06:15:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 29 Sep 2021 10:15:35 +0000 Subject: [issue45316] [C API] Functions not exported with PyAPI_FUNC() In-Reply-To: <1632903484.87.0.875373224779.issue45316@roundup.psfhosted.org> Message-ID: <1632910535.73.0.190601911531.issue45316@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: Regarding these three functions: void PyLineTable_InitAddressRange(const char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range); int PyLineTable_NextAddressRange(PyCodeAddressRange *range); int PyLineTable_PreviousAddressRange(PyCodeAddressRange *range); They are explicitly not part of the C API (limited or otherwise): https://www.python.org/dev/peps/pep-0626/#out-of-process-debuggers-and-profilers ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45316> _______________________________________ From report at bugs.python.org Wed Sep 29 06:19:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 10:19:45 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632910785.43.0.933333445982.issue39039@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset d6b69f21d8ec4af47a9c79f3f50d20be3d0875fc by ?ukasz Langa in branch '3.10': [3.10] bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766) (GH-28613) https://github.com/python/cpython/commit/d6b69f21d8ec4af47a9c79f3f50d20be3d0875fc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 06:22:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 10:22:23 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632910943.25.0.0580746332038.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +26986 pull_request: https://github.com/python/cpython/pull/28615 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Wed Sep 29 06:55:08 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 10:55:08 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632912908.41.0.390594032053.issue45291@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26987 pull_request: https://github.com/python/cpython/pull/28616 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Wed Sep 29 06:55:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 10:55:26 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632912926.57.0.386752356341.issue45291@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset bc4cde40339dd372960f27401d8fdaa4dab0f469 by zhanpon in branch 'main': bpo-45291: Explicitly set --libdir=lib when configure OpenSSL (GH-28566) https://github.com/python/cpython/commit/bc4cde40339dd372960f27401d8fdaa4dab0f469 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Wed Sep 29 06:56:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 10:56:18 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632912978.47.0.491846999918.issue39039@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 7bff4d396f20451f20977be3ce23a879c6bc3e46 by ?ukasz Langa in branch '3.9': [3.9] bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766) (GH-28614) https://github.com/python/cpython/commit/7bff4d396f20451f20977be3ce23a879c6bc3e46 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 06:58:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 10:58:55 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1632913135.05.0.0374176482101.issue39039@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks for the fix, Jack! ? ? ? Since the change translated `zlib.error` to `tarfile.ReadError` which already has to be handled by user code, it's strictly decreasing the surface of necessary exception handling. So, treating this as a bug fix, I backported this to 3.9 and 3.10 as well. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue39039> _______________________________________ From report at bugs.python.org Wed Sep 29 07:05:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 29 Sep 2021 11:05:04 +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: <1632913504.7.0.631143239786.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: > There is a clear disadvantage in moving the docstring from the function's code object to the enclosing code object: > > Docstrings are rarely looked at (relative to other operations on functions). Inner functions and comprehensions are created many times for the same code object, and their docstring are (almost) never inspected. > > Given that, the obvious enhancement is to create docstrings lazily to reduce the overhead of creating a function. Docstrings are created during unmarshaling, not when creating function. And since comprehensions don't have docstring, GH-28138 has zero cost for comprehensions. Summary of disadvantages of each approaches: a) status quo (e.g. co_consts[0]) * We can not share co_consts tuples between functions using same constant but having different docstring. * Even when a function don't use docstring, it need to have co_consts[0]=None. b) CO_DOCSTRING + co_consts[0] (ref: https://github.com/iritkatriel/cpython/pull/30 ) * Additional flag for code object * We can not share co_consts tuples between functions using same constant but having different docstring. c) co_doc * Increases size of all code object, including non-functions (e.g. comprehensions, classes, modules) * One pointer per code object is cheap enough. * Need additional `r_object()` call during unmarshal. * Need to measure this overhead. d) MAKE_FUNCTION (GH-28138) * Additional flag for MAKE_FUNCTION * Push docstring to stack (e.g. one LOAD_CONST) only when the function has docstring. * LOAD_CONST is much cheaper than MAKE_FUNCTION * It is cheaper than annotations too. --- I think (d) is the best and (c) is the second best. Since no one support (d) for now, I will create a pull request for (c). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Wed Sep 29 07:40:33 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 29 Sep 2021 11:40:33 +0000 Subject: [issue45317] Document the removal the usage of the C stack in Python to Python calls Message-ID: <1632915633.23.0.578655230735.issue45317@roundup.psfhosted.org> New submission from Mark Shannon <mark at hotpy.org>: Assuming that issue 45256 is implemented, we will need to document it. I'm opening a separate issue, so this doesn't get lost in the midst of 45256. We need to: Document the changes to gdb. Possibly at https://wiki.python.org/moin/DebuggingWithGdb, or in the main docs. Add a "what's new" entry explaining what the impact of this change is. ---------- assignee: docs at python components: Documentation messages: 402850 nosy: Mark.Shannon, docs at python priority: release blocker severity: normal status: open title: Document the removal the usage of the C stack in Python to Python calls type: enhancement versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45317> _______________________________________ From report at bugs.python.org Wed Sep 29 07:41:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 11:41:30 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632915690.91.0.675560898867.issue45291@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 02fdd73a19464bafe9e5f98ecd17fd0a634c3f20 by Miss Islington (bot) in branch '3.10': bpo-45291: Explicitly set --libdir=lib when configure OpenSSL (GH-28566) (GH-28616) https://github.com/python/cpython/commit/02fdd73a19464bafe9e5f98ecd17fd0a634c3f20 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Wed Sep 29 07:41:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 29 Sep 2021 11:41:43 +0000 Subject: [issue45317] Document the removal the usage of the C stack in Python to Python calls In-Reply-To: <1632915633.23.0.578655230735.issue45317@roundup.psfhosted.org> Message-ID: <1632915703.77.0.042517321014.issue45317@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45317> _______________________________________ From report at bugs.python.org Wed Sep 29 07:42:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 11:42:01 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632915721.66.0.497458271463.issue45291@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Thanks, Yiyang Zhan! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved versions: +Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Wed Sep 29 07:42:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 29 Sep 2021 11:42:29 +0000 Subject: [issue45317] Document the removal the usage of the C stack in Python to Python calls In-Reply-To: <1632915633.23.0.578655230735.issue45317@roundup.psfhosted.org> Message-ID: <1632915749.89.0.671393361119.issue45317@roundup.psfhosted.org> Change by Mark Shannon <mark at hotpy.org>: ---------- assignee: docs at python -> Mark.Shannon _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45317> _______________________________________ From report at bugs.python.org Wed Sep 29 07:42:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 11:42:36 +0000 Subject: [issue45317] Document the removal the usage of the C stack in Python to Python calls In-Reply-To: <1632915633.23.0.578655230735.issue45317@roundup.psfhosted.org> Message-ID: <1632915756.28.0.263961752533.issue45317@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I will prepare a PR to also document the gdb helpers in the main docs. The wiki is insuficient. ---------- assignee: Mark.Shannon -> pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45317> _______________________________________ From report at bugs.python.org Wed Sep 29 07:47:24 2021 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Wed, 29 Sep 2021 11:47:24 +0000 Subject: [issue45318] Python 3.10: cyclomatic complexity of match-case syntax Message-ID: <1632916044.26.0.76023159461.issue45318@roundup.psfhosted.org> New submission from Bo?tjan Mejak <bostjan.xperia at gmail.com>: I am wondering about the cyclomatic complexity of using the new match-case syntax in Python 3.10, and later. What is the cyclomatic complexity difference (if any?) of a match-case code as opposed to code that uses the if-elif-else syntax? So my question is this: Are there any benefits in using the match-case syntax in terms of cyclomatic complexity? ---------- components: Interpreter Core messages: 402854 nosy: PythonEnthusiast priority: normal severity: normal status: open title: Python 3.10: cyclomatic complexity of match-case syntax type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45318> _______________________________________ From report at bugs.python.org Wed Sep 29 07:51:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 11:51:40 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses Message-ID: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> New submission from Christian Heimes <lists at cheimes.de>: While I was working on a patch to port wrapt to limited API and stable ABI, I noticed a possible regression in __annotations__ PyGetSetDef. It looks like C heap type subclasses no longer inherit the __annotations__ descriptor from a C heap type parent class. A gdb session confirmed that 3.10 no longer calls the WraptObjectProxy_set_annotations setter of the parent class while 3.9 does. I had to add { "__annotations__", (getter)WraptObjectProxy_get_annotations, (setter)WraptObjectProxy_set_annotations, 0}, to PyGetSetDef of the child class in order to fix the behavior. Python 3.9 and older work as expected. You can reproduce the behavior by disabling WRAPT_ANNOTATIONS_GETSET_WORKAROUND and run "tox -e py310-install-extensions". The PR is https://github.com/GrahamDumpleton/wrapt/pull/187. ---------- components: C API keywords: 3.10regression messages: 402855 nosy: christian.heimes, pablogsal priority: normal severity: normal stage: test needed status: open title: Possible regression in __annotations__ descr for heap type subclasses type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:12:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:12:37 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632917557.72.0.440262763279.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: If someone wants this issue to be solved in 3.10.0 it must be resolved ASAP. I am going to start freezing the release branch in one day or two to start testing the final candidate as much as possible so this issue has 24h at max to be merged into 3.10 and cherry picked into the release branch ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 08:13:30 2021 From: report at bugs.python.org (Graham Dumpleton) Date: Wed, 29 Sep 2021 12:13:30 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632917610.52.0.19229564286.issue45319@roundup.psfhosted.org> Change by Graham Dumpleton <Graham.Dumpleton at gmail.com>: ---------- nosy: +grahamd _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:11:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:11:01 +0000 Subject: [issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders In-Reply-To: <1632790875.67.0.121557732673.issue45307@roundup.psfhosted.org> Message-ID: <1632917461.52.0.377317976613.issue45307@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- priority: release blocker -> stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45307> _______________________________________ From report at bugs.python.org Wed Sep 29 08:15:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:15:55 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632917755.1.0.274936477418.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: This means that if anyone wants to pursue the 4% that is left the fix must be committed within 24 hours. ---------- priority: release blocker -> _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 08:15:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:15:18 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632917718.82.0.852874806054.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I'm landing PR 28475 for now as it improves the situation from 7% to 4% slowdown and is contained enough. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 08:20:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:20:28 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632918028.86.0.805571131003.issue45319@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Christian, could you bisect using your reproducer? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:22:30 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 29 Sep 2021 12:22:30 +0000 Subject: [issue45320] Remove deprecated inspect functions Message-ID: <1632918150.03.0.388631628057.issue45320@roundup.psfhosted.org> New submission from Hugo van Kemenade <hugovk+python at gmail.com>: inspect.getargspec was deprecated in docs since 3.0 (https://docs.python.org/3.0/library/inspect.html?highlight=getargspec#inspect.getargspec), raising a DeprecationWarning since 3.5 (bpo-20438, https://github.com/python/cpython/commit/3cfec2e2fcab9f39121cec362b78ac235093ca1c). inspect.formatargspec was deprecated in docs since 3.5 (https://docs.python.org/3.5/library/inspect.html?highlight=getargspec#inspect.formatargspec), raising a DeprecationWarning since 3.8 (bpo-33582, https://github.com/python/cpython/commit/46c5cd0f6e22bdfbdd3f0b18f1d01eda754e7e11). Undocumented inspect.Signature.from_function and inspect.Signature.from_builtin in docs and by raising a DeprecationWarning since 3.5 (bpo-20438, https://github.com/python/cpython/commit/3cfec2e2fcab9f39121cec362b78ac235093ca1c). These can be removed in Python 3.11. ---------- components: Library (Lib) messages: 402860 nosy: hugovk priority: normal severity: normal status: open title: Remove deprecated inspect functions versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45320> _______________________________________ From report at bugs.python.org Wed Sep 29 08:22:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:22:37 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632918157.59.0.440791014464.issue44394@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +26988 pull_request: https://github.com/python/cpython/pull/28617 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 08:25:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 12:25:39 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632918339.99.0.422663885483.issue45319@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +petr.viktorin, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:26:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:26:32 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632918392.02.0.0230952217235.issue45319@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: If you want a potential fix to be included in 3.10.0 it must be commited in the next 24/48 hours, otherwise it will need to wait for 3.10.1 ---------- nosy: -petr.viktorin, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:35:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 12:35:16 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632918916.97.0.787691974362.issue45319@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: I'm bisecting now. ---------- nosy: +petr.viktorin, vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:39:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 12:39:50 +0000 Subject: [issue44809] Changelog missing removal of StrEnum etc. In-Reply-To: <1627906937.39.0.327433164161.issue44809@roundup.psfhosted.org> Message-ID: <1632919190.76.0.622188714335.issue44809@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: The changelog says now: bpo-44559: [Enum] module reverted to 3.9; 3.10 changes pushed until 3.11 (https://docs.python.org/3.10/whatsnew/changelog.html#id9) Please, feel free to reopen if we are missing anything ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44809> _______________________________________ From report at bugs.python.org Wed Sep 29 08:42:14 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 29 Sep 2021 12:42:14 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632919334.09.0.0777409961723.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: > If someone wants this issue to be solved in 3.10.0 it must be resolved ASAP. neonene suggested that the tracing tests for pattern matching (added in 3.10b4/rc1) caused PGO to wrongly optimize the more uncommon tracing paths in ceval. I will verify their one-line fix to disable that test for PGO and report back within the next 48 hours. Related issue: https://bugs.python.org/issue44600 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 08:46:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 29 Sep 2021 12:46:43 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632919603.45.0.834518311817.issue45319@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:47:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 29 Sep 2021 12:47:04 +0000 Subject: [issue45316] [C API] Functions not exported with PyAPI_FUNC() In-Reply-To: <1632903484.87.0.875373224779.issue45316@roundup.psfhosted.org> Message-ID: <1632919624.11.0.511800607771.issue45316@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45316> _______________________________________ From report at bugs.python.org Wed Sep 29 08:47:50 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 29 Sep 2021 12:47:50 +0000 Subject: [issue45295] Speed up classmethod calls via LOAD_METHOD In-Reply-To: <1632673781.3.0.384078877149.issue45295@roundup.psfhosted.org> Message-ID: <1632919670.98.0.944445515041.issue45295@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45295> _______________________________________ From report at bugs.python.org Wed Sep 29 08:48:03 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 29 Sep 2021 12:48:03 +0000 Subject: [issue45320] Remove deprecated inspect functions In-Reply-To: <1632918150.03.0.388631628057.issue45320@roundup.psfhosted.org> Message-ID: <1632919683.86.0.131227172044.issue45320@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- keywords: +patch pull_requests: +26989 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28618 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45320> _______________________________________ From report at bugs.python.org Wed Sep 29 08:48:03 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 29 Sep 2021 12:48:03 +0000 Subject: [issue20438] inspect: Deprecate getfullargspec? In-Reply-To: <1391014813.06.0.594760406572.issue20438@psf.upfronthosting.co.za> Message-ID: <1632919683.93.0.256008460594.issue20438@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- nosy: +hugovk nosy_count: 11.0 -> 12.0 pull_requests: +26990 pull_request: https://github.com/python/cpython/pull/28618 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue20438> _______________________________________ From report at bugs.python.org Wed Sep 29 08:48:04 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 29 Sep 2021 12:48:04 +0000 Subject: [issue33582] formatargspec deprecated but does not emit DeprecationWarning. In-Reply-To: <1526770549.95.0.682650639539.issue33582@psf.upfronthosting.co.za> Message-ID: <1632919684.1.0.859379493642.issue33582@roundup.psfhosted.org> Change by Hugo van Kemenade <hugovk+python at gmail.com>: ---------- nosy: +hugovk nosy_count: 6.0 -> 7.0 pull_requests: +26991 pull_request: https://github.com/python/cpython/pull/28618 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue33582> _______________________________________ From report at bugs.python.org Wed Sep 29 08:49:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 12:49:05 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632919745.88.0.138718849164.issue45319@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: The culprit is commit 2f2b69855d6524e15d12c15ddc0adce629e7de84 for bpo-43901: Lazy-create an empty annotations dict in all unannotated user classes and modules (GH-25623). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 08:49:45 2021 From: report at bugs.python.org (sping) Date: Wed, 29 Sep 2021 12:49:45 +0000 Subject: [issue45321] Module xml.parsers.expat.errors misses error code constants of libexpat >=2.0 Message-ID: <1632919785.51.0.148853477081.issue45321@roundup.psfhosted.org> New submission from sping <sebastian at pipping.org>: (This has been mention at https://bugs.python.org/issue44394#msg395642 before, but issue 44394 has been closed as fixed despite that part being forgotten, hence the dedicated ticket...) Module `xml.parsers.expat.errors` and its docs need 6 more error code entries to be complete: /* Added in 2.0. */ 38 XML_ERROR_RESERVED_PREFIX_XML 39 XML_ERROR_RESERVED_PREFIX_XMLNS 40 XML_ERROR_RESERVED_NAMESPACE_URI /* Added in 2.2.1. */ 41 XML_ERROR_INVALID_ARGUMENT /* Added in 2.3.0. */ 42 XML_ERROR_NO_BUFFER /* Added in 2.4.0. */ 43 XML_ERROR_AMPLIFICATION_LIMIT_BREACH The source for this is: - https://github.com/libexpat/libexpat/blob/72d7ce953827fe08a56b8ea64092f208be6ffc5b/expat/lib/expat.h#L120-L129 The place where additions is needed is: - https://github.com/python/cpython/blob/f76889a88720b56c8174f26a20a8e676a460c7a6/Modules/pyexpat.c#L1748 - https://github.com/python/cpython/blame/f76889a88720b56c8174f26a20a8e676a460c7a6/Doc/library/pyexpat.rst#L867 Thanks in advance. ---------- components: Extension Modules messages: 402866 nosy: sping priority: normal severity: normal status: open title: Module xml.parsers.expat.errors misses error code constants of libexpat >=2.0 versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45321> _______________________________________ From report at bugs.python.org Wed Sep 29 09:12:45 2021 From: report at bugs.python.org (neonene) Date: Wed, 29 Sep 2021 13:12:45 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632921165.12.0.250297729771.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: I have another fix. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 09:17:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 13:17:09 +0000 Subject: [issue44896] AttributeError in ast.unparse In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1632921429.6.0.989095203821.issue44896@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Sorry, I think we shouldn't be changing `ast.py` this way. To reiterate my review comment from the PR: I think we should just let this go and instead advertise that if you put new synthetic nodes in a tree, you have to either: - provide `lineno` and `col_offset` yourself; or - use `fix_missing_locations()` to fill out the information for you. The problem with the logic that I commented on twice now (on the PR) is one reason for my opinion. Another is bigger though: Suppose user code is replacing nodes or just inserting new ones. This operation not only creates nodes without location attributes. It also in all likelihood *moves* locations of type comments and those aren't updated (for example, `_type_ignores[123]` should now really be `_type_ignores[125]` to still point at the same tokens). So user code shouldn't be naive when it comes to missing locations, and we definitely shouldn't paper over missing locations. ---------- nosy: +lukasz.langa resolution: -> rejected stage: patch review -> resolved _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44896> _______________________________________ From report at bugs.python.org Wed Sep 29 09:18:45 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 13:18:45 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632921525.95.0.9045063558.issue44394@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26992 pull_request: https://github.com/python/cpython/pull/28619 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:18:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 13:18:50 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632921530.63.0.322337831934.issue44394@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26993 pull_request: https://github.com/python/cpython/pull/28620 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:18:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 13:18:49 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632921529.07.0.289158332475.issue44394@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset 6c1154b9de29e1c9cd3d05f5289543e5cff73895 by Pablo Galindo Salgado in branch 'main': bpo-44394: Ensure libexpat is linked against libm (GH-28617) https://github.com/python/cpython/commit/6c1154b9de29e1c9cd3d05f5289543e5cff73895 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:19:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 13:19:33 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632921573.94.0.0262742463074.issue44394@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26994 pull_request: https://github.com/python/cpython/pull/28621 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:21:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 13:21:46 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632921706.17.0.143436335321.issue45319@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Ah, that is likely because type_getsets now gets directly an __annotations__ field. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 09:23:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 13:23:17 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632921797.06.0.555502195671.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > I have another fix. If you have another fix, please create a PR ASAN and get it reviewed and merged by a core dev in the next 24 hours, otherwise it will need to wait until 3.10.1 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 09:37:21 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 13:37:21 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1632922641.81.0.106853035284.issue45220@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26995 pull_request: https://github.com/python/cpython/pull/28622 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Wed Sep 29 09:48:03 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 13:48:03 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632923283.53.0.716053547391.issue44394@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset fafa213870193cf79557588ae8f9a4af570fd6e3 by Miss Islington (bot) in branch '3.9': bpo-44394: Ensure libexpat is linked against libm (GH-28617) https://github.com/python/cpython/commit/fafa213870193cf79557588ae8f9a4af570fd6e3 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:50:50 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 29 Sep 2021 13:50:50 +0000 Subject: [issue45318] Python 3.10: cyclomatic complexity of match-case syntax In-Reply-To: <1632916044.26.0.76023159461.issue45318@roundup.psfhosted.org> Message-ID: <1632923450.37.0.244751092389.issue45318@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: @Bo?tjan Mejak: I think this question belongs on a discussion forum rather than in the Python bug tracker - as I understand it, there's no bug reported here, and no change to the Python core proposed. I'll close here. You might consider taking this to discuss.python.org or another forum. ---------- nosy: +mark.dickinson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45318> _______________________________________ From report at bugs.python.org Wed Sep 29 09:53:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 13:53:49 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632923629.54.0.692076278223.issue44394@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +26996 pull_request: https://github.com/python/cpython/pull/28624 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 09:54:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 13:54:54 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1632923694.86.0.933395744221.issue45220@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 456d6d9fefac828c19fc1b562f6301f00965fe59 by Miss Islington (bot) in branch '3.8': bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) (GH-28622) https://github.com/python/cpython/commit/456d6d9fefac828c19fc1b562f6301f00965fe59 ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45220> _______________________________________ From report at bugs.python.org Wed Sep 29 10:13:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 14:13:46 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632924826.26.0.460897889504.issue44394@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 412ae8ab10734b72384c969181919cc4eb154406 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44394: Ensure libexpat is linked against libm (GH-28617) (GH-28621) https://github.com/python/cpython/commit/412ae8ab10734b72384c969181919cc4eb154406 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 10:14:04 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 14:14:04 +0000 Subject: [issue45211] Useful (expensive) information is discarded in getpath.c. In-Reply-To: <1631726385.76.0.396419410784.issue45211@roundup.psfhosted.org> Message-ID: <1632924844.34.0.548754088497.issue45211@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Yeah, I was thinking along those lines too but hesitated. :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45211> _______________________________________ From report at bugs.python.org Wed Sep 29 10:17:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 14:17:50 +0000 Subject: [issue45320] Remove deprecated inspect functions In-Reply-To: <1632918150.03.0.388631628057.issue45320@roundup.psfhosted.org> Message-ID: <1632925070.77.0.526864148368.issue45320@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: Have you done any checks how much external code is using the deprecated callables in the wild? I remember when the 3.5 deprecations started, a lot of libraries started emitting them because they stuck to `getargspec` which was Python 2 compatible. ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45320> _______________________________________ From report at bugs.python.org Wed Sep 29 10:25:54 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 29 Sep 2021 14:25:54 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632925554.65.0.841108234173.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: Sadly, I can't reproduce the speedups OP reported from disabling test_patma.TestTracing. It's not any faster than what we have with PR28475. (See attached pyperformance). I'm looking forward to their other fix :). Even if it comes in 3.10.1 that's still a huge win. I don't think everyone immediately upgrades when a new Python version arrives. IMO, we should note in What's New that only for Windows, 3.10.0 has a slight slowdown. Some use cases are slower (by >10%!), while some people won't feel a thing. (Then again, maybe this is offset by the LOAD_ATTR opcache in 3.10 and we get a net zero effect?). I'll submit a PR soon if the full fix misses 3.10.0. ---------- Added file: https://bugs.python.org/file50315/310rc2patched_vs_310rc2notrace.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 10:30:13 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 14:30:13 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632925813.37.0.198910867069.issue44394@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +26997 pull_request: https://github.com/python/cpython/pull/28627 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 10:31:32 2021 From: report at bugs.python.org (tongxiaoge) Date: Wed, 29 Sep 2021 14:31:32 +0000 Subject: [issue45322] [X86_64]test_concurrent_futures fail Message-ID: <1632925892.37.0.547180941783.issue45322@roundup.psfhosted.org> New submission from tongxiaoge <shixuantong at huawei.com>: The error log is as follows: [ 1848s] 0:19:24 load avg: 22.28 [411/412/1] test_concurrent_futures failed (19 min 19 sec) -- running: test_capi (19 min 22 sec) [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] [ 1848s] [ 1848s] Traceback: [ 1848s] Thread 0x00007fb68ffab700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 296 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Thread 0x00007fb6907ac700 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", line 415 in select [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", line 921 in wait [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", line 361 in _queue_management_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 885 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 942 in _bootstrap_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", line 905 in _bootstrap [ 1848s] [ 1848s] Current thread 0x00007fb69e8f7740 (most recent call first): [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 972 in _fail_on_deadlock [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1033 in test_crash [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in __call__ [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in run [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 1919 in _run_suite [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2041 in run_unittest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", line 1300 in test_main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 2173 in decorator [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 141 in _runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 656 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 636 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 713 in main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in _main [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in <module> [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 85 in _run_code [ 1848s] File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 193 in _run_module_as_main [ 1848s] ---------- components: Tests messages: 402879 nosy: christian.heimes, sxt1001, thatiparthy, vstinner priority: normal severity: normal status: open title: [X86_64]test_concurrent_futures fail versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45322> _______________________________________ From report at bugs.python.org Wed Sep 29 10:36:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 29 Sep 2021 14:36:03 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1632926163.45.0.911275814511.issue44394@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 90004fca1cc3c6e3c9b2c3faae5cb1b7d7711648 by Miss Islington (bot) in branch '3.8': [3.8] bpo-44394: Ensure libexpat is linked against libm (GH-28617) (GH-28620) https://github.com/python/cpython/commit/90004fca1cc3c6e3c9b2c3faae5cb1b7d7711648 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44394> _______________________________________ From report at bugs.python.org Wed Sep 29 10:41:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 14:41:39 +0000 Subject: [issue45322] [X86_64]test_concurrent_futures fail In-Reply-To: <1632925892.37.0.547180941783.issue45322@roundup.psfhosted.org> Message-ID: <1632926499.63.0.122568508678.issue45322@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Please stop adding Victor and me to the noisy list. That's rather rude. A core dev or triager will pick up the ticket eventually and notify the relevant experts. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45322> _______________________________________ From report at bugs.python.org Wed Sep 29 10:41:51 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 14:41:51 +0000 Subject: [issue45322] [X86_64]test_concurrent_futures fail In-Reply-To: <1632925892.37.0.547180941783.issue45322@roundup.psfhosted.org> Message-ID: <1632926511.88.0.0662069010404.issue45322@roundup.psfhosted.org> Change by Christian Heimes <lists at cheimes.de>: ---------- nosy: -christian.heimes _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45322> _______________________________________ From report at bugs.python.org Wed Sep 29 11:02:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 15:02:53 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1632927773.73.0.861291854218.issue45319@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Larry, could you please take a look? Your commit is causing a regression for C subclasses of heap types when the parent class has an "__annotations__" descriptor. The child class no longer uses the descriptor of the parent class. ---------- nosy: +larry _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45319> _______________________________________ From report at bugs.python.org Wed Sep 29 11:17:06 2021 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Wed, 29 Sep 2021 15:17:06 +0000 Subject: [issue36819] Crash during encoding using UTF-16/32 and custom error handler In-Reply-To: <1557168681.45.0.232948256283.issue36819@roundup.psfhosted.org> Message-ID: <1632928626.56.0.118548656394.issue36819@roundup.psfhosted.org> Walter D?rwald <walter at livinglogic.de> added the comment: The original specification (PEP 293) required that an error handler called for encoding *must* return a replacement string (not bytes). This returned string must then be encoded again. Only if this fails an exception must be raised. Returning bytes from the encoding error handler is an extension specified by PEP 383: > The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning Unicode strings which then get encoded again (also see the discussion below). So for 3. in Serhiy's problem list > 3. Incorrect exception can be raised if the error handler returns invalid string/bytes: a non-ASCII string or a bytes object consisting of not a whole number of units. I get: ? ~/ ? python Python 3.9.7 (default, Sep 3 2021, 12:37:55) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def bad(exc): ... return ('\udbc0', exc.start) ... >>> import codecs >>> codecs.register_error('bad', bad) >>> '\udbc0'.encode('utf-16', 'bad') Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeEncodeError I would have expected an exception message that basically looks like the one I'd get, if I had used the strict error handler. But otherwise returning a replacement that is unencodable is allowed and should raise an exception (which happens here, but with a missing exception message). (Returning something unencodable might make sense when the error handler is able to create replacement characters for some unencodable input, but not for other, but of course the error handler can always raise an exception directly). Returning invalid bytes is not an issue, they simply get written to the output. That's exactly the use case of PEP 383: The bytes couldn't be decoded in the specified encoding, so they are "invalid", but the surrogateescape error handler encodes them back to the same "invalid" bytes. So the error handler is allowed to output bytes that can't be decoded again with the same encoding. Returning a restart position outside the valid range of the length of the original string should raise an IndexError according to PEP 293: > If the callback does not raise an exception (either the one passed in, or a different one), it must return a tuple: `(replacement, newpos)` > `replacement` is a unicode object that the encoder will encode and emit instead of the unencodable `object[start:end]` part, `newpos` specifies > a new position within object, where (after encoding the replacement) the encoder will continue encoding. > Negative values for `newpos` are treated as being relative to end of object. If `newpos` is out of bounds the encoder will raise an `IndexError`. Of course we could retroactively reinterpret "out of bounds" as outside of `range(exc.start + 1, len(object))`, instead of outside `range(0, len(object))`. An error handler that never advances is broken anyway. But we can't detect "never". However it would probably be OK to reject pathological error handlers (i.e. those that don't advance (i.e. return at least `exc.start + 1` as the restart position)). But I'm not sure how that's different from an error handler that skips ahead much farther (i.e. returns something like `(exc.start+len(object))//2` or `max(exc.start+1, len(object)-10)`): The returned restart position leads to a certain expectation of how many bytes the encoder might have to output until everything is encoded and must adjust accordingly. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ From report at bugs.python.org Wed Sep 29 11:19:21 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Bourgault?=) Date: Wed, 29 Sep 2021 15:19:21 +0000 Subject: [issue45323] unexpected behavior on first match case _ Message-ID: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> New submission from Jo?l Bourgault <joel.bourgault at gmail.com>: While testing the `match...case` construction, I get the following behavior with Docker image Python 3.10 rc2-slim: ```python >>> match "robert": ... case x if len(x) > 10: ... print("long nom") ... case [0, y]: ... print("point ? x nul") ... case _: ... print("nothing interesting") ... nothing interesting >>> x # assigned, since matched, even if 'guarded-out' 'robert' >>> y # not assigned, because not matched Traceback (most recent call last): ... NameError: name 'y' is not defined >>> _ # normally not assigned, but we get a value?? ? 'robert' >>> del _ # but the variable does not even exist!?!?!? ??? Traceback (most recent call last): ... NameError: name '_' is not defined ``` Moreover, if we continue working in the same session by assigning `_` explicitly and playing with `case _`, we don't get any weird behavior anymore, and `_` behaves as a normal variable. So it seems to me that there is some weird corner case here, that should be adressed. ---------- messages: 402884 nosy: ojob priority: normal severity: normal status: open title: unexpected behavior on first match case _ type: behavior versions: Python 3.10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Wed Sep 29 11:34:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 15:34:43 +0000 Subject: [issue45322] [X86_64]test_concurrent_futures fail In-Reply-To: <1632925892.37.0.547180941783.issue45322@roundup.psfhosted.org> Message-ID: <1632929683.71.0.529574705063.issue45322@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 224 in _feed Python 3.7 no longer accept bugfixes: I close the issue. You can open a new issue if you can reproduce the issue on Python 3.9 or newer: https://devguide.python.org/#status-of-python-branches ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45322> _______________________________________ From report at bugs.python.org Wed Sep 29 11:38:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 15:38:07 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632929887.22.0.561770191701.issue45116@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > IMO, we should note in What's New that only for Windows, 3.10.0 has a slight slowdown. I disagree. This is a regression/bug and we don't advertise "known bugs" in the what's new, the same for any other bugfix that has been delayed until 3.10.1 > Some use cases are slower (by >10%!) Can you still reproduce this with PR 28475? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 11:48:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 15:48:28 +0000 Subject: [issue45249] Update doctect SyntaxErrors for location range In-Reply-To: <1632155458.61.0.570546761746.issue45249@roundup.psfhosted.org> Message-ID: <1632930508.69.0.663941023944.issue45249@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45249> _______________________________________ From report at bugs.python.org Wed Sep 29 11:56:10 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 29 Sep 2021 15:56:10 +0000 Subject: [issue45323] unexpected behavior on first match case _ In-Reply-To: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> Message-ID: <1632930970.09.0.203977779052.issue45323@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: If you are working in the interactive interpreter, you may be running into a conflict with the "magic" variable `_` which the interactive interpreter creates to hold the result of the last evaluated statement. So when you evaluate `x`, and that returns the string "robert", it also gets assigned to `_`. But you can't easily delete `_` because it lives in the builtin namespace, not the global namespace. This happens with anything, not just match statements: >>> x = "spam eggs" >>> x 'spam eggs' >>> _ 'spam eggs' >>> del _ # Not a global, can't delete it! Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name '_' is not defined So I think the weird behaviour with _ that you have stumbled over is a red herring. However, it does seem to me that *perhaps* the assignment to x shouldn't be occurring at all. So that may be a bug in the match statement? ---------- nosy: +steven.daprano _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Wed Sep 29 12:06:07 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 29 Sep 2021 16:06:07 +0000 Subject: [issue45323] unexpected behavior on first match case _ In-Reply-To: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> Message-ID: <1632931567.67.0.961548544271.issue45323@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: It is a bit tricky to find the documentation for the magic single underscore, but it is here: https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Wed Sep 29 12:16:37 2021 From: report at bugs.python.org (Hinrich Mahler) Date: Wed, 29 Sep 2021 16:16:37 +0000 Subject: [issue28206] signal.Signals not documented In-Reply-To: <1474297204.47.0.613989661481.issue28206@psf.upfronthosting.co.za> Message-ID: <1632932197.19.0.86278167643.issue28206@roundup.psfhosted.org> Change by Hinrich Mahler <hinrich.mahler at freenet.de>: ---------- keywords: +patch pull_requests: +26998 pull_request: https://github.com/python/cpython/pull/28628 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue28206> _______________________________________ From report at bugs.python.org Wed Sep 29 12:17:35 2021 From: report at bugs.python.org (Nico) Date: Wed, 29 Sep 2021 16:17:35 +0000 Subject: [issue36207] robotsparser deny all with some rules In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org> Message-ID: <1632932255.61.0.176889352915.issue36207@roundup.psfhosted.org> Nico <nico.bonefato at protonmail.com> added the comment: Had same problem today for my website (https://www.bonus4casino.fr/), following for a fix ---------- nosy: +nico.bonefato _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36207> _______________________________________ From report at bugs.python.org Wed Sep 29 12:40:42 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 29 Sep 2021 16:40:42 +0000 Subject: [issue45320] Remove deprecated inspect functions In-Reply-To: <1632918150.03.0.388631628057.issue45320@roundup.psfhosted.org> Message-ID: <1632933642.7.0.771040093942.issue45320@roundup.psfhosted.org> Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment: Slightly related, inspect.getfullargspec was also deprecated and later undeprecated. Please find the discussion post this message https://bugs.python.org/issue36751#msg341128 https://bugs.python.org/issue37010 ---------- nosy: +xtreak _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45320> _______________________________________ From report at bugs.python.org Wed Sep 29 12:30:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 16:30:13 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632933013.05.0.731695466729.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- keywords: +patch pull_requests: +26999 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28629 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 12:54:17 2021 From: report at bugs.python.org (neonene) Date: Wed, 29 Sep 2021 16:54:17 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632934457.92.0.10885174348.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: ---------- pull_requests: +27000 pull_request: https://github.com/python/cpython/pull/28630 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 12:54:47 2021 From: report at bugs.python.org (neonene) Date: Wed, 29 Sep 2021 16:54:47 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632934487.22.0.292360450189.issue45116@roundup.psfhosted.org> Change by neonene <nicesalmon at gmail.com>: ---------- pull_requests: +27001 pull_request: https://github.com/python/cpython/pull/28631 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 13:08:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 17:08:26 +0000 Subject: [issue36207] robotsparser deny all with some rules In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org> Message-ID: <1632935306.01.0.186897812428.issue36207@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- Removed message: https://bugs.python.org/msg402889 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36207> _______________________________________ From report at bugs.python.org Wed Sep 29 13:10:14 2021 From: report at bugs.python.org (neonene) Date: Wed, 29 Sep 2021 17:10:14 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632935414.3.0.0179216317737.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: I submitted 2 drafts in a hurry. Sorry for short explanations. I'll add more reports. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 13:22:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 29 Sep 2021 17:22:52 +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: <1632936172.11.0.24973132939.issue36521@roundup.psfhosted.org> Guido van Rossum <guido at python.org> added the comment: Not so fast. I'm not in favor of (c) co_doc either any more (for the reasons you state). I would go for (b), a CO_DOCSTRING flag plus co_consts[0]. I expect that co_consts sharing to be a very minor benefit, but you could easily count this with another small change to the count script. Moving the docstring to the surrounding object would not make much of a difference time- or speed-wise but I think it's the wrong thing to do since it dissociates the docstring from the function. Nested function creation could perhaps become a fraction faster if we didn't copy the docstring into the function object, leaving it func_doc NULL, making func.__doc__ a property that falls back on co_consts[0] if the flag is set. I expect lazy docstrings to be in the distant future (I experimented quite a bit with different marshal formats to support this and it wasn't easy at all) but I don't want to exclude it. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Wed Sep 29 13:33:59 2021 From: report at bugs.python.org (neonene) Date: Wed, 29 Sep 2021 17:33:59 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632936839.1.0.998719774639.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: @pablogsal I'm OK with more effective fixes in 3.10.1 and later. Thanks all, thanks kj and malin for many help. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 13:41:21 2021 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Wed, 29 Sep 2021 17:41:21 +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: <1632937281.97.0.165365723887.issue44751@roundup.psfhosted.org> Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA at GMail.Com> added the comment: Could you backport this fix to at least 3.9 and 3.10 branches? This is fix for regression which was previously backported to 2.7 and 3.6 branches. ---------- nosy: +Arfrever _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 13:49:33 2021 From: report at bugs.python.org (Sam James) Date: Wed, 29 Sep 2021 17:49:33 +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: <1632937773.93.0.837980679045.issue44751@roundup.psfhosted.org> Change by Sam James <sam at cmpct.info>: ---------- nosy: +thesamesam _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 13:57:04 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 17:57:04 +0000 Subject: [issue45324] The frozen importer should capture info in find_spec(). Message-ID: <1632938224.05.0.143549467143.issue45324@roundup.psfhosted.org> New submission from Eric Snow <ericsnowcurrently at gmail.com>: Currently FrozenImporter (in Lib/importlib/_bootstrap.py) does minimal work in its find_spec() method. It only checks whether or not the module is frozen. However, in doing so it has gathered all the info we need to load the module. We end up repeating that work in exec_module(). Rather than duplicating that effort, we should preserve the info in spec.loader_state. This has the added benefit of aligning more closely with the division between finder and loader. Once we get to the loader, there shouldn't be a need to check if the module is frozen nor otherwise interact with the internal frozen module state (i.e. PyImport_FrozenModules). ---------- assignee: eric.snow components: Interpreter Core messages: 402895 nosy: eric.snow priority: normal severity: normal stage: needs patch status: open title: The frozen importer should capture info in find_spec(). type: behavior versions: Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45324> _______________________________________ From report at bugs.python.org Wed Sep 29 13:58:40 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 17:58:40 +0000 Subject: [issue45324] The frozen importer should capture info in find_spec(). In-Reply-To: <1632938224.05.0.143549467143.issue45324@roundup.psfhosted.org> Message-ID: <1632938320.98.0.0927771763369.issue45324@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: Taking care of this will also be necessary (probably) as we work on adding __file__ to frozen stdlib modules. (See bpo-21736.) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45324> _______________________________________ From report at bugs.python.org Wed Sep 29 14:07:16 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 29 Sep 2021 18:07:16 +0000 Subject: [issue45324] The frozen importer should capture info in find_spec(). In-Reply-To: <1632938224.05.0.143549467143.issue45324@roundup.psfhosted.org> Message-ID: <1632938836.16.0.823305305835.issue45324@roundup.psfhosted.org> Change by Barry A. Warsaw <barry at python.org>: ---------- nosy: +barry _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45324> _______________________________________ From report at bugs.python.org Wed Sep 29 14:08:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 18:08:04 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue Message-ID: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> New submission from Pablo Galindo Salgado <pablogsal at gmail.com>: We should allow Py_BuildValue to take a "p" argument that takes a C int and produces a Python Bool so it would be symmetric with the p format code for PyArg_Parse that takes a Python object and returns a C int containing PyObject_IsTrue(obj). ---------- messages: 402897 nosy: pablogsal priority: normal severity: normal status: open title: Allow "p" in Py_BuildValue _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 14:18:01 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 18:18:01 +0000 Subject: [issue45324] The frozen importer should capture info in find_spec(). In-Reply-To: <1632938224.05.0.143549467143.issue45324@roundup.psfhosted.org> Message-ID: <1632939481.53.0.710294343463.issue45324@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- keywords: +patch pull_requests: +27002 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28633 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45324> _______________________________________ From report at bugs.python.org Wed Sep 29 14:22:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 18:22:35 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632939755.35.0.80484025826.issue45325@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- keywords: +patch pull_requests: +27003 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28634 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 14:33:10 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 18:33:10 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632940390.58.0.870452071019.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +27004 pull_request: https://github.com/python/cpython/pull/28635 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 29 14:55:39 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 29 Sep 2021 18:55:39 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1632941739.67.0.363133698743.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 45ca1c04139300ec0289a32f78c7ac922a4f7b07 by Eric Snow in branch 'main': bpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635) https://github.com/python/cpython/commit/45ca1c04139300ec0289a32f78c7ac922a4f7b07 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Wed Sep 29 15:48:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 19:48:54 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632944934.76.0.0308250067474.issue45325@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: There was no much need of this feature. In rare cases when we needed to build a bool in Py_BuildValue (I have found only 2 cases in the stdlib, and one of them is added by me) we use the following idiom: Py_BuildValue("...O...", ..., expr ? Py_True : Py_False, ...) You can have a temptation to write it as Py_BuildValue("...p...", ..., expr, ...) but there is a catch -- the arguments should be a C int. If it is not, you can break a stack. Explicit cast to int ("(int)expr") is not always correct, so you will need to write "expr ? 1 : 0" which is not much better than "expr ? Py_True : Py_False". ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:20:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 20:20:56 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632946856.3.0.298043712471.issue45325@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: I would be interested to see how the "p" format could be used in existing code. I found a few places would benefit of it. Either create a new draft PR, or put it in the same PR 28634. Modules/_itertoolsmodule.c: return Py_BuildValue("O(N)(OO)", Py_TYPE(lz), it, lz->saved, Py_True); return Py_BuildValue("O(O)(OO)", Py_TYPE(lz), lz->it, lz->saved, lz->firstpass ? Py_True : Py_False); Modules/_ssl.c: ok = RAND_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len); if (ok == 0 || ok == 1) return Py_BuildValue("NO", bytes, ok == 1 ? Py_True : Py_False); return Py_BuildValue( "{sksssssssisi" "sOssssssss" "}", "id", cipher_id, "name", cipher_name, "protocol", cipher_protocol, "description", buf, "strength_bits", strength_bits, "alg_bits", alg_bits ,"aead", aead ? Py_True : Py_False, "symmetric", skcipher, "digest", digest, "kea", kx, "auth", auth ); Modules/main.c: runargs = PyTuple_Pack(2, module, set_argv0 ? Py_True : Py_False); Objects/fileobject.c: stream = _PyObject_CallMethodId(io, &PyId_open, "isisssO", fd, mode, buffering, encoding, errors, newline, closefd ? Py_True : Py_False); ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:23:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:23:57 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632947037.27.0.449101291128.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Either create a new draft PR, or put it in the same PR 28634. I prefer to reach an agreement first here before I add more things to the PR ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:24:35 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 20:24:35 +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: <1632947075.67.0.0933589992192.issue44751@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +27005 pull_request: https://github.com/python/cpython/pull/28636 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 16:24:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 20:24:50 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632947090.49.0.232429161497.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +27006 pull_request: https://github.com/python/cpython/pull/28637 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Wed Sep 29 16:25:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:25:22 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632947122.28.0.303865848271.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > There was no much need of this feature. In rare cases when we needed to build a bool in Py_BuildValue (I have found only 2 cases in the stdlib, and one of them is added by me) we use the following idiom: Is true that this is not very common, but I have find this in several occasions writing extension code and given the small impact and maintenance cost and the symmetry with PyArg_Parse I figured that could be useful ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:25:08 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 20:25:08 +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: <1632947108.24.0.527295385218.issue44751@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +27007 pull_request: https://github.com/python/cpython/pull/28638 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 16:28:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 20:28:04 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632947284.17.0.428939742609.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset d441437ee71ae174c008c23308b749b91020ba77 by Serhiy Storchaka in branch 'main': bpo-45229: Make datetime tests discoverable (GH-28615) https://github.com/python/cpython/commit/d441437ee71ae174c008c23308b749b91020ba77 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Wed Sep 29 16:28:05 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 20:28:05 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632947285.7.0.516435451206.issue45229@roundup.psfhosted.org> Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>: ---------- pull_requests: +27008 pull_request: https://github.com/python/cpython/pull/28639 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Wed Sep 29 16:33:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 20:33:40 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632947620.82.0.905349859504.issue45325@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > but there is a catch -- the arguments should be a C int. If it is not, you can break a stack. I never understood how "..." arguments work under the hood. What happens if you pass a double, it is stored as a double on the C stack, and then Py_BuildValue() will read junk data? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:41:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 20:41:07 +0000 Subject: [issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application In-Reply-To: <1632299546.72.0.498896278525.issue45262@roundup.psfhosted.org> Message-ID: <1632948067.57.0.478817611651.issue45262@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > "Assertion failed: Py_IS_TYPE(rl, &PyRunningLoopHolder_Type), file D:\a\1\s\Modules_asynciomodule.c, line 261" The _asyncio extension uses static types and doesn't implement the multiphase initialization API. It doesn't work well with your "deinitialize/initialize the interpreter" use case. The _asyncio extension should use heap types and the multiphase init API. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45262> _______________________________________ From report at bugs.python.org Wed Sep 29 16:43:05 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 29 Sep 2021 20:43:05 +0000 Subject: [issue45320] Remove deprecated inspect functions In-Reply-To: <1632918150.03.0.388631628057.issue45320@roundup.psfhosted.org> Message-ID: <1632948185.96.0.0886445305458.issue45320@roundup.psfhosted.org> Hugo van Kemenade <hugovk+python at gmail.com> added the comment: Of the 188 repos I managed to clone of 200 top PyPI packages, looks like these 9 are still calling them: botocore client_python cython google-api-python-client grpc ipython pycodestyle pyrsistent wrapt Details at https://github.com/python/cpython/pull/28618#issuecomment-930524790 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45320> _______________________________________ From report at bugs.python.org Wed Sep 29 16:44:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 20:44:13 +0000 Subject: [issue25653] ctypes+callbacks+fork+selinux = crash In-Reply-To: <1447826584.36.0.973987165664.issue25653@psf.upfronthosting.co.za> Message-ID: <1632948253.59.0.898118110472.issue25653@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: Another recent crash involving libffi, closure, fork and SELinux: https://bugzilla.redhat.com/show_bug.cgi?id=1977410 This bug comes from libffi, not from Python (but it can be easily reproducing using ctypes which uses libffi). ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue25653> _______________________________________ From report at bugs.python.org Wed Sep 29 16:48:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:48:05 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632948485.25.0.642906368836.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: The va_start macro just sets up a pointer to the first function parameter, e.g.:- void func (int a, ...) { // va_start char *p = (char *) &a + sizeof a; } which makes p point to the second parameter. The va_arg macro does this:- void func (int a, ...) { // va_start char *p = (char *) &a + sizeof a; // va_arg int i1 = *((int *)p); p += sizeof (int); // va_arg int i2 = *((int *)p); p += sizeof (int); // va_arg long i2 = *((long *)p); p += sizeof (long); } ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 16:47:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Sep 2021 20:47: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: <1632948430.49.0.479414835448.issue42813@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: I believe that this should be closed as not-a-bug. Ending a file with <newline><indent><eof> *is* a syntax error. Previous, it was assumed that the problem, in retrospect, was the 'extra' indent. But one can equally say that the problem is the 'missing' statement after the otherwise legitimate indent. Even a newline is enough to make the code legal. The current message no longer guess whether there is too much or too little code. ---------- nosy: +pablogsal, terry.reedy _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42813> _______________________________________ From report at bugs.python.org Wed Sep 29 16:48:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 29 Sep 2021 20:48:04 +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: <1632948484.42.0.41724566831.issue44751@roundup.psfhosted.org> miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment: New changeset 9626ac8b7421aa5fc04a30359521d24f40105141 by Miss Islington (bot) in branch '3.9': closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) https://github.com/python/cpython/commit/9626ac8b7421aa5fc04a30359521d24f40105141 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 16:49:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:49:47 +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: <1632948587.82.0.282509041534.issue42813@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I concur ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42813> _______________________________________ From report at bugs.python.org Wed Sep 29 16:50:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:50:04 +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: <1632948604.84.0.687215687887.issue42813@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- Removed message: https://bugs.python.org/msg402911 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42813> _______________________________________ From report at bugs.python.org Wed Sep 29 16:50:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 20:50:26 +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: <1632948626.9.0.883185909057.issue42813@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: I concur with Terry, ending a file with <newline><indent><eof> *is* a syntax error. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42813> _______________________________________ From report at bugs.python.org Wed Sep 29 17:08:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Sep 2021 21:08:35 +0000 Subject: [issue37080] Cannot compile Python3.7.3 on Alt-F (ARM) In-Reply-To: <1559057852.62.0.663214501823.issue37080@roundup.psfhosted.org> Message-ID: <1632949715.84.0.893082906846.issue37080@roundup.psfhosted.org> Terry J. Reedy <tjreedy at udel.edu> added the comment: Jarl, I don't know if we support compiling on such devices, even though the OS is linux. I suggest that you ask on python-list, where someone might have the experience to help you. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37080> _______________________________________ From report at bugs.python.org Wed Sep 29 17:14:09 2021 From: report at bugs.python.org (Dmitry Marakasov) Date: Wed, 29 Sep 2021 21:14:09 +0000 Subject: [issue45326] Unexpected TypeError with type alias+issubclass+ABC Message-ID: <1632950049.79.0.711339156878.issue45326@roundup.psfhosted.org> New submission from Dmitry Marakasov <amdmi3 at amdmi3.ru>: Here's a curious problem. issubclass() check of a type against an ABC-derived class raises TypeError claiming that type is not a class, however inspect.isclass() says it's a class, and issubclass() check against a simple class works fine: ``` from abc import ABC class C1: pass issubclass(dict[str, str], C1) # False class C2(ABC): pass issubclass(dict[str, str], C2) # TypeError: issubclass() arg 1 must be a class ``` I've ran into this problem while using `inspect` module to look for subclasses of a specific ABC in a module which may also contain type aliases, and after converting a type alias from `Dict[str, str]` to modern `dict[str, str]` I've got an unexpected crash in this code: if inspect.isclass(member) and issubclass(member, superclass): Not sure which is the culprit, ABC or how dict[]-style type aliases are implemented. ---------- components: Library (Lib) messages: 402914 nosy: AMDmi3 priority: normal severity: normal status: open title: Unexpected TypeError with type alias+issubclass+ABC versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45326> _______________________________________ From report at bugs.python.org Wed Sep 29 17:46:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Sep 2021 21:46:30 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632951990.09.0.0351680563867.issue45325@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: > What happens if you pass a double, it is stored as a double on the C stack, and then Py_BuildValue() will read junk data? AFAIK, it is complicated. On old computer primitive compilers just pushed arguments one by one on the stack (in platform-depending order). When you push 64-bytes double and read 32-bit int, you get a junk not only for this read, but for reads of all following or preceding arguments. Modern compilers on modern platforms can use registers to pass variable arguments. I do not know details, but doubles and ints are passed using different registers, so the difference can be even larger. My concern is that such feature can provoke bugs. The risk can exceed the minor benefit. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 17:50:24 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 29 Sep 2021 21:50:24 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632952224.98.0.868842787471.issue45291@roundup.psfhosted.org> Christian Heimes <lists at cheimes.de> added the comment: Thanks! The documentation was not up to date for OpenSSL 3.0.0. The default for --libdir was changed late in the development cycle. ---------- nosy: +christian.heimes status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Wed Sep 29 17:58:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 21:58:01 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632952681.61.0.0422701707346.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: You can see how is implemented on am64 for example here: https://blog.nelhage.com/2010/10/amd64-and-va_arg/ ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 17:58:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 29 Sep 2021 21:58:50 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632952730.83.0.0717318478525.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > My concern is that such feature can provoke bugs. The risk can exceed the minor benefit. But isn't that risk the same for other formatting parameters? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 19:00:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 23:00:42 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1632956442.26.0.189144527724.issue43753@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27009 pull_request: https://github.com/python/cpython/pull/28641 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43753> _______________________________________ From report at bugs.python.org Wed Sep 29 19:02:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 23:02:15 +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: <1632956535.58.0.469839961141.issue44751@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 80285ecc8deaa2b0e7351bf4be863d1a0ad3c188 by Miss Islington (bot) in branch '3.10': closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) (GH-28636) https://github.com/python/cpython/commit/80285ecc8deaa2b0e7351bf4be863d1a0ad3c188 ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 19:04:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 23:04:11 +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: <1632956651.11.0.283418586054.issue44751@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Could you backport this fix to at least 3.9 and 3.10 branches? Done. > This is fix for regression which was previously backported to 2.7 and 3.6 branches. I'm not sure what you mean. In Python 2.7 and Python 3.6, <crypt.h> was already included by Include/Python.h: #ifdef HAVE_CRYPT_H #include <crypt.h> #endif ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Wed Sep 29 19:25:08 2021 From: report at bugs.python.org (Matt Wozniski) Date: Wed, 29 Sep 2021 23:25:08 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632957908.94.0.350786681365.issue45325@roundup.psfhosted.org> Matt Wozniski <godlygeek at gmail.com> added the comment: > but there is a catch -- the arguments should be a C int Or a type that promotes to int. If you pass a C short or char, or a C++ bool, it is implicitly promoted to int. > so you will need to write "expr ? 1 : 0" Or alternatively "!!expr" > which is not much better than "expr ? Py_True : Py_False" I had to write that recently after reading through the Py_BuildValue docs twice to make sure I wasn't missing a format code I could use. It's a strange omission, especially because 'p' exists for PyArg_Parse. I'd very much like to see this change. ---------- nosy: +godlygeek _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 19:28:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Sep 2021 23:28:18 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1632958098.2.0.25842468718.issue43753@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 8d3e7eff0936926554db6162c992af5829dc8160 by Victor Stinner in branch 'main': bpo-43753: _operator.is_() uses Py_Is() (GH-28641) https://github.com/python/cpython/commit/8d3e7eff0936926554db6162c992af5829dc8160 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue43753> _______________________________________ From report at bugs.python.org Wed Sep 29 19:37:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Sep 2021 23:37:57 +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: <1632958677.81.0.379873082108.issue42813@roundup.psfhosted.org> Change by Terry J. Reedy <tjreedy at udel.edu>: ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue42813> _______________________________________ From report at bugs.python.org Wed Sep 29 19:38:20 2021 From: report at bugs.python.org (Matt Wozniski) Date: Wed, 29 Sep 2021 23:38:20 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632958700.89.0.0738133197056.issue45325@roundup.psfhosted.org> Matt Wozniski <godlygeek at gmail.com> added the comment: I spotted three other uses in the stdlib: Modules/_io/_iomodule.c raw = PyObject_CallFunction(RawIO_class, "OsOO", path_or_fd, rawmode, closefd ? Py_True : Py_False, opener); wrapper = PyObject_CallFunction((PyObject *)&PyTextIOWrapper_Type, "OsssO", buffer, encoding, errors, newline, line_buffering ? Py_True : Py_False); Modules/_sqlite/connection.c if (PySys_Audit("sqlite3.enable_load_extension", "OO", self, onoff ? Py_True : Py_False) < 0) { return NULL; } ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 19:49:32 2021 From: report at bugs.python.org (Matt Wozniski) Date: Wed, 29 Sep 2021 23:49:32 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632959372.95.0.860053068997.issue45325@roundup.psfhosted.org> Matt Wozniski <godlygeek at gmail.com> added the comment: The leftmost argument of the ternary is an int for every example that Victor and I found in the stdlib, so no casting would be required in any of these cases. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Wed Sep 29 20:11:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 00:11:49 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632960709.55.0.309745759.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 09796f2f142fdb1214f34a3ca917959ecb32a88b by Victor Stinner in branch 'main': bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629) https://github.com/python/cpython/commit/09796f2f142fdb1214f34a3ca917959ecb32a88b ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 20:30:19 2021 From: report at bugs.python.org (jakirkham) Date: Thu, 30 Sep 2021 00:30:19 +0000 Subject: [issue41226] Supporting `strides` in `memoryview.cast` In-Reply-To: <1594087287.71.0.356108904694.issue41226@roundup.psfhosted.org> Message-ID: <1632961819.99.0.362542817375.issue41226@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- components: +Library (Lib) type: -> enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41226> _______________________________________ From report at bugs.python.org Wed Sep 29 20:30:58 2021 From: report at bugs.python.org (jakirkham) Date: Thu, 30 Sep 2021 00:30:58 +0000 Subject: [issue40718] Support out-of-band pickling for builtin types In-Reply-To: <1590089154.09.0.42583865069.issue40718@roundup.psfhosted.org> Message-ID: <1632961858.51.0.868201736681.issue40718@roundup.psfhosted.org> Change by jakirkham <jakirkham at gmail.com>: ---------- components: +Library (Lib) _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40718> _______________________________________ From report at bugs.python.org Wed Sep 29 20:36:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 00:36:28 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632962188.62.0.619227370325.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27010 pull_request: https://github.com/python/cpython/pull/28642 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 20:55:33 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 30 Sep 2021 00:55:33 +0000 Subject: [issue45326] Unexpected TypeError with type alias+issubclass+ABC In-Reply-To: <1632950049.79.0.711339156878.issue45326@roundup.psfhosted.org> Message-ID: <1632963333.98.0.753889765118.issue45326@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45326> _______________________________________ From report at bugs.python.org Wed Sep 29 21:07:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:07:19 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632964039.23.0.352858920387.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset d62d925823b005c33b432e527562b573a3a89635 by Victor Stinner in branch 'main': bpo-41710: Add pytime_add() and pytime_mul() (GH-28642) https://github.com/python/cpython/commit/d62d925823b005c33b432e527562b573a3a89635 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 21:08:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 30 Sep 2021 01:08:56 +0000 Subject: [issue45326] Unexpected TypeError with type alias+issubclass+ABC In-Reply-To: <1632950049.79.0.711339156878.issue45326@roundup.psfhosted.org> Message-ID: <1632964136.09.0.920368386197.issue45326@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45326> _______________________________________ From report at bugs.python.org Wed Sep 29 21:09:05 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 30 Sep 2021 01:09:05 +0000 Subject: [issue45326] Unexpected TypeError with type alias+issubclass+ABC In-Reply-To: <1632950049.79.0.711339156878.issue45326@roundup.psfhosted.org> Message-ID: <1632964145.8.0.342026227407.issue45326@roundup.psfhosted.org> Change by Dong-hee Na <donghee.na at python.org>: ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45326> _______________________________________ From report at bugs.python.org Wed Sep 29 21:10:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:10:43 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632964243.89.0.954311772584.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27011 pull_request: https://github.com/python/cpython/pull/28643 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 21:12:57 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 30 Sep 2021 01:12: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: <1632964377.46.0.0862841949151.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: > I'm not in favor of (c) co_doc either any more (for the reasons you state). I would go for (b), a CO_DOCSTRING flag plus co_consts[0]. I expect that co_consts sharing to be a very minor benefit, but you could easily count this with another small change to the count script. OK. Let's reject (c). I expect that CO_DOCSTRING benefit is much more minor than co_consts sharing. I will compare (b) with (d). > Nested function creation could perhaps become a fraction faster if we didn't copy the docstring into the function object, leaving it func_doc NULL, making func.__doc__ a property that falls back on co_consts[0] if the flag is set. Copying the docstring is way faster than creating annotations. So I don't think nested function creation time is main issue. > I expect lazy docstrings to be in the distant future (I experimented quite a bit with different marshal formats to support this and it wasn't easy at all) but I don't want to exclude it. Since code object is immutable/hashable, removing docstring from code object makes this idea easy. For example, we can store long docstrings in some db (e.g. sqlite, dbm) in the __pycache__ directory and store its id to func.__doc__. When func.__doc__ is accessed, it can load the docstring from db. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Wed Sep 29 21:14:50 2021 From: report at bugs.python.org (Ma Lin) Date: Thu, 30 Sep 2021 01:14:50 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632964490.08.0.178358225425.issue45116@roundup.psfhosted.org> Ma Lin <malincns at 163.com> added the comment: I think this is a bug of MSVC2019, not a really regression of CPython. So changing the code of CPython is just a workaround, maybe the right direction is to prompt MSVC to fix the bug, otherwise there will be more trouble when 3.11 is released a year later. Seeing MSVC's reply, it seems they didn't realize that it was a bug, but suggested to adjust the training samples and use `__forceinline`. They don't know `__forceinline` hangs the build process since 28d28e0. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 21:25:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:25:02 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632965102.23.0.503365608815.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27012 pull_request: https://github.com/python/cpython/pull/28644 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 21:39:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:39:04 +0000 Subject: [issue37080] Cannot compile Python3.7.3 on Alt-F (ARM) In-Reply-To: <1559057852.62.0.663214501823.issue37080@roundup.psfhosted.org> Message-ID: <1632965944.17.0.875687190215.issue37080@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > Use GCC option -fPIC for shared objects, please Did you try that? I guess that the configure.ac block about CCSHARED="-fPIC" doesn't handle your operating system. Try to modify manually Makefile to use "CCSHARED=-fPIC", make clean, and try make again. I suggest starting without --enable-optimizations until you solve the build errors. ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37080> _______________________________________ From report at bugs.python.org Wed Sep 29 21:41:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:41:10 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1632966070.0.0.268194364956.issue1596321@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue1596321> _______________________________________ From report at bugs.python.org Wed Sep 29 21:49:00 2021 From: report at bugs.python.org (neonene) Date: Thu, 30 Sep 2021 01:49:00 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1632966539.99.0.729450649706.issue45116@roundup.psfhosted.org> neonene <nicesalmon at gmail.com> added the comment: _PyEval_EvalFrameDefault() may also need to be divided. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Wed Sep 29 21:50:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 01:50:41 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632966641.74.0.733768348899.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 0231b6da45b610d33ee4e99bf190e31488d6ab26 by Victor Stinner in branch 'main': bpo-41710: Fix building pytime.c on Windows (GH-28644) https://github.com/python/cpython/commit/0231b6da45b610d33ee4e99bf190e31488d6ab26 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Wed Sep 29 23:24:50 2021 From: report at bugs.python.org (Yiyang Zhan) Date: Thu, 30 Sep 2021 03:24:50 +0000 Subject: [issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7 In-Reply-To: <1632653925.67.0.37350677863.issue45291@roundup.psfhosted.org> Message-ID: <1632972290.56.0.0407255234236.issue45291@roundup.psfhosted.org> Yiyang Zhan <pon.zhan at gmail.com> added the comment: Thank you for reviewing the pull request ? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45291> _______________________________________ From report at bugs.python.org Thu Sep 30 02:26:57 2021 From: report at bugs.python.org (Vinayak Hosamani) Date: Thu, 30 Sep 2021 06:26:57 +0000 Subject: [issue45327] json loads is stuck infinitely when the file name is Boolean Message-ID: <1632983217.04.0.955112259844.issue45327@roundup.psfhosted.org> New submission from Vinayak Hosamani <vinayakuh at gmail.com>: Below snippet works fine on Python2 >>> import json >>> tc_report_file = False >>> tc_data = json.load(open(tc_report_file)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: coercing to Unicode: need string or buffer, bool found >>> as we can see it is throwing an exception same piece of code is stuck at Python3.8.10 vinayakh at ats-engine:~/stf_files$ python3 Python 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> import json >>> tc_report_file = False >>> tc_data = json.load(open(tc_report_file)) ---------- components: Library (Lib) messages: 402933 nosy: vinayakuh priority: normal severity: normal status: open title: json loads is stuck infinitely when the file name is Boolean versions: Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45327> _______________________________________ From report at bugs.python.org Thu Sep 30 02:38:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 30 Sep 2021 06:38:05 +0000 Subject: [issue45327] json loads is stuck infinitely when the file name is Boolean In-Reply-To: <1632983217.04.0.955112259844.issue45327@roundup.psfhosted.org> Message-ID: <1632983885.58.0.833152383376.issue45327@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: You can demonstrate this without the json module: # python2 >>> open(False) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: coercing to Unicode: need string or buffer, bool found # python3 >>> open(False).readlines() The python3 version doesn't return. ---------- nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45327> _______________________________________ From report at bugs.python.org Thu Sep 30 02:43:22 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 30 Sep 2021 06:43:22 +0000 Subject: [issue45327] Reading from a file is stuck infinitely when the file name is Boolean In-Reply-To: <1632983217.04.0.955112259844.issue45327@roundup.psfhosted.org> Message-ID: <1632984202.22.0.710764818149.issue45327@roundup.psfhosted.org> Change by Eric V. Smith <eric at trueblade.com>: ---------- components: +Interpreter Core -Library (Lib) title: json loads is stuck infinitely when the file name is Boolean -> Reading from a file is stuck infinitely when the file name is Boolean type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45327> _______________________________________ From report at bugs.python.org Thu Sep 30 02:56:59 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 30 Sep 2021 06:56:59 +0000 Subject: [issue45327] Reading from a file is stuck infinitely when the file name is Boolean In-Reply-To: <1632983217.04.0.955112259844.issue45327@roundup.psfhosted.org> Message-ID: <1632985019.08.0.875445131109.issue45327@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: The issue is that False is causing a read from stdin, since False == 0. >>> open(0).readlines() test ['test\n'] Here I typed "test", followed by Ctrl-D (end of file). readlines() then completed and printed its result. I think the basic answer here is "don't do this". It's not a bug, and is documented. https://docs.python.org/3/library/functions.html#open says: file is a path-like object giving the pathname (absolute or relative to the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. So an integer file descriptor False is causing stdin to be wrapped. >>> False == 0 True >>> isinstance(False, int) True ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45327> _______________________________________ From report at bugs.python.org Thu Sep 30 03:04:27 2021 From: report at bugs.python.org (Vinayak Hosamani) Date: Thu, 30 Sep 2021 07:04:27 +0000 Subject: [issue45327] Reading from a file is stuck infinitely when the file name is Boolean In-Reply-To: <1632983217.04.0.955112259844.issue45327@roundup.psfhosted.org> Message-ID: <1632985467.47.0.753657316927.issue45327@roundup.psfhosted.org> Vinayak Hosamani <vinayakuh at gmail.com> added the comment: Thanks for the clarification Eric. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45327> _______________________________________ From report at bugs.python.org Thu Sep 30 03:26:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 07:26:43 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632986803.33.0.543708473613.issue45229@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +27013 pull_request: https://github.com/python/cpython/pull/28645 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 03:30:39 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Thu, 30 Sep 2021 07:30:39 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1632987039.56.0.96590756854.issue40059@roundup.psfhosted.org> Change by Chih-Hsuan Yen <yan12125+foss at gmail.com>: ---------- nosy: +yan12125 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40059> _______________________________________ From report at bugs.python.org Thu Sep 30 04:06:57 2021 From: report at bugs.python.org (R) Date: Thu, 30 Sep 2021 08:06:57 +0000 Subject: [issue45328] http.client.HTTPConnection doesn't work without TCP_NODELAY Message-ID: <1632989216.99.0.864211743878.issue45328@roundup.psfhosted.org> New submission from R <rtobarc at gmail.com>: I'm working on trying to run python under SerenityOS. At the moment, SerenityOS doesn't implement the TCP_NODELAY socket option. This makes the HTTPConnection.connect() method raise an OSError for an operation that is otherwise optional. Additionally, the connection object can be left in an intermediate state: the underlying socket is always created, but depending on what method was invoked (either connect() directly or a higher-level one such as putrequest()) the connection object can be in IDLE or REQ_STARTED state. I have a patch that works (attached), and I'll be working on submitting a PR now. Usage of TCP_NODELAY was introduced in 3.5 (#23302), so even though I've been testing against 3.10rc2 for the time being I'm sure it will affect all versions in between. ---------- components: Library (Lib) files: http-client.patch keywords: patch messages: 402937 nosy: rtobar2 priority: normal severity: normal status: open title: http.client.HTTPConnection doesn't work without TCP_NODELAY type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50316/http-client.patch _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45328> _______________________________________ From report at bugs.python.org Thu Sep 30 04:12:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 08:12:20 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632989540.27.0.754269618565.issue45325@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: > But isn't that risk the same for other formatting parameters? I think that the risk for other formatting parameters is smaller, because you know, that there are different formatting parameters for different integer and floating point types, and for pointers, and you know that you should care about truncation and overflow if the type of the argument is different from the type of the parameter. But I am not in strict opposition against this feature. It is just that I have fixed so many bugs, that I try to search potential flaws and drawbacks in any new feature. Now you know about this, and you can decide whether the benefit is larger than the risk of potential damages. To me they look equally small. Technically PR 28634 LGTM. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Thu Sep 30 04:17:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 08:17:02 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632989822.64.0.5618293007.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset 37b8294d6295ca12553fd7c98778be71d24f4b24 by Victor Stinner in branch 'main': bpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643) https://github.com/python/cpython/commit/37b8294d6295ca12553fd7c98778be71d24f4b24 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Thu Sep 30 04:21:23 2021 From: report at bugs.python.org (Rodrigo) Date: Thu, 30 Sep 2021 08:21:23 +0000 Subject: [issue45328] http.client.HTTPConnection doesn't work without TCP_NODELAY In-Reply-To: <1632989216.99.0.864211743878.issue45328@roundup.psfhosted.org> Message-ID: <1632990083.24.0.962574948363.issue45328@roundup.psfhosted.org> Change by Rodrigo <rtobar at icrar.org>: ---------- nosy: +rtobar nosy_count: 1.0 -> 2.0 pull_requests: +27014 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28646 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45328> _______________________________________ From report at bugs.python.org Thu Sep 30 04:34:30 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Bourgault?=) Date: Thu, 30 Sep 2021 08:34:30 +0000 Subject: [issue45323] unexpected behavior on first match case _ In-Reply-To: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> Message-ID: <1632990870.74.0.972550641959.issue45323@roundup.psfhosted.org> Jo?l Bourgault <joel.bourgault at gmail.com> added the comment: I obtain the reported behaviour using `python -m doctests <presentation>.md` in a Gitlab pipeline, so it is likely that the execution is similar to the Python interpreter. Therefore, I am satisfied by your answer, so I close this 'bug'; thanks a lot! Now, about the fact that `x` is assigned when matched even if "guarded-out" afterwards: this is exposed in the tutorial, so I consider this to be the expected behavior; see last sentence of https://www.python.org/dev/peps/pep-0636/#adding-conditions-to-patterns. Note: I discovered the observed behavior while writing a presentation, sourced in a markdown file and then rendered as a RevealJS presentation, visible here (French): https://poles.pages.forge.kaizen-solutions.net/pole-python/pr-sentations/python-structural-pattern-matching. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Thu Sep 30 04:42:17 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Bourgault?=) Date: Thu, 30 Sep 2021 08:42:17 +0000 Subject: [issue45323] unexpected behavior on first match case _ In-Reply-To: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> Message-ID: <1632991337.86.0.436089482105.issue45323@roundup.psfhosted.org> Change by Jo?l Bourgault <joel.bourgault at gmail.com>: ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Thu Sep 30 04:46:43 2021 From: report at bugs.python.org (=?utf-8?b?56mG5YWw?=) Date: Thu, 30 Sep 2021 08:46:43 +0000 Subject: [issue45309] asyncio task can not be used to open_connection and read data. In-Reply-To: <1632822872.87.0.0190246614717.issue45309@roundup.psfhosted.org> Message-ID: <1632991603.15.0.981307321787.issue45309@roundup.psfhosted.org> Change by ?? <whitestockingirl at gmail.com>: ---------- resolution: -> not a bug _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45309> _______________________________________ From report at bugs.python.org Thu Sep 30 04:46:48 2021 From: report at bugs.python.org (=?utf-8?b?56mG5YWw?=) Date: Thu, 30 Sep 2021 08:46:48 +0000 Subject: [issue45309] asyncio task can not be used to open_connection and read data. In-Reply-To: <1632822872.87.0.0190246614717.issue45309@roundup.psfhosted.org> Message-ID: <1632991608.14.0.316812193679.issue45309@roundup.psfhosted.org> Change by ?? <whitestockingirl at gmail.com>: ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45309> _______________________________________ From report at bugs.python.org Thu Sep 30 04:51:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 08:51:16 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632991876.53.0.279715995951.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27015 pull_request: https://github.com/python/cpython/pull/28647 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Thu Sep 30 05:04:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 09:04:20 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1632992660.93.0.77973645157.issue45325@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > I think that the risk for other formatting parameters is smaller, because you know, that there are different formatting parameters for different integer and floating point types, and for pointers, and you know that you should care about truncation and overflow if the type of the argument is different from the type of the parameter. IMO such problem can be solved with documentation. Pablo: can you try to explain the problem in the documentation, and maybe provide an example in the doc showing how to avoid it? I guess that a generic fix is to replace "value" with "value != 0". In C, "expr != 0" is an int, no? What I understood is that Py_BuildValue("p", value) is problematic if value type is not int. "!value" or "!!value" also has the issue if I understood correctly. Like: long value = 3; Py_BuildValue("p", !value); I agree with Serhiy that Py_BuildValue() is ok-ish with other formats, but IMO it's the responsibility of the developer to pass the expect type (int for "p" format). This problem is not specific to Py_BuildValue(). printf() also has exactly the same issue. Such code has an undefined behavior: long long x = 1; print("%d\n", x); You must cast explicitly: long long x = 1; print("%d\n", (int)x); Or use a different format, like: long long x = 1; print("%lld\n", x); ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Thu Sep 30 05:23:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 09:23:13 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1632993793.02.0.769867501106.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: New changeset b34dd58fee707b8044beaf878962a6fa12b304dc by Victor Stinner in branch 'main': bpo-41710: Document _PyTime_t API in pytime.h (GH-28647) https://github.com/python/cpython/commit/b34dd58fee707b8044beaf878962a6fa12b304dc ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Thu Sep 30 06:09:27 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Bourgault?=) Date: Thu, 30 Sep 2021 10:09:27 +0000 Subject: [issue45323] unexpected behavior on first match case _ In-Reply-To: <1632928761.88.0.894816549892.issue45323@roundup.psfhosted.org> Message-ID: <1632996567.59.0.293085695978.issue45323@roundup.psfhosted.org> Jo?l Bourgault <joel.bourgault at gmail.com> added the comment: Complement: the Python tutorial presents the "magic _" in the following section, close to its end: https://docs.python.org/3/tutorial/introduction.html#numbers > In interactive mode, the last printed expression is assigned to the variable _. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45323> _______________________________________ From report at bugs.python.org Thu Sep 30 06:15:20 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 30 Sep 2021 10:15:20 +0000 Subject: [issue41226] Supporting `strides` in `memoryview.cast` In-Reply-To: <1594087287.71.0.356108904694.issue41226@roundup.psfhosted.org> Message-ID: <1632996920.66.0.119740516247.issue41226@roundup.psfhosted.org> Vedran ?a?i? <vedgar at gmail.com> added the comment: I surely don't understand what the third argument means. What's (1, 2) there, and what stride does it produce? ---------- nosy: +veky _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41226> _______________________________________ From report at bugs.python.org Thu Sep 30 06:39:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 10:39:19 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1632998359.83.0.534119725301.issue45229@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: Unfortunately, this PR28615 seems to have broken a bunch of buildbots. For instance: https://buildbot.python.org/all/#/builders/75/builds/172/steps/5/logs/stdio ``` test_divide_and_round (test.datetimetester.TestModule_Pure) ... ok test_divide_and_round (test.datetimetester.TestModule_Fast) ... skipped 'Only run for Pure Python implementation' ---------------------------------------------------------------------- Ran 2 tests in 0.000s OK (skipped=1) test_divide_and_round (test.datetimetester.TestModule_Pure) ... ERROR .test test_datetime failed test_divide_and_round (test.datetimetester.TestModule_Fast) ... skipped 'Only run for Pure Python implementation' ====================================================================== ERROR: test_divide_and_round (test.datetimetester.TestModule_Pure) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/datetimetester.py", line 88, in test_divide_and_round dar = datetime_module._divide_and_round ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'datetime' has no attribute '_divide_and_round' ---------------------------------------------------------------------- Ran 2 tests in 0.003s FAILED (errors=1, skipped=1) 1 test failed again: test_datetime == Tests result: FAILURE then FAILURE == ``` ---------- nosy: +pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 06:56:23 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 30 Sep 2021 10:56:23 +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: <1632999383.24.0.0169485150481.issue36521@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: I strongly favor (b) over (d). (d) adds more complexity to MAKE_FUNCTION. MAKE_FUNCTION represents a measurable fraction of execution time for many programs. The more flags and branches it has, the harder it is to optimize. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Thu Sep 30 06:56:31 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 30 Sep 2021 10:56:31 +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: <1632999391.15.0.59382780538.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: I used this tool to count co_const size and numbers. https://github.com/faster-cpython/tools/pull/6 Target is asyncio in the main branch. main (b34dd58f): Total: 31 files; 1,068 code objects; 12,741 lines; 39,208 opcodes; 3,880 total size of co_consts; 738 number of co_consts LOAD_NONE (https://github.com/python/cpython/pull/28376): Total: 31 files; 1,068 code objects; 12,741 lines; 39,208 opcodes; 3,617 total size of co_consts; 743 number of co_consts (b) LOAD_NONE + CO_DOCSTRING (b: https://github.com/methane/cpython/pull/36): Total: 31 files; 1,068 code objects; 12,741 lines; 39,208 opcodes; 3,272 total size of co_consts; 732 number of co_consts (d) LOAD_NONE + remove docstring from code (d: https://github.com/methane/cpython/pull/37): Total: 31 files; 1,068 code objects; 12,741 lines; 39,469 opcodes; 3,255 total size of co_consts; 574 number of co_consts number of co_consts: main -> (b) = 738 -> 732 (-6, -0.8%) (b) -> (d) = 732 -> 574 (-158, -21.6%) total size of co_consts: main -> (b) = 3880 -> 3272 (-608, -15.7%) (b) -> (d) = 3272 -> 3255 (-17, -0.5%) (*) (*) It seems tiny difference. But note that code objects for modules and classes will be released after execution. So (d) will have smaller total size of remaining co_consts after execution. --- Another target is SQLAlchemy-1.4.25/lib main (b34dd58f): Total: 236 files; 11,802 code objects; 179,284 lines; 372,983 opcodes; 46,091 total size of co_consts; 7,979 number of co_consts LOAD_NONE (https://github.com/python/cpython/pull/28376): Total: 236 files; 11,802 code objects; 179,284 lines; 372,983 opcodes; 43,272 total size of co_consts; 7,980 number of co_consts (b) LOAD_NONE + CO_DOCSTRING (b: https://github.com/methane/cpython/pull/36): Total: 236 files; 11,802 code objects; 179,284 lines; 372,983 opcodes; 39,599 total size of co_consts; 7,833 number of co_consts (d) LOAD_NONE + remove docstring from code (d: https://github.com/methane/cpython/pull/37): Total: 236 files; 11,802 code objects; 179,284 lines; 375,396 opcodes; 39,418 total size of co_consts; 6,526 number of co_consts number of co_consts: main -> (b) = 7979 -> 7833 (-146, -1.83%) (b) -> (d) = 7833 -> 6526 (-1307, -16.7%) total size of co_consts: main -> (b) = 46091 -> 39599 (-6492, -14.1%) (b) -> (d) = 39599 -> 39418 (-141, -0.36%) --- Conclusion: (b) reduces total size of co_consts significantly, and (d) reduces both of total size and number of co_consts significantly. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Thu Sep 30 07:08:32 2021 From: report at bugs.python.org (Min RK) Date: Thu, 30 Sep 2021 11:08:32 +0000 Subject: [issue36841] Supporting customization of float encoding in JSON In-Reply-To: <1557261153.38.0.171143852563.issue36841@roundup.psfhosted.org> Message-ID: <1633000112.78.0.696348735188.issue36841@roundup.psfhosted.org> Change by Min RK <benjaminrk at gmail.com>: ---------- nosy: +minrk nosy_count: 5.0 -> 6.0 pull_requests: +27016 pull_request: https://github.com/python/cpython/pull/28648 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36841> _______________________________________ From report at bugs.python.org Thu Sep 30 07:12:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 30 Sep 2021 11:12:02 +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: <1633000322.42.0.137439339574.issue36521@roundup.psfhosted.org> Inada Naoki <songofacandy at gmail.com> added the comment: My machine at the office (used for benchmarking) is hanged up and I need to go to the office to reboot. So I don't have benchmark machine for now. Please prioritize LOAD_NONE/LOAD_COMMON_CONST than this. It is hard to maintain merged branches. Merging LOAD_NONE/LOAD_COMMON_CONST into main branch makes this issue easier. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Thu Sep 30 07:21:11 2021 From: report at bugs.python.org (TAGAMI Yukihiro) Date: Thu, 30 Sep 2021 11:21:11 +0000 Subject: [issue45329] pyexpat: segmentation fault when `--with-system-expat` is specified Message-ID: <1633000871.63.0.316839646856.issue45329@roundup.psfhosted.org> New submission from TAGAMI Yukihiro <tagami.yukihiro at gmail.com>: Some tests, which are related to pyexpat, get failed with `./configure --with-system-expat`. ``` 11 tests failed: test_minidom test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn test_plistlib test_pulldom test_pyexpat test_sax test_xml_etree test_xml_etree_c test_xmlrpc ``` Since 3.10.0b2, `Modules/pyexpat.c` has been broken. I guess this is caused by accessing freed memory. For more detail, please refer to the attached file. ---------- components: Extension Modules files: pyexpat-log.txt messages: 402949 nosy: y-tag priority: normal severity: normal status: open title: pyexpat: segmentation fault when `--with-system-expat` is specified type: crash versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50317/pyexpat-log.txt _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45329> _______________________________________ From report at bugs.python.org Thu Sep 30 07:24:43 2021 From: report at bugs.python.org (Min RK) Date: Thu, 30 Sep 2021 11:24:43 +0000 Subject: [issue36841] Supporting customization of float encoding in JSON In-Reply-To: <1557261153.38.0.171143852563.issue36841@roundup.psfhosted.org> Message-ID: <1633001083.62.0.40116620262.issue36841@roundup.psfhosted.org> Min RK <benjaminrk at gmail.com> added the comment: We just ran into this in Jupyter where we've removed a pre-processing step for data structures passed to json.dumps, which took care of this, but was expensive https://github.com/jupyter/jupyter_client/pull/706 My expectation was that our `default` would be called for the unsupported value, but it isn't. I see the PR proposes a new option, but would it be sensible to use the already-existing `default` callback for this? It seems like what `default` is for. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36841> _______________________________________ From report at bugs.python.org Thu Sep 30 07:50:13 2021 From: report at bugs.python.org (TAGAMI Yukihiro) Date: Thu, 30 Sep 2021 11:50:13 +0000 Subject: [issue45329] pyexpat: segmentation fault when `--with-system-expat` is specified In-Reply-To: <1633000871.63.0.316839646856.issue45329@roundup.psfhosted.org> Message-ID: <1633002613.15.0.64564958225.issue45329@roundup.psfhosted.org> Change by TAGAMI Yukihiro <tagami.yukihiro at gmail.com>: ---------- keywords: +patch pull_requests: +27017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28649 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45329> _______________________________________ From report at bugs.python.org Thu Sep 30 07:59:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 11:59:50 +0000 Subject: [issue45329] pyexpat: segmentation fault when `--with-system-expat` is specified In-Reply-To: <1633000871.63.0.316839646856.issue45329@roundup.psfhosted.org> Message-ID: <1633003190.35.0.11117191017.issue45329@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- nosy: +vstinner _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45329> _______________________________________ From report at bugs.python.org Thu Sep 30 08:04:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 12:04:41 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1633003481.32.0.679506840586.issue45325@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > But I am not in strict opposition against this feature. It is just that I have fixed so many bugs, that I try to search potential flaws and drawbacks in any new feature. Now you know about this, and you can decide whether the benefit is larger than the risk of potential damages. To me they look equally small. Thanks, Serhiy, for your insights and careful consideration. Among many things, your attention to detail, experience and careful consideration are what I admire the most! You rock :) I will look at the stdlib examples and will incorporated them into the PR and then I will carefully consider the change again. Thanks for the comments! ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Thu Sep 30 08:08:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 12:08:49 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633003729.17.0.865954500052.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: Seems this is not a new bug: $ ./python -m test test_datetime test_datetime -m test_divide_and_round 0:00:00 load avg: 2.36 Run tests sequentially 0:00:00 load avg: 2.36 [1/2] test_datetime 0:00:00 load avg: 2.36 [2/2] test_datetime test test_datetime failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython3.9/Lib/test/datetimetester.py", line 88, in test_divide_and_round dar = datetime_module._divide_and_round AttributeError: module 'datetime' has no attribute '_divide_and_round' test_datetime failed (1 error) == Tests result: FAILURE == But for some causes it was not reproduced with refleak tests. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 08:21:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 12:21:05 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633004465.81.0.303945392503.issue45229@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: > Seems this is not a new bug: I agree, is unfortunate. But sadly is breaking all buildbots and therefore is hiding other issues and making the 'test-with-buildbots' label not useful. I would prefer to revert until we have a fix (and not land the backports until then). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 08:21:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 12:21:30 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633004490.85.0.16308625271.issue45229@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- pull_requests: +27018 pull_request: https://github.com/python/cpython/pull/28650 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 08:47:51 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 30 Sep 2021 12:47:51 +0000 Subject: [issue36841] Supporting customization of float encoding in JSON In-Reply-To: <1557261153.38.0.171143852563.issue36841@roundup.psfhosted.org> Message-ID: <1633006071.37.0.925182130305.issue36841@roundup.psfhosted.org> Change by Mark Dickinson <dickinsm at gmail.com>: ---------- nosy: +mark.dickinson _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36841> _______________________________________ From report at bugs.python.org Thu Sep 30 08:53:32 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 30 Sep 2021 12:53:32 +0000 Subject: [issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1633006412.38.0.910628913249.issue45116@roundup.psfhosted.org> Ken Jin <kenjin4096 at gmail.com> added the comment: @Pablo > I disagree. This is a regression/bug and we don't advertise "known bugs" in the what's new, the same for any other bugfix that has been delayed until 3.10.1 Alright, in hindsight 3.10 What's New was a bad suggestion on my part. I wonder if there's a better location for such news though. >> Some use cases are slower (by >10%!) > Can you still reproduce this with PR 28475? Yes that number is *with* PR28475. Without that PR it was worse. The second pyperformance comparison in this file is 3.10a7 vs PR28475 https://bugs.python.org/file50293/PR28475_vs_310rc2_vs_310a7.txt. Omitting python_startup (unstable on Windows) and unpack_sequence (microbenchmark): - logging_silent: 250 ns +- 7 ns -> 291 ns +- 10 ns: 1.16x slower - hexiom: 14.0 ms +- 0.3 ms -> 15.7 ms +- 3.0 ms: 1.12x slower - logging_simple: 16.1 us +- 0.2 us -> 18.0 us +- 0.5 us: 1.12x slower - nbody: 215 ms +- 7 ms -> 235 ms +- 4 ms: 1.09x slower - logging_format: 17.8 us +- 0.3 us -> 19.4 us +- 0.5 us: 1.09x slower - richards: 104 ms +- 6 ms -> 112 ms +- 3 ms: 1.08x slower - xml_etree_parse: 218 ms +- 3 ms -> 235 ms +- 3 ms: 1.08x slower - sqlalchemy_imperative: 34.5 ms +- 0.9 ms -> 37.1 ms +- 1.1 ms: 1.08x slower - xml_etree_iterparse: 158 ms +- 2 ms -> 168 ms +- 2 ms: 1.06x slower - pathlib: 255 ms +- 6 ms -> 271 ms +- 3 ms: 1.06x slower - pyflate: 963 ms +- 10 ms -> 1.02 sec +- 0.02 sec: 1.06x slower - unpickle_pure_python: 446 us +- 11 us -> 471 us +- 9 us: 1.06x slower ---- anything <= 1.05x slower is snipped since it could be noise ----- At this point I don't know if we have any quick fixes left. So maybe we should open another issue for 3.11 and consider factoring out uncommon opcodes into functions like Victor and Mark suggested. We could make use of the opcode stats the faster-cpython folks have collected https://github.com/faster-cpython/tools. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45116> _______________________________________ From report at bugs.python.org Thu Sep 30 09:09:28 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 30 Sep 2021 13:09:28 +0000 Subject: [issue45330] dulwich_log performance regression in 3.10 Message-ID: <1633007368.54.0.0773120735117.issue45330@roundup.psfhosted.org> New submission from Ken Jin <kenjin4096 at gmail.com>: Somewhere between May02-May11, dulwich_log benchmark on pyperformance had a major performance regression on the 3.10 branch. https://speed.python.org/timeline/?exe=12&base=&ben=dulwich_log&env=1&revs=200&equid=off&quarts=on&extr=on For a start, we could git bisect with pyperformance. FWIW, I couldn't reproduce the perf regression on Windows. So it might be a Linux-only thing. ---------- messages: 402955 nosy: iritkatriel, kj priority: normal severity: normal status: open title: dulwich_log performance regression in 3.10 type: performance versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45330> _______________________________________ From report at bugs.python.org Thu Sep 30 09:18:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 13:18:30 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633007910.22.0.887937246154.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: See issue40058 and issue40173. ---------- dependencies: +Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round', test.support.import_fresh_module fails to correctly block submodules when fresh is specified _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 09:30:52 2021 From: report at bugs.python.org (Julien Palard) Date: Thu, 30 Sep 2021 13:30:52 +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: <1633008652.15.0.311374852057.issue10716@roundup.psfhosted.org> Change by Julien Palard <julien+python at palard.fr>: ---------- pull_requests: +27019 pull_request: https://github.com/python/cpython/pull/28651 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue10716> _______________________________________ From report at bugs.python.org Thu Sep 30 09:34:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 30 Sep 2021 13:34:47 +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: <1633008887.25.0.816615327051.issue36521@roundup.psfhosted.org> Mark Shannon <mark at hotpy.org> added the comment: Since the docstring itself will always be present (attached to the function object), removing a docstring from a co_consts tuple will only save one pointer (8 bytes). Given that, it would appear that (d) uses *more* memory than (b). For the sqlalchemy example: the saving in co_consts is about 1.6k (200 pointers), but an increase in bytecode size of 2.4k. Either way, the difference is a tiny fraction of the total memory used for code objects. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Thu Sep 30 09:35:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 30 Sep 2021 13:35:08 +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: <1633008908.09.0.57926307519.issue36521@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: It?s not clear that LOAD_NONE/LOAD_COMMON_CONST are worth doing. Any way the docstring question is not necessarily related to that. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue36521> _______________________________________ From report at bugs.python.org Thu Sep 30 09:46:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 13:46:33 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633009593.82.0.311338128331.issue45229@roundup.psfhosted.org> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment: New changeset b07fddd527efe67174ce6b0fdbe8dac390b16e4e by Pablo Galindo Salgado in branch 'main': Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650) https://github.com/python/cpython/commit/b07fddd527efe67174ce6b0fdbe8dac390b16e4e ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 09:57:43 2021 From: report at bugs.python.org (Sam Bishop) Date: Thu, 30 Sep 2021 13:57:43 +0000 Subject: [issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. Message-ID: <1633010263.22.0.644959932757.issue45331@roundup.psfhosted.org> New submission from Sam Bishop <sam at psyx.co>: Range types are perfectly valid as values in an enum, like so. class EnumOfRanges(Enum): ZERO = range(0, 0) RANGE_A = range(1, 11) RANGE_B = range(11, 26) However unlike the other base types , 'int', 'str', 'float', etc. You cannot create a "range enum" class RangeEnum(range, Enum): ZERO = range(0, 0) RANGE_A = range(1, 11) RANGE_B = range(11, 26) produces `TypeError: type 'range' is not an acceptable base type` when you try and import `RangeEnum`. The current documentation for `enum` implicitly says this should work by not mentioning anything special here https://docs.python.org/3/library/enum.html#others It also allows the use of range objects as value types, another implicit suggestion that we should be able to restrict an enum class to just range values like we can for other builtin class types. Also to keep this a concise issue: - Yes I'm aware not all of the base classes can be subclassed. - Yes I know I that there are good reasons bool should not be subclassable. So I'd like to suggest one of three things should be done to improve the situation: A: Solve https://bugs.python.org/issue17279 and by documenting the special base class objects that cannot be subclassed and reference this in the documentation for Enums. B: Make a decision as to which base class objects we should be able to subclass, and then improve their C implementations to allow subclassing. (It's also probably worth documenting the final list of special objects and solving https://bugs.python.org/issue17279 should this approach be selected.) C: The __new__ method on EnumMeta should be made smarter so that it either emits a more useful warning (I had to head to the CPython source code to work out what the error `TypeError: type 'range' is not an acceptable base type` meant) or somehow being more smart about how it handles the special classes which can't cannot be subclassed allowing them to be used anyway. which again sort of involves solving https://bugs.python.org/issue17279, and in the case that its just made magically smarter, I'll admit could confuse some people as to why "Enum" is special and can subclass these but their own code can't just do `class MyRange(range):` Regardless of the outcome, it would be good to fill in this pitfall one way or the other for the sake of future developers, I'm a reasonably experienced Python developer and it caught me by surprise I'm likely not the first and probably wont be the last if the behaviour remains as it currently is. ---------- components: Interpreter Core messages: 402960 nosy: techdragon priority: normal severity: normal status: open title: Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. type: enhancement versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45331> _______________________________________ From report at bugs.python.org Thu Sep 30 09:59:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 13:59:09 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633010349.32.0.361670770918.issue40173@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 09:58:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 13:58:57 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633010337.63.0.0688631839195.issue40173@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: I just encountered this bug after rewriting datetime tests in issue45229. It is also the cause of issue40058. Not knowing about this issue I have wrote different patch than Hai Shi. It makes the code of import_fresh_module() clearer and fixes many other issues. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 10:00:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 14:00:50 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633010450.92.0.088215473833.issue40173@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +27020 pull_request: https://github.com/python/cpython/pull/28654 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 10:10:30 2021 From: report at bugs.python.org (Julien Palard) Date: Thu, 30 Sep 2021 14:10: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: <1633011030.35.0.460834632151.issue10716@roundup.psfhosted.org> Julien Palard <julien+python at palard.fr> added the comment: Tried myself at it. I'm not a front-end guy, fasten your seatbelts. I tried to keep it minimal, but after some work the change is not that small, I focused on the HTML modernization only, not the design (to try to land at least a first step toward modernization). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue10716> _______________________________________ From report at bugs.python.org Thu Sep 30 10:46:13 2021 From: report at bugs.python.org (Julien Palard) Date: Thu, 30 Sep 2021 14:46:13 +0000 Subject: [issue32523] inconsistent spacing in changelog.html In-Reply-To: <1515514882.86.0.467229070634.issue32523@psf.upfronthosting.co.za> Message-ID: <1633013173.81.0.0611123770348.issue32523@roundup.psfhosted.org> Julien Palard <julien+python at palard.fr> added the comment: This still happen, but it's hard to tell if it'll happen from blurb, as when it's two paragraphs consisting of a text and a list it does not happen, sphinx just put the list as a sublist and it's clean. I don't want to tell people stop using list, it's very readable. Also sometimes having a paragraph, a list, then one or two more paragraphs looks usefull, see examples in [1]. [1]: https://github.com/python/core-workflow/pull/274#issuecomment-931387938 So I'm no longer trying to fix it in blurb. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue32523> _______________________________________ From report at bugs.python.org Thu Sep 30 11:06:49 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 30 Sep 2021 15:06:49 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1633014409.61.0.288696260764.issue21736@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +27021 pull_request: https://github.com/python/cpython/pull/28655 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21736> _______________________________________ From report at bugs.python.org Thu Sep 30 11:23:23 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 30 Sep 2021 15:23:23 +0000 Subject: [issue45330] dulwich_log performance regression in 3.10 In-Reply-To: <1633007368.54.0.0773120735117.issue45330@roundup.psfhosted.org> Message-ID: <1633015403.52.0.656157055206.issue45330@roundup.psfhosted.org> Change by Brandt Bucher <brandtbucher at gmail.com>: ---------- nosy: +brandtbucher _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45330> _______________________________________ From report at bugs.python.org Thu Sep 30 11:26:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 15:26:12 +0000 Subject: [issue45332] Decimal test and benchmark are broken Message-ID: <1633015572.09.0.109680774964.issue45332@roundup.psfhosted.org> New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>: The test and the benchmark for the decimal module are broken in 3.10+. $ ./python Modules/_decimal/tests/deccheck.py Traceback (most recent call last): File "/home/serhiy/py/cpython/Modules/_decimal/tests/deccheck.py", line 50, in <module> from test.support import import_fresh_module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'import_fresh_module' from 'test.support' (/home/serhiy/py/cpython/Lib/test/support/__init__.py) $ ./python Modules/_decimal/tests/bench.py Traceback (most recent call last): File "/home/serhiy/py/cpython/Modules/_decimal/tests/bench.py", line 11, in <module> from test.support import import_fresh_module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'import_fresh_module' from 'test.support' (/home/serhiy/py/cpython/Lib/test/support/__init__.py) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/serhiy/py/cpython/Modules/_decimal/tests/bench.py", line 13, in <module> from test.test_support import import_fresh_module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'import_fresh_module' from 'test.test_support' (/home/serhiy/py/cpython/Lib/test/test_support.py) Modules/_decimal/tests/bench.py ---------- components: Demos and Tools messages: 402964 nosy: serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Decimal test and benchmark are broken type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45332> _______________________________________ From report at bugs.python.org Thu Sep 30 11:44:46 2021 From: report at bugs.python.org (Matt Wozniski) Date: Thu, 30 Sep 2021 15:44:46 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1633016686.03.0.205108917961.issue45325@roundup.psfhosted.org> Matt Wozniski <godlygeek at gmail.com> added the comment: > "!value" or "!!value" also has the issue if I understood correctly. No, just as "value != 0" is an int, so is "!value". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45325> _______________________________________ From report at bugs.python.org Thu Sep 30 11:54:52 2021 From: report at bugs.python.org (chovey) Date: Thu, 30 Sep 2021 15:54:52 +0000 Subject: [issue45333] += operator and accessors bug? Message-ID: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> New submission from chovey <chovey at sandia.gov>: We used get/set attribute accessors with private data, and suspect the beaviour we see with the += operator contains a bug. Below is our original implementation, followed by our fix. But, we feel the original implementation should have worked. Please advise. Thank you. @property def position(self) -> np.ndarray: return self._position @position.setter def position(self, val: np.ndarray): self._position = val def update(self, *, delta_t: float): # Nope! Bug! (?) # Tried to combine the getter and setter for self.position # with the += operator, which will not work. # self.position += self.velocity * delta_t # # This fixes the behaviour. self._position = self.velocity * delta_t + self.position ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 402966 nosy: chovey priority: normal severity: normal status: open title: += operator and accessors bug? type: behavior versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 11:56:48 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 30 Sep 2021 15:56:48 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1633017408.21.0.332005917262.issue21736@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +27022 pull_request: https://github.com/python/cpython/pull/28656 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue21736> _______________________________________ From report at bugs.python.org Thu Sep 30 11:57:11 2021 From: report at bugs.python.org (Vigneshwar Elangovan) Date: Thu, 30 Sep 2021 15:57:11 +0000 Subject: [issue45334] String Strip not working Message-ID: <1633017431.24.0.598560965902.issue45334@roundup.psfhosted.org> New submission from Vigneshwar Elangovan <vigneshwar.e14 at gmail.com>: string = "monitorScript_cpu.py" a = string.strip("monitorScript_") print(a) ----> getting output => u.py Should stip only "monitorScript_" but stripping additional 2 charaters "monitorScript_cp" Below code working fine: string = "monitorScript_send_user.py" a = string.strip("monitorScript_") print(a) ---------- components: Parser files: capture.PNG messages: 402967 nosy: lys.nikolaou, pablogsal, vigneshwar.e14 priority: normal severity: normal status: open title: String Strip not working type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file50318/capture.PNG _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45334> _______________________________________ From report at bugs.python.org Thu Sep 30 12:03:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 30 Sep 2021 16:03:37 +0000 Subject: [issue45334] String Strip not working In-Reply-To: <1633017431.24.0.598560965902.issue45334@roundup.psfhosted.org> Message-ID: <1633017817.84.0.773890231518.issue45334@roundup.psfhosted.org> Change by Pablo Galindo Salgado <pablogsal at gmail.com>: ---------- components: -Parser nosy: -pablogsal _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45334> _______________________________________ From report at bugs.python.org Thu Sep 30 12:08:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:08:30 +0000 Subject: [issue45334] String Strip not working In-Reply-To: <1633017431.24.0.598560965902.issue45334@roundup.psfhosted.org> Message-ID: <1633018110.01.0.16139499031.issue45334@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: It works as intended (please re-read the documentation carefully). It strips all characters specified in the argument. It strips characters "c" and "p" and stops before character "u" because "monitorScript_" contains "c" and "p", but not "u". ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45334> _______________________________________ From report at bugs.python.org Thu Sep 30 12:13:10 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 30 Sep 2021 16:13:10 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633018390.04.0.452228981961.issue45333@roundup.psfhosted.org> Eric V. Smith <eric at trueblade.com> added the comment: Please show what result you're getting, and what result you're expecting. "will not work" is not very helpful for us to replicate it. ---------- components: -2to3 (2.x to 3.x conversion tool) nosy: +eric.smith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 12:20:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:20:47 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633018847.63.0.397520958975.issue40173@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset ec4d917a6a68824f1895f75d113add9410283da7 by Serhiy Storchaka in branch 'main': bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654) https://github.com/python/cpython/commit/ec4d917a6a68824f1895f75d113add9410283da7 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 12:27:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:27:12 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633019232.28.0.300234867761.issue40173@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +27023 pull_request: https://github.com/python/cpython/pull/28657 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 12:33:51 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 30 Sep 2021 16:33:51 +0000 Subject: [issue45332] Decimal test and benchmark are broken In-Reply-To: <1633015572.09.0.109680774964.issue45332@roundup.psfhosted.org> Message-ID: <1633019631.44.0.184898701796.issue45332@roundup.psfhosted.org> Change by Mark Dickinson <dickinsm at gmail.com>: ---------- nosy: +mark.dickinson _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45332> _______________________________________ From report at bugs.python.org Thu Sep 30 12:35:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:35:59 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633019759.7.0.223695140492.issue40173@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- pull_requests: +27024 pull_request: https://github.com/python/cpython/pull/28658 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 12:46:26 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 30 Sep 2021 16:46:26 +0000 Subject: [issue45334] String Strip not working In-Reply-To: <1633017431.24.0.598560965902.issue45334@roundup.psfhosted.org> Message-ID: <1633020386.95.0.214034786299.issue45334@roundup.psfhosted.org> Steven D'Aprano <steve+python at pearwood.info> added the comment: Serhiy is correct. Please see the documentation. https://docs.python.org/3/library/stdtypes.html#str.strip If you are using version 3.9 or better, you can use removeprefix instead: https://docs.python.org/3/library/stdtypes.html#str.removeprefix ---------- nosy: +steven.daprano _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45334> _______________________________________ From report at bugs.python.org Thu Sep 30 12:56:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:56:52 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633021012.25.0.0403707032857.issue40173@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 7873884d4730d7e637a968011b8958bd79fd3398 by Serhiy Storchaka in branch '3.10': [3.10] bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654) (GH-28657) https://github.com/python/cpython/commit/7873884d4730d7e637a968011b8958bd79fd3398 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 12:57:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:57:50 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633021070.25.0.22562674489.issue40173@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset f7e99c98130a705f88348dde60adb98d5bfd8b98 by Serhiy Storchaka in branch '3.9': [3.9] bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654) (GH-28658) https://github.com/python/cpython/commit/f7e99c98130a705f88348dde60adb98d5bfd8b98 ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 12:58:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 16:58:38 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633021118.56.0.278309068449.issue45229@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: New changeset 993a130d3abe7684dc9c999874b4dd1d8ea55a2a by Serhiy Storchaka in branch '3.9': [3.9] bpo-45229: Make datetime tests discoverable (GH-28615). (GH-28645) https://github.com/python/cpython/commit/993a130d3abe7684dc9c999874b4dd1d8ea55a2a ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 13:32:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 17:32:20 +0000 Subject: [issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified In-Reply-To: <1585927123.84.0.0735169096885.issue40173@roundup.psfhosted.org> Message-ID: <1633023140.09.0.140034569859.issue40173@roundup.psfhosted.org> Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: _save_and_remove_module in the old code did too much and too little. It tested that the fresh module is importable, saved the current state of the fresh module and its submodules and removed the fresh module and its submodules. Since it tested importability before saving all states, it can have a side effect of importing other fresh module, and since it did it before blocking, the imported "fresh" module could import the blocked modules. > 1. Switching the order of how "fresh" and "blocked" are resolved or It does not help, because the step of resolving "fresh" includes saving the sys.modules state, and the step of resolving "blocked" modifies sys.modules. Also the step of resolving "fresh" can modify sys.modules before saving its sate. 2. Deleting `sys.modules[name]` if it exists immediately before calling `importlib.import_module(name) It would be not enough, because the problem can occur in one of additional fresh modules imported by the initial module. We need to remove all fresh modules before attempting to import them. The new import_fresh_module() consists of the following steps: 1. Save the state of all fresh and blocked modules and their submodules. 2. Remove the fresh modules and their submodules and block the blocked modules and their submodules. 3. Import all additional fresh modules and return None if any of them is not importable. 4. Import the initial module and raise ImportError if it is not importable. 5. Restore states of all fresh and blocked modules and their submodules. It does not save and restore the state of all modules, because some indirectly imported modules can not support repeated importing. It can be reconsidered in new versions. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue40173> _______________________________________ From report at bugs.python.org Thu Sep 30 13:33:54 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 30 Sep 2021 17:33:54 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633023234.63.0.132827914831.issue45333@roundup.psfhosted.org> Mark Dickinson <dickinsm at gmail.com> added the comment: Did you by any chance get an error message resembling the following? > "Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'" (If you can give us a complete piece of code that we can run ourselves, that would save us from having to guess what the issue is.) ---------- nosy: +mark.dickinson _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 13:46:19 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 30 Sep 2021 17:46:19 +0000 Subject: [issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. In-Reply-To: <1633010263.22.0.644959932757.issue45331@roundup.psfhosted.org> Message-ID: <1633023979.1.0.426583636643.issue45331@roundup.psfhosted.org> Change by Ethan Furman <ethan at stoneleaf.us>: ---------- assignee: -> ethan.furman nosy: +ethan.furman versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45331> _______________________________________ From report at bugs.python.org Thu Sep 30 14:50:44 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 30 Sep 2021 18:50:44 +0000 Subject: [issue44841] filemode in repr of ZipInfo, but is not a ZipInfo attribute In-Reply-To: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org> Message-ID: <1633027844.92.0.0757568607046.issue44841@roundup.psfhosted.org> Ronald Oussoren <ronaldoussoren at mac.com> added the comment: The repr() output of a ZipInfo contains filemode, but it is not an attribute of those objects, see <https://docs.python.org/3/library/zipfile.html#zipinfo-objects> for a list of attributes and methods. Adding an @property for mode that extracts the mode (as an integer) from the external_attr could be useful, that avoids having to know about that encoding in users of the library. You currently have to extract the mode yourself. Luckily that isn't too hard, basically: ```mode = info.external_attr >> 16```. Only use this when the value is not 0, as it will be zero when the archive was created by software that doesn't store a mode. You can convert this integer to a human readable string using the function stat.filemode(). I've changed the version to 3.11 because adding a mode attribute to ZipInfo would be a new feature and is therefore only possible in a new feature release. ---------- title: ZipInfo crashes on filemode -> filemode in repr of ZipInfo, but is not a ZipInfo attribute versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44841> _______________________________________ From report at bugs.python.org Thu Sep 30 15:23:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 30 Sep 2021 19:23:56 +0000 Subject: [issue45330] dulwich_log performance regression in 3.10 In-Reply-To: <1633007368.54.0.0773120735117.issue45330@roundup.psfhosted.org> Message-ID: <1633029836.37.0.0487653089442.issue45330@roundup.psfhosted.org> Irit Katriel <iritkatriel at gmail.com> added the comment: Looks like this is using a 3rd party module (dulwitch.repo). Could it be a new version of that? ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45330> _______________________________________ From report at bugs.python.org Thu Sep 30 15:37:28 2021 From: report at bugs.python.org (Ian Fisher) Date: Thu, 30 Sep 2021 19:37:28 +0000 Subject: [issue45335] Default TIMESTAMP converter in sqlite3 ignores time zone Message-ID: <1633030648.15.0.389354245942.issue45335@roundup.psfhosted.org> New submission from Ian Fisher <ian at iafisher.com>: The SQLite converter that the sqlite3 library automatically registers for TIMESTAMP columns (https://github.com/python/cpython/blob/main/Lib/sqlite3/dbapi2.py#L66) ignores the time zone even if it is present and always returns a naive datetime object. I think that the converter should return an aware object if the time zone is present in the database. As it is, round trips of TIMESTAMP values from the database to Python and back might erase the original time zone info. Now that datetime.datetime.fromisoformat is in Python 3.7, this should be easy to implement. ---------- components: Library (Lib) messages: 402979 nosy: iafisher priority: normal severity: normal status: open title: Default TIMESTAMP converter in sqlite3 ignores time zone type: enhancement _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45335> _______________________________________ From report at bugs.python.org Thu Sep 30 15:40:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 30 Sep 2021 19:40:19 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633030819.65.0.513745694752.issue45229@roundup.psfhosted.org> Change by ?ukasz Langa <lukasz at langa.pl>: ---------- pull_requests: +27025 pull_request: https://github.com/python/cpython/pull/28660 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 15:48:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 19:48:32 +0000 Subject: [issue45310] test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb' In-Reply-To: <1632831738.98.0.525271172358.issue45310@roundup.psfhosted.org> Message-ID: <1633031312.79.0.845560483304.issue45310@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +27026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28661 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45310> _______________________________________ From report at bugs.python.org Thu Sep 30 15:49:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Sep 2021 19:49:09 +0000 Subject: [issue45310] test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb' In-Reply-To: <1632831738.98.0.525271172358.issue45310@roundup.psfhosted.org> Message-ID: <1633031349.45.0.681888944723.issue45310@roundup.psfhosted.org> Change by Serhiy Storchaka <storchaka+cpython at gmail.com>: ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45310> _______________________________________ From report at bugs.python.org Thu Sep 30 15:55:16 2021 From: report at bugs.python.org (Aaron Smith) Date: Thu, 30 Sep 2021 19:55:16 +0000 Subject: [issue17792] Unhelpful UnboundLocalError due to del'ing of exception target In-Reply-To: <1366329322.51.0.489771554551.issue17792@psf.upfronthosting.co.za> Message-ID: <1633031716.36.0.590938398451.issue17792@roundup.psfhosted.org> Aaron Smith <aaronwsmith at gmail.com> added the comment: I encountered the similar behavior unexpectedly when dealing with LEGB scope of names. Take the following example run under Python 3.9.2: def doSomething(): x = 10 del x print(x) x = 5 doSomething() This produces a UnboundLocalError at print(x) even though "x" can still be found in the global scope. Indeed if your add print(globals()) before the print(x) line, you can see "x" listed. By contrast, LEGB scope behavior works as expected in this example: def doSomething(): print(x) x = 5 doSomething() The former example yielding the UnboundLocalError when dealing with name scope feels like a bug that lines up with the original behavior described in this enhancement request, as I believe "x" is still a bounded name in the global scope, but was explicitly deleted from the local scope. ---------- nosy: +aaronwsmith _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17792> _______________________________________ From report at bugs.python.org Thu Sep 30 15:58:41 2021 From: report at bugs.python.org (ed wolf) Date: Thu, 30 Sep 2021 19:58:41 +0000 Subject: [issue45336] Issue with xml.tree.ElementTree.write Message-ID: <1633031921.76.0.241035024911.issue45336@roundup.psfhosted.org> New submission from ed wolf <bq824 at cummins.com>: When executing the following command after modifiy an xml file an error is prodcued. import xml.etree.ElementTree as ET rtexmlFile = 'Fox_CM3550A_SWP1_Rte_ecuc.arxml' rte_ecu_tree = ET.parse(rtexmlFile) root = rte_ecu_tree.getroot() rte_ecu_tree.write(rtexmlFile, encoding="UTF-8", xml_declaration="True", default_namespace="None" method="xml",short_empty_elements="True" ) ValueError: cannot use non-qualified names with default_namespace option The documentation for the ElementTree.write function indicates the following format for this command but this format does not seem to wrok The write command does not also take into account when having standalone in the xml defintion. For ex, <?xml version="1.0" encoding="UTF-8" standalone="no"?> ElementTree.write will not add standalone back to the xml file Is this a bug in version 3.7? write(file, encoding="us-ascii", xml_declaration=None, default_namespace=None, method="xml", *, short_empty_elements=True) Writes the element tree to a file, as XML. file is a file name, or a file object opened for writing. encoding 1 is the output encoding (default is US-ASCII). xml_declaration controls if an XML declaration should be added to the file. Use False for never, True for always, None for only if not US-ASCII or UTF-8 or Unicode (default is None). default_namespace sets the default XML namespace (for ?xmlns?). method is either "xml", "html" or "text" (default is "xml"). The keyword-only short_empty_elements parameter controls the formatting of elements that contain no content. If True (the default), they are emitted as a single self-closed tag, otherwise they are emitted as a pair of start/end tags. The output is either a string (str) or binary (bytes). This is controlled by the encoding argument. If encoding is "unicode", the output is a string; otherwise, it?s binary. Note that this may conflict with the type of file if it?s an open file object; make sure you do not try to write a string to a binary stream and vice versa. ---------- assignee: docs at python components: Documentation messages: 402981 nosy: docs at python, twowolfs priority: normal severity: normal status: open title: Issue with xml.tree.ElementTree.write type: performance versions: Python 3.7 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45336> _______________________________________ From report at bugs.python.org Thu Sep 30 16:23:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 30 Sep 2021 20:23:45 +0000 Subject: [issue45229] Always use unittest for collecting tests in regrtests In-Reply-To: <1631863872.14.0.108756439349.issue45229@roundup.psfhosted.org> Message-ID: <1633033425.46.0.82952649514.issue45229@roundup.psfhosted.org> ?ukasz Langa <lukasz at langa.pl> added the comment: New changeset 2cf76cf4ccd177b8d6d2bf21b5462258ae87522d by ?ukasz Langa in branch '3.9': Revert "bpo-45229: Make datetime tests discoverable (GH-28615). (GH-28645)" (GH-28660) https://github.com/python/cpython/commit/2cf76cf4ccd177b8d6d2bf21b5462258ae87522d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45229> _______________________________________ From report at bugs.python.org Thu Sep 30 16:39:58 2021 From: report at bugs.python.org (Adam Yoblick) Date: Thu, 30 Sep 2021 20:39:58 +0000 Subject: [issue45337] Create venv with pip fails when target dir is under userappdata using Microsoft Store python Message-ID: <1633034398.54.0.325301195524.issue45337@roundup.psfhosted.org> New submission from Adam Yoblick <Adam.Yoblick at microsoft.com>: Repro steps: 1. Install Python 3.9 from the Microsoft Store 2. Try to create a virtual environment under the userappdata folder, using a command line similar to the following: "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\python3.9.exe" -m venv "C:\Users\advolker\AppData\Local\Microsoft\CookiecutterTools\env" 3. Observe the following error: Error: Command '['C:\\Users\\advolker\\AppData\\Local\\Microsoft\\CookiecutterTools\\env\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 106. Note that creating a venv without pip DOES work: "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\python3.9.exe" -m venv "C:\Users\advolker\AppData\Local\Microsoft\CookiecutterTools\env" --without-pip BUT the venv is NOT at the specified location. This is because the Windows Store app creates a redirect when creating the venv, and that redirect is only visible from within the python executable. This means that python doesn't respect the redirect when trying to install pip into the newly created venv. ---------- components: Windows messages: 402983 nosy: AdamYoblick, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Create venv with pip fails when target dir is under userappdata using Microsoft Store python versions: Python 3.9 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45337> _______________________________________ From report at bugs.python.org Thu Sep 30 16:40:20 2021 From: report at bugs.python.org (Adam Yoblick) Date: Thu, 30 Sep 2021 20:40:20 +0000 Subject: [issue45337] Create venv with pip fails when target dir is under userappdata using Microsoft Store python In-Reply-To: <1633034398.54.0.325301195524.issue45337@roundup.psfhosted.org> Message-ID: <1633034420.13.0.293699902971.issue45337@roundup.psfhosted.org> Change by Adam Yoblick <Adam.Yoblick at microsoft.com>: ---------- type: -> behavior _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45337> _______________________________________ From report at bugs.python.org Thu Sep 30 16:46:24 2021 From: report at bugs.python.org (chovey) Date: Thu, 30 Sep 2021 20:46:24 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633034784.56.0.221898992762.issue45333@roundup.psfhosted.org> chovey <chovey at sandia.gov> added the comment: Let me get a minimum working example (MWE) developed and then I will return and paste it in here. Ball in my court. Than, you. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 17:01:55 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 30 Sep 2021 21:01:55 +0000 Subject: [issue45337] Create venv with pip fails when target dir is under userappdata using Microsoft Store python In-Reply-To: <1633034398.54.0.325301195524.issue45337@roundup.psfhosted.org> Message-ID: <1633035715.52.0.634094805445.issue45337@roundup.psfhosted.org> Steve Dower <steve.dower at python.org> added the comment: Thanks Adam. This analysis is correct, and I think there are two parts to this. First, we probably need to add an os.path.realpath(path_to_venv) before we try and launch the environment. We *could* limit this to when it's under AppData, but I think limiting it to Windows is enough. Second, if the realpath generated a different path, we should warn the caller. That wouldn't have helped in this (programmatic) case, but at least if someone is looking at the output they'll get an important hint. (The docs describing this behaviour are at https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes ) ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45337> _______________________________________ From report at bugs.python.org Thu Sep 30 17:02:41 2021 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Thu, 30 Sep 2021 21:02:41 +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: <1633035761.05.0.640362135505.issue44751@roundup.psfhosted.org> Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA at GMail.Com> added the comment: > > This is fix for regression which was previously backported to 2.7 and 3.6 branches. > > I'm not sure what you mean. > > In Python 2.7 and Python 3.6, <crypt.h> was already included by Include/Python.h: See issue #32635, where Victor Stinner backported some commit (with problematic location of '#include <crypt.h>') to 2.7 and 3.6 branches (which was released in >=2.7.15 and >=3.6). ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Thu Sep 30 17:07:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 21:07:53 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1633036073.6.0.602918675582.issue41710@roundup.psfhosted.org> Change by STINNER Victor <vstinner at python.org>: ---------- pull_requests: +27027 pull_request: https://github.com/python/cpython/pull/28662 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Thu Sep 30 17:20:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 21:20:06 +0000 Subject: [issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC) In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1633036806.74.0.27539451366.issue41710@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: On Unix, PyCOND_TIMEDWAIT() is implemented with pthread_cond_timedwait(). If pthread_condattr_setclock() is available, it uses CLOCK_MONOTONIC. Otherwise, it uses CLOCK_REALTIME. The glibc 2.30 adds pthread_cond_clockwait() which could be used to use CLOCK_MONOTONIC. But if pthread_cond_clockwait() is available (glibc 2.30 or newer), it expects that pthread_condattr_setclock() is also available. So I'm not sure that it's worth it to change PyCOND_TIMEDWAIT(). See the _PyThread_cond_after() function which computes an absolute timestamp (timespec) from a relative timeout in microseconds. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue41710> _______________________________________ From report at bugs.python.org Thu Sep 30 17:27:36 2021 From: report at bugs.python.org (chovey) Date: Thu, 30 Sep 2021 21:27:36 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633037256.48.0.610092849821.issue45333@roundup.psfhosted.org> chovey <chovey at sandia.gov> added the comment: I confirm I do get this error: Exception has occurred: _UFuncOutputCastingError Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' I next will paste a minimum working example. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 17:28:15 2021 From: report at bugs.python.org (chovey) Date: Thu, 30 Sep 2021 21:28:15 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633037295.44.0.443934519625.issue45333@roundup.psfhosted.org> chovey <chovey at sandia.gov> added the comment: import sys import numpy as np class Kinematics: def __init__(self, *, initial_position: np.ndarray, initial_velocity: np.ndarray): self._position = initial_position # meters self._velocity = initial_velocity # meters per second @property def position(self) -> np.ndarray: return self._position @position.setter def position(self, val: np.ndarray): self._position = val @property def velocity(self) -> np.ndarray: return self._velocity @velocity.setter def velocity(self, val: np.ndarray): self._velocity = val def update_shows_bug(self, *, delta_t: float): # Tries to combine the getter and setter for self.position # with the += operator, which will not work. # Will cause this error: # Exception has occurred: _UFuncOutputCastingError # Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' self.position += self.velocity * delta_t def update_fixes_bug(self, *, delta_t: float): # Fixes the bug exibited in the 'update_shows_bug' method. self._position = self.velocity * delta_t + self.position def main(argv): # after an elapsed time of 2 seconds, calucate the new position dt = 2.0 # seconds, elapsed time step # construct a Kinematics object x0, y0 = 1000, 2000 # meters xdot0, ydot0 = 20, 30 # meters per second k1 = Kinematics( initial_position=np.array([x0, y0]), initial_velocity=np.array([xdot0, ydot0]) ) # m and m/s k2 = Kinematics( initial_position=np.array([x0, y0]), initial_velocity=np.array([xdot0, ydot0]) ) # m and m/s # expected updated position is rate * time + initial_position # # x-direction # = (20 m/s) * (2 s) + 1000 m # = 40 m + 1000 m # = 1040 m # # y-direction # = (30 m/s) * (2 s) + 2000 m # = 60 m + 2000 m # = 2060 m xf, yf = 1040, 2060 # meters # k1.update_shows_bug(delta_t=dt) # will trigger error # new_position_with_bug = k1.position # assert new_position_with_bug[0] == xf # meters, succeeds # assert new_position_with_bug[1] == yf # meters, succeeds k2.update_fixes_bug(delta_t=dt) new_position_without_bug = k2.position assert new_position_without_bug[0] == xf # meters, succeeds assert new_position_without_bug[1] == yf # meters, succeeds print("Finished.") if __name__ == "__main__": main(sys.argv[1:]) ---------- Added file: https://bugs.python.org/file50319/bug_plus_equals_numpy.py _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 17:54:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Sep 2021 21:54:16 +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: <1633038856.85.0.647909315211.issue44751@roundup.psfhosted.org> STINNER Victor <vstinner at python.org> added the comment: > See issue #32635, where Victor Stinner backported some commit (with problematic location of '#include <crypt.h>') to 2.7 and 3.6 branches (which was released in >=2.7.15 and >=3.6). crypt.h was added to Python.h by: https://github.com/python/cpython/pull/5284/files And this change was then backported to 2.7 and 3.6. Ok, now I understand. Well, it's now fixed in all branches accepting bugfixes. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue44751> _______________________________________ From report at bugs.python.org Thu Sep 30 18:18:56 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 30 Sep 2021 22:18:56 +0000 Subject: [issue45337] Create venv with pip fails when target dir is under userappdata using Microsoft Store python In-Reply-To: <1633034398.54.0.325301195524.issue45337@roundup.psfhosted.org> Message-ID: <1633040336.22.0.624171916388.issue45337@roundup.psfhosted.org> Change by Steve Dower <steve.dower at python.org>: ---------- keywords: +patch pull_requests: +27028 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28663 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45337> _______________________________________ From report at bugs.python.org Thu Sep 30 19:48:58 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 30 Sep 2021 23:48:58 +0000 Subject: [issue45333] += operator and accessors bug? In-Reply-To: <1633017292.67.0.488480039709.issue45333@roundup.psfhosted.org> Message-ID: <1633045738.91.0.445757643458.issue45333@roundup.psfhosted.org> Josh Rosenberg <shadowranger+python at gmail.com> added the comment: This has nothing to do with properties, it's 100% about using augmented assignment with numpy arrays and mixed types. An equivalent reproducer is: a = np.array([1,2,3]) # Implicitly of dtype np.int64 a += 0.5 # Throws the same error, no properties involved The problem is that += is intended to operate in-place on mutable types, numpy arrays *are* mutable types (unlike normal integers in Python), you're trying to compute a result that can't be stored in a numpy array of integers, and numpy isn't willing to silently make augmented assignment with incompatible types make a new copy with a different dtype (they *could* do this, but it would lead to surprising behavior, like += on the *same* numpy array either operating in place or creating a new array with a different dtype and replacing the original based on the type on the right-hand side). The short form is: If your numpy computation is intended to produce a new array with a different data type, you can't use augmented assignment. And this isn't a bug in CPython in any event; it's purely about the choices (reasonable ones IMO) numpy made implementing their __iadd__ overload. ---------- nosy: +josh.r resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45333> _______________________________________ From report at bugs.python.org Thu Sep 30 19:58:00 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 30 Sep 2021 23:58:00 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1633046280.17.0.827355397868.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +27029 pull_request: https://github.com/python/cpython/pull/28664 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 30 20:28:43 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 01 Oct 2021 00:28:43 +0000 Subject: [issue17792] Unhelpful UnboundLocalError due to del'ing of exception target In-Reply-To: <1366329322.51.0.489771554551.issue17792@psf.upfronthosting.co.za> Message-ID: <1633048123.48.0.675320475641.issue17792@roundup.psfhosted.org> Josh Rosenberg <shadowranger+python at gmail.com> added the comment: Aaron: Your understanding of how LEGB works in Python is a little off. Locals are locals for the *entire* scope of the function, bound or unbound; deleting them means they hold nothing (they're unbound) but del can't actually stop them from being locals. The choice of whether to look something up in the L, E or GB portions of LEGB scoping rules is a *static* choice made when the function is defined, and is solely about whether they are assigned to anywhere in the function (without an explicit nonlocal/global statement to prevent them becoming locals as a result). Your second example can be made to fail just by adding a line after the print: def doSomething(): print(x) x = 1 and it fails for the same reason: def doSomething(): x = 10 del x print(x) fails; a local is a local from entry to exit in a function. Failure to assign to it for a while doesn't change that; it's a local because you assigned to it at least once, along at least one code path. del-ing it after assigning doesn't change that, because del doesn't get rid of locals, it just empties them. Imagine how complex the LOAD_FAST instruction would get if it needed to handle not just loading a local, but when the local wasn't bound, had to choose *dynamically* between: 1. Raising UnboundLocalError (if the value is local, but was never assigned) 2. Returning a closure scoped variable (if the value was local, but got del-ed, and a closure scope exists) 3. Raising NameError (if the closure scope variable exists, but was never assigned) 4. Returning a global/builtin variable (if there was no closure scope variable *or* the closure scope variable was created, but explicitly del-ed) 5. Raising NameError (if no closure, global or builtin name exists) That's starting to stretch the definition of "fast" in LOAD_FAST. :-) ---------- nosy: +josh.r _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue17792> _______________________________________ From report at bugs.python.org Thu Sep 30 20:39:05 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 01 Oct 2021 00:39:05 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1633048745.82.0.820758176882.issue45020@roundup.psfhosted.org> Eric Snow <ericsnowcurrently at gmail.com> added the comment: New changeset 7e5c107541726b90d3f2e6e69ef37180cf58335d by Eric Snow in branch 'main': bpo-45020: Add more test cases for frozen modules. (gh-28664) https://github.com/python/cpython/commit/7e5c107541726b90d3f2e6e69ef37180cf58335d ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ From report at bugs.python.org Thu Sep 30 21:45:05 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 01 Oct 2021 01:45:05 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1633052705.97.0.71303812226.issue45020@roundup.psfhosted.org> Change by Eric Snow <ericsnowcurrently at gmail.com>: ---------- pull_requests: +27030 pull_request: https://github.com/python/cpython/pull/28665 _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________