From report at bugs.python.org Sun Mar 1 01:58:53 2020 From: report at bugs.python.org (S Murthy) Date: Sun, 01 Mar 2020 06:58:53 +0000 Subject: [issue39800] Inconsistent/incomplete disassembly of methods vs method source code In-Reply-To: <1582990073.8.0.514436528319.issue39800@roundup.psfhosted.org> Message-ID: <1583045933.79.0.14741892744.issue39800@roundup.psfhosted.org> S Murthy added the comment: Yes, I know that a method body may contain more than just the return statement - I was referrring to the byte code for the method def f(x): return x**2. I don't think the output of dis.dis is correct here for the source string of f - it doesn't make sense for example to iterate over Bytecode(f) and get only the instruction for the return statement, but then iterate over Bytecode(inspect.getsource(f)) to get only the byte code for the def - the documentation for dis.dis and Bytecode indicate that all the bytecode for a piece of code, whether specified as a method, callable, generator, async. generator, coroutine, class, or a source string, will be generated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 02:12:09 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 01 Mar 2020 07:12:09 +0000 Subject: [issue12915] Add inspect.locate and inspect.resolve In-Reply-To: <1583015739.29.0.583147277621.issue12915@roundup.psfhosted.org> Message-ID: <905689BF-D1C9-4199-A9BC-9234B62EB765@felt.demon.nl> Michael Felt added the comment: I am very busy with normal work this week. However I?ll attempt to add a pr with your (Victor?s) suggestion. Sent from my iPhone > On 29 Feb 2020, at 23:36, STINNER Victor wrote: > > ? > STINNER Victor added the comment: > >> File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_pkgutil.py", line 249, in test_name_resolution >> os.makedirs(d, exist_ok=True) > (...) >> UnicodeEncodeError: 'latin-1' codec can't encode characters in position 17-19: ordinal not in range(256) > > The test should be modified to skip the current uw value in the loop ("continue") if the filesystem encoding cannot encode the Unicode string (catch UnicodeEncodeError on the makedirs() call). > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:26:22 2020 From: report at bugs.python.org (Manjusaka) Date: Sun, 01 Mar 2020 09:26:22 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 Message-ID: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> New submission from Manjusaka : Hello Guys: I have tried Python 3.9.0a4, I have an issue: the __ior__ and the __or__ have different behavior For example: x={} y=[(1,2)] x|=y is right and x=x|y will raise an exception. I think it's should be better make the same between two magic method ? ---------- components: C API messages: 363045 nosy: Manjusaka priority: normal severity: normal status: open title: different behavior between __ior__ and __or__ in dict made by PEP 584 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:35:15 2020 From: report at bugs.python.org (swgmma) Date: Sun, 01 Mar 2020 09:35:15 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1583055315.64.0.364894774655.issue30082@roundup.psfhosted.org> swgmma added the comment: Sorry, perhaps I did not word it clearly. Indeed the code to implement this looks trivial, however the part I am having trouble with is reproducing the reported issue in the first place. For example, running the attached file from a command prompt (`python test.py`) does not result in any additional windows popping up. Either my test case is wrong or there is something else going on. ---------- Added file: https://bugs.python.org/file48938/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:37:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 01 Mar 2020 09:37:26 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583055446.0.0.486039448822.issue39806@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +brandtbucher, gvanrossum, steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:39:26 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Mar 2020 09:39:26 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583055566.24.0.734511112989.issue39806@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is how PEP 584 specifies it. The in-place operator is more lenient. It corresponds the behavior of list operators. >>> x = [] >>> y = (1, 2) >>> x + y Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate list (not "tuple") to list >>> x += y >>> x [1, 2] But on other hand, the in-place operator of set is more restrictive: >>> x = set() >>> x |= (1, 2) Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |=: 'set' and 'tuple' Should not we make "|=" for dict and "+=" for list more restrictive? I heard that it was considered a mistake in list to accept arbitrary iterables. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:41:59 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 01 Mar 2020 09:41:59 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583055719.94.0.939491886602.issue39806@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > Augmented assignment behaves identically to the update method called with a single positional argument, so it also accepts anything implementing the Mapping protocol (more specifically, anything with the keys and __getitem__ methods) or iterables of key-value pairs. This is analogous to list += and list.extend, which accept any iterable, not just lists. Continued from above: Couldn't link to the specific part but the rationale is explained at https://www.python.org/dev/peps/pep-0584/#specification ---------- nosy: +xtreak -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:42:51 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 01 Mar 2020 09:42:51 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583055771.62.0.876792482988.issue39806@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:47:42 2020 From: report at bugs.python.org (Manjusaka) Date: Sun, 01 Mar 2020 09:47:42 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583056062.79.0.586363157778.issue39806@roundup.psfhosted.org> Manjusaka added the comment: In my opinion, make more lenient or not is OK, but we should guarantee the magic method should keep clean and right meaning For example, the __iadd__ in std data structure should be as same as the __add__ except it's an in-place operator. If it's necessary, I will make a PR to fix this ---------- nosy: -xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:51:46 2020 From: report at bugs.python.org (Manjusaka) Date: Sun, 01 Mar 2020 09:51:46 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583056306.22.0.229694952392.issue39806@roundup.psfhosted.org> Manjusaka added the comment: > Augmented assignment behaves identically to the update method called with a single positional argument, so it also accepts anything implementing the Mapping protocol (more specifically, anything with the keys and __getitem__ methods) or iterables of key-value pairs. This is analogous to list += and list.extend, which accept any iterable, not just lists. Continued from above: But the __or__ in implementation doesn't restrict the type of the input data. But it's almost the same with __ior__. I think we should keep the behavior as same as possible. some lenient or same restrictive ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:55:08 2020 From: report at bugs.python.org (Manjusaka) Date: Sun, 01 Mar 2020 09:55:08 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583056508.88.0.264552205836.issue39806@roundup.psfhosted.org> Change by Manjusaka : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 04:55:12 2020 From: report at bugs.python.org (Young Wong) Date: Sun, 01 Mar 2020 09:55:12 +0000 Subject: [issue39807] Python38 installed in wrong directory on Windows Message-ID: <1583056512.25.0.736477691281.issue39807@roundup.psfhosted.org> New submission from Young Wong : I'm on Windows 10 and downloaded the Python 3.8 installation package. I explicitly selected `C:\Program Files\Python38` as my installation path during in the menu, but it installs it in `C:\Program Files (x86)\Python38` at the end. My `C:\Program Files` has Python37. ---------- components: Windows messages: 363051 nosy: Young Wong, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python38 installed in wrong directory on Windows versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 05:27:01 2020 From: report at bugs.python.org (swgmma) Date: Sun, 01 Mar 2020 10:27:01 +0000 Subject: [issue39808] pathlib: reword docs for stat() Message-ID: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> New submission from swgmma : The docs for stat() (https://docs.python.org/3.9/library/pathlib.html#pathlib.Path.stat) state: > Return information about this path (similarly to os.stat()). The result is looked up at each call to this method." Nit picks: 1) It states "similarly to os.stat()" which implies there may be differences between the two, when in fact they both return the same `os.stat_result` object. 2) It should mention that `stat()` returns a `os.stat_result` object without having to go digging into the docs for `os` to find out. ---------- assignee: docs at python components: Documentation messages: 363052 nosy: docs at python, swgmma priority: normal severity: normal status: open title: pathlib: reword docs for stat() versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 05:38:17 2020 From: report at bugs.python.org (swgmma) Date: Sun, 01 Mar 2020 10:38:17 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583059097.21.0.484831605566.issue39808@roundup.psfhosted.org> Change by swgmma : ---------- keywords: +patch pull_requests: +18076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 05:42:16 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 10:42:16 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583059336.51.0.103853745876.issue39776@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- priority: normal -> critical versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 05:54:19 2020 From: report at bugs.python.org (Luca) Date: Sun, 01 Mar 2020 10:54:19 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser Message-ID: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> New submission from Luca : It is often desirable to limit the help text width, for instance to 78 or 88 columns, regardless of the actual size of the terminal window. Currently you can achieve this in rather cumbersome ways, for instance by setting "os.environ['COLUMNS'] = '80'" (but this requires the "os" module, which may not be needed otherwise by your module, and may lead to other undesired effects), or by writing a custom formatting class. IMHO there should be a simpler option for such a basic task. I propose to add a max_text_width parameter to ArgumentParser. This would require only minor code changes to argparse (see attached patch), should I open a pull request on GitHub? ---------- components: Library (Lib) files: argparse_max_text_width.patch keywords: patch messages: 363053 nosy: lucatrv priority: normal severity: normal status: open title: argparse: add max_text_width parameter to ArgumentParser type: enhancement versions: Python 3.9 Added file: https://bugs.python.org/file48939/argparse_max_text_width.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 05:58:01 2020 From: report at bugs.python.org (Andrea) Date: Sun, 01 Mar 2020 10:58:01 +0000 Subject: [issue39577] venv --prompt argument is ignored In-Reply-To: <1581066525.57.0.495811141664.issue39577@roundup.psfhosted.org> Message-ID: <1583060281.46.0.922952342051.issue39577@roundup.psfhosted.org> Andrea added the comment: Hi, Apologies for the delays in returning to you. I have been using ZSH and Oh My ZSH on top. The prompt variable, which I have customised, looks like the following: % $(virtualenv_info)$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' Judging from the documentation, I have the correct variable in place, so I'm not sure what's the problem as of now. What should be the right value in a standard bash or zsh shell? Thanks Andrea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 06:48:13 2020 From: report at bugs.python.org (Andrea) Date: Sun, 01 Mar 2020 11:48:13 +0000 Subject: [issue39577] venv --prompt argument is ignored In-Reply-To: <1581066525.57.0.495811141664.issue39577@roundup.psfhosted.org> Message-ID: <1583063293.91.0.523985227909.issue39577@roundup.psfhosted.org> Andrea added the comment: Actually, the virtual_info appears to be a function within the theme, that does the following function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') ' } So, eventually the problems is in the function that retrieves the wrong variable. My question at this stage is, where is this "Prompt" variable set? Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 06:59:05 2020 From: report at bugs.python.org (Alex Hall) Date: Sun, 01 Mar 2020 11:59:05 +0000 Subject: [issue39810] Generic script for finding bugs in get_source_segment Message-ID: <1583063945.36.0.652749436793.issue39810@roundup.psfhosted.org> New submission from Alex Hall : Attached is a script which: - Gets all the source code it can find from sys.modules - Looks at every node in the parsed source - Gets source text for that node using ast.get_source_segment - Parses the source text again - Compares the original node with the newly parsed node - Points out if the nodes don't match I ran this on Python 3.8.0, and it found several issues which have now been solved. So if there was a test like this then many bugs would have been caught earlier. I haven't tried it on a build of master, so I'm actually not sure which bugs have been fixed and what new bugs have been introduced. The script partly relies on [asttokens](https://github.com/gristlabs/asttokens) which is another way to get the source code of a node. This helps to skip some known issues and to show what the output from get_source_segment should probably be. You don't strictly need to install asttokens to run the script but it's helpful. ---------- components: Interpreter Core files: get_source_segment_test.py messages: 363056 nosy: alexmojaki priority: normal severity: normal status: open title: Generic script for finding bugs in get_source_segment type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file48940/get_source_segment_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 07:15:46 2020 From: report at bugs.python.org (toonn) Date: Sun, 01 Mar 2020 12:15:46 +0000 Subject: [issue39811] Curses crash on ^4 Message-ID: <1583064946.05.0.172302785808.issue39811@roundup.psfhosted.org> New submission from toonn : We got a report about a crash which seems to happen in the curses library when a user pressed ^4. How do we go about debugging this? https://github.com/ranger/ranger/issues/1859 ---------- components: Library (Lib) messages: 363057 nosy: toonn priority: normal severity: normal status: open title: Curses crash on ^4 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 07:55:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 01 Mar 2020 12:55:11 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583067311.8.0.704329716791.issue39809@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 08:57:03 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 13:57:03 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583071023.03.0.715186264418.issue39763@roundup.psfhosted.org> Antoine Pitrou added the comment: @Elad: > I'm not convinced that a multi-threaded fork()+exec() from C would be any better, unless the Python code goes to great lengths to avoid any non-async-signal-safe operations between the fork() and the exec(). That's exactly what the C code in the C subprocess module for POSIX does, though: https://github.com/python/cpython/blob/master/Modules/_posixsubprocess.c#L828-L854 That's why I hope that using subprocess instead of a fork()+exec() sequence naively coded in pure Python would solve the issue. @Guido: > I can sort of see why you consider the small example a red herring, since it mixes threads and fork Perhaps "red herring" was the wrong expression. What I mean is that it's no surprise that fork()+exec() sequence written in pure Python would be unsafe in multi-thread settings. The solution, though, is not to avoid threads or try to workaround the issue in ThreadPoolExecutor, but rather to avoid doing fork()+exec() in pure Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:03:31 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 14:03:31 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures Message-ID: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> New submission from Antoine Pitrou : Since issue37266 (which forbid daemon threads in subinterpreters), we probably want to forego daemon threads in concurrent.futures. This means we also need a way to run an atexit-like hook before non-daemon threads are joined on (sub)interpreter shutdown. See discussion below: https://bugs.python.org/issue37266#msg362890 ---------- components: Library (Lib) messages: 363059 nosy: aeros, pitrou, tomMoral priority: normal severity: normal stage: needs patch status: open title: Avoid daemon threads in concurrent.futures type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:10:35 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 01 Mar 2020 14:10:35 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1583071835.03.0.755261289248.issue30082@roundup.psfhosted.org> Steve Dower added the comment: Try running that script with pythonw.exe instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:17:40 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 14:17:40 +0000 Subject: [issue15012] test issue In-Reply-To: <1338954222.11.0.497891813063.issue15012@psf.upfronthosting.co.za> Message-ID: <1583072260.69.0.597876883163.issue15012@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:18:24 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 14:18:24 +0000 Subject: [issue15012] test issue In-Reply-To: <1338954222.11.0.497891813063.issue15012@psf.upfronthosting.co.za> Message-ID: <1583072304.3.0.194254975052.issue15012@roundup.psfhosted.org> Antoine Pitrou added the comment: Could someone please post a dummy reply to this issue? I'm hoping to fix e-mail notifications for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:20:55 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 01 Mar 2020 14:20:55 +0000 Subject: [issue15012] test issue In-Reply-To: <1338954222.11.0.497891813063.issue15012@psf.upfronthosting.co.za> Message-ID: <1583072455.77.0.498806020768.issue15012@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: test comment for email ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:25:35 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 01 Mar 2020 14:25:35 +0000 Subject: [issue12915] Add inspect.locate and inspect.resolve In-Reply-To: <1315326633.9.0.910127000285.issue12915@psf.upfronthosting.co.za> Message-ID: <1583072735.25.0.338426079478.issue12915@roundup.psfhosted.org> Change by Michael Felt : ---------- pull_requests: +18078 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/18720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:29:15 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 14:29:15 +0000 Subject: [issue39813] test_ioctl skipped -- Unable to open /dev/tty Message-ID: <1583072955.22.0.585630626982.issue39813@roundup.psfhosted.org> New submission from Marco Sulla : During `make test`, I get the error in the title. (venv_3_9) marco at buzz:~/sources/cpython_test$ ll /dev/tty crw-rw-rw- 1 root tty 5, 0 Mar 1 15:24 /dev/tty ---------- components: Tests messages: 363063 nosy: Marco Sulla priority: normal severity: normal status: open title: test_ioctl skipped -- Unable to open /dev/tty type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:34:47 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 14:34:47 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583073287.74.0.972614541149.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: The problem is here: Programs/_testembed.o: $(srcdir)/Programs/_testembed.c $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c `MAINCC` in my Makefile is `g++-9`. Probably, MAINCC is set to the value of ``--with-cxx-main`, if specified. I replaced `MAINCC` with `CC` at this line, and it works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:42:42 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 14:42:42 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583073762.16.0.168844583606.issue39697@roundup.psfhosted.org> Change by Marco Sulla : ---------- keywords: +patch pull_requests: +18079 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:44:37 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 14:44:37 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583073877.15.0.37144095108.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: https://github.com/python/cpython/pull/18721 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 09:45:29 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Mar 2020 14:45:29 +0000 Subject: [issue39811] Curses crash on ^4 In-Reply-To: <1583064946.05.0.172302785808.issue39811@roundup.psfhosted.org> Message-ID: <1583073929.33.0.480331852751.issue39811@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not related to curses and Python. Run arbitrary program (for example `cat` or `sleep 100`) and press Ctrl-4. You will get a core dump. This is because your terminal generates the signal SIGQUIT on Ctrl-4, and default action on SIGQUIT is core dump. So it all works as expected. If you want to change it, ignore the signal. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 10:03:44 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 01 Mar 2020 15:03:44 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583075024.07.0.174111878065.issue38597@roundup.psfhosted.org> Steve Dower added the comment: In thinking about this, I think the best way forward is to just remove the logic that might statically link the initialization code, and instead commit to CPython releases always including vcruntime140.dll even if we switch to a newer version one day. Hopefully third party distributions will do the same, though it should only matter for ABI3 modules that are not recompiled for the newer versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 10:05:59 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 01 Mar 2020 15:05:59 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583075159.1.0.507312536093.issue38597@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +18080 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 10:22:16 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 15:22:16 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583076136.1.0.728732863023.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: Mmmmhhhh... wait a moment. It seems the behavior is intended: https://bugs.python.org/issue1324762 I quote: The patch contains the following changes: [...] 2) The compiler used to translate python's main() function is stored in the configure / Makefile variable MAINCC. By default, MAINCC=$(CC). [...] If --with-cxx-main= is on the configure command line, then MAINCC=. Honestly I have _no idea_ why this change was made. Unluckily, the link to the discussion is broken. ---------- nosy: +cludwig _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 11:32:19 2020 From: report at bugs.python.org (Jeremy Kloth) Date: Sun, 01 Mar 2020 16:32:19 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583080339.42.0.469948760547.issue39697@roundup.psfhosted.org> Jeremy Kloth added the comment: What seems to be, at least, the conclusion of the thread: https://mail.python.org/archives/list/python-dev at python.org/thread/YXMD5EIHAODRZGTQ3HU74OPGEBAVCSK6/ ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 11:50:10 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 01 Mar 2020 16:50:10 +0000 Subject: [issue39813] test_ioctl skipped -- Unable to open /dev/tty In-Reply-To: <1583072955.22.0.585630626982.issue39813@roundup.psfhosted.org> Message-ID: <1583081410.95.0.489251797876.issue39813@roundup.psfhosted.org> Eric V. Smith added the comment: Can you give us some information about your operating system? Did you build this version of python yourself? Assuming so, how did you build it? Please show us the header you see when starting this version of python. How are you invoking this test? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 12:55:50 2020 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Eiras?=) Date: Sun, 01 Mar 2020 17:55:50 +0000 Subject: [issue39750] UnicodeError becomes unpicklable if data is appended to args In-Reply-To: <1582647336.17.0.517223219132.issue39750@roundup.psfhosted.org> Message-ID: <1583085350.79.0.755473946684.issue39750@roundup.psfhosted.org> Jo?o Eiras added the comment: On a related note, after inspecting the UnicodeEror C code, the exception object keeps explicit references to 'encoding', 'object', 'start', 'end' and 'reason'. That means that if those properties are set (the C code does have setters) then the properties stored in UnicodeError go out of sync with the args tuple in BaseException. And so pickling and unpickling will restore the original values, and not those that were set after the exception being created, unless args is too modified. My suggestion would be to just fetch all 5 properties from the args tuple inside the getters and setters, and in the setters, recreate the tuple with a modified value. The constructor could do argument validation but would not set any properties, because that would be delegated to BaseException. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:09:30 2020 From: report at bugs.python.org (paul j3) Date: Sun, 01 Mar 2020 18:09:30 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583086170.67.0.889353932537.issue39809@roundup.psfhosted.org> paul j3 added the comment: https://bugs.python.org/issue13041 is (I think) the latest issue/patch to deal with the help width. I don't like the idea of adding more parameters to the `ArgumentParser` class. It's too complicated already. There are a couple of ways that a user can do this already. One is a custom version of the `parser.format_help`, though as your patch shows, that actually has to go through the `_get_formatter` method. Only `format_help` is listed in the public API. Another is a subclass of HelpFormatter. It just needs to customize the `width` parameter. I vaguely recall suggesting such a subclass in a previous bug/issue, but can't find that. Subclassing HelpFormatter is an established way of customizing the format. Here's a discussion of this on StackOverflow. It uses a simple lambda as `formatter_class`: https://stackoverflow.com/questions/44333577/explain-lambda-argparse-helpformatterprog-width formatter = lambda prog: argparse.HelpFormatter(prog, width=100) and https://stackoverflow.com/questions/32888815/max-help-position-is-not-works-in-python-argparse-library ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:10:54 2020 From: report at bugs.python.org (Jan-Philip Gehrcke) Date: Sun, 01 Mar 2020 18:10:54 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1583086254.41.0.50671203149.issue16487@roundup.psfhosted.org> Jan-Philip Gehrcke added the comment: I am not too attached to "my" patch, but because I love Python I really would like us to land on a solution. > However I want all changes and new additions to the SSL module to follow PEP 543 so I can provide a PEP 543-compatible interface in the near future (3.8 or 3.9). Christian, I wonder: did we make progress on this front? Will the stdlib in the 3.9 release make it easy to load cert and key material from memory? > Mainly to not crush the will to help and contribute Thanks Anton for your words, truly appreciated. I do not want to sound too negative, but I would like to confirm that emotionally this issue here was a bit of an unpleasant experience for me, and it certainly inhibited my intentions, energy, motivation to (try to) contribute more. Thanks, though, to all supporters here. ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:31:42 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Mar 2020 18:31:42 +0000 Subject: [issue39814] Hyphens not generated for split-words in a "note" directive Message-ID: <1583087502.84.0.65826697988.issue39814@roundup.psfhosted.org> New submission from Raymond Hettinger : The justification algorithm for the docs will sometimes split words at the end of a line and will add a hyphen to indicate the continuation. This works in most text but is broken within a "note" directive. For example, there dangling "im" split of "implemenation" at the end of the third line in the note at: https://docs.python.org/3/library/functools.html#functools.total_ordering Contrast this with the correct "sup-" split of "supplies" in the first sentence. ---------- assignee: docs at python components: Documentation messages: 363075 nosy: docs at python, rhettinger priority: normal severity: normal status: open title: Hyphens not generated for split-words in a "note" directive type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:34:39 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Mar 2020 18:34:39 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ Message-ID: <1583087679.43.0.929392471324.issue39815@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- components: Library (Lib) keywords: easy nosy: rhettinger priority: normal severity: normal status: open title: functools.cached_property() not included in __all__ type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:36:25 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Mar 2020 18:36:25 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583087785.8.0.0318705881939.issue39809@roundup.psfhosted.org> Raymond Hettinger added the comment: > I don't like the idea of adding more parameters to > the `ArgumentParser` class. It's too complicated already. I concur with Paul. Let's pass on this suggestion. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:43:07 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 18:43:07 +0000 Subject: [issue39769] compileall.compile_dir(..., ddir="") omits the intermediate package paths when prepending the prefix In-Reply-To: <1582780685.98.0.127631905646.issue39769@roundup.psfhosted.org> Message-ID: <1583088187.42.0.368401988462.issue39769@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset ce720d3e0674d6ac6f1b950c20a89be4cfde7853 by Gregory P. Smith in branch '3.8': bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718) https://github.com/python/cpython/commit/ce720d3e0674d6ac6f1b950c20a89be4cfde7853 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 13:46:50 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 18:46:50 +0000 Subject: [issue39769] compileall.compile_dir(..., ddir="") omits the intermediate package paths when prepending the prefix In-Reply-To: <1582780685.98.0.127631905646.issue39769@roundup.psfhosted.org> Message-ID: <1583088410.06.0.566712944959.issue39769@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +18082 pull_request: https://github.com/python/cpython/pull/18725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:06:58 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 19:06:58 +0000 Subject: [issue39769] compileall.compile_dir(..., ddir="") omits the intermediate package paths when prepending the prefix In-Reply-To: <1582780685.98.0.127631905646.issue39769@roundup.psfhosted.org> Message-ID: <1583089618.64.0.689234532593.issue39769@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 7c64726ced3d6b5d04537386d6a9ca6d179c3be4 by Gregory P. Smith in branch '3.7': [3.7] bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718) (GH-18725) https://github.com/python/cpython/commit/7c64726ced3d6b5d04537386d6a9ca6d179c3be4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:07:52 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 19:07:52 +0000 Subject: [issue39769] compileall.compile_dir(..., ddir="") omits the intermediate package paths when prepending the prefix In-Reply-To: <1582780685.98.0.127631905646.issue39769@roundup.psfhosted.org> Message-ID: <1583089672.96.0.534565311576.issue39769@roundup.psfhosted.org> Gregory P. Smith added the comment: if anyone needs this on their older 3.6 or 3.5 trees, the 3.7/3.8 patch is a trivial backport. ---------- stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:20:55 2020 From: report at bugs.python.org (Xinfa Zhu) Date: Sun, 01 Mar 2020 19:20:55 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583090455.57.0.0429522256368.issue38597@roundup.psfhosted.org> Xinfa Zhu added the comment: Steve, don't know if you still need it but here is what you requested. Sorry for the slow move (I was working on something else). Seems mine is finding the x64 before the OneCore, though I don't know the significance. Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] on win32 In[2]: import glob In[3]: glob.glob(r"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\redist\MSVC\**\x64\Microsoft.VC14*.CRT\vcruntime140.dll", recursive=True) Out[3]: ['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\redist\\MSVC\\14.24.28127\\x64\\Microsoft.VC142.CRT\\vcruntime140.dll', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\redist\\MSVC\\14.24.28127\\onecore\\x64\\Microsoft.VC142.CRT\\vcruntime140.dll'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:26:27 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 19:26:27 +0000 Subject: [issue39813] test_ioctl skipped -- Unable to open /dev/tty In-Reply-To: <1583072955.22.0.585630626982.issue39813@roundup.psfhosted.org> Message-ID: <1583090787.07.0.663286749651.issue39813@roundup.psfhosted.org> Marco Sulla added the comment: OS: Lubuntu 18.04.4 Steps to reproduce: sudo apt-get install git libbz2-dev liblzma-dev uuid-dev libffi-dev libsqlite3-dev libreadline-dev libssl-dev libgdbm-dev libgdbm-compat-dev tk-dev libncurses5-dev git clone https://github.com/python/cpython.git cd cpython CC=gcc-9 CXX=g++-9 ./configure --enable-optimizations --with-lto make -j 4 make test marco at buzz:~/sources/cpython_test$ python3.9 Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:35:36 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 01 Mar 2020 19:35:36 +0000 Subject: [issue39814] Hyphens not generated for split-words in a "note" directive In-Reply-To: <1583087502.84.0.65826697988.issue39814@roundup.psfhosted.org> Message-ID: <1583091336.06.0.77703343665.issue39814@roundup.psfhosted.org> Ido Michael added the comment: Looks like a bug in the dev repo? What's the class responsible for rendering the notes? I can take this ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:35:48 2020 From: report at bugs.python.org (Alex Hall) Date: Sun, 01 Mar 2020 19:35:48 +0000 Subject: [issue39816] More descriptive error message than "too many values to unpack" Message-ID: <1583091348.39.0.0422747327362.issue39816@roundup.psfhosted.org> New submission from Alex Hall : Based on the discussion in https://mail.python.org/archives/list/python-ideas at python.org/thread/C6QEAEEAELUHMLB23OBRSQK2UYU3AF5O/ When unpacking fails with an error such as: ValueError: too many values to unpack (expected 2) the name of the type of the unpacked object should be included, e.g. ValueError: too many values to unpack (expected 2) from object of type 'str' and if the type is exactly list or tuple, which are already special cased: https://github.com/python/cpython/blob/baf29b221682be0f4fde53a05ea3f57c3c79f431/Python/ceval.c#L2243-L2252 then the length can also be included: ValueError: too many values to unpack (expected 2, got 3) from object of type 'tuple' ---------- components: Interpreter Core messages: 363083 nosy: alexmojaki priority: normal severity: normal status: open title: More descriptive error message than "too many values to unpack" type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:40:59 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 01 Mar 2020 19:40:59 +0000 Subject: [issue39753] inspecting a partial with bound keywods gives incorrect signature In-Reply-To: <1582656134.57.0.362705493242.issue39753@roundup.psfhosted.org> Message-ID: <1583091659.04.0.234913882739.issue39753@roundup.psfhosted.org> Ido Michael added the comment: Is it a bug? I can add the signature and set a PR ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:59:34 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Mar 2020 19:59:34 +0000 Subject: [issue38641] lib2to3 does not support py38 return/yield syntax with starred expressions In-Reply-To: <1572441583.83.0.896942127015.issue38641@roundup.psfhosted.org> Message-ID: <1583092774.21.0.456328076961.issue38641@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 768d739c1cd8c1d41902229581811a9b86bcc76e by Vlad Emelianov in branch 'master': bpo-38641: Add lib2to3 support for starred expressions in return/yield statements (GH-16994) https://github.com/python/cpython/commit/768d739c1cd8c1d41902229581811a9b86bcc76e ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 14:59:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Mar 2020 19:59:46 +0000 Subject: [issue38641] lib2to3 does not support py38 return/yield syntax with starred expressions In-Reply-To: <1572441583.83.0.896942127015.issue38641@roundup.psfhosted.org> Message-ID: <1583092786.29.0.596875630977.issue38641@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:07:26 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Mar 2020 20:07:26 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583093246.16.0.445182873563.issue39520@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 185903de12de8837bf0dc0008a16e5e56c66a019 by Batuhan Ta?kaya in branch 'master': bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304) https://github.com/python/cpython/commit/185903de12de8837bf0dc0008a16e5e56c66a019 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:12:20 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Mar 2020 20:12:20 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1583093540.4.0.737119660395.issue38870@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 397b96f6d7a89f778ebc0591e32216a8183fe667 by Batuhan Ta?kaya in branch 'master': bpo-38870: Implement a precedence algorithm in ast.unparse (GH-17377) https://github.com/python/cpython/commit/397b96f6d7a89f778ebc0591e32216a8183fe667 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:13:03 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Mar 2020 20:13:03 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ Message-ID: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> New submission from Raymond Hettinger : >>> import functools >>> functools.cached_property >>> functools.__all__ ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES', 'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial', 'partialmethod', 'singledispatch', 'singledispatchmethod'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:16:21 2020 From: report at bugs.python.org (toonn) Date: Sun, 01 Mar 2020 20:16:21 +0000 Subject: [issue39811] Curses crash on ^4 In-Reply-To: <1583064946.05.0.172302785808.issue39811@roundup.psfhosted.org> Message-ID: <1583093781.81.0.408048745746.issue39811@roundup.psfhosted.org> toonn added the comment: Vim can handle ^4 just fine while still responding to SIGQUIT though. Is there a way to determine where the signal's coming from to decide whether to react to it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:17:28 2020 From: report at bugs.python.org (Hakan) Date: Sun, 01 Mar 2020 20:17:28 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ In-Reply-To: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> Message-ID: <1583093848.33.0.588878630257.issue39815@roundup.psfhosted.org> Change by Hakan : ---------- keywords: +patch nosy: +hakancelik nosy_count: 1.0 -> 2.0 pull_requests: +18083 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:17:47 2020 From: report at bugs.python.org (Oscar) Date: Sun, 01 Mar 2020 20:17:47 +0000 Subject: [issue39817] CRITICAL: TypeError: cannot pickle 'generator' Message-ID: <1583093867.42.0.0359831443421.issue39817@roundup.psfhosted.org> New submission from Oscar : I use Windows 10 Home 1909 CRITICAL: TypeError: cannot pickle 'generator' object PS D:\projects\user.log> Traceback (most recent call last): File "", line 1, in File "c:\users\user\appdata\local\programs\python\python38\lib\multiprocessing\spawn.py", line 102, in spawn_main source_process = _winapi.OpenProcess( OSError: [WinError 87] ---------- components: Library (Lib), Windows messages: 363090 nosy: dotoscat, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: CRITICAL: TypeError: cannot pickle 'generator' type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:18:29 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 20:18:29 +0000 Subject: [issue32630] Migrate decimal to use PEP 567 context variables In-Reply-To: <1516690615.68.0.467229070634.issue32630@psf.upfronthosting.co.za> Message-ID: <1583093909.22.0.185403588819.issue32630@roundup.psfhosted.org> Gregory P. Smith added the comment: FYI - this appears to have caused a regression - https://bugs.python.org/issue39776 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:21:39 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Mar 2020 20:21:39 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583094099.35.0.358097961951.issue39794@roundup.psfhosted.org> Gregory P. Smith added the comment: While i don't think this was needed in 3.7 and 3.8, you kept the default behavior the same so I don't think it is a problem. If someone builds an interpreter with this configure flag, does it break compatibility with anything that code may have started to expect as of 3.7? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:32:11 2020 From: report at bugs.python.org (Kyle Stanley) Date: Sun, 01 Mar 2020 20:32:11 +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: <1583094731.33.0.420149594721.issue39816@roundup.psfhosted.org> Kyle Stanley added the comment: +1, I've always found the "too many values to unpack" error messages be rather vague. Adding the type should make the message more clear, and easier to debug the error for users. But, I think Chris Angelico raised a good point regarding the length (in the python-ideas thread): > For your provided use-case, the length is almost irrelevant; the best > way to spot the bug is to see "oh, it was trying to unpack a string, > not a tuple". And that part can be done much more easily and safely. So can we separate this into including the type, and including the length into two separate PRs? It can be part of the same issue, but I think including just the type for all of the unpacking error messages will be far easier to merge than merging the length one as well; considering that the former has significantly more added value. ---------- nosy: +aeros _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:49:18 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 20:49:18 +0000 Subject: [issue39678] RFC improve readability of _queue_management_worker for ProcessPoolExecutor In-Reply-To: <1582038781.26.0.540574827732.issue39678@roundup.psfhosted.org> Message-ID: <1583095758.07.0.329947962282.issue39678@roundup.psfhosted.org> Antoine Pitrou added the comment: New changeset 0e89076247580ba0e570c4816f0e5628a7e36e83 by Thomas Moreau in branch 'master': bpo-39678: refactor queue manager thread (GH-18551) https://github.com/python/cpython/commit/0e89076247580ba0e570c4816f0e5628a7e36e83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:49:34 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 20:49:34 +0000 Subject: [issue39678] RFC improve readability of _queue_management_worker for ProcessPoolExecutor In-Reply-To: <1582038781.26.0.540574827732.issue39678@roundup.psfhosted.org> Message-ID: <1583095774.78.0.0464541100979.issue39678@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 15:53:20 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Mar 2020 20:53:20 +0000 Subject: [issue15012] test issue In-Reply-To: <1338954222.11.0.497891813063.issue15012@psf.upfronthosting.co.za> Message-ID: <1583096000.02.0.986404324224.issue15012@roundup.psfhosted.org> Antoine Pitrou added the comment: Unfortunately, I didn't receive the notification :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 16:01:38 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 01 Mar 2020 21:01:38 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ In-Reply-To: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> Message-ID: <1583096498.2.0.768418443393.issue39815@roundup.psfhosted.org> miss-islington added the comment: New changeset 217dce9ee6e3cf27a0cedbe1e4a6455776373ec2 by Hakan ?elik in branch 'master': bpo-39815: add cached_property to all (GH-18726) https://github.com/python/cpython/commit/217dce9ee6e3cf27a0cedbe1e4a6455776373ec2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 16:26:46 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 01 Mar 2020 21:26:46 +0000 Subject: [issue39803] _PyLong_FormatAdvancedWriter has an unnecessary str In-Reply-To: <1583003979.36.0.40883960897.issue39803@roundup.psfhosted.org> Message-ID: <1583098006.48.0.207260128671.issue39803@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 3fe9117779f0c75f7a0c3d7748c5bf281fbc1e4c by Andy Lester in branch 'master': closes bpo-39803: Remove unused str from _PyLong_FormatAdvancedWriter. (GH-18709) https://github.com/python/cpython/commit/3fe9117779f0c75f7a0c3d7748c5bf281fbc1e4c ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 16:41:43 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 01 Mar 2020 21:41:43 +0000 Subject: [issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584 In-Reply-To: <1583054782.31.0.481926462368.issue39806@roundup.psfhosted.org> Message-ID: <1583098903.68.0.920845352333.issue39806@roundup.psfhosted.org> Guido van Rossum added the comment: This is as intended. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 16:56:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 01 Mar 2020 21:56:06 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583099766.16.0.305341651238.issue39776@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:11:43 2020 From: report at bugs.python.org (=?utf-8?q?Grzegorz_Kraso=C5=84?=) Date: Sun, 01 Mar 2020 22:11:43 +0000 Subject: [issue39818] Declaring local variable invalidates access to a global variable Message-ID: <1583100703.5.0.728842586999.issue39818@roundup.psfhosted.org> New submission from Grzegorz Kraso? : I'm not certain if this is intended behavior, but I would like to make sure. Please resolve with the lowest priority. It seems tricky that line #6 can influence instruction that chronologically appears earlier. Especially taking into account that line #6 is never executed. ---------- components: Interpreter Core files: demo.py messages: 363099 nosy: Grzegorz Kraso? priority: normal severity: normal status: open title: Declaring local variable invalidates access to a global variable type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48941/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:13:22 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 01 Mar 2020 22:13:22 +0000 Subject: [issue39818] Declaring local variable invalidates access to a global variable In-Reply-To: <1583100703.5.0.728842586999.issue39818@roundup.psfhosted.org> Message-ID: <1583100802.34.0.928751112637.issue39818@roundup.psfhosted.org> Eric V. Smith added the comment: This is by design. See https://eli.thegreenplace.net/2011/05/15/understanding-unboundlocalerror-in-python for a good explanation. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:19:26 2020 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sun, 01 Mar 2020 22:19:26 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1583101166.58.0.810420918461.issue16487@roundup.psfhosted.org> Kristj?n Valur J?nsson added the comment: I gave up contributing a long time ago now because it was too emotionally exhausting to me. This issue was one that helped tip the scales. I hope things have become easier now because good projects like Python need the enthusiasm and spirit of volunteer contributors. Good luck. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:22:16 2020 From: report at bugs.python.org (=?utf-8?q?Grzegorz_Kraso=C5=84?=) Date: Sun, 01 Mar 2020 22:22:16 +0000 Subject: [issue39818] Declaring local variable invalidates access to a global variable In-Reply-To: <1583100703.5.0.728842586999.issue39818@roundup.psfhosted.org> Message-ID: <1583101336.19.0.885651410256.issue39818@roundup.psfhosted.org> Grzegorz Kraso? added the comment: Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:34:01 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 01 Mar 2020 22:34:01 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1583102041.54.0.119264509597.issue38691@roundup.psfhosted.org> Ido Michael added the comment: @vstinner ready for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:43:50 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 22:43:50 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583102630.72.0.773752624083.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: Okay... if I have understood well, the problem is with C++ Extensions. Some questions: 1. does this problem exists yet? 2. if yes, maybe Python have to wrap the python.c and _testembed.c so they can also be compiled with a C++ compiler? 3. --with-cxx-main is not somewhat misleading? There's no documentation, and I interpreted it as "the _main_ compiler for C++", while it means "the compiler for main()". Should I suggest (maybe in another issue) to deprecate it and use --with-mainfun-compiler ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:51:24 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 01 Mar 2020 22:51:24 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1583103084.59.0.0130639746766.issue10572@roundup.psfhosted.org> Change by Ido Michael : ---------- pull_requests: +18084 pull_request: https://github.com/python/cpython/pull/18727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:51:11 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 22:51:11 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583103071.75.0.673765966518.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: Furthermore, I have not understood a think: if I understood well, --with-cxx-main is used on _some_ platforms that have problems with C++ extensions. What platforms? Is there somewhere a unit test for testing if Python compiled on one of these platforms with -with-cxx-main= works, and if a C++ extension works with this build? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 17:59:40 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 01 Mar 2020 22:59:40 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1583103580.49.0.88590450781.issue10572@roundup.psfhosted.org> Ido Michael added the comment: I've created a clean PR - will do it in 2 rounds: This PR GH-18727, contains the modified test of ctypes, sqlite3 and tkinter modules. Once that's approved I'll deal with the other remaining 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 18:12:05 2020 From: report at bugs.python.org (Joshua Kinard) Date: Sun, 01 Mar 2020 23:12:05 +0000 Subject: [issue39819] NULL pointer crash in Modules/_cursesmodule.c in PyInit__curses() on MIPS uclibc-ng and ncurses-6.2 Message-ID: <1583104325.7.0.594003781513.issue39819@roundup.psfhosted.org> New submission from Joshua Kinard : Inside a MIPS O32 chroot, based on uclibc-ng-1.0.32, if python-27 or python-3.7 are built against ncurses-6.2, then after compilation, there is a crash in the '_curses' module. Specific to Python-3.7, the crash is in Modules/_cursesmodule.c:3482, PyInit__curses(): 3477: { 3478: int key; 3479: char *key_n; 3480: char *key_n2; 3481: for (key=KEY_MIN;key < KEY_MAX; key++) { 3482: key_n = (char *)keyname(key); 3483: if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0) 3484: continue; 3485: if (strncmp(key_n,"KEY_F(",6)==0) { 3486: char *p1, *p2; It looks like keyname() is casting to a NULL pointer and crashing when 'key' is 257. The issue is reproducible by running python and trying to import the curses modules: # python Python 3.7.6 (default, Feb 29 2020, 22:51:27) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import curses Segmentation fault Or: # python -m curses Segmentation fault dmesg shows this on the main host: [99297.243445] do_page_fault(): sending SIGSEGV to python for invalid read access from 0000000000000000 [99297.243459] epc = 0000000000000000 in python3.7m[400000+10000] [99297.243483] ra = 0000000076a68c6c in _curses.cpython-37m-mips-linux-gnu.so[76a50000+20000] I've been able to work out that the fault has something to do with ncurses itself. There is no issue if built against ncurses-6.1, and even the later datestamped patches appear to be okay. It seems like any ncurses AFTER 20190609 will exhibit the problem. ncurses-6.2 was recently released, and it, too, causes this issue. However, I am unable to get gdb to trace through any of the ncurses libraries. The faulting code is in Python itself, so I assume it's something to do with a macro definition or an include provided by ncurses-6.2 that introduces the breakage. This issue also only happens in a uclibc-ng-based root. I have had zero issues building python-3.7 in multiple glibc-based roots and even a musl-1.1.24-based root works fine. So I am not completely sure if the fault is truly with Python itself, or the combination of uclibc-ng, ncurses-6.2, and Python. As far as I know, the issue may also be specific to MIPS hardware, but I do not have a similar chroot on any other architecture to verify this with. I'll attach to this bug a gdb backtrace of Python built with -O0 and -gddb3. I have a core file available if that will help, but will probably need to e-mail that as I'll have to include the malfunctioning python binary and the separate debug symbol files generated from my build. ---------- components: Extension Modules files: py37-gdb-bt-sigsegv-cursesmodule-uclibc-20200301.txt messages: 363107 nosy: kumba priority: normal severity: normal status: open title: NULL pointer crash in Modules/_cursesmodule.c in PyInit__curses() on MIPS uclibc-ng and ncurses-6.2 type: crash versions: Python 2.7, Python 3.7 Added file: https://bugs.python.org/file48942/py37-gdb-bt-sigsegv-cursesmodule-uclibc-20200301.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 18:20:53 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sun, 01 Mar 2020 23:20:53 +0000 Subject: [issue39817] CRITICAL: TypeError: cannot pickle 'generator' In-Reply-To: <1583093867.42.0.0359831443421.issue39817@roundup.psfhosted.org> Message-ID: <1583104853.0.0.914105021525.issue39817@roundup.psfhosted.org> R?mi Lapeyre added the comment: Hi Oscar, can you attach a small program that reproduce the error? It's probable that the error is in your code and not in Python. ---------- nosy: +remi.lapeyre -paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 18:30:35 2020 From: report at bugs.python.org (Marco Sulla) Date: Sun, 01 Mar 2020 23:30:35 +0000 Subject: [issue39820] Bracketed paste mode for REPL Message-ID: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> New submission from Marco Sulla : I suggest to add an implementation of bracketed paste mode in the REPL. Currently if you, for example, copy & paste a piece of Python code to see if it works, if the code have a blank line without indentation and the previous and next line are indented, REPL raises an error. If you create a .py, paste the same code and run it with the python interpreter, no error is raised, since the syntax is legit. Bracketed paste mode is implemented in many text editors, as vi. ---------- components: Interpreter Core messages: 363109 nosy: Marco Sulla priority: normal severity: normal status: open title: Bracketed paste mode for REPL type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 18:40:43 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Mar 2020 23:40:43 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ In-Reply-To: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> Message-ID: <1583106043.49.0.400721469533.issue39815@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 3.0 -> 4.0 pull_requests: +18085 pull_request: https://github.com/python/cpython/pull/18728 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 19:08:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 00:08:32 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ In-Reply-To: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> Message-ID: <1583107712.8.0.215709938893.issue39815@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 12b714391e485d0150b343b114999bae4a0d34dd by Pablo Galindo in branch '3.8': [3.8] bpo-39815: add cached_property to all (GH-18726) (GH-18728) https://github.com/python/cpython/commit/12b714391e485d0150b343b114999bae4a0d34dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 19:08:52 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 00:08:52 +0000 Subject: [issue39815] functools.cached_property() not included in __all__ In-Reply-To: <1583093583.7.0.992003924447.issue39815@roundup.psfhosted.org> Message-ID: <1583107732.83.0.845216657731.issue39815@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 19:58:33 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Mar 2020 00:58:33 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583110713.0.0.247667633266.issue39794@roundup.psfhosted.org> Raymond Hettinger added the comment: +1 for the backport. A build option isn't new feature, but it does provide a debugging tool and work-around for people who are having problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 22:14:12 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 03:14:12 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583118852.83.0.377671297772.issue39199@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 114081f8adafa16283df30c456716a1bef4758d0 by Pablo Galindo in branch 'master': bpo-39199: Add descriptions of non-deprecated nodes to the AST module documentation (GH-17812) https://github.com/python/cpython/commit/114081f8adafa16283df30c456716a1bef4758d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 1 23:54:37 2020 From: report at bugs.python.org (Abhishek) Date: Mon, 02 Mar 2020 04:54:37 +0000 Subject: [issue39821] grp library functions grp.getgrnam() & grp.getgrgid() returning incorrect gr_mem information Message-ID: <1583124877.81.0.857891340735.issue39821@roundup.psfhosted.org> New submission from Abhishek : If root user is part of a linux group, then in the response of getgrnam() & grp.getgrid(), in te gr_mem part, root user is not listed. [root at biplab2 ~]# getent group | grep starwars starwars:x:1011:root,abhi [root at biplab2 ~]# python3 Python 3.6.8 (default, Dec 5 2019, 16:11:43) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux >>> import grp >>> grp.getgrnam('starwars') grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['abhi']) >>> grp.getgrgid(1011) grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['abhi']) But, when grp.getgrall() is run, we the correct response (gr_mem includes root user as well) >>> grp.getgrall() grp.struct_group(gr_name='starwars', gr_passwd='x', gr_gid=1011, gr_mem=['root', 'abhi'])] ---------- messages: 363113 nosy: abhi.sharma priority: normal severity: normal status: open title: grp library functions grp.getgrnam() & grp.getgrgid() returning incorrect gr_mem information type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:05:41 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 02 Mar 2020 05:05:41 +0000 Subject: [issue39645] Read approximate state of concurrent.futures.Future In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583125541.61.0.873140147602.issue39645@roundup.psfhosted.org> Kyle Stanley added the comment: > This leaves just future.state() and having the states as publicly accessible module-level constants. After reading over the python-ideas again and having some time to reflect, I think we can start with just adding future.state(), as that had the most value. Since future.state() is primarily intended for debugging/informational purposes as an approximation (similar to `queue.qsize()`) rather than something to be consistently relied upon, I don't see a strong practical use case for returning the states as enums (instead of a string). If we consider adding a means to directly modify the state of the future in the future or providing an option to safely read the state of the future (through its RLock) later down the road, it may be worth considering. But not at the moment, IMO. I'll update the name of the issue accordingly, and should have time to open a PR in the next few days. It should be rather straightforward, with the main emphasis being on the documentation to ensure that it clearly communicates the purpose of future.state(); so that users don't assume it's anything more than an approximation. ---------- title: Expand concurrent.futures.Future's public API -> Read approximate state of concurrent.futures.Future _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:08:32 2020 From: report at bugs.python.org (Ammar Askar) Date: Mon, 02 Mar 2020 05:08:32 +0000 Subject: [issue39821] grp library functions grp.getgrnam() & grp.getgrgid() returning incorrect gr_mem information In-Reply-To: <1583124877.81.0.857891340735.issue39821@roundup.psfhosted.org> Message-ID: <1583125712.77.0.667150367449.issue39821@roundup.psfhosted.org> Ammar Askar added the comment: I can't re-create this locally (tested on master and 3.5.2): ammar at cowlick:~/cpython$ getent group | grep testgroup testgroup:x:1008:ammar,root ammar at cowlick:~/cpython$ ./python Python 3.9.0a4+ (heads/master:02a4d57, Feb 27 2020, 01:54:32) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import grp >>> grp.getgrnam('testgroup') grp.struct_group(gr_name='testgroup', gr_passwd='x', gr_gid=1008, gr_mem=['ammar', 'root']) Both getgrnam and getgrall use the same underlying function to convert the `struct group` so this might be a problem with your libc. Could you post your distro info? ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:14:07 2020 From: report at bugs.python.org (Philip Lee) Date: Mon, 02 Mar 2020 05:14:07 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1583126047.64.0.317597444174.issue30082@roundup.psfhosted.org> Philip Lee added the comment: To reproduce the reported issue, one could also test with ffmpeg.exe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:27:00 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 02 Mar 2020 05:27:00 +0000 Subject: [issue39645] Read approximate state of concurrent.futures.Future In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583126820.62.0.943387987048.issue39645@roundup.psfhosted.org> Guido van Rossum added the comment: I?m a bit disappointed, since it looks like this won?t allow implementing the OP?s classes without using private APIs. The debugging and loggin use cases aren?t very compelling to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:31:57 2020 From: report at bugs.python.org (Abhishek) Date: Mon, 02 Mar 2020 05:31:57 +0000 Subject: [issue39821] grp library functions grp.getgrnam() & grp.getgrgid() returning incorrect gr_mem information In-Reply-To: <1583124877.81.0.857891340735.issue39821@roundup.psfhosted.org> Message-ID: <1583127117.98.0.902530256018.issue39821@roundup.psfhosted.org> Abhishek added the comment: I also observed now that it works on other distro. On red hat enterprise linux (rhel) 7.7, I a, getting the correct output. The bug which I have raised was tested on rhel 8.2. [root at biplab2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.2 Beta (Ootpa) [root at biplab2 ~]# cat /proc/version Linux version 4.18.0-167.el8.ppc64le (mockbuild at ppc-061.build.eng.bos.redhat.com) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Sun Dec 15 01:20:45 UTC 2019 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:36:21 2020 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 02 Mar 2020 05:36:21 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583127381.25.0.0899706242374.issue36144@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +18086 pull_request: https://github.com/python/cpython/pull/18729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:54:14 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 02 Mar 2020 05:54:14 +0000 Subject: [issue39645] Read approximate state of concurrent.futures.Future In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583128454.26.0.0546806268377.issue39645@roundup.psfhosted.org> Kyle Stanley added the comment: > I?m a bit disappointed, since it looks like this won?t allow implementing the OP?s classes without using private APIs. The debugging and loggin use cases aren?t very compelling to me. Yeah, I had every intention when I initially proposed the idea on the python-ideas thread to provide an extensive means of implementing custom Future and Executor classes, but Antoine brought up a very valid concern about users shooting themselves in the foot with it: > I'm much more lukewarm on set_state(). How hard is it to reimplement > one's own Future if someone wants a different implementation? By > allowing people to change the future's internal state, we're also > giving them a (small) gun to shoot themselves with. In terms of a cost-benefit analysis, I'd imagine that it's going to be a rather small portion of the concurrent.futures users that would actually have a genuine use case for implementing their own custom Future or Executor. He was still approving of a `future.state()` though, which is why I considered implementing it alone: > That sounds useful to me indeed. I assume you mean something like a > state() method? We already have Queue.qsize() which works a bit like > this (unlocked and advisory). Although not nearly as significant (or interesting), I've personally encountered situations where it would be useful for logging purposes to be able to read the approximate state of the future. But if the consensus ends up being that it's not useful enough to justify adding compared to the original purpose of the issue, I would certainly understand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 00:58:35 2020 From: report at bugs.python.org (Zachary Ware) Date: Mon, 02 Mar 2020 05:58:35 +0000 Subject: [issue39807] Python38 installed in wrong directory on Windows In-Reply-To: <1583056512.25.0.736477691281.issue39807@roundup.psfhosted.org> Message-ID: <1583128715.79.0.203936639576.issue39807@roundup.psfhosted.org> Zachary Ware added the comment: That almost certainly means you were installing the 32-bit version of Python. 32-bit processes see `C:\Program Files (x86)\` as `C:\Program Files\`; I no longer remember whether they can actually see the real `C:\Program Files\` at all. ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:01:32 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 02 Mar 2020 06:01:32 +0000 Subject: [issue39645] Read approximate state of concurrent.futures.Future In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583128892.79.0.933531499366.issue39645@roundup.psfhosted.org> Guido van Rossum added the comment: But note my response to Antoine at the time, mentioning that implementing ?as_completed()? is impossible that way. Antoine then backtracked somewhat. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:16:13 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:16:13 +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: <1583129773.09.0.814166215319.issue39816@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Chris and Kyle. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:17:00 2020 From: report at bugs.python.org (Nick Moore) Date: Mon, 02 Mar 2020 06:17:00 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583129820.29.0.858565169634.issue26460@roundup.psfhosted.org> Nick Moore added the comment: I suspect this is going to come up about this time of every leap year :-/ The workaround is prepending "%Y " to the pattern and eg: "2020 " to the date string, but that's not very nice. Would adding a kwarg "default_year" be an acceptable solution? I can't think of any other situation other than leap years when this is going to come up. If both "default_year" and "%Y" are present throw an exception (maybe therefore just call the kwarg "year") In the weird case where you want to do date maths involving the month as well, you can always use a safe choice like "default_year=2020" and then fix the year up afterwards: ``` dt = datetime.strptime(date_str, "%b %d", default_year=2020) dt = dt.replace(year=2021 if dt.month > 6 else 2022) ``` ---------- nosy: +nickzoic versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:17:02 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 02 Mar 2020 06:17:02 +0000 Subject: [issue39645] Expand concurrent.futures.Future's public API In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583129822.05.0.545192149098.issue39645@roundup.psfhosted.org> Kyle Stanley added the comment: > But note my response to Antoine at the time, mentioning that implementing > ?as_completed()? is impossible that way. Antoine then backtracked somewhat. Ah, I had seen that but for some reason hadn't considered that Antoine might have also changed his stance on a means of modifying the state of the future: > > It's actually really hard to implement your own > > Future class that works > > well with concurrent.futures.as_completed() -- this is basically what > > complicated the OP's implementation. Maybe it would be useful to look into > > a protocol to allow alternative Future implementations to hook into that? > Ah, I understand the reasons then. Ok, it does sound useful to explore > the space of solutions. But let's decouple it from simply querying the > current Future state. In that case, I'll revert the title and leave the issue open for further discussion; but I'll hold off on any PRs until we have some consensus regarding the direction we want to go in with regards to potential new future protocols. Apologies for the misunderstanding, thanks for clarifying. :) I'd also be interested in hearing Brian Quinlain's thoughts on the matter. ---------- title: Read approximate state of concurrent.futures.Future -> Expand concurrent.futures.Future's public API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:18:27 2020 From: report at bugs.python.org (Zachary Ware) Date: Mon, 02 Mar 2020 06:18:27 +0000 Subject: [issue39814] Hyphens not generated for split-words in a "note" directive In-Reply-To: <1583087502.84.0.65826697988.issue39814@roundup.psfhosted.org> Message-ID: <1583129907.92.0.0653567984293.issue39814@roundup.psfhosted.org> Zachary Ware added the comment: Is this not a Sphinx issue? ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:27:58 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 02 Mar 2020 06:27:58 +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: <1583130478.27.0.353118060131.issue39816@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:29:07 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 06:29:07 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583130547.26.0.471451081887.issue39378@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18088 pull_request: https://github.com/python/cpython/pull/18731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:29:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:29:01 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583130541.01.0.213609819046.issue39378@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1f577ce363121d590b51abf5c41d1bcf3d751436 by Hai Shi in branch 'master': bpo-39378: partial of PickleState struct should be traversed. (GH-18046) https://github.com/python/cpython/commit/1f577ce363121d590b51abf5c41d1bcf3d751436 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:28:59 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 06:28:59 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583130539.94.0.680490937498.issue39378@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18087 pull_request: https://github.com/python/cpython/pull/18730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:33:27 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:33:27 +0000 Subject: [issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations In-Reply-To: <1580350307.52.0.118414531826.issue39495@roundup.psfhosted.org> Message-ID: <1583130807.89.0.235531939215.issue39495@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4edc95cf0a2960431621eee9bc194f6225f1690b by Shantanu in branch 'master': bpo-39495: Remove default value from C impl of TreeBuilder.start (GH-18275) https://github.com/python/cpython/commit/4edc95cf0a2960431621eee9bc194f6225f1690b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:39:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:39:56 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583131196.14.0.146332795302.issue38971@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2565edec2c974b2acca03b4cc5025e83f903ddd7 by Chris A in branch 'master': bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666) https://github.com/python/cpython/commit/2565edec2c974b2acca03b4cc5025e83f903ddd7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:42:45 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:42:45 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583131365.55.0.463782024136.issue38913@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 28d0bcac8b7e6dbd28311f1283dabb6a4d649fcb by Serhiy Storchaka in branch 'master': bpo-38913: Fix segfault in Py_BuildValue("(s#O)", ...) if entered with exception raised. (GH-18656) https://github.com/python/cpython/commit/28d0bcac8b7e6dbd28311f1283dabb6a4d649fcb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:46:51 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:46:51 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583131611.53.0.848175929384.issue38913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18089 pull_request: https://github.com/python/cpython/pull/18732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:47:02 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 06:47:02 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583131622.48.0.277624184771.issue39378@roundup.psfhosted.org> miss-islington added the comment: New changeset d3c24350892b55b4ea6fb81b84e577968c1f2f91 by Miss Islington (bot) in branch '3.7': bpo-39378: partial of PickleState struct should be traversed. (GH-18046) https://github.com/python/cpython/commit/d3c24350892b55b4ea6fb81b84e577968c1f2f91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:47:26 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 06:47:26 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583131646.85.0.918059435548.issue39378@roundup.psfhosted.org> miss-islington added the comment: New changeset 5f2ade20a556f8c20555c7032436477d6dc86d4f by Miss Islington (bot) in branch '3.8': bpo-39378: partial of PickleState struct should be traversed. (GH-18046) https://github.com/python/cpython/commit/5f2ade20a556f8c20555c7032436477d6dc86d4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 01:54:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 06:54:47 +0000 Subject: [issue39378] partial of PickleState struct should be traversed. In-Reply-To: <1579325487.94.0.252462243653.issue39378@roundup.psfhosted.org> Message-ID: <1583132087.01.0.198202160093.issue39378@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:30:17 2020 From: report at bugs.python.org (Chris Withers) Date: Mon, 02 Mar 2020 07:30:17 +0000 Subject: [issue39753] inspecting a partial with bound keywords gives incorrect signature In-Reply-To: <1582656134.57.0.362705493242.issue39753@roundup.psfhosted.org> Message-ID: <1583134217.59.0.837654384947.issue39753@roundup.psfhosted.org> Chris Withers added the comment: Not sure I understand your comment. The results of calling inpsect on a partial with bound keyword parameters are incorrect. Furthermore, it is surprisingly that partial objects don't maintain their own __signature__. What is it you're suggesting? ---------- title: inspecting a partial with bound keywods gives incorrect signature -> inspecting a partial with bound keywords gives incorrect signature _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:39:05 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:39:05 +0000 Subject: [issue39822] Use NULL instead of None for empty attrib in C implementation of Element Message-ID: <1583134745.29.0.697381999553.issue39822@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently None is used instead of an empty directory for the attrib field in the C implementation of Element in ElementTree. It is a pure optimization: an empty dict takes a memory and its creation has a cost. The proposed PR makes NULL be using instead of None. This simplifies the code. ---------- components: Extension Modules messages: 363133 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Use NULL instead of None for empty attrib in C implementation of Element versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:42:53 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 07:42:53 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583134973.52.0.318588102953.issue38971@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18090 pull_request: https://github.com/python/cpython/pull/18733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:43:00 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 07:43:00 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583134980.81.0.577103527348.issue38971@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18091 pull_request: https://github.com/python/cpython/pull/18734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:43:14 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:43:14 +0000 Subject: [issue39822] Use NULL instead of None for empty attrib in C implementation of Element In-Reply-To: <1583134745.29.0.697381999553.issue39822@roundup.psfhosted.org> Message-ID: <1583134994.13.0.649190479475.issue39822@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18092 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:53:39 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:53:39 +0000 Subject: [issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations In-Reply-To: <1580350307.52.0.118414531826.issue39495@roundup.psfhosted.org> Message-ID: <1583135619.03.0.458891869605.issue39495@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:54:48 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:54:48 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583135688.88.0.926927665962.issue38913@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a7b8a969eb3daacb1fcb029a8c5fecb5d09c964b by Serhiy Storchaka in branch '3.8': [3.8] bpo-38913: Fix segfault in Py_BuildValue("(sGH-O)", ...) if entered with exception raised. (GH-18656). (GH-18732) https://github.com/python/cpython/commit/a7b8a969eb3daacb1fcb029a8c5fecb5d09c964b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:55:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:55:32 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583135732.43.0.268371610209.issue38913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> crash versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 02:58:51 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 07:58:51 +0000 Subject: [issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}() In-Reply-To: <1570543574.99.0.942798410146.issue38410@roundup.psfhosted.org> Message-ID: <1583135931.27.0.108628504123.issue38410@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 87a4cd5fbebdd0e6166b421d2c3706bc2f2e5a11 by Serhiy Storchaka in branch '3.8': bpo-38410: Properly handle PySys_Audit() failures (GH-18658) https://github.com/python/cpython/commit/87a4cd5fbebdd0e6166b421d2c3706bc2f2e5a11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 03:02:20 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 08:02:20 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583136140.16.0.139316172263.issue38971@roundup.psfhosted.org> miss-islington added the comment: New changeset f4d709f4a3c69bd940bd6968a70241277132bed7 by Miss Islington (bot) in branch '3.7': bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666) https://github.com/python/cpython/commit/f4d709f4a3c69bd940bd6968a70241277132bed7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 03:03:11 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 08:03:11 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583136191.45.0.0387224550783.issue38971@roundup.psfhosted.org> miss-islington added the comment: New changeset f28b0c74e54a133cb0287b4297af67d0d7c14d6e by Miss Islington (bot) in branch '3.8': bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666) https://github.com/python/cpython/commit/f28b0c74e54a133cb0287b4297af67d0d7c14d6e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 03:16:43 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 08:16:43 +0000 Subject: [issue38971] codecs.open leaks file descriptor when invalid encoding is passed In-Reply-To: <1575478307.61.0.215522324906.issue38971@roundup.psfhosted.org> Message-ID: <1583137003.9.0.882154416322.issue38971@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is too later for 2.7. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 03:24:42 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 02 Mar 2020 08:24:42 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583137482.15.0.757119830564.issue39820@roundup.psfhosted.org> Mark Dickinson added the comment: Is this even possible in a plain text console (or plain text console + GNU readline-equivalent)? > Bracketed paste mode is implemented in many text editors, as vi. Sure, but the REPL is not a text editor, and knows very little about the context it's being run in. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:00:46 2020 From: report at bugs.python.org (S Murthy) Date: Mon, 02 Mar 2020 09:00:46 +0000 Subject: [issue39823] Disassembly - improve documentation for bytecode instruction class and set source line no. attribute for every instruction Message-ID: <1583139646.83.0.873183200808.issue39823@roundup.psfhosted.org> New submission from S Murthy : I note that on disassembling a piece of source code (via source strings or code objects) the corresponding sequence of bytecode instruction objects (https://docs.python.org/3/library/dis.html#dis.Instruction) do not always have the `starts_line` attribute set - the storage and display of this line no. seems to be based on whether a given instruction is the first in a block of instructions which implement a given source line. I think it would be better, for mapping source and logical lines of code to bytecode instruction blocks, to set `starts_line` for every instruction, and amend the bytecode printing method (`dis._disassemble_bytes`) to keep the existing behaviour by detecting whether an instruction is the first line of an instruction block. ATM `Instruction` objects are created and generated within this loop in `dis._get_bytecode_instructions`: def _get_instructions_bytes(code, varnames=None, names=None, constants=None, cells=None, linestarts=None, line_offset=0): """Iterate over the instructions in a bytecode string. Generates a sequence of Instruction namedtuples giving the details of each opcode. Additional information about the code's runtime environment (e.g. variable names, constants) can be specified using optional arguments. """ labels = findlabels(code) starts_line = None for offset, op, arg in _unpack_opargs(code): if linestarts is not None: starts_line = linestarts.get(offset, None) ... ... So it's this line starts_line = linestarts.get(offset, None) which currently causes `starts_line` to be to set to `None` for every instruction which isn't the first in an instruction block - linestarts is a dict of source line numbers and offsets of the first instructions starting the corresponding instruction blocks. My idea is to (1) change that line above to starts_line = linestarts.get(offset, starts_line) which ensures every instruction will have the corresponding source line no. set, (2) amend `Instruction._disassemble` to add a new optional argument `print_start_line` with default of `True` to determine whether to print the source line no., and (3) amend `dis._disassemble_bytes` to accept a new optional argument `start_line_by_block` with a default of `True` which can be used to preserve existing behaviour of printing source line numbers by instruction block. I was wondering whether this sounds OK, if so, I am happy to submit a PR. ---------- components: Library (Lib) messages: 363140 nosy: smurthy priority: normal severity: normal status: open title: Disassembly - improve documentation for bytecode instruction class and set source line no. attribute for every instruction type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:10:47 2020 From: report at bugs.python.org (S Murthy) Date: Mon, 02 Mar 2020 09:10:47 +0000 Subject: [issue39823] Disassembly - improve documentation for bytecode instruction class and set source line no. attribute for every instruction In-Reply-To: <1583139646.83.0.873183200808.issue39823@roundup.psfhosted.org> Message-ID: <1583140247.8.0.995558193097.issue39823@roundup.psfhosted.org> S Murthy added the comment: Docstring for `Instruction` should be more precise. ATM the description of `starts_line` is line started by this opcode (if any), otherwise None I think "source line started ..." would be a bit more precise and accurate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:22:12 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 09:22:12 +0000 Subject: [issue39807] Python38 installed in wrong directory on Windows In-Reply-To: <1583056512.25.0.736477691281.issue39807@roundup.psfhosted.org> Message-ID: <1583140932.08.0.520496330287.issue39807@roundup.psfhosted.org> Steve Dower added the comment: Yep, that seems like the reason. All of that redirection is handled by the OS and I don't think we'd want to override it. However, I suspect we're close to having another discussion about making the 64 bit download the default. There are fewer actual 32-bit OS installs out there (though I don't have real numbers yet) and I think we're seeing more people get confused by the 32-bit installer than would be by an immediate error if they need a different one. That said, ARM devices can only run the 32-bit version. If we start seeing those pick up, we may have to reconsider again. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:23:25 2020 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Mon, 02 Mar 2020 09:23:25 +0000 Subject: [issue38826] Regular Expression Denial of Service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1573955142.95.0.285133152076.issue38826@roundup.psfhosted.org> Message-ID: <1583141005.48.0.708074064498.issue38826@roundup.psfhosted.org> Change by Micha? G?rny : ---------- nosy: +mgorny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:23:41 2020 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Mon, 02 Mar 2020 09:23:41 +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: <1583141021.63.0.61676770558.issue39503@roundup.psfhosted.org> Change by Micha? G?rny : ---------- nosy: +mgorny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:25:06 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 09:25:06 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1583141106.94.0.26592929423.issue30082@roundup.psfhosted.org> Steve Dower added the comment: It'll have to be a program that cannot inherit the active console. Ffmpeg normally can, but running the first script with pythonw will make sure there is no console to inherit, and a new one will pop up for a regular Python process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:42:47 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 02 Mar 2020 09:42:47 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583142167.75.0.915715465226.issue38380@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Would you prefer that I close GH_18678 and split it up in separate RPs for macOS and Windows? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:52:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 09:52:22 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL Message-ID: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> New submission from STINNER Victor : Currently, when a module implements m_traverse(), m_clear() or m_free(), these methods can be called with md_state=NULL even if the module implements the "Multi-phase extension module initialization" API (PEP 489). I'm talking about these module methods: * tp_traverse: module_traverse() calls md_def->m_traverse() if m_traverse is not NULL * tp_clear: module_clear() calls md_def->m_clear() if m_clear is not NULL * tp_dealloc: module_dealloc() calls md_def->m_free() is m_free is not NULL Because of that, the implementation of these methods must check manually if md_state is NULL or not. I propose to change module_traverse(), module_clear() and module_dealloc() to not call m_traverse(), m_clear() and m_free() if md_state is NULL and m_size > 0. "m_size > 0" is an heuristic to check if the module implements the "Multi-phase extension module initialization" API (PEP 489). For example, the _pickle module doesn't fully implements the PEP 489: m_size > 0, but PyInit__pickle() uses PyModule_Create(). See bpo-32374 which documented that "m_traverse may be called with m_state=NULL" (GH-5140). ---------- components: Interpreter Core messages: 363145 nosy: vstinner priority: normal severity: normal status: open title: Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:53:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 09:53:06 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583142786.6.0.291804778002.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: The question came up while I reviewed PR 18608 which ports the audioop extension module to multiphase initialization (PEP 489): https://github.com/python/cpython/pull/18608/files#r386061746 Petr Viktorin referred to m_clear() documentation which says that md_state *can* be NULL when m_clear() is called: https://docs.python.org/3/c-api/module.html#c.PyModuleDef.m_clear ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:54:52 2020 From: report at bugs.python.org (Inada Naoki) Date: Mon, 02 Mar 2020 09:54:52 +0000 Subject: [issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict In-Reply-To: <1582811259.66.0.363702048971.issue39775@roundup.psfhosted.org> Message-ID: <1583142892.67.0.332973349509.issue39775@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 211055176157545ce98e6c02b09d624719e6dd30 by Inada Naoki in branch 'master': bpo-39775: inspect: Change Signature.parameters back to OrderedDict. (GH-18684) https://github.com/python/cpython/commit/211055176157545ce98e6c02b09d624719e6dd30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 04:55:04 2020 From: report at bugs.python.org (Inada Naoki) Date: Mon, 02 Mar 2020 09:55:04 +0000 Subject: [issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict In-Reply-To: <1582811259.66.0.363702048971.issue39775@roundup.psfhosted.org> Message-ID: <1583142904.4.0.708198277001.issue39775@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:01:59 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 02 Mar 2020 10:01:59 +0000 Subject: [issue39050] The "Help" button in IDLE's config dialog does not work In-Reply-To: <1576360901.2.0.273955220755.issue39050@roundup.psfhosted.org> Message-ID: <1583143319.12.0.0927500977547.issue39050@roundup.psfhosted.org> Zackery Spytz added the comment: Terry, should this issue remain open? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:29:47 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 02 Mar 2020 10:29:47 +0000 Subject: [issue37266] Daemon threads must be forbidden in subinterpreters In-Reply-To: <1560418565.72.0.288239825756.issue37266@roundup.psfhosted.org> Message-ID: <1583144987.31.0.43615589197.issue37266@roundup.psfhosted.org> Antoine Pitrou added the comment: Ok, I opened issue39812 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:45:59 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 10:45:59 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583145959.56.0.97340780566.issue39794@roundup.psfhosted.org> Stefan Krah added the comment: For the people who find this issue via a search engine: 1) The defaults in 3.7, 3.8 and 3.9 are unchanged (you get the ContextVar). 2) ./configure --without-decimal-contextvar enables the exact TLS context code from 3.3-3.6. There is no new code. 3) On Windows you need to edit PC\pyconfig.h to enable the TLS context. 4) There are extensive tests for the flag in: Modules/_decimal/tests/runall-memorydebugger.sh ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:50:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 10:50:53 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583146253.15.0.0661726213924.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: There are different kinds of extension modules: (1) no module state (m_size <= 0): **not affected** by this change. Example: _asyncio which implements m_free() to clear global variables and free lists. (2) Have a module state but PyInit_xxx() calls PyModule_Create(): PyModule_Create() always allocates md_state. I understand that such extension module is **not affected** by this change. (3) Multi-phase extension: PyInit_xxx() function calls PyModuleDef_Init(). Such extension module **is affected** if m_traverse, m_clear or m_free() is not NULL. Example: atexit module implements m_traverse, m_clear and m_free. PyModuleObject structure contains Python objects like md_dict (dict), md_name (str) or md_weaklist (list): * module_traverse() always traverses md_dict: m_traverse() is no needed for that. * module_clear() always clears md_dict: m_clear() is no needed for that. * module_dealloc() always deallocates md_dict, md_name and md_weaklist: m_free() is no needed for that. * md_name is a string, it cannot be involved in a reference cycle. I don't think that it's possible to extend PyModuleObject structure (as done by PyListObject for PyObject) to add other Python objects: md_state is designed for that. PyModule_Create() allocates exactly sizeof(PyModuleObject) bytes. If an extension module has a module state, stores Python objects *outside* this state and uses m_traverse, m_clear and m_free to handle these objects: the GC will no longer be able to handle these objects before the module is executed with this change. If such extension module exists, I consider that it's ok to only handle objects stored outside the module state once the module is executed. The window between and is very short. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:51:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 10:51:37 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583146297.36.0.621196049498.issue39824@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18093 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:52:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 10:52:47 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583146367.45.0.325949536332.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 18738 to implement this change. ---------- nosy: +Dormouse759, ncoghlan, pablogsal, petr.viktorin, shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:53:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 10:53:03 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583146383.34.0.0640422792429.issue39824@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL -> Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 05:56:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 10:56:00 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583146560.18.0.32607866218.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: > I propose to change module_traverse(), module_clear() and module_dealloc() to not call m_traverse(), m_clear() and m_free() if md_state is NULL and m_size > 0. Note: This change also means that m_traverse, m_clear and m_free are no longer called if md_state is set to NULL. But it never occurs in practice. module_dealloc() calls PyMem_FREE(m->md_state) but it doesn't set md_state to NULL. It's not needed, since the module memory is deallocated anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:01:22 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 11:01:22 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583146882.16.0.454788637746.issue39794@roundup.psfhosted.org> Stefan Krah added the comment: > If someone builds an interpreter with this configure flag, does it break > compatibility with anything that code may have started to expect as of 3.7? Yes, anything that relies on the implicit context being coroutine-safe does not work. The only test that expectedly breaks in the stdlib is: Lib/test/test_asyncio/test_context.py Basically you can't use operators inside coroutines in the same thread if both coroutines use a different implicit context. You can of course replace all operators inside coroutines by the corresponding context methods: # Unsafe with TLS context: async def foo(): with localcontext(Context(prec=10)): x = Decimal(1) / 9 # Safe, just avoid the TLS context: async def foo(): c = Context(prec=10) x = c.divide(Decimal(1), 9) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:09:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 11:09:21 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583147361.82.0.52190882298.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: Proposed PR checking if the module state is NULL: * PR 18358: _locale module * PR 18608: audioop module * PR 18613: binascii ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:09:55 2020 From: report at bugs.python.org (Antony Lee) Date: Mon, 02 Mar 2020 11:09:55 +0000 Subject: [issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict In-Reply-To: <1582811259.66.0.363702048971.issue39775@roundup.psfhosted.org> Message-ID: <1583147395.1.0.0949613265015.issue39775@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:10:54 2020 From: report at bugs.python.org (Antony Lee) Date: Mon, 02 Mar 2020 11:10:54 +0000 Subject: [issue23080] BoundArguments.arguments should be unordered In-Reply-To: <1418907389.55.0.608772896554.issue23080@psf.upfronthosting.co.za> Message-ID: <1583147454.04.0.537606399216.issue23080@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:12:24 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 11:12:24 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583147544.65.0.470281719724.issue38380@roundup.psfhosted.org> Steve Dower added the comment: No, that one is fine. I just need someone else to jump in and tag the commit in cpython-source-deps for me (because I can't clone it successfully on my current internet connection). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:20:48 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 11:20:48 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583148048.51.0.621026764993.issue38597@roundup.psfhosted.org> Steve Dower added the comment: > don't know if you still need it but here is what you requested. Thanks. That basically confirms that something is interfering with distutils. Skipping the check entirely should avoid it. ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:26:48 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 02 Mar 2020 11:26:48 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583148408.89.0.419909053492.issue38380@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ah, but you're all set @steve.dower, someone at cpython-source-deps already pulled my tags: https://github.com/python/cpython-source-deps/tags :) But I guess that if I were to do the same maneouver again, it would probably be preferable if I made one PR for macOS and another for Windows, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:32:39 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 02 Mar 2020 11:32:39 +0000 Subject: [issue39610] memoryview.__len__ should raise an exception for 0d buffers In-Reply-To: <1581435772.39.0.91175671687.issue39610@roundup.psfhosted.org> Message-ID: <1583148759.03.0.250479496174.issue39610@roundup.psfhosted.org> Eric Wieser added the comment: Thanks for pointing out the docs reference, I updated the patch to reword that section. There's a sentence right before the one you draw attention to which to me reads as another argument to change this: > ``len(view)`` is equal to the length of :class:`~memoryview.tolist` On Python 2.7, this gives >>> len(view_0d) 1 >>> len(view_0d.tolist()) NotImplementedError: tolist() only supports one-dimensional objects On Python 3.8 before my patch, this gives: >>> len(view_0d) 1 >>> len(view_0d.tolist()) TypeError: object of type 'int' has no len() On Python 3.8, with my patch, this gives: >>> len(view_0d) TypeError: 0-dim memory has no length >>> len(view_0d.tolist()) TypeError: object of type 'int' has no len() As I read it, only with my patch is this sentence satisfied by the implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:35:11 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 11:35:11 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583148911.71.0.597931897553.issue38380@roundup.psfhosted.org> Steve Dower added the comment: Nope, same PR and bug is totally fine. Putting the NEWS items in their platform-specific sections is how we normally do it (though to be fair, I had to go look it up). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:36:32 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 02 Mar 2020 11:36:32 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583148992.77.0.92834072437.issue38380@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ok, thanks for your patience and time. I'll fix the NEWS entries right away. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:39:41 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 11:39:41 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583149181.64.0.84317207191.issue38380@roundup.psfhosted.org> Steve Dower added the comment: I marked the PR to backport to 3.7 and 3.8. Up to Benjamin whether 2.7 gets it, but unless there's a specific and impactful CVE that's been fixed, I doubt it (the one linked at the start of this issue seems to require direct modification of the SQL statement, which would be a bug in itself if permitted, so I think it's outside of our threat model for CPython). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:40:49 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 11:40:49 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583149249.28.0.834221175683.issue39794@roundup.psfhosted.org> Stefan Krah added the comment: To make things more clear (it is good that Gregory asked): ONLY use this flag if you don't use coroutines at all OR control ALL async libraries in your application. Random async libraries from PyPI may rely on the ContextVar and silently give incorrect results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 06:56:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 11:56:10 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583150170.45.0.00466653396625.issue39796@roundup.psfhosted.org> STINNER Victor added the comment: _PyWarnings_Init() initializes tstate->interp->warnings which is the module state of the warnings module: WarningsState *st = _Warnings_GetState(); if (st == NULL) { goto error; } if (_Warnings_InitState(st) < 0) { goto error; } In Python 2, _PyWarnings_Init() called Py_InitModule3() which immediately stored the _warnings module to sys.modules['_warnings']. In Python 3, _PyWarnings_Init() calls PyModule_Create() which creates a module but doesn't add it to sys.modules. I don't think that removing _PyWarnings_Init() call from pylifecycle.c is correct. We want the _warnings module to be ready as early as possible. The problem is that pylifecycle.c creates a module object which is not stored anywhere: /* Initialize _warnings. */ if (_PyWarnings_Init() == NULL) { return _PyStatus_ERR("can't initialize warnings"); } pylifecycle.c should only call _Warnings_InitState() without creating a module. There are C functions which access the module state (tstate->interp->warnings) without going through the module object, like PyErr_WarnFormat(). ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:07:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 12:07:21 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583150841.38.0.340207261974.issue39796@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18094 pull_request: https://github.com/python/cpython/pull/18739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:22:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 12:22:43 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583151763.95.0.464522577309.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: > And setup.py does use use multiple processes via a thread pool, where each thread calls fork(), if it detects that "make" was invoked with the parallel (-j) option. Oh ok, now I get it :-) setup.py uses distutils to build extensions and distutils.command.build_ext uses concurrent.futures for parallelism: if self.parallel: self._build_extensions_parallel() else: self._build_extensions_serial() with: def _build_extensions_parallel(self): workers = self.parallel if self.parallel is True: workers = os.cpu_count() # may return None try: from concurrent.futures import ThreadPoolExecutor except ImportError: workers = None if workers is None: self._build_extensions_serial() return with ThreadPoolExecutor(max_workers=workers) as executor: futures = [executor.submit(self.build_extension, ext) for ext in self.extensions] for ext, fut in zip(self.extensions, futures): with self._filter_build_errors(ext): fut.result() The problem is not concurrent.futures but the job submitted to the executor: build_extension() uses distutils.spawn() which is unsafe. distutils.spawn() is the root issue if I understood correctly. It must be rewritten with subprocess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:25:19 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 12:25:19 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583151919.91.0.0287852052723.issue38380@roundup.psfhosted.org> miss-islington added the comment: New changeset 1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e by Erlend Egeberg Aasland in branch 'master': bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678) https://github.com/python/cpython/commit/1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:25:34 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 12:25:34 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583151934.08.0.157454763789.issue38380@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18096 pull_request: https://github.com/python/cpython/pull/18741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:25:27 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 12:25:27 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583151927.11.0.990547702207.issue38380@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18095 pull_request: https://github.com/python/cpython/pull/18740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:36:28 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Mar 2020 12:36:28 +0000 Subject: [issue39050] The "Help" button in IDLE's config dialog does not work In-Reply-To: <1576360901.2.0.273955220755.issue39050@roundup.psfhosted.org> Message-ID: <1583152588.67.0.423342832407.issue39050@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:43:36 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 02 Mar 2020 12:43:36 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583153016.85.0.541650968809.issue38913@roundup.psfhosted.org> Charalampos Stratakis added the comment: After this change, the arm64 buildbots are reporting reference leaks: 1:03:24 load avg: 0.95 Re-running failed tests in verbose mode 1:03:24 load avg: 0.95 Re-running test_capi in verbose mode test_capi leaked [4, 4, 4] references, sum=12 e.g. https://buildbot.python.org/all/#/builders/563/builds/25 ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:46:05 2020 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 02 Mar 2020 12:46:05 +0000 Subject: [issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError In-Reply-To: <1582745153.24.0.421575819454.issue39764@roundup.psfhosted.org> Message-ID: <1583153165.04.0.458665358239.issue39764@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 4482337decdbd0c6e2150346a68b3616bda664aa by Lidi Zheng in branch 'master': bpo-39764: Make Task.get_stack accept ag_frame (#18669) https://github.com/python/cpython/commit/4482337decdbd0c6e2150346a68b3616bda664aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:46:07 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 12:46:07 +0000 Subject: [issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError In-Reply-To: <1582745153.24.0.421575819454.issue39764@roundup.psfhosted.org> Message-ID: <1583153167.53.0.649429654703.issue39764@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18097 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 07:49:09 2020 From: report at bugs.python.org (hai shi) Date: Mon, 02 Mar 2020 12:49:09 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583153349.79.0.913937110431.issue39796@roundup.psfhosted.org> hai shi added the comment: Wow, Thanks, victor, much useful infos. >In Python 3, _PyWarnings_Init() calls PyModule_Create() which creates a module but doesn't add it to sys.modules. this operation will be executed in _bootstrap_external. > We want the _warnings module to be ready as early as possible. if we don't load _warnings module as soon as possible, what possible risks will be raise? > There are C functions which access the module state (tstate->interp->warnings) without going through the module object, like PyErr_WarnFormat(). This is important info. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:01:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 13:01:47 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583154107.13.0.608810303302.issue38913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:04:07 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 13:04:07 +0000 Subject: [issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError In-Reply-To: <1582745153.24.0.421575819454.issue39764@roundup.psfhosted.org> Message-ID: <1583154247.41.0.0137698169253.issue39764@roundup.psfhosted.org> miss-islington added the comment: New changeset 43932dc1eaf36d75b2ee0420d8be747001315c26 by Miss Islington (bot) in branch '3.8': bpo-39764: Make Task.get_stack accept ag_frame (GH-18669) https://github.com/python/cpython/commit/43932dc1eaf36d75b2ee0420d8be747001315c26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:06:37 2020 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 02 Mar 2020 13:06:37 +0000 Subject: [issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError In-Reply-To: <1582745153.24.0.421575819454.issue39764@roundup.psfhosted.org> Message-ID: <1583154397.02.0.386800458425.issue39764@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:21:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 13:21:22 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583155282.04.0.821207347438.issue38913@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:40:07 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 02 Mar 2020 13:40:07 +0000 Subject: [issue39825] EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows) Message-ID: <1583156407.62.0.364374237882.issue39825@roundup.psfhosted.org> New submission from Antoine Pitrou : On Windows, Python 3.7.6 and 3.8.1: ``` >>> import sysconfig >>> sysconfig.get_config_var('EXT_SUFFIX') '.pyd' >>> from distutils import sysconfig >>> sysconfig.get_config_var('EXT_SUFFIX') '.cp38-win_amd64.pyd' ``` The sysconfig answer is probably wrong (the ABI-qualified extension '.cp38-win_amd64.pyd' should be preferred). ---------- components: Distutils, Library (Lib) messages: 363171 nosy: dstufft, eric.araujo, paul.moore, pitrou, steve.dower, tarek, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows) type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:51:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 13:51:31 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583157091.2.0.648593508355.issue39763@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18098 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:56:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 13:56:59 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583157419.08.0.86810331817.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 18743 to reimplement distutils.spawn.spawn() function with the subprocess module. It also changes setup.py to use a basic implementation of the subprocess module if the subprocess module is not available: before required C extension modules are built. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 08:59:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 13:59:26 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583157566.93.0.020946418093.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: Attached fork_mt.py example uses exec_fn() function... which is not defined. Is it on purpose? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 09:02:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 14:02:25 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583157745.0.0.0888760745818.issue39796@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 66b7973c1b2e6aa6a2462c6b13971a08cd665af2 by Victor Stinner in branch 'master': bpo-39796: Fix _warnings module initialization (GH-18739) https://github.com/python/cpython/commit/66b7973c1b2e6aa6a2462c6b13971a08cd665af2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 09:04:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 14:04:16 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583157856.3.0.291642662875.issue39796@roundup.psfhosted.org> STINNER Victor added the comment: > if we don't load _warnings module as soon as possible, what possible risks will be raise? There are different risks: * Worst case: using the _warnings module state before it's initialized may lead to crash. * Best case: some warnings are not emitted. Anyway, the initial issue should now be fixed by my commit. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 09:11:18 2020 From: report at bugs.python.org (Elad Lahav) Date: Mon, 02 Mar 2020 14:11:18 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583158278.22.0.806070820007.issue39763@roundup.psfhosted.org> Elad Lahav added the comment: "Attached fork_mt.py example uses exec_fn() function... which is not defined. Is it on purpose?" That was my mistake - a copy/paste of existing code from distutils. Since the example hangs before the script gets to exec_fn() I didn't notice the problem. Just change it to os.execl ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 09:43:07 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 02 Mar 2020 14:43:07 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583160187.18.0.525577487318.issue39778@roundup.psfhosted.org> Antoine Pitrou added the comment: Yes, I don't think other weakref-supporting objects traverse the weakreflist in their tp_traverse. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:02:12 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 15:02:12 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583161332.0.0.099571638725.issue38380@roundup.psfhosted.org> miss-islington added the comment: New changeset 7ca251bd85f1182b9734579975c17fbd0488e2a4 by Miss Islington (bot) in branch '3.7': bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678) https://github.com/python/cpython/commit/7ca251bd85f1182b9734579975c17fbd0488e2a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:02:11 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 15:02:11 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583161331.82.0.81087047223.issue38380@roundup.psfhosted.org> miss-islington added the comment: New changeset 7ad99821d8ae75222c50e69194a39f535bb058f5 by Miss Islington (bot) in branch '3.8': bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678) https://github.com/python/cpython/commit/7ad99821d8ae75222c50e69194a39f535bb058f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:02:11 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 15:02:11 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583161331.82.0.81087047223.issue38380@roundup.psfhosted.org> miss-islington added the comment: New changeset 7ad99821d8ae75222c50e69194a39f535bb058f5 by Miss Islington (bot) in branch '3.8': bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678) https://github.com/python/cpython/commit/7ad99821d8ae75222c50e69194a39f535bb058f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:03:22 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 02 Mar 2020 15:03:22 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583161402.06.0.221558184752.issue38380@roundup.psfhosted.org> Steve Dower added the comment: Leaving open until someone (*cough* Benjamin) confirms whether this has to go into 2.7 or not. ---------- nosy: +benjamin.peterson stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:04:37 2020 From: report at bugs.python.org (lorb) Date: Mon, 02 Mar 2020 15:04:37 +0000 Subject: [issue39826] logging HTTPHandler does not support proxy Message-ID: <1583161477.89.0.356688736779.issue39826@roundup.psfhosted.org> New submission from lorb : The HTTPHandler does not support using a proxy. It would be necessary to subclass it and reimplement `emit` to enable passing in proxy settings. Adding a hook to make it easy to customize the connection used would solve this. ---------- components: Library (Lib) messages: 363181 nosy: lorb priority: normal severity: normal status: open title: logging HTTPHandler does not support proxy type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:05:22 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 02 Mar 2020 15:05:22 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583161522.71.0.796930997078.issue38380@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Cool. Should I remove Python-3.* from the Versions label, so it doesn't show up in searches for 3.* issues? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:05:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 15:05:46 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583161546.57.0.917154261716.issue39778@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:10:54 2020 From: report at bugs.python.org (hai shi) Date: Mon, 02 Mar 2020 15:10:54 +0000 Subject: [issue39796] warning extension module inited twice in python3.9 In-Reply-To: <1582981417.61.0.704723505761.issue39796@roundup.psfhosted.org> Message-ID: <1583161854.92.0.387588138491.issue39796@roundup.psfhosted.org> hai shi added the comment: copy that, thanks for your explanation, victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:11:30 2020 From: report at bugs.python.org (Till Korten) Date: Mon, 02 Mar 2020 15:11:30 +0000 Subject: [issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar Message-ID: <1583161890.16.0.234726594776.issue39827@roundup.psfhosted.org> New submission from Till Korten : This issue occurs when a locale is set that uses comma as decimal separator (e.g. locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')). I have a tkinter.Spinbox with increment=0.1 connected to a tkinter.DoubleVar. When I change the value of the Spinbox using the arrow buttons and subsequently try to read out the variable with tkinter.DoubleVar.get(), my code throws the follwoing error: _tkinter.TclError: expected floating-point number but got "0,1". Here is a minimal code example: ------------- import tkinter import locale locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8') class TestDoubleVar(): def __init__(self): root = tkinter.Tk() self.var = tkinter.DoubleVar() self.var.set(0.8) number = tkinter.Spinbox( root, from_=0, to=1, increment=0.1, textvariable=self.var, command=self.update, width=4 ) number.pack(side=tkinter.LEFT) root.mainloop() def update(self, *args): print(float(self.var.get())) if __name__ == '__main__': TestDoubleVar() ------- Actual result: the code throws an error Expected result: the code should print the values of the DoubleVar even with a locale set that uses comma as the decimal separator. n.b. the problem also occurs with tkinter.Scale ---------- components: Tkinter files: test_doublevar.py messages: 363184 nosy: thawn priority: normal severity: normal status: open title: setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file48943/test_doublevar.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:14:16 2020 From: report at bugs.python.org (lorb) Date: Mon, 02 Mar 2020 15:14:16 +0000 Subject: [issue39826] logging HTTPHandler does not support proxy In-Reply-To: <1583161477.89.0.356688736779.issue39826@roundup.psfhosted.org> Message-ID: <1583162056.45.0.730301168474.issue39826@roundup.psfhosted.org> Change by lorb : ---------- keywords: +patch pull_requests: +18099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:14:59 2020 From: report at bugs.python.org (Ruairidh MacLeod) Date: Mon, 02 Mar 2020 15:14:59 +0000 Subject: [issue37636] Deprecate slicing and ordering operations on sys.version In-Reply-To: <1563626755.13.0.11799518747.issue37636@roundup.psfhosted.org> Message-ID: <1583162099.77.0.713517204475.issue37636@roundup.psfhosted.org> Change by Ruairidh MacLeod : ---------- nosy: +rkm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:30:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 15:30:28 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError Message-ID: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> New submission from STINNER Victor : The json.tool module doesn't catch BrokenPipeError: ----------------------- $ echo "{}" | python3 -m json.tool | true BrokenPipeError: [Errno 32] Broken pipe During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/lib64/python3.7/json/tool.py", line 45, in main() File "/usr/lib64/python3.7/json/tool.py", line 41, in main outfile.write('\n') BrokenPipeError: [Errno 32] Broken pipe ----------------------- json.tool should catch BrokenPipeError. ---------- components: Library (Lib) messages: 363185 nosy: vstinner priority: normal severity: normal status: open title: json.tool should catch BrokenPipeError versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:36:16 2020 From: report at bugs.python.org (Kim-Adeline Miguel) Date: Mon, 02 Mar 2020 15:36:16 +0000 Subject: [issue39829] __len__ called twice in the list() constructor Message-ID: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> New submission from Kim-Adeline Miguel : (See #33234) Recently we added Python 3.8 to our CI test matrix, and we noticed a possible backward incompatibility with the list() constructor. We found that __len__ is getting called twice, while before 3.8 it was only called once. Here's an example: class Foo: def __iter__(self): print("iter") return iter([3, 5, 42, 69]) def __len__(self): print("len") return 4 Calling list(Foo()) using Python 3.7 prints: iter len But calling list(Foo()) using Python 3.8 prints: len iter len It looks like this behaviour was introduced for #33234 with PR GH-9846. We realize that this was merged a while back, but at least we wanted to make the team aware of this change in behaviour. ---------- components: Interpreter Core messages: 363186 nosy: brett.cannon, eric.snow, kimiguel, pablogsal, rhettinger priority: normal severity: normal status: open title: __len__ called twice in the list() constructor type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:42:00 2020 From: report at bugs.python.org (Eric Snow) Date: Mon, 02 Mar 2020 15:42:00 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1583163720.26.0.998737335755.issue33234@roundup.psfhosted.org> Eric Snow added the comment: Possible backward incompatibility caused by this issue: issue39829 ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:44:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 15:44:00 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1583163840.41.0.709822381633.issue39829@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Why should that be backwards incompatible? The number of times we can `__len__` on the constructor is an implementation detail. The reason is called now twice is because there is an extra check for the preallocation logic, which is detached from the logic of the subsequent list_extend(self, iterable). On the other hand, there may be a chance for optimization here, but on a very rough first plan, that may require coupling some logic (passing down the calculated length to list_extend() or some helper, which I am not very fond of. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:54:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 15:54:29 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583164469.32.0.49705102404.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I concur with Antoine and Tim. The GC already has the machinery to deal with weak references in the correct way (even more after recent bugfixes regarding callbacks). Traversing the weak reference list in incorrect because the object does not "own" the weak references to it, as the weak references can die even if the object is alive. Also, as Tim mentions, the traverse will be called on the head of the list, in the same way if you do object.__weakref__ you will only get the HEAD of the list: >>> import weakref >>> class A: ... >>> a = A() >>> w1 = weakref.ref(a) >>> w2 = weakref.ref(a, lambda *args: None) # Use a callback to avoid re-using the original weakref >>> id(w1) 4328697104 >>> id(w2) 4328758864 >>> id(a.__weakref__) 4328697104 I think that this is not very well documented, as there is no pointers on what should and should not be traversed in https://docs.python.org/3.8/c-api/typeobj.html#c.PyTypeObject.tp_traverse. I will prepare a PR to the documentation if everybody agrees and another one removing the traverse unless someone sees that something else is at play. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:54:33 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 15:54:33 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583164473.36.0.731051706965.issue39778@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- assignee: -> pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 10:54:58 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 02 Mar 2020 15:54:58 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583164498.17.0.577090547807.issue39828@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 11:05:30 2020 From: report at bugs.python.org (Hakan) Date: Mon, 02 Mar 2020 16:05:30 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583165130.97.0.378923073144.issue39828@roundup.psfhosted.org> Hakan added the comment: I'd like to work on this issue but what should it do when it captures that error. ---------- nosy: +hakancelik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 11:33:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 16:33:59 +0000 Subject: [issue39704] Disable code coverage In-Reply-To: <1582241922.94.0.0257768022577.issue39704@roundup.psfhosted.org> Message-ID: <1583166839.1.0.808833481983.issue39704@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 11:43:40 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 02 Mar 2020 16:43:40 +0000 Subject: [issue39704] Disable code coverage In-Reply-To: <1582241922.94.0.0257768022577.issue39704@roundup.psfhosted.org> Message-ID: <1583167420.79.0.674603332811.issue39704@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 11:49:33 2020 From: report at bugs.python.org (Ammar Askar) Date: Mon, 02 Mar 2020 16:49:33 +0000 Subject: [issue39704] Disable code coverage In-Reply-To: <1582241922.94.0.0257768022577.issue39704@roundup.psfhosted.org> Message-ID: <1583167773.13.0.256455494753.issue39704@roundup.psfhosted.org> Ammar Askar added the comment: Just a quick update, I think this is a codecov bug as per here: https://community.codecov.io/t/prs-are-commented-even-with-comment-off/941 The yaml configuration doesn't show up here: https://codecov.io/gh/python/cpython/settings/yaml While we wait for a response from codecov, we can fix this in the interim by overriding the settings at an organization level. An owner of the Python organization can enable this here: the organization level stuff would be here: https://codecov.io/account/gh/python/yaml placing ``` comment: off coverage: status: changes: off project: off patch: off ``` as the config should hopefully fix this for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:03:15 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 17:03:15 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583168595.92.0.807981367608.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- keywords: +patch pull_requests: +18101 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:04:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:04:51 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583168691.07.0.732299428.issue39674@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18102 pull_request: https://github.com/python/cpython/pull/18747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:05:27 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 17:05:27 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583168727.97.0.909711951819.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: I think the PR fixes the issue but I have to run longer tests still. Threads created by PyGILState_Ensure() could have a duplicate tstate->id, which confused the ContextVar caching machinery. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:06:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:06:23 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583168783.37.0.326123846158.issue39674@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18103 pull_request: https://github.com/python/cpython/pull/18748 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:39:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:39:23 +0000 Subject: [issue39737] Speed up list.__eq__ by about 6% In-Reply-To: <1582520201.72.0.954951125447.issue39737@roundup.psfhosted.org> Message-ID: <1583170763.86.0.389457150473.issue39737@roundup.psfhosted.org> STINNER Victor added the comment: I suggest to use LTO + PGO optimizations when benchmarking Python: https://pyperformance.readthedocs.io/usage.html#how-to-get-stable-benchmarks Benchmarking is hard :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:40:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:40:24 +0000 Subject: [issue39694] Incorrect dictionary unpacking when calling str.format In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org> Message-ID: <1583170824.62.0.21813440318.issue39694@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:45:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:45:02 +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: <1583171102.45.0.680324408547.issue37330@roundup.psfhosted.org> STINNER Victor added the comment: > While we are of course able to patch new versions of Samba, this will make it harder to bisect back though Samba history. I don't understand the bisect part. Would you mind to elaborate? What do you want to bisect? > It would be really great if this kind of change could be reverted or at least deferred so Samba can rely on a stable language platform for it's build system. The "U" mode was deprecated since September 2012 (Python 3.3): you had 8 years to handle the DeprecationWarning. 8 years before actually removing a deprecated feature sounds like a stable language platform to me. I'm not sure of the benefit of deferring the change. Does it mean that Sambda would not be updated? Well, your comment fits exactly into bpo-39674 scope, except that revert the "U" mode is not scheduled yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 12:45:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Mar 2020 17:45:46 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583171146.83.0.428146828252.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: Andrew Bartlett of the Samba project asked to revert the removal of the "U" mode: https://bugs.python.org/issue37330#msg362362 We should consider to revert the removal, and only remove the "U" mode in Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 13:59:25 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 18:59:25 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1583175565.78.0.983700591273.issue38870@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50 by Batuhan Ta?kaya in branch 'master': bpo-38870: Add docstring support to ast.unparse (GH-17760) https://github.com/python/cpython/commit/89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:04:46 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 02 Mar 2020 19:04:46 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583175886.35.0.839534042022.issue39778@roundup.psfhosted.org> Tim Peters added the comment: After some thought, I'm sure the diagnosis is correct: the weakref list must be made invisible to gc. That is, simply don't traverse it at all. The crash is exactly what's expected from traversing objects a container doesn't own references to. I agree the tp_traverse docs should point out that weakref lists are special this way, but I think the problem is unique to them - can't think of another case where a container points to an object it doesn't own a reference to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:10:36 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 19:10:36 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583176236.43.0.40254158331.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I agree the tp_traverse docs should point out that weakref lists are special this way, but I think the problem is unique to them - can't think of another case where a container points to an object it doesn't own a reference to. Agreed, I was thinking a small warning or something because this is not the first time I see similar errors or users confused about what they should and should not track (with this I mention that we should say that "only objects that are *owned* should be tracked, and then the weakref warning or something similar). I will prepare a PR soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:17:49 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 02 Mar 2020 19:17:49 +0000 Subject: [issue39830] zipfile.Path is not included in __all__ Message-ID: <1583176669.44.0.585908649046.issue39830@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Since zipfile.Path is a public API and documented it could be included in __all__ . This might be a problem for code that uses below pattern : from zipfile import * from pathlib import Path If this is accepted this can be a good beginner issue. ---------- components: Library (Lib) messages: 363199 nosy: barry, jaraco, xtreak priority: normal severity: normal status: open title: zipfile.Path is not included in __all__ type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:22:04 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 19:22:04 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583176924.57.0.481657574102.issue39778@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +18104 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:28:42 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 19:28:42 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583177322.42.0.818377035337.issue38913@roundup.psfhosted.org> Serhiy Storchaka added the comment: Actually there is a leak in PyErr_WarnEx(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:35:06 2020 From: report at bugs.python.org (Marco Sulla) Date: Mon, 02 Mar 2020 19:35:06 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583177706.32.0.76640165714.issue39820@roundup.psfhosted.org> Marco Sulla added the comment: > Is this even possible in a plain text console? Yes. See Jupyter Console (aka IPython). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:37:17 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 02 Mar 2020 19:37:17 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583177837.68.0.139396504237.issue26460@roundup.psfhosted.org> Paul Ganssle added the comment: I don't think adding a default_year parameter is the right solution here. The actual problem is that `time.strptime`, and by extension `datetime.strptime` has a strange and confusing interface. What should happen is either that `year` is set to None or some other marker of a missing value or datetime.strptime should raise an exception when it's being asked to construct something that does not contain a year. Since there is no concept of a partial datetime, I think our best option would be to throw an exception, except that this has been baked into the library for ages and would start to throw exceptions even when the person has correctly handled the Feb 29th case. I think one possible "solution" to this would be to raise a warning any time someone tries to use `datetime.strptime` without requesting a year to warn them that the thing they're doing only exists for backwards compatibility reasons. We could possibly eventually make that an exception, but I'm not sure it's totally worth a break in backwards compatibility when a warning should put people on notice. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:40:18 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 19:40:18 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() Message-ID: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> New submission from Serhiy Storchaka : The test added for issue38913 exposed a reference leak in PyErr_WarnEx(). ---------- components: Interpreter Core messages: 363203 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Reference leak in PyErr_WarnEx() type: resource usage versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:43:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 19:43:07 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583178187.76.0.303408470879.issue39831@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18750 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:44:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 19:44:34 +0000 Subject: [issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised In-Reply-To: <1574749641.72.0.139840395561.issue38913@roundup.psfhosted.org> Message-ID: <1583178274.96.0.700276299628.issue38913@roundup.psfhosted.org> Serhiy Storchaka added the comment: Opened issue39831. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:51:44 2020 From: report at bugs.python.org (Brian Quinlan) Date: Mon, 02 Mar 2020 19:51:44 +0000 Subject: [issue39645] Expand concurrent.futures.Future's public API In-Reply-To: <1581838685.03.0.542500965222.issue39645@roundup.psfhosted.org> Message-ID: <1583178704.12.0.339264474407.issue39645@roundup.psfhosted.org> Brian Quinlan added the comment: I'll try to take a look at this before the end of the week, but I'm currently swamped with other life stuff :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 14:59:34 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 02 Mar 2020 19:59:34 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583179174.35.0.13300096585.issue39682@roundup.psfhosted.org> Brett Cannon added the comment: I guess a question is whether we want immutability guarantees (I for one didn't even know you could hash Path objects until now). I'm personally fine with that idea as it mentally makes sense to not need paths to be mutable. But as I said, someone needs to take at least some stab at seeing if any preexisting code out there will break if the _closed flag is removed before we can continue this discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 15:05:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Mar 2020 20:05:12 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583179512.93.0.96693940215.issue39831@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2d2f85517f8216146a2f888d1ad4d765b3be2339 by Serhiy Storchaka in branch 'master': bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750) https://github.com/python/cpython/commit/2d2f85517f8216146a2f888d1ad4d765b3be2339 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 15:22:42 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 20:22:42 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583180562.88.0.877156142432.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: New changeset b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9 by Stefan Krah in branch 'master': bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) https://github.com/python/cpython/commit/b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 15:30:05 2020 From: report at bugs.python.org (Antony Lee) Date: Mon, 02 Mar 2020 20:30:05 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583181005.98.0.563992447077.issue39682@roundup.psfhosted.org> Antony Lee added the comment: Immutability and hashability are listed first among "general properties" of paths (https://docs.python.org/3/library/pathlib.html#general-properties), and in the PEP proposing pathlib (https://www.python.org/dev/peps/pep-0428/#immutability). Looking at it again I *guess* the docs version could be read as only guaranteeing this for PurePaths (because that's in the PurePath section) rather than Path, but the PEP version clearly implies that this is true for both PurePaths and concrete Paths. It may be tricky to check usage in third-party packages, given that one would need to look for `with : ...` rather than, say, a method name which can be grepped. Do you have any suggestions here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 16:00:30 2020 From: report at bugs.python.org (Roundup Robot) Date: Mon, 02 Mar 2020 21:00:30 +0000 Subject: [issue37953] Fix ForwardRef equality checks In-Reply-To: <1566828364.46.0.753751170409.issue37953@roundup.psfhosted.org> Message-ID: <1583182830.19.0.885275946852.issue37953@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +18106 pull_request: https://github.com/python/cpython/pull/18751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 16:24:36 2020 From: report at bugs.python.org (Luca) Date: Mon, 02 Mar 2020 21:24:36 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583184276.37.0.0621539494076.issue39809@roundup.psfhosted.org> Luca added the comment: That lambda function would not give the same result, as it would constrain the text width to a fixed value, while my proposal would just set a maximum limit (if the terminal is narrower, the actual text width would be reduced). With the current implementation all possible solutions are in my opinion overkilling for such a basic task. Maybe it is not a direct consequence of this, but as a matter of fact most Python scripts using `argparse` that I know (including `pip`) do not control the text width, which IMHO is not a good practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 16:37:22 2020 From: report at bugs.python.org (Andrew Bartlett) Date: Mon, 02 Mar 2020 21:37:22 +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: <1583185042.67.0.363140659319.issue37330@roundup.psfhosted.org> Andrew Bartlett added the comment: Thanks for the reply. To clarify, it is best to understand where Samba thinks of itself in terms of Python. We use python, but we don't really think of ourselves as a python project, and while we have some developers with a depth of experience in the language, most of us just use it as a tool to get things done, in particular to build Samba. Samba has a build system built in Python, called Waf. Samba uses waf to build the project (particularly the C parts), and our build of the C binaries is portable back to Python 2.6. Often in Samba we find bugs. This might come as a shock! ;-). Many of those bugs are regressions, and so it is useful to build old versions, sometimes 7 year old versions, to confirm if/when the behaviour regressed. We are able to do this, with only one patch to address a perl behaviour change, even on a modern Ubuntu 18.04 system, all the way back to 2013. I terms of 'but this has been deprecated for years', Samba has only had releases been able to even use Python3 in the build system for a year (first committed to master in July 2018). Nobody in Samba was aware of any DeprecationWarning and for better or worse we only knew about the issue once our builds failed in Fedora. We are incredibly grateful that Fedora tried a rebuild with the alpha version of Python 3.9 as otherwise we would find out only after this was well baked into a release. Thankfully we don't need universal newlines, but no matter if we need them, old versions of Samba will fail to build without a fix-up patch. More importantly, I think it is unlikely that Samba is the only software to have used this feature, intentionally or otherwise, or to be in this position. While not as critical here, for context as to why we support Python 2.6 to build, it should be noted that retaining this compatibility was a critical part of being able to get consensus to otherwise move to Python 3.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 17:04:30 2020 From: report at bugs.python.org (paul j3) Date: Mon, 02 Mar 2020 22:04:30 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583186670.2.0.910159011893.issue39809@roundup.psfhosted.org> paul j3 added the comment: But you can replace the simple 'lambda' with a function that takes the max with 'columns'. In other words, include: width = _shutil.get_terminal_size().columns width -= 2 width = min(max_text_width, width) The only thing that the 'formatter_class' parameter requires is a callable that takes 'prog' as argument. That can be a class, a subclass, a lambda or a function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:05:08 2020 From: report at bugs.python.org (Luca) Date: Mon, 02 Mar 2020 23:05:08 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583190308.37.0.685688981936.issue39809@roundup.psfhosted.org> Luca added the comment: OK, I will do this for my package, but I do not believe many others will do the same without a `max_text_width` parameter (too much care is needed for this to work correctly), and as a result most packages using `argparse` will continue to not properly handle text width. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:12:57 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 23:12:57 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583190777.76.0.612201338367.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 by Pablo Galindo in branch 'master': bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) https://github.com/python/cpython/commit/0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:14:59 2020 From: report at bugs.python.org (Nick Moore) Date: Mon, 02 Mar 2020 23:14:59 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583190899.88.0.780076237984.issue26460@roundup.psfhosted.org> Nick Moore added the comment: Not disagreeing with you that "%b %d" timestamps with no "%Y" are excerable, but they're fairly common in the *nix world unfortunately. People need to parse them, and the simple and obvious way to do this breaks every four years. I like the idea of having a warning for not including %Y *and* not setting a default_year kwarg though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:24:44 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 23:24:44 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583191484.54.0.077129058725.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- pull_requests: +18107 pull_request: https://github.com/python/cpython/pull/18752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:26:14 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 02 Mar 2020 23:26:14 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583191574.6.0.790778777023.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- pull_requests: +18108 pull_request: https://github.com/python/cpython/pull/18753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:31:01 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 23:31:01 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583191861.69.0.75878158168.issue39778@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18109 pull_request: https://github.com/python/cpython/pull/18754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:33:22 2020 From: report at bugs.python.org (Luca) Date: Mon, 02 Mar 2020 23:33:22 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583192002.84.0.926921679158.issue39809@roundup.psfhosted.org> Luca added the comment: For the benefit of other developers willing to control text width with `argparse`, using the lambda function let `mypy` fail with the following error: 541: error: Argument "formatter_class" to "ArgumentParser" has incompatible type "Callable[[Any], RawDescriptionHelpFormatter]"; expected "Type[HelpFormatter]" So I am reverting back to the following custom formatting class: class RawDescriptionHelpFormatterMaxTextWidth80(argparse.RawDescriptionHelpFormatter): """Set maximum text width = 80.""" def __init__(self, prog): width = min(80, shutil.get_terminal_size().columns - 2) argparse.RawDescriptionHelpFormatter.__init__(self, prog, width=width) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:33:48 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 02 Mar 2020 23:33:48 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583192028.83.0.38070803063.issue26460@roundup.psfhosted.org> Gregory P. Smith added the comment: I _doubt_ there is code expecting the default year when unspecified to actually be 1900. Change that default to any old year with a leap year (1904?) and it'll still (a) stand out as a special year that can be looked up should it wind up being _used_ as the year in code somewhere and (b) not fail every four years for people just parsing to extract Month + Day values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:36:18 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 23:36:18 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583192178.18.0.456113323855.issue39778@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +18110 pull_request: https://github.com/python/cpython/pull/18755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:36:48 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 23:36:48 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583192208.4.0.969356997669.issue39778@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18111 pull_request: https://github.com/python/cpython/pull/18756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:49:57 2020 From: report at bugs.python.org (Pete Wicken) Date: Mon, 02 Mar 2020 23:49:57 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1583192997.09.0.387387515793.issue28577@roundup.psfhosted.org> Change by Pete Wicken : ---------- keywords: +patch nosy: +Wicken nosy_count: 5.0 -> 6.0 pull_requests: +18112 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:52:49 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 02 Mar 2020 23:52:49 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583193169.57.0.630276166252.issue39682@roundup.psfhosted.org> Antoine Pitrou added the comment: As with the Accessor abstraction, the original idea was to support Path objects backed by a directory file descriptor (for use with openat() and friends). That idea was abandoned but it looks like the context manager stayed. It's certainly not useful currently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:53:06 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Mar 2020 23:53:06 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583193186.84.0.761257639031.issue39778@roundup.psfhosted.org> miss-islington added the comment: New changeset 69ded3944c202da972754644c0bbf7f77cc5e8ea by Miss Islington (bot) in branch '3.7': bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) https://github.com/python/cpython/commit/69ded3944c202da972754644c0bbf7f77cc5e8ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:55:23 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Mar 2020 23:55:23 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583193323.74.0.691337998909.issue39778@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9ddcb914f9c2debe7c1359b2450cd1573e86b91c by Pablo Galindo in branch '3.8': [3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) (GH-18756) https://github.com/python/cpython/commit/9ddcb914f9c2debe7c1359b2450cd1573e86b91c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 18:57:49 2020 From: report at bugs.python.org (Pete Wicken) Date: Mon, 02 Mar 2020 23:57:49 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1583193469.21.0.577302594948.issue28577@roundup.psfhosted.org> Pete Wicken added the comment: I've had a go at implementing this. I did not implement for IPv6 as this was not mentioned here, but it seems like it would make sense for it as well. I can add that in too if you like. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:04:18 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 03 Mar 2020 00:04:18 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583193858.08.0.294283526719.issue38597@roundup.psfhosted.org> Steve Dower added the comment: New changeset ce3a4984089b8e0ce5422ca32d75ad057b008074 by Steve Dower in branch 'master': bpo-38597: Never statically link extension initialization code on Windows (GH-18724) https://github.com/python/cpython/commit/ce3a4984089b8e0ce5422ca32d75ad057b008074 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:04:24 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 00:04:24 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583193864.29.0.457662604272.issue38597@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +18113 pull_request: https://github.com/python/cpython/pull/18758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:08:31 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 03 Mar 2020 00:08:31 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583194111.96.0.136525870451.issue38597@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18114 pull_request: https://github.com/python/cpython/pull/18759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:12:17 2020 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 03 Mar 2020 00:12:17 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1583192028.83.0.38070803063.issue26460@roundup.psfhosted.org> Message-ID: Alexander Belopolsky added the comment: > On Mar 2, 2020, at 6:33 PM, Gregory P. Smith wrote: > > Change that default to any old year with a leap year (1904?) In the 21st century, the year 2000 default makes much more sense than 1900. Luckily 2000 is also a leap year. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:25:16 2020 From: report at bugs.python.org (Norbert) Date: Tue, 03 Mar 2020 00:25:16 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS Message-ID: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> New submission from Norbert : Modules whose names contain characters that are in precomposed form but can be decomposed in Normalization Form D can?t be found on macOS. To reproduce: 1. Download and unzip the attached file Modules.zip. This produces a directory Modules with four Python source files. 2. In Terminal, go to the directory that contains Modules. 3. Run "python3 -m Modules.Import". Expected behavior: The following lines should be generated: Maerchen M?rchen Actual behavior: The first line, ?Maerchen? is generated, but then an error occurs: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code exec(code, run_globals) File "/Users/business/tmp/pyimports/Modules/Import.py", line 5, in from Modules.M?rchen import hello2 ModuleNotFoundError: No module named 'Modules.M?rchen' Evaluation: In the source file Modules/Import.py, the name of the module ?M?rchen? is written with the precomposed character U+00E4. The file name M?rchen.py uses the decomposed character sequence U+0061 U+0308 instead. Macintosh file names commonly use a variant of Normalization Form D in file names ? the old file system HFS enforces this, and while APFS doesn?t, the Finder still generates file names in this form. U+00E4 and U+0061 U+0308 are canonically equivalent, so they should be treated as equal in module loading. Tested configuration: CPython 3.8.2 macOS 10.14.6 ---------- components: Interpreter Core files: Modules.zip messages: 363224 nosy: Norbert priority: normal severity: normal status: open title: Modules with decomposable characters in module name not found on macOS type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48944/Modules.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:26:30 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 00:26:30 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583195190.12.0.890371794683.issue38597@roundup.psfhosted.org> miss-islington added the comment: New changeset 8a5f7ad5e423b74ea612e25472e5bff3adf1ea87 by Steve Dower in branch '3.7': [3.7] bpo-38597: Never statically link extension initialization code on Windows (GH-18724) (GH-18759) https://github.com/python/cpython/commit/8a5f7ad5e423b74ea612e25472e5bff3adf1ea87 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:30:24 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 00:30:24 +0000 Subject: [issue38597] C Extension import limit In-Reply-To: <1572119300.64.0.0138111717141.issue38597@roundup.psfhosted.org> Message-ID: <1583195424.75.0.449582332185.issue38597@roundup.psfhosted.org> miss-islington added the comment: New changeset 0d20364b132014eec609b900997c34779a4d548c by Miss Islington (bot) in branch '3.8': bpo-38597: Never statically link extension initialization code on Windows (GH-18724) https://github.com/python/cpython/commit/0d20364b132014eec609b900997c34779a4d548c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:39:30 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 00:39:30 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583195970.18.0.673587923134.issue39697@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This seems like a duplicate of https://bugs.python.org/issue35912 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:49:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 00:49:05 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583196545.18.0.32012897599.issue39831@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 1.0 -> 2.0 pull_requests: +18115 pull_request: https://github.com/python/cpython/pull/18760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:52:11 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 00:52:11 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583196731.21.0.409314214286.issue39831@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18116 pull_request: https://github.com/python/cpython/pull/18761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 19:53:37 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 00:53:37 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583196817.48.0.356638301249.issue39831@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I made the backports to 3.7 and 3.8 manually to calm down the refleak buildbots as the automatic backports failed :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 20:13:16 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 01:13:16 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583197996.9.0.79709853973.issue39831@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 394dc0db878c08d003772de163a57ac12046d865 by Pablo Galindo in branch '3.8': [3.8] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750) (GH-18761) https://github.com/python/cpython/commit/394dc0db878c08d003772de163a57ac12046d865 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 20:13:27 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 01:13:27 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583198007.59.0.551215146206.issue39831@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 499c926fbeafa7e4c15d925fea27fe8a65cc3b25 by Pablo Galindo in branch '3.7': [3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18760) https://github.com/python/cpython/commit/499c926fbeafa7e4c15d925fea27fe8a65cc3b25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 20:16:14 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 01:16:14 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583198174.57.0.521072394312.issue39831@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closing this as the backports are merged. Thanks, Serhiy, for finding the leak and for the fix :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 20:37:31 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 01:37:31 +0000 Subject: [issue38091] Import deadlock detection causes deadlock In-Reply-To: <1568122000.74.0.240735069302.issue38091@roundup.psfhosted.org> Message-ID: <1583199451.07.0.734840954323.issue38091@roundup.psfhosted.org> miss-islington added the comment: New changeset 6daa37fd42c5d5300172728e8b4de74fe0b319fc by Armin Rigo in branch 'master': bpo-38091: Import deadlock detection causes deadlock (GH-17518) https://github.com/python/cpython/commit/6daa37fd42c5d5300172728e8b4de74fe0b319fc ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:00:17 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 02:00:17 +0000 Subject: [issue39802] Ensure {get, set}_escdelay and {get, set}_tabsize only implemented when the extensions are activated In-Reply-To: <1583002134.9.0.406998676979.issue39802@roundup.psfhosted.org> Message-ID: <1583200817.97.0.61971177435.issue39802@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4991cf47c487500fdedc34f0a2eb4b7468a67c3c by Batuhan Ta?kaya in branch 'master': bpo-39802: Only expose set_escdelay and set_tabsize when curses extensions are activated (GH-18705) https://github.com/python/cpython/commit/4991cf47c487500fdedc34f0a2eb4b7468a67c3c ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:13:50 2020 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Tue, 03 Mar 2020 02:13:50 +0000 Subject: [issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace In-Reply-To: <1582736188.76.0.993881693157.issue39761@roundup.psfhosted.org> Message-ID: <1583201630.17.0.129331425507.issue39761@roundup.psfhosted.org> Change by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:16:06 2020 From: report at bugs.python.org (Evan) Date: Tue, 03 Mar 2020 02:16:06 +0000 Subject: [issue39833] Bug in html parsing module triggered by malformed input Message-ID: <1583201765.99.0.950637389492.issue39833@roundup.psfhosted.org> New submission from Evan : Relevant base python library-- C:\Users\User\AppData\Local\Programs\Python\Python38\lib\_markupbase.py The issue- After parsing over 900 SEC filings using beautifulsoup4, I get this user warning. UserWarning: unknown status keyword 'ERF' in marked section warnings.warn(msg) Followed by a traceback .... File "C:\Users\XXXX\AppData\Local\Programs\Python\Python38\lib\site-packages\bs4\__init__.py", line 325, in __init__ self._feed() .... File "C:\Users\XXXX\AppData\Local\Programs\Python\Python38\lib\_markupbase.py", line 160, in parse_marked_section if not match: UnboundLocalError: local variable 'match' referenced before assignment It's probably to due to malformed input from on of the docs. 144 lines into _markupbase lib we have: # Internal -- parse a marked section # Override this to handle MS-word extension syntax content def parse_marked_section(self, i, report=1): rawdata= self.rawdata assert rawdata[i:i+3] == ' ending match= _markedsectionclose.search(rawdata, i+3) elif sectName in {"if", "else", "endif"}: # look for MS Office ]> ending match= _msmarkedsectionclose.search(rawdata, i+3) else: self.error('unknown status keyword %r in marked section' % rawdata[i+3:j]) if not match: return -1 if report: j = match.start(0) self.unknown_decl(rawdata[i+3: j]) return match.end(0) `match` should be set to None in the fall-through else statement right before `if not match`. ---------- components: Library (Lib) messages: 363234 nosy: SanJacintoJoe priority: normal severity: normal status: open title: Bug in html parsing module triggered by malformed input type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:19:05 2020 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 03 Mar 2020 02:19:05 +0000 Subject: [issue39833] Bug in html parsing module triggered by malformed input In-Reply-To: <1583201765.99.0.950637389492.issue39833@roundup.psfhosted.org> Message-ID: <1583201945.77.0.184081761748.issue39833@roundup.psfhosted.org> Ezio Melotti added the comment: Thanks for the report. This is a duplicate of #34480. ---------- nosy: +ezio.melotti resolution: -> duplicate stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:50:44 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 02:50:44 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583203844.3.0.728464388087.issue39778@roundup.psfhosted.org> miss-islington added the comment: New changeset 6df421fe87a9418d6c59f89dbc5d5573b6826855 by Pablo Galindo in branch 'master': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) https://github.com/python/cpython/commit/6df421fe87a9418d6c59f89dbc5d5573b6826855 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:51:04 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 02:51:04 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583203864.65.0.913453036963.issue39778@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18118 pull_request: https://github.com/python/cpython/pull/18763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 21:50:56 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 02:50:56 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583203856.79.0.884218820475.issue39778@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18117 pull_request: https://github.com/python/cpython/pull/18762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 22:04:04 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 03:04:04 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583204644.78.0.0232277849411.issue39778@roundup.psfhosted.org> miss-islington added the comment: New changeset 72fff60d7649df88026838d8b5f14f541393f268 by Miss Islington (bot) in branch '3.7': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) https://github.com/python/cpython/commit/72fff60d7649df88026838d8b5f14f541393f268 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 2 22:04:16 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 03:04:16 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583204656.74.0.14977872332.issue39778@roundup.psfhosted.org> miss-islington added the comment: New changeset 1827fc30f463786ebff13752e35c3224652bc94e by Miss Islington (bot) in branch '3.8': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) https://github.com/python/cpython/commit/1827fc30f463786ebff13752e35c3224652bc94e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:19:16 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 08:19:16 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583223556.67.0.190640664801.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 5a92f42d8723ee865be80f028d402204649da15d by Stefan Krah in branch '3.8': bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) (#18752) https://github.com/python/cpython/commit/5a92f42d8723ee865be80f028d402204649da15d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:20:01 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 08:20:01 +0000 Subject: [issue39776] Crash in decimal module in heavy-multithreaded scenario In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583223601.63.0.508710498059.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 852aee69f49c654a03ad1f64d90a78ba8848e2c6 by Stefan Krah in branch '3.7': bpo-39776: Lock ++interp->tstate_next_unique_id (GH-18746) https://github.com/python/cpython/commit/852aee69f49c654a03ad1f64d90a78ba8848e2c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:44:30 2020 From: report at bugs.python.org (E) Date: Tue, 03 Mar 2020 08:44:30 +0000 Subject: [issue39834] + vs. % operator precedence not correct Message-ID: <1583225070.21.0.47230314315.issue39834@roundup.psfhosted.org> New submission from E : + has operator precedence over % in python: https://docs.python.org/3/reference/expressions.html However: > i=5 > i+5 % 10 10 > 10 % 10 0 > (i+5) % 10 0 Thus, for + to take precedence over %, parentheses need to be used. ---------- components: Interpreter Core messages: 363241 nosy: ergun priority: normal severity: normal status: open title: + vs. % operator precedence not correct type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:44:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 08:44:35 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583225075.33.0.228872352972.issue39831@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not so easy for 3.7. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:49:21 2020 From: report at bugs.python.org (E) Date: Tue, 03 Mar 2020 08:49:21 +0000 Subject: [issue39834] + vs. % operator precedence not correct In-Reply-To: <1583225070.21.0.47230314315.issue39834@roundup.psfhosted.org> Message-ID: <1583225361.6.0.0228365534405.issue39834@roundup.psfhosted.org> E added the comment: Actually, the operator precedence is read upside down: https://docs.python.org/3/reference/expressions.html Thus, % has operator precedence and this might be causing the incorrect values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:51:29 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 08:51:29 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583225489.71.0.518469353371.issue39831@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18119 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 03:52:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 08:52:41 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583225561.76.0.487269019082.issue39831@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18120 pull_request: https://github.com/python/cpython/pull/18765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:06:34 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 09:06:34 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583226394.01.0.764931260887.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- title: Crash in decimal module in heavy-multithreaded scenario -> PyContextVar_Get(): crash due to race condition in updating tstate->id _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:07:22 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 09:07:22 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583226442.37.0.134394400346.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- assignee: -> skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:08:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 09:08:31 +0000 Subject: [issue35912] _testembed.c fails to compile when using --with-cxx-main in the configure step In-Reply-To: <1549464332.95.0.70522769189.issue35912@roundup.psfhosted.org> Message-ID: <1583226511.14.0.241632414472.issue35912@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-39697. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Failed to build with --with-cxx-main=g++-9.2.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:08:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 09:08:45 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583226525.67.0.0805302141862.issue39697@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-35912 as a duplicate of this issue (which has a longer history). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:09:55 2020 From: report at bugs.python.org (Steven Hilton) Date: Tue, 03 Mar 2020 09:09:55 +0000 Subject: [issue30988] Exception parsing invalid email address headers starting or ending with dot In-Reply-To: <1500699002.76.0.343337119039.issue30988@psf.upfronthosting.co.za> Message-ID: <1583226595.12.0.792462209797.issue30988@roundup.psfhosted.org> Change by Steven Hilton : ---------- nosy: +Steven Hilton nosy_count: 5.0 -> 6.0 pull_requests: +18121 pull_request: https://github.com/python/cpython/pull/18687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:10:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 09:10:44 +0000 Subject: [issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion In-Reply-To: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> Message-ID: <1583226644.61.0.982912910446.issue39778@roundup.psfhosted.org> STINNER Victor added the comment: It seems like OrderedDict was the only type which visited weak references: $ scm.py grep 'VISIT.*weak' master: Grep 'VISIT.*weak' -- <4284 filenames> ============================================== Objects/odictobject.c:1457: Py_VISIT(od->od_weakreflist); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:15:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 09:15:47 +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: <1583226947.93.0.382040094246.issue37330@roundup.psfhosted.org> STINNER Victor added the comment: > Thankfully we don't need universal newlines, but no matter if we need them, old versions of Samba will fail to build without a fix-up patch. io.open() is available since Python 2.6 and handles different kinds of newlines transparently. Example: $ python2 Python 2.7.17 (default, Oct 20 2019, 00:00:00) >>> f=open("test", "wb"); f.write("a\rb\rc\r"); f.close() >>> import io; f=io.open("test"); lines=list(f); f.close(); lines [u'a\n', u'b\n', u'c\n'] Do you suggest to change the documentation to suggest to open io.open() for applications which still care about Python 2? https://docs.python.org/dev/whatsnew/3.9.html#changes-in-the-python-api Note: Python 2 is no longer supported upstream, I strongly advice you to upgrade to Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:19:45 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 09:19:45 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583227185.34.0.780528500304.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: Since many duplicate tstate ids are generated in the test case before the crash happens, I guess a set of tstates with the same id silently uses the cached context of the "winner" tstate. This can lead to incorrect results without noticing. ---------- priority: critical -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:21:22 2020 From: report at bugs.python.org (Pete Wicken) Date: Tue, 03 Mar 2020 09:21:22 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1583227282.58.0.867204615229.issue28577@roundup.psfhosted.org> Pete Wicken added the comment: Ok it was bugging me that they were different, so I also added the same logic for IPv6Networks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:21:33 2020 From: report at bugs.python.org (E) Date: Tue, 03 Mar 2020 09:21:33 +0000 Subject: [issue39834] + vs. % operator precedence not correct In-Reply-To: <1583225070.21.0.47230314315.issue39834@roundup.psfhosted.org> Message-ID: <1583227293.72.0.908807993285.issue39834@roundup.psfhosted.org> Change by E : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 04:56:43 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 09:56:43 +0000 Subject: [issue39802] Ensure {get, set}_escdelay and {get, set}_tabsize only implemented when the extensions are activated In-Reply-To: <1583002134.9.0.406998676979.issue39802@roundup.psfhosted.org> Message-ID: <1583229403.69.0.107668240115.issue39802@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 Mar 3 05:11:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 10:11:21 +0000 Subject: [issue12915] Add inspect.locate and inspect.resolve In-Reply-To: <1315326633.9.0.910127000285.issue12915@psf.upfronthosting.co.za> Message-ID: <1583230281.88.0.709148500721.issue12915@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e0acec15412203359d59db33e447698ee51e07fc by Michael Felt in branch 'master': bpo-12915: Skip test_pkgutil.test_name_resolution() non-encodable filenames (GH-18720) https://github.com/python/cpython/commit/e0acec15412203359d59db33e447698ee51e07fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 05:12:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 10:12:12 +0000 Subject: [issue12915] Add inspect.locate and inspect.resolve In-Reply-To: <1315326633.9.0.910127000285.issue12915@psf.upfronthosting.co.za> Message-ID: <1583230332.72.0.620799343839.issue12915@roundup.psfhosted.org> STINNER Victor added the comment: I understand that all known issues are now fixed, so I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 05:25:41 2020 From: report at bugs.python.org (Julien Danjou) Date: Tue, 03 Mar 2020 10:25:41 +0000 Subject: [issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure In-Reply-To: <1581339256.79.0.552474006467.issue39599@roundup.psfhosted.org> Message-ID: <1583231141.89.0.676794328213.issue39599@roundup.psfhosted.org> Julien Danjou added the comment: The problem is that AFAIK the wheel system does not allow you to specify and provide a wheel for each minor Python version. For references, the code that segfaults is: https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/profile/collector/stack.pyx ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 05:30:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 10:30:21 +0000 Subject: [issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure In-Reply-To: <1581339256.79.0.552474006467.issue39599@roundup.psfhosted.org> Message-ID: <1583231421.71.0.524631658597.issue39599@roundup.psfhosted.org> STINNER Victor added the comment: > The problem is that AFAIK the wheel system does not allow you to specify and provide a wheel for each minor Python version. The alternative is to identify which part of your code depends on PyGC_Head size, and handle the different sizes there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 07:11:14 2020 From: report at bugs.python.org (Luca) Date: Tue, 03 Mar 2020 12:11:14 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583237474.2.0.23976426704.issue39809@roundup.psfhosted.org> Luca added the comment: Of course I still think there should be an easier way to do this though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 07:14:03 2020 From: report at bugs.python.org (Julien Danjou) Date: Tue, 03 Mar 2020 12:14:03 +0000 Subject: [issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure In-Reply-To: <1581339256.79.0.552474006467.issue39599@roundup.psfhosted.org> Message-ID: <1583237643.83.0.0898981208242.issue39599@roundup.psfhosted.org> Julien Danjou added the comment: Right, though if you read the code I linked, the PyGC_Head size is never used. AFAICS the Cython code does not access it either (at least not directly). The code segfaults at import time. I'm not even sure it's possible and the problem isn't in something in CPython itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 07:57:11 2020 From: report at bugs.python.org (=?utf-8?b?aGVydsOp?=) Date: Tue, 03 Mar 2020 12:57:11 +0000 Subject: [issue39467] Allow to deprecate CLI arguments in argparse In-Reply-To: <1580148851.76.0.444481366951.issue39467@roundup.psfhosted.org> Message-ID: <1583240231.07.0.882962303588.issue39467@roundup.psfhosted.org> herv? added the comment: hello, First thanks everyone to took time to discute about this proposal. This topic is now opened since ~1 months so I don't think we will more feedback about this, then I will address all your comments in my changes soon to match an implementation more consensually based. ---------- nosy: +4383 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 08:17:39 2020 From: report at bugs.python.org (Gerard C Weatherby) Date: Tue, 03 Mar 2020 13:17:39 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583241459.59.0.998974118126.issue26460@roundup.psfhosted.org> Gerard C Weatherby added the comment: Yes, code that has been working for my organization the past two years just broke this weekend. Meaning depends on context. The straightforward solution is that if no year is specified, the return value should default to the current year. ---------- nosy: +gerardw at alum.mit.edu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 08:37:24 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 03 Mar 2020 13:37:24 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583242644.08.0.189787360537.issue39820@roundup.psfhosted.org> Mark Dickinson added the comment: See also the discussion in #38747 (also opened by Marco), which was closed as rejected. This issue is close to a duplicate of that one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 08:38:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 13:38:24 +0000 Subject: [issue39704] Disable code coverage In-Reply-To: <1582241922.94.0.0257768022577.issue39704@roundup.psfhosted.org> Message-ID: <1583242704.62.0.439336708357.issue39704@roundup.psfhosted.org> STINNER Victor added the comment: Ernest updated the organization configuration to: --- comment: off coverage: status: changes: off project: off patch: off --- which gives: { "comment": false, "coverage": { "status": { "changes": false, "patch": false, "project": false } } } Codecov should no longer add comments to pull requests. I close the issue. Reopen it if Codecov adds *new* comments to pull requests. Thanks Ernest! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 09:35:33 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 03 Mar 2020 14:35:33 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583246133.72.0.514956956113.issue39682@roundup.psfhosted.org> Barney Gale added the comment: Can I ask what sort of backwards-compatibility guarantees Python provides for these cases? In the case of using a Path object as a context manager, I think we can say: - It's easy to do - there's no need to call any underscore-prefixed methods for example - It's undocumented - It's pretty hard to determine existing usage statically - grepping for `with p:` is years of work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 09:36:15 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 03 Mar 2020 14:36:15 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583246175.8.0.863575878268.issue39682@roundup.psfhosted.org> Barney Gale added the comment: Also, thank you Antoine for your explanation :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:00:51 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 15:00:51 +0000 Subject: [issue38960] DTrace FreeBSD build fix In-Reply-To: <1575439788.6.0.75374191254.issue38960@roundup.psfhosted.org> Message-ID: <1583247651.42.0.990761385916.issue38960@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +18123 pull_request: https://github.com/python/cpython/pull/18766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:00:51 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 15:00:51 +0000 Subject: [issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace In-Reply-To: <1582736188.76.0.993881693157.issue39761@roundup.psfhosted.org> Message-ID: <1583247651.3.0.656733801906.issue39761@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +18122 pull_request: https://github.com/python/cpython/pull/18766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:02:55 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 15:02:55 +0000 Subject: [issue38960] DTrace FreeBSD build fix In-Reply-To: <1575439788.6.0.75374191254.issue38960@roundup.psfhosted.org> Message-ID: <1583247775.49.0.335435987005.issue38960@roundup.psfhosted.org> Petr Viktorin added the comment: The fix introduced a regression, see bpo-39761 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:12:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 15:12:26 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583248346.49.0.950383975418.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: Another candidate is to revert the ignored "U" mode in open(): commit e471e72977c83664f13d041c78549140c86c92de of bpo-37330. Removing "U" mode of open() broke 11 packages in Fedora: * aubio * openvswitch * python-SALib * python-altgraph * python-apsw * python-magic-wormhole-mailbox-server * python-munch * python-parameterized * python-pylibmc * python-sphinx-testing * veusz Keeping "U" mode in Python 3.9 is also a formal request from Andrew Bartlett of the Samba project: https://bugs.python.org/issue37330#msg362362 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:17:15 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:17:15 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583248635.16.0.280609014479.issue39776@roundup.psfhosted.org> Change by Stefan Krah : Added file: https://bugs.python.org/file48945/pydecimal_cases.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:18:33 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 03 Mar 2020 15:18:33 +0000 Subject: [issue39835] Implement PyObject_CopyToObject Message-ID: <1583248713.2.0.213749571334.issue39835@roundup.psfhosted.org> New submission from Joannah Nanjekye : I suggest implementing a C-API for copying data into a buffer exported by an obj. i.e int PyObject_CopyToObject(PyObject *obj, void *buf, Py_ssize_t len, char fortran) as was intended in PEP 3118. The documentation there says this functionality should: "Copy len bytes of data pointed to by the contiguous chunk of memory pointed to by buf into the buffer exported by obj. Return 0 on success and return -1 and raise an error on failure. If the object does not have a writable buffer, then an error is raised. If fortran is 'F', then if the object is multi-dimensional, then the data will be copied into the array in Fortran-style (first dimension varies the fastest). If fortran is 'C', then the data will be copied into the array in C-style (last dimension varies the fastest). If fortran is 'A', then it does not matter and the copy will be made in whatever way is more efficient." ---------- components: C API messages: 363264 nosy: nanjekyejoannah priority: normal severity: normal status: open title: Implement PyObject_CopyToObject type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:18:37 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 03 Mar 2020 15:18:37 +0000 Subject: [issue39836] Implement PyObject_GetMemoryView Message-ID: <1583248717.8.0.114073017278.issue39836@roundup.psfhosted.org> New submission from Joannah Nanjekye : We have a memory-view object represented with the following structure: typedef struct { PyObject_VAR_HEAD _PyManagedBufferObject *mbuf; /* managed buffer */ Py_hash_t hash; /* hash value for read-only views */ int flags; /* state flags */ Py_ssize_t exports; /* number of buffer re-exports */ Py_buffer view; /* private copy of the exporter's view */ PyObject *weakreflist; Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */ } PyMemoryViewObject; It would be good to have the implementation for PyObject_GetMemoryView which returns a memory-view object as was originally intended in PEP 3118 i.e : PyObject *PyObject_GetMemoryView(PyObject *obj) ---------- components: C API messages: 363265 nosy: nanjekyejoannah priority: normal severity: normal status: open title: Implement PyObject_GetMemoryView type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:20:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 15:20:30 +0000 Subject: [issue39836] Implement PyObject_GetMemoryView In-Reply-To: <1583248717.8.0.114073017278.issue39836@roundup.psfhosted.org> Message-ID: <1583248830.65.0.293502307282.issue39836@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:20:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 15:20:46 +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: <1583248846.69.0.534683223976.issue37330@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18125 pull_request: https://github.com/python/cpython/pull/18767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:20:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 15:20:46 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583248846.63.0.904641341916.issue39674@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18124 pull_request: https://github.com/python/cpython/pull/18767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:21:52 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:21:52 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583248912.41.0.0183239145443.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: Also _pydecimal was affected. This is a modified version of Evgeny's test case: from _pydecimal import * from time import sleep from random import randint import sys sys.setswitchinterval(0.0000001) def usleep(x): sleep(x/1000000.0) class Test: def __init__(self, threadno): self.threadno = threadno def GetCallback(self): usleep(randint(0, 9)); setcontext(Context(Emax=self.threadno)) usleep(randint(0, 9)) c = getcontext() try: if c.Emax != self.threadno: raise RuntimeError("GetCallback: another thread changed this thread's context") except AttributeError: raise RuntimeError("GetCallback: type(c)==%s and c.Emax disappeared" % type(c)) usleep(randint(0, 9)) return self.Callback def Callback(self): c = getcontext() try: c.Emax = self.threadno except AttributeError: raise RuntimeError("Callback: type(c)==%s and c.Emax disappeared" % type(c)) def DoTest(threadno): return Test(threadno).GetCallback() It produces one of the exceptions or a segfault. You may have to build in release mode to get the race. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:23:41 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:23:41 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583249021.5.0.591306168604.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: Setting to release blocker, but please move to deferred again if a release is almost finished. ---------- nosy: +lukasz.langa, ned.deily priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:31:20 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:31:20 +0000 Subject: [issue39794] Add --without-decimal-contextvar option to use just threads in decimal In-Reply-To: <1582975453.71.0.297927511147.issue39794@roundup.psfhosted.org> Message-ID: <1583249480.7.0.885987097576.issue39794@roundup.psfhosted.org> Stefan Krah added the comment: #39776 is fixed, but _pydecimal was also affected, see msg363266. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:37:08 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:37:08 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583249828.12.0.521294788989.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 10:37:26 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 15:37:26 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583249846.6.0.986967636364.issue39776@roundup.psfhosted.org> Change by Stefan Krah : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:00:19 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 03 Mar 2020 16:00:19 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1583251219.54.0.418696858676.issue38870@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +18126 pull_request: https://github.com/python/cpython/pull/18768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:01:15 2020 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 03 Mar 2020 16:01:15 +0000 Subject: [issue38826] Regular Expression Denial of Service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1573955142.95.0.285133152076.issue38826@roundup.psfhosted.org> Message-ID: <1583251275.74.0.23072872731.issue38826@roundup.psfhosted.org> Matthew Barnett added the comment: A smaller change to the regex would be to replace the "(?:.*,)*" with "(?:[^,]*,)*". I'd also suggest using a raw string instead: rx = re.compile(r'''(?:[^,]*,)*[ \t]*([^ \t]+)[ \t]+realm=(["']?)([^"']*)\2''', re.I) ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:07:16 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 16:07:16 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583251636.21.0.543862850413.issue39776@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the heads-up and the fix, Stefan. The fix for 3.7.x was merged before the 3.7.7rc1 cutoff (by a few hours!) and the next 3.8.x release cutoff is planned for April and 3.9.0a5 is later in March, so, if you are not planning to merge any other changes for this issue, we can set the issue status to "closed" now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:10:58 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 16:10:58 +0000 Subject: [issue39773] Export symbols for vectorcall In-Reply-To: <1582790921.68.0.338373290894.issue39773@roundup.psfhosted.org> Message-ID: <1583251858.37.0.0407586554879.issue39773@roundup.psfhosted.org> Petr Viktorin added the comment: Yes. Can you use PyObject_Call instead (or one of the non-Vectorcall variants listed in https://docs.python.org/3.9/c-api/call.html#object-calling-api ) Vectorcall is mainly a speed optimization over PyObject_Call. We want to allow the C compiler to inline PyObject_Vectorcall whenever it is used. That can be done with static functions or macros, which does unfortunately mean that the symbol is not exported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:16:10 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 16:16:10 +0000 Subject: [issue39389] gzip metadata fails to reflect compresslevel In-Reply-To: <1579465438.04.0.91237843457.issue39389@roundup.psfhosted.org> Message-ID: <1583252170.86.0.915216389162.issue39389@roundup.psfhosted.org> Ned Deily added the comment: Ping. The 3.7.x backport (PR 18101) for this issue is still open and neither needs to be fixed or closed. ---------- nosy: +ned.deily resolution: fixed -> stage: resolved -> backport needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:16:32 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 16:16:32 +0000 Subject: [issue39389] gzip metadata fails to reflect compresslevel In-Reply-To: <1579465438.04.0.91237843457.issue39389@roundup.psfhosted.org> Message-ID: <1583252192.93.0.931981558207.issue39389@roundup.psfhosted.org> Ned Deily added the comment: "either" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:18:44 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 16:18:44 +0000 Subject: [issue39530] Documentation about comparisons between numeric types is misleading In-Reply-To: <1580653054.78.0.127921454413.issue39530@roundup.psfhosted.org> Message-ID: <1583252324.63.0.84123992099.issue39530@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18127 pull_request: https://github.com/python/cpython/pull/18737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:21:32 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Mar 2020 16:21:32 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583252492.29.0.162423369736.issue39776@roundup.psfhosted.org> Stefan Krah added the comment: Thanks Ned, closing then. Evgeny, please reopen if you see it again (I ran the tests for about 20 min, way above the usual reproduction time of 1 min). Thanks for the very instructive test case! ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:29:57 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 16:29:57 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583252997.63.0.662920482963.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: IMO: - The "native" format should use native _Bool, and we should only test unpacking 0 and 1 - The "standard" format should use portable char semantics: continue to treat any non-zero value as true - The docs should grow a warning that for the native format of '?', representation of true/false depends on the platform/compiler. But what is "format"? The docs talk about size, alignment and byte order; bool representation is a slightly different concept. I'm not sure if it should follow Byte order or Size/Alignment: I think that the latter would be better (so only "@" uses the native _Bool semantics, but "=" uses portable char semantics), but it might be be harder to implement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:30:56 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 16:30:56 +0000 Subject: [issue39546] argparse: allow_abbrev=False is ignored for alternative prefix characters In-Reply-To: <1580760688.73.0.980793532046.issue39546@roundup.psfhosted.org> Message-ID: <1583253056.75.0.242261230605.issue39546@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 Mar 3 11:31:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 16:31:28 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583253088.14.0.948768077989.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2aa694dd55202eb6d062fdf49c07cf95f8520f2d by Victor Stinner in branch '3.8': bpo-39674: Update collections ABC deprecation doc (GH-18748) https://github.com/python/cpython/commit/2aa694dd55202eb6d062fdf49c07cf95f8520f2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:31:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 16:31:18 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583253078.29.0.830179484172.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 91fe4142642286b65c166f7b6e27de16f42b1286 by Victor Stinner in branch 'master': bpo-39674: Update collections ABC deprecation doc (GH-18747) https://github.com/python/cpython/commit/91fe4142642286b65c166f7b6e27de16f42b1286 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 11:56:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 16:56:03 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1583254563.53.0.917409926966.issue35293@roundup.psfhosted.org> STINNER Victor added the comment: > Relevant docutils upstream issue : https://sourceforge.net/p/docutils/bugs/373/ . Also the SyntaxWarning was changed to DeprecationWarning with msg349335. SyntaxWarning warnings have been fixed in docutils 0.16. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 12:05:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 17:05:19 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs Message-ID: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> New submission from STINNER Victor : The Azure Pipelines jobs have been reimplemented as GitHub actions which are better integrated with GitHub: * Docs / Docs (pull_request) * Tests / Windows (x64) (pull_request) * Tests / macOS (pull_request) * Tests / Ubuntu (pull_request) * etc. Azure Pipelines runs the same jobs, but it looks slower. It is voting and so prevents to merge a PR until it completes. I propose to simply remove the job. I already proposed it on python-dev: https://mail.python.org/archives/list/python-dev at python.org/message/NC2ZS4WSF5AYGUUMBB7I4YIQ4YJXWBA5/ In this thread: https://mail.python.org/archives/list/python-dev at python.org/thread/2NSPJUEWULTLLALR3HY3H2PRYAUT474C/#NC2ZS4WSF5AYGUUMBB7I4YIQ4YJXWBA5 ---------- components: Tests messages: 363279 nosy: vstinner priority: normal severity: normal status: open title: Remove Azure Pipelines from GitHub PRs versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 12:10:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 17:10:22 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583255422.93.0.313033838973.issue39837@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18128 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 12:16:20 2020 From: report at bugs.python.org (Nick Moore) Date: Tue, 03 Mar 2020 17:16:20 +0000 Subject: [issue26460] datetime.strptime without a year fails on Feb 29 In-Reply-To: <1456768955.02.0.995801288981.issue26460@psf.upfronthosting.co.za> Message-ID: <1583255780.45.0.128727702938.issue26460@roundup.psfhosted.org> Nick Moore added the comment: It's kind of funny that there's already consideration of this in _strptime._strptime(), which returns a tuple used by datetime.datetime.strptime() to construct the new datetime. Search for `leap_year_fix`. I think the concern though is if we changed the default year that might possibly break someone's existing code: thus my suggestion to allow the programmer to explicitly change the default. However, I can also see that if their code is parsing dates in this way it is already wrong, and that if we're causing users pain now when they upgrade Python we're at least saving them pain at 2024-02-29 00:00:01. Taking that approach, perhaps parsing dates with no year should just throw an exception, forcing the programmer to do it right the first time. In this case though, I'd rather have a "year" kwarg to prevent the programmer having to do horrible string hacks like my code currently does. I'm not sure: is it useful for me to produce a PR so we have something specific to consider? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 12:43:36 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 17:43:36 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583257416.35.0.369586119754.issue39831@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ae75a294352e9b9487f5dc8e88f068e7e6974dc2 by Serhiy Storchaka in branch 'master': bpo-39831: Remove outdated comment. (GH-18764) https://github.com/python/cpython/commit/ae75a294352e9b9487f5dc8e88f068e7e6974dc2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 12:43:57 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 17:43:57 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583257437.07.0.641216905758.issue39831@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18129 pull_request: https://github.com/python/cpython/pull/18770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:01:16 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Mar 2020 18:01:16 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583258476.37.0.0129436339446.issue39831@roundup.psfhosted.org> miss-islington added the comment: New changeset 57fb29219f09ee705065e39ad488334a9c7e3d71 by Miss Islington (bot) in branch '3.8': bpo-39831: Remove outdated comment. (GH-18764) https://github.com/python/cpython/commit/57fb29219f09ee705065e39ad488334a9c7e3d71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:03:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 03 Mar 2020 18:03:51 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583258631.55.0.898137330633.issue39837@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:04:21 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 03 Mar 2020 18:04:21 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583258661.73.0.0410407662804.issue39831@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > It is not so easy for 3.7. Apologies Serhiy, I thought it was more straightforward and just wanted to stop the mail storm that the refleak buildbots were causing :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:05:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 18:05:38 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583258738.42.0.908888479173.issue39689@roundup.psfhosted.org> STINNER Victor added the comment: Charalampos Stratakis also reported this issue to python-dev: "Unpacking native bools in the struct module: Is Python relying on undefined behavior?" https://mail.python.org/archives/list/python-dev at python.org/thread/O742VLCYX2AE3RWQK5RBQ3BGUOHESLF5/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:08:24 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 03 Mar 2020 18:08:24 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583258904.52.0.825119549098.issue39682@roundup.psfhosted.org> Brett Cannon added the comment: > Can I ask what sort of backwards-compatibility guarantees Python provides for these cases? A deprecation warning for two releases (i.e. two years). Then it can be removed. So if people want to move forward with removing this then a DeprecationWarning would need to be raised in all places where _closed is set with a message stating the functionality is deprecated in 3.9 and slated for removal in 3.11 (along with appropriate doc updates, both for the module and What's New). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:12:44 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 03 Mar 2020 18:12:44 +0000 Subject: [issue39838] Possible unnecessary redifinition of _POSIX_C_SOURCE Message-ID: <1583259164.39.0.686980300564.issue39838@roundup.psfhosted.org> New submission from Joannah Nanjekye : Please note the compile warning: ./pyconfig.h:1590: warning: "_POSIX_C_SOURCE" redefined #define _POSIX_C_SOURCE 200809L In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26, from /workspace/cpython/Modules/expat/xmltok.c:34: /usr/include/features.h:295: note: this is the location of the previous definition # define _POSIX_C_SOURCE 199506L There must be a way of avoiding this warning. ---------- components: Interpreter Core messages: 363286 nosy: nanjekyejoannah priority: normal severity: normal status: open title: Possible unnecessary redifinition of _POSIX_C_SOURCE type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:24:30 2020 From: report at bugs.python.org (=?utf-8?b?0KDRg9GB0YLQsNC8INCo0LDRhQ==?=) Date: Tue, 03 Mar 2020 18:24:30 +0000 Subject: [issue39839] Non-working error handler when creating a task with assigning a variable Message-ID: <1583259870.1.0.174919125514.issue39839@roundup.psfhosted.org> New submission from ?????? ??? : #This example does not work due to assigning the task to a variable import asyncio import logging def handle_exception(loop, context): msg = context.get("exception", context["message"]) logging.error("Caught exception: %s", msg) async def test(): await asyncio.sleep(1) raise Exception("Crash.") def main(): loop = asyncio.get_event_loop() loop.set_exception_handler(handle_exception) # if removed "task = " - exception handler will work. task = loop.create_task(test()) try: loop.run_forever() finally: loop.close() if __name__ == "__main__": main() ---------- components: asyncio messages: 363287 nosy: asvetlov, yselivanov, ?????? ??? priority: normal severity: normal status: open title: Non-working error handler when creating a task with assigning a variable versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:26:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 18:26:50 +0000 Subject: [issue1294959] Problems with /usr/lib64 builds. Message-ID: <1583260010.44.0.262893211428.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: > Why "sys.python_libdir"? Isn't that too public? A lot of similar path-related info is in sysconfig; why shouldn't it be there? I replied in a previous comment: "Matthias Klose asked to not add another sys attribute, but Jan Mat?jek explained that the option value is needed to import the sysconfig module. Moreover, the option value is needed in the site module and we are trying to avoid "import sysconfig" in site since it would slowdown Python startup time." > How does "sys.python_libdir" work on other platforms? On Windows, the variable is equal to "lib". It's equal to "lib" on all platforms, except if you use configure to override its value. Does it reply to your question? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:29:16 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 03 Mar 2020 18:29:16 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583260156.57.0.951183432293.issue39837@roundup.psfhosted.org> Steve Dower added the comment: Deleting the files is not the right first step. First, it needs to be changed to a non-required check. Then, I can use the web UI to disable it starting. *Then*, we can remove *some* of the files in the directory. Others are used for the official release, and have to stay. PR 18769 should *not* be merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:32:53 2020 From: report at bugs.python.org (Rustam Shakh) Date: Tue, 03 Mar 2020 18:32:53 +0000 Subject: [issue39839] Non-working error handler when creating a task with assigning a variable In-Reply-To: <1583259870.1.0.174919125514.issue39839@roundup.psfhosted.org> Message-ID: <1583260373.42.0.715135594929.issue39839@roundup.psfhosted.org> Rustam Shakh added the comment: # This line doesn`t work task = loop.create_task(test()) # This line works loop.create_task(test()) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:34:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 18:34:27 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583260467.34.0.658403257194.issue39837@roundup.psfhosted.org> STINNER Victor added the comment: > PR 18769 should *not* be merged. Ok, I closed it. > First, it needs to be changed to a non-required check. Who is allowed to do that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:38:52 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 03 Mar 2020 18:38:52 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583260732.73.0.288807188755.issue39837@roundup.psfhosted.org> Steve Dower added the comment: > Who is allowed to do that? Brett did it the first time. I'm having too much trouble with GitHub right now to find the current admins. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:50:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 18:50:21 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583261421.28.0.231234568366.issue35712@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 469325c30e147680543b2f5118b83fd95055a499 by MojoVampire in branch 'master': bpo-35712: Make using NotImplemented in a boolean context issue a deprecation warning (GH-13195) https://github.com/python/cpython/commit/469325c30e147680543b2f5118b83fd95055a499 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 13:52:02 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Mar 2020 18:52:02 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583261522.61.0.239674266955.issue35712@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 14:20:45 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 03 Mar 2020 19:20:45 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583263245.23.0.5945110147.issue39689@roundup.psfhosted.org> Gregory P. Smith added the comment: fwiw oss-fuzz also finds this on struct (via ubsan) https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20949 struct.unpack('?', ' ') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 14:21:56 2020 From: report at bugs.python.org (Marco Sulla) Date: Tue, 03 Mar 2020 19:21:56 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583263316.3.0.673638798699.issue39820@roundup.psfhosted.org> Marco Sulla added the comment: Please read the message of Terry J. Reed: https://bugs.python.org/issue38747#msg356345 I quote the relevant part below > Skipping the rest of your post, I will just restate why I closed this > issue. > > 1. It introduces too many features not directly related. The existing > unix-only completions uses two modules. I suspect some of the other > features would also need new modules. (But Marco, please don't rush > to immediately open 8 new issues.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 14:39:23 2020 From: report at bugs.python.org (Shevis Johnson) Date: Tue, 03 Mar 2020 19:39:23 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583264363.91.0.6744866603.issue31122@roundup.psfhosted.org> Change by Shevis Johnson : ---------- nosy: +shevis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 14:53:11 2020 From: report at bugs.python.org (Marco Sulla) Date: Tue, 03 Mar 2020 19:53:11 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1583265191.03.0.541299736378.issue39697@roundup.psfhosted.org> Marco Sulla added the comment: I agree with Pablo Galindo Salgado: https://bugs.python.org/issue35912#msg334942 The "quick and dirty" solution is to change MAINCC to CC, for _testembed.c AND python.c (g++ fails with both). After that, _testembed.c and python.c should be changed so they can be compiled with a c++ compiler, and a system test should be added. Anyway, I found the original patch: https://bugs.python.org/file6816/cxx-main.patch In the original patch, the README contained detailed information. I think these informations could be restored, maybe in ./configure --help Anyway, I have a question. In README, it's stated: There are platforms that do not require you to build Python with a C++ compiler in order to use C++ extension modules. E.g., x86 Linux with ELF shared binaries and GCC 3.x, 4.x is such a platform. All x86 platforms? Also x86-64? And what does it means "Linux with ELF"? It means that Linux has shared libraries or that Python is compiled with --enable-shared? And what it means gcc 3 and 4? It means gcc 3+? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 14:53:30 2020 From: report at bugs.python.org (Augie Fackler) Date: Tue, 03 Mar 2020 19:53:30 +0000 Subject: [issue39840] FileNotFoundError et al show b-prefix on filepaths if passed as bytes Message-ID: <1583265210.54.0.278699602043.issue39840@roundup.psfhosted.org> New submission from Augie Fackler : I'm not really sure if this is a bug per se, so please feel encouraged to close as WAI if you like, but: >>> open(b'foo', 'rb') Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: b'foo' Seems a little weird to me (and it shows up in the UI layer of hg), because the path-as-bytes seems like it shouldn't show up in the human-readable version of the exception (I think I would have expected the fsdecode() of the bytes, for consistency?) But that's up to you. If the presentation format of this feels right to Python that's no big deal. ---------- messages: 363297 nosy: durin42 priority: normal severity: normal status: open title: FileNotFoundError et al show b-prefix on filepaths if passed as bytes versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 15:18:14 2020 From: report at bugs.python.org (Pete Wicken) Date: Tue, 03 Mar 2020 20:18:14 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1583266694.81.0.600757160514.issue33433@roundup.psfhosted.org> Change by Pete Wicken : ---------- nosy: +Wicken _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 15:34:17 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 03 Mar 2020 20:34:17 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583267657.24.0.469138492901.issue39682@roundup.psfhosted.org> Antoine Pitrou added the comment: Note you could simply remove the "closed" flag and the context manager live. That way, you don't have to deprecate anything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 15:39:35 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Mar 2020 20:39:35 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583267975.98.0.531601895454.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: Viewing the oss-fuzz bug requires login. Is there any interesting public info in it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 15:59:02 2020 From: report at bugs.python.org (Alan Robertson) Date: Tue, 03 Mar 2020 20:59:02 +0000 Subject: [issue39841] "as" variable in except block deletes local variables with same name Message-ID: <1583269142.54.0.23852633046.issue39841@roundup.psfhosted.org> New submission from Alan Robertson : When an exception "as" variable occurs, it deletes local variables with the same name. This is certainly surprising, and doesn't appear to be a documented behavior (but maybe I don't know where to look). The word "bug" comes to mind. The following few lines of code illustrate it nicely: def testme(): err = Exception("nothing worked") try: raise ValueError("no value") except ValueError as err: pass print(err) testme() ---------- components: Interpreter Core files: foo.py messages: 363300 nosy: alanr priority: normal severity: normal status: open title: "as" variable in except block deletes local variables with same name versions: Python 3.7 Added file: https://bugs.python.org/file48946/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:21:56 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 03 Mar 2020 21:21:56 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583270516.69.0.870279673289.issue39820@roundup.psfhosted.org> Eric V. Smith added the comment: I suggest closing this issue. If the REPL is going to be improved, it won't be done one-feature-at-a-time on the bug tracker. It will need to have a holistic design that takes into account desired features and the architecture of the systems that it needs to interface with. Windows and Linux may require very different approaches. For such a design, the bug tracker is a poor choice of venue for the discussion. I suggest starting on python-ideas and maybe python-dev until a design and set of features is decided on, and only at that point open issue(s) on the bug tracker. That said, I'm not sure it's worth complicating CPython itself with such changes, when IPython exists. But that can be decided on python-ideas and then on python-dev. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:24:05 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 03 Mar 2020 21:24:05 +0000 Subject: [issue39841] "as" variable in except block deletes local variables with same name In-Reply-To: <1583269142.54.0.23852633046.issue39841@roundup.psfhosted.org> Message-ID: <1583270645.27.0.462786357625.issue39841@roundup.psfhosted.org> R?mi Lapeyre added the comment: Hi Alan, this is documented at https://docs.python.org/3/reference/compound_stmts.html#the-try-statement: > When an exception has been assigned using as target, it is cleared at the end of the except clause. This is as if > > except E as N: > foo > > was translated to > > except E as N: > try: > foo > finally: > del N > This is because the exception keeps a reference to the code frame that would make a cycle with the locals which would not be destroyed until the next garbage collection. I think you will need to use a different name in the except clause. ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:27:49 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 03 Mar 2020 21:27:49 +0000 Subject: [issue39841] "as" variable in except block deletes local variables with same name In-Reply-To: <1583269142.54.0.23852633046.issue39841@roundup.psfhosted.org> Message-ID: <1583270869.24.0.464182657914.issue39841@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, this is a known issue. See https://docs.python.org/3/reference/compound_stmts.html#the-try-statement, in particular the sentence "When an exception has been assigned using as target, it is cleared at the end of the except clause" and the following text. Basically, at the end of the exception block python does a "del err" in order to prevent a long-lived reference cycle including the exception. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:30:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 21:30:28 +0000 Subject: [issue39639] Remove Suite node from AST In-Reply-To: <1581767209.41.0.653411841191.issue39639@roundup.psfhosted.org> Message-ID: <1583271028.0.0.412459273461.issue39639@roundup.psfhosted.org> STINNER Victor added the comment: Jeff Allen: thanks for the useful feedback on how it's used in Jython! ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:33:13 2020 From: report at bugs.python.org (Ammar Askar) Date: Tue, 03 Mar 2020 21:33:13 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583271193.28.0.493170169261.issue39689@roundup.psfhosted.org> Ammar Askar added the comment: Nothing too interesting, here's the stack trace: /src/cpython3/Modules/_struct.c:487:28: runtime error: load of value 32, which is not a valid value for type '_Bool' #0 0x7f50371a7670 in nu_bool cpython3/Modules/_struct.c:487:28 #1 0x7f503719ea3d in s_unpack_internal cpython3/Modules/_struct.c:1512:21 #2 0x7f5037199f7e in unpack cpython3/Modules/clinic/_struct.c.h:259:20 #3 0xb8b8bc in cfunction_vectorcall_FASTCALL cpython3/Objects/methodobject.c:366:24 #4 0x4fe113 in _PyObject_VectorcallTstate cpython3/./Include/cpython/abstract.h:111:21 #5 0x4fe51f in object_vacall cpython3/Objects/call.c:789:14 #6 0x4fe7d8 in PyObject_CallFunctionObjArgs cpython3/Objects/call.c:896:14 #7 0x4d394e in fuzz_struct_unpack cpython3/Modules/_xxtestfuzz/fuzzer.c:121:26 #8 0x4d394e in _run_fuzz cpython3/Modules/_xxtestfuzz/fuzzer.c:398:14 #9 0x4d394e in LLVMFuzzerTestOneInput cpython3/Modules/_xxtestfuzz/fuzzer.c:453:11 ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:33:29 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 03 Mar 2020 21:33:29 +0000 Subject: [issue39020] [AIX] module _curses fails to build since ESCDELAY has been added In-Reply-To: <1576003274.61.0.235026296751.issue39020@roundup.psfhosted.org> Message-ID: <1583271209.76.0.2481983748.issue39020@roundup.psfhosted.org> Michael Felt added the comment: This issue was resolved by issue39802. Marking as fixed, and closed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:41:30 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 03 Mar 2020 21:41:30 +0000 Subject: [issue39840] FileNotFoundError et al show b-prefix on filepaths if passed as bytes In-Reply-To: <1583265210.54.0.278699602043.issue39840@roundup.psfhosted.org> Message-ID: <1583271690.6.0.871441775194.issue39840@roundup.psfhosted.org> Eric V. Smith added the comment: That behavior is consistent with other exceptions. It's a helpful piece of information if you were to see it in a traceback, without any other context. So this is by design. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 16:52:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 21:52:27 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583272347.42.0.794064339219.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 116fd4af7370706d0d99ac7c70541ef965672d4e by Victor Stinner in branch 'master': bpo-39674: Suggest to test with DeprecationWarning (GH-18552) https://github.com/python/cpython/commit/116fd4af7370706d0d99ac7c70541ef965672d4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:20:29 2020 From: report at bugs.python.org (Alan Robertson) Date: Tue, 03 Mar 2020 22:20:29 +0000 Subject: [issue39841] "as" variable in except block deletes local variables with same name In-Reply-To: <1583269142.54.0.23852633046.issue39841@roundup.psfhosted.org> Message-ID: <1583274029.11.0.031201535623.issue39841@roundup.psfhosted.org> Alan Robertson added the comment: Thanks for your kind explanation. I may even vaguely remember seeing this sometime in the past. Thanks much for your time! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:25:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 03 Mar 2020 22:25:10 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583274310.32.0.931106124378.issue39689@roundup.psfhosted.org> STINNER Victor added the comment: Using memcpy() to write a value different than 0 or 1 into a _Bool is clearly an undefined behavior. Example with clang UBSan. bool.c: --- #include #include int main() { char ch = 42; _Bool x; memcpy(&x, &ch, 1); return x == true; } --- $ clang -fsanitize=bool bool.c -o bool $ ./bool bool.c:9:12: runtime error: load of value 42, which is not a valid value for type '_Bool' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:25:51 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 03 Mar 2020 22:25:51 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583274351.43.0.737660911263.issue39702@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset be501ca2419a91546dea85ef4f36945545458589 by Brandt Bucher in branch 'master': bpo-39702: Relax grammar restrictions on decorators (PEP 614) (GH-18570) https://github.com/python/cpython/commit/be501ca2419a91546dea85ef4f36945545458589 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:26:50 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 03 Mar 2020 22:26:50 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583274410.56.0.45295965526.issue39702@roundup.psfhosted.org> Guido van Rossum added the comment: I'm guessing there's some doc update that needs to happen now the code has landed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:29:44 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 22:29:44 +0000 Subject: [issue37953] Fix ForwardRef equality checks In-Reply-To: <1566828364.46.0.753751170409.issue37953@roundup.psfhosted.org> Message-ID: <1583274584.34.0.120969805456.issue37953@roundup.psfhosted.org> Ned Deily added the comment: New changeset 3eff46fc7d2e3c80c4dedba4177782f1fc8ad89b by Ryan Rowe in branch '3.7': bpo-37953: Fix ForwardRef hash and equality checks (GH-15400) (GH-18751) https://github.com/python/cpython/commit/3eff46fc7d2e3c80c4dedba4177782f1fc8ad89b ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:30:18 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 22:30:18 +0000 Subject: [issue37953] Fix ForwardRef equality checks In-Reply-To: <1566828364.46.0.753751170409.issue37953@roundup.psfhosted.org> Message-ID: <1583274618.09.0.241814708139.issue37953@roundup.psfhosted.org> Change by Ned Deily : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:32:50 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Mar 2020 22:32:50 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583274770.35.0.333590500926.issue39831@roundup.psfhosted.org> Ned Deily added the comment: Is the 3.7.x backport (PR 18765) ready to merge? ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 17:35:46 2020 From: report at bugs.python.org (Marco Sulla) Date: Tue, 03 Mar 2020 22:35:46 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583274946.37.0.369388093899.issue39820@roundup.psfhosted.org> Marco Sulla added the comment: Excuse me, but my original "holistic" proposal was rejected and it was suggested to me to propose only relevant changes, and one for issue. Now you say exactly the contrary. I feel a bit confused. PS: yes, I can, and I use, IPython. But IMHO IPython does too much things and its design is not very pythonic. Bracketed paste mode is a good feature, and I think REPL will be much more useful if it implements it. On the contrary, if you don't think IPython is good, pythonic and essential, I suppose there's no problem to substitute REPL with IPython in CPython core itself. ---------- nosy: +eryksun, steven.daprano, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 18:06:02 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 03 Mar 2020 23:06:02 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583276762.69.0.00844797293712.issue39820@roundup.psfhosted.org> Eric V. Smith added the comment: Reasonable people can disagree. If someone else thinks this can be done piecemeal, then I'm not stopping anyone. I just think that's a mistake and will lead to much frustration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 18:57:59 2020 From: report at bugs.python.org (Marco Sulla) Date: Tue, 03 Mar 2020 23:57:59 +0000 Subject: [issue39842] partial_format() Message-ID: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> New submission from Marco Sulla : In `string` module, there's a very little known class `Template`. It implements a very simple template, but it has an interesting method: `safe_substitute()`. `safe_substitute()` permits you to not fill the entire Template at one time. On the contrary, it substitute the placeholders that are passed, and leave the others untouched. I think it could be useful to have a similar method for the format minilanguage. I propose a partial_format() method. === WHY I think this is useful? === This way, you can create subtemplates from a main template. You could want to use the template for creating a bunch of strings, all of them with the same value for some placeholders, but different values for other ones. This way you have *not* to reuse the same main template and substitute every time the placeholders that does not change. `partial_format()` should act as `safe_substitute()`: if some placeholder misses a value, no error will be raised. On the contrary, the placeholder is leaved untouched. Some example: >>> "{} {}".partial_format(1) '1 {}' >>> "{x} {a}".partial_format(a="elephants") '{x} elephants' >>> "{:-f} and {:-f} nights".partial_format(1000) '1000 and {:-f} nights' ---------- components: Interpreter Core messages: 363317 nosy: Marco Sulla priority: normal severity: normal status: open title: partial_format() type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 20:21:14 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 04 Mar 2020 01:21:14 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583284874.26.0.9679073779.issue31122@roundup.psfhosted.org> Dima Tisnek added the comment: I volunteer to test the theory that the connection is closed mid-flight. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 20:47:04 2020 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 04 Mar 2020 01:47:04 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583286424.32.0.436505798006.issue39702@roundup.psfhosted.org> Brandt Bucher added the comment: Agreed. I'll have something up later, hopefully. I'll add a tiny blurb to whatsnew, as well as adding the PEP to the "See also:" note in https://docs.python.org/3.9/reference/compound_stmts.html and updating the mini-grammar there. I don't think it needs much else. Hmmm. It looks like the page of the docs that I've linked above wasn't ever updated for the walrus. We should probably add updating this part of the docs to https://devguide.python.org/grammar/... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 21:01:25 2020 From: report at bugs.python.org (Andrew Bartlett) Date: Wed, 04 Mar 2020 02:01:25 +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: <1583287285.42.0.817185995397.issue37330@roundup.psfhosted.org> Andrew Bartlett added the comment: I think we are speaking past each other. Yes, Python 2 is no longer being changed, which is awesome as we need for fear breakage of the older builds that use that for the build system. The issue isn't the particular language feature, or that there is no way to further adapt code, but that a valid build script that operates correctly on Python 3.8 will no longer, without warning to us, operate on Python 2.9 or at best 2.10. Thankfully the only Samba versions with support for Python3 are still in maintenance, so course I've back-ported patches to the tip of each release branch to work around this change. But again, that doesn't help when I need to build an arbitrary git revision in the future. (That warnings were available, if we knew were to look, is an entirely moot point at this stage). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 21:02:19 2020 From: report at bugs.python.org (Andrew Bartlett) Date: Wed, 04 Mar 2020 02:02:19 +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: <1583287339.39.0.460826784328.issue37330@roundup.psfhosted.org> Andrew Bartlett added the comment: ...Python 2.9 or at best 2.10. Of course I mean Python 3.9 or at best 3.10. Sorry for the confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 21:17:23 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 04 Mar 2020 02:17:23 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583288243.07.0.0473676040474.issue31122@roundup.psfhosted.org> Dima Tisnek added the comment: Rejoice: https://github.com/dimaqq/bpo-31122 Short, easy to reproduce :) (I've tested on Mac: 3.7, 3.8, 3.9a from python.org, linked against OpenSSL 1.1.1c/d) Funnily enough, Python 2.7 raises an ssl.SSLEOFError instead ???? ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 21:45:36 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 04 Mar 2020 02:45:36 +0000 Subject: [issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds In-Reply-To: <1570313540.41.0.0224198940573.issue38380@roundup.psfhosted.org> Message-ID: <1583289936.93.0.971448846039.issue38380@roundup.psfhosted.org> Benjamin Peterson added the comment: Traditionally, we've taken these dependency updates in 2.7, but there doesn't seem to be a compelling reason to take this one. ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 23:17:54 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 04 Mar 2020 04:17:54 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583295474.91.0.382779229126.issue39702@roundup.psfhosted.org> Guido van Rossum added the comment: Sounds good. If you feel like it you can submit a PR to the devguide, I'm sure Brett will merge it quickly... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 23:34:33 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 04:34:33 +0000 Subject: [issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode In-Reply-To: <1573231108.59.0.407559138222.issue38747@roundup.psfhosted.org> Message-ID: <1583296473.7.0.691196891913.issue38747@roundup.psfhosted.org> Terry J. Reedy added the comment: Not surprisingly, I agree with Steven that enhancing IDLE may be a better use of core developer time. It and Tkinter (and turtle) are options for the Windows and macOS (and some non-PSF) installers and easily installed on Linux. IDLE has most of the requested features, and where it does not, I will consider well-specified enhancements. 1. Pasting a compound statement with embedded blank lines. >>> def f(): a = 1 # following line has no spaces or tabs b=3 print(a, b) >>> f() 1, 3 Pasting multiple statements, separated or not by blank lines, and pasting non-BMP unicode, are separate issues. 2. Auto-indent: after ':' (see example above) and for syntactic sequences. (Currently, the latter only works in editors because '>>> ' prompts and tab indents interfere. There is a issue with PR that will allow this to be fixed.) strings = ['a', 'b', # autoindent ] ardvark = fribble(a, b, # autoindent ) 3. Code blocks are one history entry. Yes, where 'code block' means one complete statement, possibly multiple lines, as submitted for execution. The example in 1. can be recalled as submitted, with the blank line. 4. Save interactive session. Yes. I intend to add an option to only save code, without prompts or output, so the code can be pasted into an editor and edited and run. Or maybe the code should be loaded directly into an editor. 5. Add history() builtin. I believe that on linux this is redundant with existing enhanced history mechanisms, which include storing history across sessions in a 'standard' place. I believe my idea for 4. covers must of the use cases. 6. Add a. pprint and b. getsource to builtins. I think this would be rejected. I seldom use either of those two functions, but constantly import other things. So I would want other things added. Startup files are the mechanism for personally customizing one's shell. Simple imports serve for ad hoc customizations. Note that getsource(name) needs to be passed to print() to be readable. As for getting source: IDLE displays a popup signature for any function if one is available. Given a traceback or grep output, one can open any source-based module in an editor at the line indicated. Open Module lets one easily open any importable source based module with only the import name, not the full path. For long source chunks, a separate window is really much better than printed in the shell. A possible IDLE enhancement would be the ability to add an object name and to jump to its definition. 7. Syntax coloring. Yes, with full customization. 8. Bracket matching for(), {}, and []. Yes, with a couple of options. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 3 23:45:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 04:45:16 +0000 Subject: [issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode In-Reply-To: <1573231108.59.0.407559138222.issue38747@roundup.psfhosted.org> Message-ID: <1583297116.92.0.505403409615.issue38747@roundup.psfhosted.org> Terry J. Reedy added the comment: > why a C extension apart and not a patch to `readline`? Search "python ctypes vs c extension". Multiple SO answers. I believe speed and language competancy are big factors. I don't think and stdlib modules use ctypes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 00:00:55 2020 From: report at bugs.python.org (=?utf-8?q?Mikko_Nyl=C3=A9n?=) Date: Wed, 04 Mar 2020 05:00:55 +0000 Subject: [issue39843] Merged fix for bpo-17560 missing from changelog Message-ID: <1583298055.95.0.17111086432.issue39843@roundup.psfhosted.org> New submission from Mikko Nyl?n : A fix for bpo-17560 (about passing very large objects between processes with multiprocessing) was merged in Nov 2018 in this PR: https://github.com/python/cpython/pull/10305 However, I see no mention of this in the changelog , even though the issue page reports the fix to be in version 3.8. Is the changelog just missing entry for this, or was the fix pulled back later and never made it's way into 3.8? ---------- assignee: docs at python components: Documentation messages: 363327 nosy: Mikko Nyl?n, docs at python priority: normal severity: normal status: open title: Merged fix for bpo-17560 missing from changelog type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 00:44:51 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 05:44:51 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583300691.43.0.510251643473.issue39820@roundup.psfhosted.org> Terry J. Reedy added the comment: Adding functions to builtins (2 of Marco's 8 #38747 ideas) should be separate from patching the repl code. I agree that the latter should not be done piecemeal. I previous wrote that we need a pydev REPL enhancement policy discussion *first* and explicitly asked Marco "please don't rush to immediately open 8 new issues." I do think that if there were an *approved* set of new features, several patches would be best, but that is moot at present. IDLE already has this feature, and most of the other enhancements Marco wants. (msg363325) The key for this one is that tcl/tk does not trigger events when inserting pasted code, so only a keyed newline triggers IDLE's user code processing. But other IDLE features are much harder, and I suspect that this would also be in the Windows console. In msg356327, Eric Sun, one of our best Windows experts, outlined the major difficulties of changing things on Windows' console. He only said something half-way encouraging about autoindent but otherwise thought that a working stdlib Windows readline extension would be needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 01:50:39 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 04 Mar 2020 06:50:39 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583304639.8.0.408713594036.issue31122@roundup.psfhosted.org> Dima Tisnek added the comment: I've traced it down to here: https://github.com/python/cpython/blob/be501ca2419a91546dea85ef4f36945545458589/Modules/_ssl.c#L791-L798 `err.c` (errno) == 0, no error, and `err.ssl` == 5, SSL_ERROR_SYSCALL, helpfully commented "look at error stack/return value/errno" in openssl/ssl.h ? I'm a bit suspicious about `s->errorhandler()` which is some old convention (git blame: 8 years ago), commented "checks errno, returns NULL, set a Python exception", but at this point, we know that errno is 0, so why call it? I'm thinking to just change that to SSLEOFError, but I wonder if something else might break? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 01:59:38 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Mar 2020 06:59:38 +0000 Subject: [issue39843] Merged fix for bpo-17560 missing from changelog In-Reply-To: <1583298055.95.0.17111086432.issue39843@roundup.psfhosted.org> Message-ID: <1583305178.42.0.579736105782.issue39843@roundup.psfhosted.org> Ned Deily added the comment: It looks like the NEWS item for this change was added to the 3.8.0a1 changes under bpo-35152 which was closed as a duplicate of bpo-17560. We could change the changelog entry in Misc/NEWS.d/3.8.0a1.rst to point to bpo-17560. Antoine? bpo-35152: Allow sending more than 2 GB at once on a multiprocessing connection on non-Windows systems. ---------- nosy: +ned.deily, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:06:23 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Mar 2020 07:06:23 +0000 Subject: [issue39389] gzip metadata fails to reflect compresslevel In-Reply-To: <1579465438.04.0.91237843457.issue39389@roundup.psfhosted.org> Message-ID: <1583305583.14.0.889261047358.issue39389@roundup.psfhosted.org> Ned Deily added the comment: New changeset 12c45efe828a90a2f2f58a1f95c85d792a0d9c0a by Miss Islington (bot) in branch '3.7': [3.7] bpo-39389: gzip: fix compression level metadata (GH-18077) (GH-18101) https://github.com/python/cpython/commit/12c45efe828a90a2f2f58a1f95c85d792a0d9c0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:06:55 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Mar 2020 07:06:55 +0000 Subject: [issue39389] gzip metadata fails to reflect compresslevel In-Reply-To: <1579465438.04.0.91237843457.issue39389@roundup.psfhosted.org> Message-ID: <1583305615.9.0.256890206506.issue39389@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:25:02 2020 From: report at bugs.python.org (David Hewitt) Date: Wed, 04 Mar 2020 07:25:02 +0000 Subject: [issue39773] Export symbols for vectorcall In-Reply-To: <1582790921.68.0.338373290894.issue39773@roundup.psfhosted.org> Message-ID: <1583306702.07.0.044749057306.issue39773@roundup.psfhosted.org> David Hewitt added the comment: I had suspected that might be the case. We already use PyObject_Call but had been hoping to experiment with the Vectorcall optimizations. Without the symbols I might resort to reproducing the implementation of these functions on the Rust side. Shouldn't be too much code duplication. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:25:53 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 04 Mar 2020 07:25:53 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583306753.87.0.223861160232.issue31122@roundup.psfhosted.org> Change by Dima Tisnek : ---------- keywords: +patch pull_requests: +18130 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:26:14 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 04 Mar 2020 07:26:14 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1583306774.81.0.504734264214.issue31122@roundup.psfhosted.org> Dima Tisnek added the comment: https://github.com/python/cpython/pull/18772 posted ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:53:22 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 07:53:22 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows Message-ID: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> New submission from Jacin Ferreira : 0) MacBook Pro 13" running MacOS 10.15.3 Catalina 1) Fresh install of Python 3.8.2 from python.org 2) Launch IDLE 3) Observe Python 3.8.2 Shell 4) Goto File Menu 5) Select Preferences 6) Observe Preferences EXPECTED RESULTS Windows should show text and are usable ACTUAL RESULTS Windows are all black and no text shows. IDLE is unusable in this state. ---------- assignee: terry.reedy components: IDLE, macOS files: Screen Shot 2020-03-03 at 11.51.21 PM.png messages: 363334 nosy: Jacin Ferreira, ned.deily, ronaldoussoren, terry.reedy priority: normal severity: normal status: open title: IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48947/Screen Shot 2020-03-03 at 11.51.21 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 02:53:45 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 07:53:45 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583308425.81.0.98376374906.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: Uploading another screen shot of preferences. ---------- Added file: https://bugs.python.org/file48948/Screen Shot 2020-03-03 at 11.51.36 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 03:01:58 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 08:01:58 +0000 Subject: [issue39820] Bracketed paste mode for REPL In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1583308918.31.0.0226910613955.issue39820@roundup.psfhosted.org> Marco Sulla added the comment: IMHO such a feature is useful for sysops that does not have a graphical interface, as Debian without an X. That's why vi is (unluckily) very popular also in 2020. IDLE can't be used in this cases. Windows users can't remotely login without a GUI, so the feature for such platforms can be not implemented, since there's builtin solutions (IDLE) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 03:13:16 2020 From: report at bugs.python.org (victorg) Date: Wed, 04 Mar 2020 08:13:16 +0000 Subject: [issue21041] pathlib.PurePath.parents rejects negative indexes In-Reply-To: <1395613011.22.0.29152070109.issue21041@psf.upfronthosting.co.za> Message-ID: <1583309596.87.0.762581058148.issue21041@roundup.psfhosted.org> victorg added the comment: Allow negative indexes that could be usefull. Example: to compare 2 or more Path, if they come from the same top directory from pathlib import Path a = Path("/a/testpy/cpython/config.log") b = Path("/b/testpy/cpython/config.log") c = Path("/a/otherfolder/text.txt") print(f"a.parents[-2] == b.parents[-2] -> {a.parents[-2] == b.parents[-2]}") # False print(f"a.parents[-2] == c.parents[-2] -> {a.parents[-2] == c.parents[-2]}") # True # index = -2 because -1 is "/" ---------- nosy: +victorg Added file: https://bugs.python.org/file48949/allowNegativeIndexParents.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 03:36:46 2020 From: report at bugs.python.org (Evgeny Boytsov) Date: Wed, 04 Mar 2020 08:36:46 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583311006.48.0.272581172565.issue39776@roundup.psfhosted.org> Evgeny Boytsov added the comment: I checked both my test example and real production code with your patch. I'm unable to reproduce the bug, so I think it is fixed now. Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 03:40:21 2020 From: report at bugs.python.org (Ion Cebotari) Date: Wed, 04 Mar 2020 08:40:21 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash Message-ID: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> New submission from Ion Cebotari : I have this code for a tool that copies files from one directory to another: parser = argparse.ArgumentParser() parser.add_argument('src_dir') parser.add_argument('dest_dir') args = parser.parse_args() It works fine on Unix, but on Windows, if the destination path ends with a backward slash, it seems that argparse parses the string as it would escape a double quote and returns the string with the double quote appended. For example, calling the script: (base) PS Z:\test> python.exe .\main.py -d Z:\tmp\test\DJI\ 'C:\unu doi\' will create the destination path string: C:\unu doi" The source path, even though it ends with the backslash as well, isn't modified by argparse. I've worked around this issue by using this validation function for the arguments: def is_valid_dir_path(string): """ Checks if the path is a valid path :param string: The path that needs to be validated :return: The validated path """ if sys.platform.startswith('win') and string.endswith('"'): string = string[:-1] if os.path.isdir(string): return string else: raise NotADirectoryError(string) parser = argparse.ArgumentParser() parser.add_argument('src_dir', type=is_valid_dir_path) parser.add_argument('dest_dir', type=is_valid_dir_path) args = parser.parse_args() ---------- messages: 363339 nosy: 888xray999 priority: normal severity: normal status: open title: Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 04:19:41 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Mar 2020 09:19:41 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583313581.97.0.599538974946.issue39844@roundup.psfhosted.org> Ned Deily added the comment: Thank you for your report. I am unable to reproduce that behavior. I suspect that the most likely explanation is that you are not actually using the python.org 3.8.2 but rather an IDLE and python from some other distributor (like Homebrew) that has a different version of Tk. There is an easy way to check that. From a Terminal.app window, enter the following commands to the Unix shell: /usr/local/bin/python3.8 -c "import sys;print(sys.version)" You should see: 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) [Clang 6.0 (clang-600.0.57)] If not, you are not using Python 3.8.2 from python.org. Otherwise, then try: /usr/local/bin/python3.8 -m idlelib and see if the Preferences window is still black. If so, another possibility is that your saved IDLE preferences may be interfering. Choose Quit IDLE from the IDLE menu then try moving your existing IDLE preferences out of the way so that IDLE will use the "factory defaults": cd mv .idlerc old_idlerc /usr/local/bin/python3.8 -m idlelib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:08:07 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Mar 2020 10:08:07 +0000 Subject: [issue39530] Documentation about comparisons between numeric types is misleading In-Reply-To: <1580653054.78.0.127921454413.issue39530@roundup.psfhosted.org> Message-ID: <1583316487.15.0.800773320654.issue39530@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18131 pull_request: https://github.com/python/cpython/pull/18736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:24:15 2020 From: report at bugs.python.org (Daniel Chimeno) Date: Wed, 04 Mar 2020 10:24:15 +0000 Subject: [issue39846] Register .whl as a unpack format in shutil unpack Message-ID: <1583317455.42.0.20954925139.issue39846@roundup.psfhosted.org> New submission from Daniel Chimeno : While working on project with Python wheels I found myself adding: ```` import shutil shutil.register_unpack_format('whl', ['.whl'], shutil._unpack_zipfile) ```` Since PEP 427 explicitly says wheels are ZIP-format archive. https://www.python.org/dev/peps/pep-0427/ I wonder if it's loable to register the unpack format by default so the shutil.unpack_archive() function works without adding it. ---------- components: Library (Lib) messages: 363341 nosy: dchimeno priority: normal severity: normal status: open title: Register .whl as a unpack format in shutil unpack type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:30:52 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Mar 2020 10:30:52 +0000 Subject: [issue39530] Documentation about comparisons between numeric types is misleading In-Reply-To: <1580653054.78.0.127921454413.issue39530@roundup.psfhosted.org> Message-ID: <1583317852.13.0.337778476764.issue39530@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18132 pull_request: https://github.com/python/cpython/pull/18773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:49:55 2020 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 04 Mar 2020 10:49:55 +0000 Subject: [issue39826] logging HTTPHandler does not support proxy In-Reply-To: <1583161477.89.0.356688736779.issue39826@roundup.psfhosted.org> Message-ID: <1583318995.55.0.109442243084.issue39826@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 22a9a546ff3bf2a63d77ca1e5494e758bc59132f by l0rb in branch 'master': bpo-39826: add getConnection() hook to logging HTTPHandler (GH-18745) https://github.com/python/cpython/commit/22a9a546ff3bf2a63d77ca1e5494e758bc59132f ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:50:33 2020 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 04 Mar 2020 10:50:33 +0000 Subject: [issue39826] logging HTTPHandler does not support proxy In-Reply-To: <1583161477.89.0.356688736779.issue39826@roundup.psfhosted.org> Message-ID: <1583319033.91.0.170256242143.issue39826@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 05:58:46 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Wed, 04 Mar 2020 10:58:46 +0000 Subject: [issue36490] Modernize function signature in Archiving section of shutil doc In-Reply-To: <1554005288.19.0.789880523073.issue36490@roundup.psfhosted.org> Message-ID: <1583319526.29.0.546664593219.issue36490@roundup.psfhosted.org> C.A.M. Gerlach added the comment: Closing on grounds of apparently not really being an issue as opposed to a misunderstanding on my part, as mentioned above. ---------- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:08:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:08:41 +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: <1583327321.93.0.0261677802999.issue37330@roundup.psfhosted.org> STINNER Victor added the comment: Le mer. 4 mars 2020 ? 03:01, Andrew Bartlett a ?crit : > (...) but that a valid build script that operates correctly on Python 3.8 will no longer, without warning to us, (...) Displaying warnings by default or not is an old debate. I added the "Python Development Mode" (-X dev) to help the situation: https://docs.python.org/dev/library/devmode.html#devmode I just added a very explicit "You should check for DeprecationWarning in your code" section in What's New In Python 3.9: https://docs.python.org/dev/whatsnew/3.9.html#you-should-check-for-deprecationwarning-in-your-code Moreover, DeprecationWarning are now (Python 3.7) displayed *by default* in the __main__ module: https://www.python.org/dev/peps/pep-0565/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:15:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:15:30 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583327730.3.0.390554448148.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: New changeset dffe4c07095e0c693e094d3c140e85a68bd8128e by Andy Lester in branch 'master': bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601) https://github.com/python/cpython/commit/dffe4c07095e0c693e094d3c140e85a68bd8128e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:20:27 2020 From: report at bugs.python.org (And Clover) Date: Wed, 04 Mar 2020 13:20:27 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days Message-ID: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> New submission from And Clover : Since bpo-15038, waiting to acquire locks/events/etc from _thread/threading on Windows can fail to return long past the requested timeout. Cause: https://github.com/python/cpython/blob/3.8/Python/thread_nt.h#L85 using 32-bit GetTickCount/DWORD, which will overflow at around 49.7 days of uptime. If the WaitForSingleObjectEx call in PyCOND_TIMEDWAIT returns later than the 'target' time, and the tick count overflows in that gap, 'milliseconds' will become very large (up to another 49.7 days) and the next PyCOND_TIMEDWAIT will be stuck for a long time. Where we've seen it is where it's most likely to happen: when the machine is hibernated during the WaitForSingleObjectEx call. I believe the TickCount continues to increase during hibernation so there is a much bigger gap between 'target' and 'now' for the overflow to happen in. Simplest fix is probably to switch to GetTickCount64/ULONGLONG. We should be able to get away with using this now we no longer support WinXP. ---------- components: Library (Lib), Windows messages: 363346 nosy: aclover, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: EnterNonRecursiveMutex on win32 can hang for 49.7 days type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:22:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:22:57 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583328177.53.0.041198819068.issue39847@roundup.psfhosted.org> STINNER Victor added the comment: time.monotonic() is now always implemented with GetTickCount64() on Windows. Previously, there was a fallback on GetTickCount() when GetTickCount64() was not available. GetTickCount() call has been removed when we dropped support for old Windows versions. Do you want to work on a fix? (PR) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:23:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:23:12 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583328192.81.0.42387749747.issue39847@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: EnterNonRecursiveMutex on win32 can hang for 49.7 days -> EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:25:28 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Wed, 04 Mar 2020 13:25:28 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1583328328.32.0.689442541464.issue32592@roundup.psfhosted.org> C.A.M. Gerlach added the comment: I'd be happy to submit a PR to resolve all the issues that I note here. Just say the word and I'll go right ahead. I presume the Windows installer code [0a] should be updated to refuse to install on Windows <8 and given an informative warning instead letting the user know their system is not supported, as well as logging the appropriate messages in each case? Appropriate failure IDs would also be defined in the associated WXL [0b]. [0a] https://github.com/python/cpython/blob/master/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp#L3041 [0b] https://github.com/python/cpython/blob/master/Tools/msi/bundle/Default.wxl The relevant Using Python on Windows docs [1a] should be updated to reflect this, along with PCBuild/readme.txt [1b]. Also, given it is dropping 2 major Windows versions, including one seeing widespread use, it should probably be mentioned in What's New; I don't see it there as it stands now. [1a] https://github.com/python/cpython/blob/master/Doc/using/windows.rst [1b] https://github.com/python/cpython/blob/master/PCbuild/readme.txt As a more trivial docs change, references to "Vista's" UAC ([2a], [2b], [2c]) could be updated to simply refer to "Windows'" UAC to avoid confusion since it presumably applies to all >=Vista versions which have said feature. [2a] https://github.com/python/cpython/blob/master/Lib/distutils/command/bdist_wininst.py#L52 [2b] https://github.com/python/cpython/blob/master/PC/bdist_wininst/install.c#L2187 [2c] https://github.com/python/cpython/blob/master/Doc/distutils/builtdist.rst#vista-user-access-control-uac Finally, maybe this is stretching the scope a bit, but the relevant part of [1a], namely [3a], should also be updated to state that Windows CE is not supported (it currently states the opposite), as this was removed in 3.6.0b1 [3ai], and additionally the Sourceforge (!) project it links to [3bii] is on an legacy archived CVS repo that hasn't been meaningfully updated since 2008 and the current versions of CE (5 and 6) at the time is long EoL now (in fact, 7 is coming up on its EoL in a year). Out of date references to Windows CE support could also be removed from the ctypes doc [3b] and the condavar code comments [3c], [3d]. [3a] https://github.com/python/cpython/blob/master/Doc/using/windows.rst#L1165 [3ai] https://github.com/python/cpython/blob/master/Misc/NEWS.d/3.6.0b1.rst#L217 [3aii] https://sourceforge.net/projects/pythonce/files/ [3b] https://github.com/python/cpython/blob/master/Doc/library/ctypes.rst [3c] https://github.com/python/cpython/blob/master/Include/internal/pycore_condvar.h#L30 [3d] https://github.com/python/cpython/blob/master/Python/condvar.h#L85 ---------- nosy: +CAM-Gerlach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:38:51 2020 From: report at bugs.python.org (Day Barr) Date: Wed, 04 Mar 2020 13:38:51 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583329131.76.0.743415743036.issue39847@roundup.psfhosted.org> Change by Day Barr : ---------- nosy: +Day Barr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:43:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:43:40 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583329420.91.0.941166306917.issue39674@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18133 pull_request: https://github.com/python/cpython/pull/18776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 08:50:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 13:50:23 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583329823.83.0.00819744842989.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1ec63b62035e73111e204a0e03b83503e1c58f2e by Victor Stinner in branch 'master': bpo-39763: distutils.spawn now uses subprocess (GH-18743) https://github.com/python/cpython/commit/1ec63b62035e73111e204a0e03b83503e1c58f2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:01:31 2020 From: report at bugs.python.org (sparrowt) Date: Wed, 04 Mar 2020 14:01:31 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583330491.89.0.287643679512.issue39847@roundup.psfhosted.org> Change by sparrowt : ---------- nosy: +sparrowt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:11:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 14:11:47 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583331107.45.0.761266584588.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a6d3546d003d9873de0f71b319ad79d203374bf0 by Victor Stinner in branch 'master': bpo-39674: Fix typo in What's New In Python 3.9 (GH-18776) https://github.com/python/cpython/commit/a6d3546d003d9873de0f71b319ad79d203374bf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:12:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 14:12:43 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583331163.4.0.873239651739.issue39763@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18134 pull_request: https://github.com/python/cpython/pull/18778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:23:57 2020 From: report at bugs.python.org (And Clover) Date: Wed, 04 Mar 2020 14:23:57 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583331837.83.0.707603686459.issue39847@roundup.psfhosted.org> And Clover added the comment: Yep, should be straightforward to fix (though not to test, as fifty-day test cases tend to be frowned upon...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:48:31 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Wed, 04 Mar 2020 14:48:31 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1583333311.24.0.894802793043.issue32592@roundup.psfhosted.org> C.A.M. Gerlach added the comment: Here's a further conservative list of low-hanging =Win 8 | Branch can be inlined and outdated comments removed: https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L866 * pathlib.py | >= Vista | Branch can be inlined and else block removed: https://github.com/python/cpython/blob/master/Lib/pathlib.py#L19 Tests: * test_winreg.py | Vista | Multiple tests and constants (All the checks and tests requiring registry reflection/`HAS_REFLECTION`): https://github.com/python/cpython/blob/master/Lib/test/test_winreg.py * test_winreg.py | can be updated to 8? https://github.com/python/cpython/blob/master/PCbuild/python.props#L101 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:52:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 14:52:19 +0000 Subject: [issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c In-Reply-To: <1582782970.67.0.345827847271.issue39770@roundup.psfhosted.org> Message-ID: <1583333539.29.0.57680521799.issue39770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 702e09fd0ad72b248b5adfa0fcfdb58600be77f6 by Andy Lester in branch 'master': bpo-39770, array module: Remove unnecessary descriptor counting (GH-18675) https://github.com/python/cpython/commit/702e09fd0ad72b248b5adfa0fcfdb58600be77f6 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:54:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 14:54:29 +0000 Subject: [issue39770] Remove unnecessary size calculation in array_modexec in Modules/arraymodule.c In-Reply-To: <1582782970.67.0.345827847271.issue39770@roundup.psfhosted.org> Message-ID: <1583333669.38.0.215998252156.issue39770@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 09:56:30 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 14:56:30 +0000 Subject: [issue39848] Warning: 'classifiers' should be a list, got type 'tuple' Message-ID: <1583333790.29.0.541399000683.issue39848@roundup.psfhosted.org> New submission from Marco Sulla : I got this warning. I suppose that `distutils` can use any iterable. ---------- components: Distutils messages: 363354 nosy: Marco Sulla, dstufft, eric.araujo priority: normal severity: normal status: open title: Warning: 'classifiers' should be a list, got type 'tuple' versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 10:08:24 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 04 Mar 2020 15:08:24 +0000 Subject: =?utf-8?q?=5Bissue39849=5D_Compiler_warninig=3A_warning=3A_variable_?= =?utf-8?q?=E2=80=98res=E2=80=99_set_but_not_used_=5B-Wunused-but-set-vari?= =?utf-8?q?able=5D?= Message-ID: <1583334504.92.0.978999288989.issue39849@roundup.psfhosted.org> New submission from Dong-hee Na : Modules/_testcapimodule.c:6808:15: warning: variable ?res? set but not used [-Wunused-but-set-variable] 6808 | PyObject *res; This warning is noticed after bpo-38913 is fixed. My GCC version is 9.2.0 :) ---------- messages: 363355 nosy: corona10, serhiy.storchaka priority: normal severity: normal status: open title: Compiler warninig: warning: variable ?res? set but not used [-Wunused-but-set-variable] type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 10:12:26 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Mar 2020 15:12:26 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash In-Reply-To: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> Message-ID: <1583334746.01.0.601244454853.issue39845@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 10:37:42 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Wed, 04 Mar 2020 15:37:42 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1583336262.29.0.459871124847.issue32592@roundup.psfhosted.org> C.A.M. Gerlach added the comment: What Eryk said wrt Windows 8 seems sound, looking at some additional data. Per Statcounter [0], Windows 8 market share has dropped to 1.32% from 2.20% of all Windows users over the past 12 months, or 1.75% -> 1.01% of all desktop users. Extrapolating a constant linear decrease, this would imply a usage share of 0.55-0.60% at Python 3.9 release, or considering a more conservative (and realistic) constant-percent decrease, this would put the amount at 0.75%. For comparison, by Statcounter's same metrics, Windows XP which was EoL 5 versions ago is still at 1.13% of the Windows or 0.90% of the total desktop market today, WinVista is at 0.41%/0.33%, Win8.1 at 4.7%/3.8% (~4x Win8) and of course the EoL and also dropped Windows 7 is at no less than 23.2%/18.5%, nearly 20 times the amount of Win 8 today and dropping more slowly besides. [0] https://gs.statcounter.com/os-version-market-share/windows/desktop/worldwide Conducting a similar analysis with the NetMarketshare data [1], we see a 0.78% -> 0.66% year on year share for Win8, which extrapolates to a 0.57% share at Py2.9 release. Vista is much lower at only 0.15%, but XP is over 2x higher at 1.35%, and Win8.1 well over 5x as large at 3.5%. Windows 7 is, again, at no less than 25.2%, nearly 40x the Win 8 marketshare. [1] https://netmarketshare.com/operating-system-market-share.aspx Users likely to be most concerned with wanting or needing to use the latest and greatest version of Python are more than likely to be power users, enthusiasts and developers, a group that was particularly averse to adopting Windows 8 when it came out, was more likely to upgrade to 8.1 , and is more aware of EoL timeframes than the average consumer. This is empirically supported by the Steam survey [2], which samples a population substantially more similar to the profile of a developer than the average web user captured by the previous two surveys. Here, the numbers are much more stark: A mere 0.17% of their >96% Windows userbase runs Windows 8, vs. 2.10% (>10x) for Windows 8.1 and 12.4% for Windows 7 (~75x). Given an infinitesimal fraction of such remaining users are likely going to require upgrading to a bleeding-edge Python version but not their OS that would have been EoL for nearly 5 years, over a year longer than Vista itself and 4 years longer than 7, I don't think supporting that EoL OS per PEP 11 for another >5+ years with another new Python version need be a priority. [2] https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:00:37 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 04 Mar 2020 16:00:37 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583337637.47.0.775222224302.issue39828@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch nosy: +corona10 nosy_count: 3.0 -> 4.0 pull_requests: +18135 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:12:51 2020 From: report at bugs.python.org (Nathan Michaels) Date: Wed, 04 Mar 2020 16:12:51 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. Message-ID: <1583338371.71.0.604294788421.issue39850@roundup.psfhosted.org> Change by Nathan Michaels : ---------- components: Library (Lib) nosy: nmichaels priority: normal severity: normal status: open title: multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:16:13 2020 From: report at bugs.python.org (Nathan Michaels) Date: Wed, 04 Mar 2020 16:16:13 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. Message-ID: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> New submission from Nathan Michaels : >>> from multiprocessing.connection import Listener >>> listener = Listener('\0conntest', family='AF_UNIX') >>> listener.close() Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.6/multiprocessing/connection.py", line 466, in close listener.close() File "/usr/lib64/python3.6/multiprocessing/connection.py", line 604, in close unlink() File "/usr/lib64/python3.6/multiprocessing/util.py", line 186, in __call__ res = self._callback(*self._args, **self._kwargs) ValueError: embedded null byte Linux has a handy feature where if the first byte of a unix domain socket's name is the null character, it won't put it in the filesystem. The socket interface works fine with it, but when SocketListener is wrapped around a socket, it throws this exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:16:54 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Mar 2020 16:16:54 +0000 Subject: [issue39639] Remove Suite node from AST In-Reply-To: <1581767209.41.0.653411841191.issue39639@roundup.psfhosted.org> Message-ID: <1583338614.41.0.931062669268.issue39639@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d82e469048e0e034d8c0020cd33b733be1adf68b by Batuhan Ta?kaya in branch 'master': bpo-39639: Remove the AST "Suite" node and associated code (GH-18513) https://github.com/python/cpython/commit/d82e469048e0e034d8c0020cd33b733be1adf68b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:17:30 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Mar 2020 16:17:30 +0000 Subject: [issue39639] Remove Suite node from AST In-Reply-To: <1581767209.41.0.653411841191.issue39639@roundup.psfhosted.org> Message-ID: <1583338650.2.0.654848877021.issue39639@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:36:23 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Mar 2020 16:36:23 +0000 Subject: [issue39848] Warning: 'classifiers' should be a list, got type 'tuple' In-Reply-To: <1583333790.29.0.541399000683.issue39848@roundup.psfhosted.org> Message-ID: <1583339783.46.0.71448510838.issue39848@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also discussion at https://bugs.python.org/issue19610 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:40:29 2020 From: report at bugs.python.org (And Clover) Date: Wed, 04 Mar 2020 16:40:29 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583340029.9.0.485707431462.issue39847@roundup.psfhosted.org> Change by And Clover : ---------- keywords: +patch pull_requests: +18136 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 11:42:44 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 16:42:44 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583340164.27.0.0466117436861.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: Thank you so much Ned. I appreciate it. What you said makes sense. I went ahead and did what you suggested and validated that I am indeed running Python 3.8.2 but I'm still getting the black screens. bin % /usr/local/bin/python3.8 -c "import sys;print(sys.version)" 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) [Clang 6.0 (clang-600.0.57)] bin % /usr/local/bin/python3.8 -m idlelib bin % cd mv .idlerc old_idlerc /usr/local/bin/python3.8 -m idlelib So weird. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:05:45 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 17:05:45 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583341545.63.0.583948511246.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: which -a python python3 /usr/bin/python /usr/local/bin/python3 /usr/bin/python3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:06:39 2020 From: report at bugs.python.org (paul j3) Date: Wed, 04 Mar 2020 17:06:39 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash In-Reply-To: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> Message-ID: <1583341599.55.0.755706724382.issue39845@roundup.psfhosted.org> paul j3 added the comment: Could you show the sys.argv (for both the linux and windows cases)? print(args) (without your correction) might also help, just to see the 'raw' Namespace. (I'd have to restart my computer to explore the Windows behavior myself). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:44:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 17:44:56 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583343896.12.0.230581986951.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 00c77ae55a82548a6b45af73cdf712ea34910645 by Victor Stinner in branch 'master': bpo-39763: Refactor setup.py (GH-18778) https://github.com/python/cpython/commit/00c77ae55a82548a6b45af73cdf712ea34910645 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:45:59 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Mar 2020 17:45:59 +0000 Subject: [issue39530] Documentation about comparisons between numeric types is misleading In-Reply-To: <1580653054.78.0.127921454413.issue39530@roundup.psfhosted.org> Message-ID: <1583343959.52.0.142933007071.issue39530@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:46:23 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Mar 2020 17:46:23 +0000 Subject: [issue39530] Documentation about comparisons between numeric types is misleading In-Reply-To: <1580653054.78.0.127921454413.issue39530@roundup.psfhosted.org> Message-ID: <1583343983.01.0.0950166878354.issue39530@roundup.psfhosted.org> Mark Dickinson added the comment: Thank you for reviewing! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:49:45 2020 From: report at bugs.python.org (Enji Cooper) Date: Wed, 04 Mar 2020 17:49:45 +0000 Subject: [issue39762] PyLong_AS_LONG missing from longobject.h In-Reply-To: <1582741168.61.0.124981854369.issue39762@roundup.psfhosted.org> Message-ID: <1583344185.52.0.235410041667.issue39762@roundup.psfhosted.org> Enji Cooper added the comment: > The reason why there was the PyInt_AS_LONG macro is that it is very simple and efficient. It never fails, because the value of the int object always fits in the C long. PyInt_AsLong is much slower. If you know that the object is int, you can use PyInt_AS_LONG for performance and simplicity. Another note: this assertion holds generally true with contemporary hardware architectures (sizeof(long long) != sizeof(int)), but there are still 32-bit hardware/software architectures (ex: non-ARM64 capable ARM arches, i386, powerpc 32-bit, etc) that violate this constraint. 32-bit architectures are at risk of overflow with 32-bit values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:50:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 17:50:25 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1583344225.69.0.973855799942.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 942f7a2dea2e95a0fa848329565c0d0288d92e47 by Victor Stinner in branch 'master': bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" (GH-18767) https://github.com/python/cpython/commit/942f7a2dea2e95a0fa848329565c0d0288d92e47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 12:50:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 17:50:25 +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: <1583344225.62.0.217232457437.issue37330@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 942f7a2dea2e95a0fa848329565c0d0288d92e47 by Victor Stinner in branch 'master': bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" (GH-18767) https://github.com/python/cpython/commit/942f7a2dea2e95a0fa848329565c0d0288d92e47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:03:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 18:03:06 +0000 Subject: [issue39851] tarfile: Exception ignored in (... stdout ...) BrokenPipeError Message-ID: <1583344986.43.0.320216561528.issue39851@roundup.psfhosted.org> New submission from STINNER Victor : When a stdout pipe is closed on the consumer side, Python logs an exception at exit: $ ./python -m tarfile -l archive.tar|true Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> BrokenPipeError: [Errno 32] Broken pipe I tried to flush explicitly stdout at exit: it allows to catch BrokenPipeError... but Python still logs the exception, since it triggered by the TextIOWrapper finalizer which tries to flush the file again. See also bpo-39828: "json.tool should catch BrokenPipeError". ---------- components: Library (Lib) messages: 363368 nosy: corona10, vstinner priority: normal severity: normal status: open title: tarfile: Exception ignored in (... stdout ...) BrokenPipeError versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:03:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 18:03:21 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583345001.11.0.192379443547.issue39828@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-39851: "tarfile: Exception ignored in (... stdout ...) BrokenPipeError" which is a different but similar issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:08:02 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Mar 2020 18:08:02 +0000 Subject: [issue39851] tarfile: Exception ignored in (... stdout ...) BrokenPipeError In-Reply-To: <1583344986.43.0.320216561528.issue39851@roundup.psfhosted.org> Message-ID: <1583345282.9.0.0550410104199.issue39851@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:12:17 2020 From: report at bugs.python.org (Dave Liptack) Date: Wed, 04 Mar 2020 18:12:17 +0000 Subject: [issue39852] IDLE: Copy/Paste behaves like Cut/Paste Message-ID: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> New submission from Dave Liptack : Python 3.8.1 IDLE 3.8.1 When COPYing text in IDLE, right-click and PASTE behaves like CUT/PASTE This also occurs with COPY -> Go to Line -> PASTE This does not occur with COPY -> left-click -> PASTE ---------- assignee: terry.reedy components: IDLE messages: 363370 nosy: Dave Liptack, terry.reedy priority: normal severity: normal status: open title: IDLE: Copy/Paste behaves like Cut/Paste type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:18:50 2020 From: report at bugs.python.org (Till Korten) Date: Wed, 04 Mar 2020 18:18:50 +0000 Subject: [issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar In-Reply-To: <1583161890.16.0.234726594776.issue39827@roundup.psfhosted.org> Message-ID: <1583345930.38.0.475106859206.issue39827@roundup.psfhosted.org> Till Korten added the comment: I just found the following code in lines 314-320 of [tkinter/ttk.py](https://github.com/python/cpython/blob/master/Lib/tkinter/ttk.py), which are clearly not localization-aware: ``` def _to_number(x): if isinstance(x, str): if '.' in x: x = float(x) else: x = int(x) return x ``` I'll keep looking for similar stuff and add a pull request once I think I have nailed down the issue I'll look for something similar in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:25:34 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Mar 2020 18:25:34 +0000 Subject: [issue35632] support unparse for Suite ast In-Reply-To: <1546365770.39.0.971588675244.issue35632@roundup.psfhosted.org> Message-ID: <1583346334.16.0.789037180906.issue35632@roundup.psfhosted.org> Batuhan Taskaya added the comment: I just removed Suite node in GH-18513, so I guess this can be closed. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:30:24 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Mar 2020 18:30:24 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583346624.66.0.578213061412.issue39844@roundup.psfhosted.org> Ned Deily added the comment: Hmm, intersting! I have seen problems with black screens before when using some newer versions of Tk which is the main reason we are using Tk 8.6.8 on macOS. Let's try getting some more info: /usr/local/bin/python3.8 -m test.pythoninfo Also, which macOS Appearance are you using (? -> System Preferences -> General)? If Dark or Auto, does switching to Light and restarting IDLE make a difference? Any other unusual screen settings or third-party extensions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:38:23 2020 From: report at bugs.python.org (Anne Archibald) Date: Wed, 04 Mar 2020 18:38:23 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads Message-ID: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> New submission from Anne Archibald : This was discovered in the astropy test suite, where ThreadPoolExecutor is used to concurrently launch a lot of urllib.request.urlopen. This occurs when the URLs are local files; I'm not sure about other URL schemes. The problem appears to occur in python 3.7 but not python 3.8 or python 3.6 (on a different machine). $ python urllib_segfault.py Linux-5.3.0-29-generic-x86_64-with-Ubuntu-19.10-eoan Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0] Segmentation fault (core dumped) $ python3.8 urllib_segfault.py Linux-5.3.0-29-generic-x86_64-with-glibc2.29 Python 3.8.0 (default, Oct 28 2019, 16:14:01) [GCC 9.2.1 20191008] $ python3 urllib_segfault.py Linux-4.15.0-88-generic-x86_64-with-Ubuntu-18.04-bionic Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] $ The Astropy bug report: https://github.com/astropy/astropy/issues/10008 ---------- components: Library (Lib) files: urllib_segfault.py messages: 363374 nosy: Anne Archibald priority: normal severity: normal status: open title: Segmentation fault with urllib.request.urlopen and threads type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48950/urllib_segfault.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:41:51 2020 From: report at bugs.python.org (Aaron Meurer) Date: Wed, 04 Mar 2020 18:41:51 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset Message-ID: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> New submission from Aaron Meurer : This is tested in CPython master. The issue also occurs in older versions of Python. >>> ast.dump(ast.parse('f"{x}"')) "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=-1, format_spec=None)]))], type_ignores=[])" >>> ast.dump(ast.parse('f"{x!r}"')) "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114, format_spec=None)]))], type_ignores=[])" >>> ast.parse('f"{x}"').body[0].value.values[0].value.col_offset 3 >>> ast.parse('f"{x!r}"').body[0].value.values[0].value.col_offset 1 The col_offset for the variable x should be 3 in both instances. ---------- messages: 363375 nosy: asmeurer priority: normal severity: normal status: open title: f-strings with format specifiers have wrong col_offset versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:44:08 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Mar 2020 18:44:08 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset In-Reply-To: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> Message-ID: <1583347448.02.0.094502874427.issue39854@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 13:53:38 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Mar 2020 18:53:38 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583348018.76.0.0445522918418.issue39842@roundup.psfhosted.org> Eric V. Smith added the comment: Do you have some concrete use case for this, or is this a speculative feature request? This will do what you want, although it uses some undocumented internals of the _string module. I've only tested it a little, and I've done especially little testing for the error conditions: from _string import formatter_parser, formatter_field_name_split def partial_format(spec, *args, **kwargs): idx = 0 auto_number = False manual_number = False result = [] for literal_text, field_name, format_spec, conversion in formatter_parser(spec): result.append(literal_text) found = False if field_name is None: # We're at the end of the input. break if not field_name: # Auto-numbering fields. if manual_number: raise ValueError( "cannot switch from manual field specification to automatic field numbering" ) auto_number = True try: value = args[idx] idx += 1 found = True except IndexError: pass elif isinstance(field_name, int): # Numbered fields. if auto_number: raise ValueError( "cannot switch from automatic field number to manual field specification" ) manual_number = True try: value = args[field_name] found = True except IndexError: pass else: # Named fields. try: value = kwargs[field_name] found = True except KeyError: pass spec = f":{format_spec}" if format_spec else "" conv = f"!{conversion}" if conversion else "" if found: s = f"{{{conv}{spec}}}" result.append(s.format(value)) else: result.append(f"{{{field_name}{conv}{spec}}}") return "".join(result) ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:00:03 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 19:00:03 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583348403.45.0.642426394751.issue39842@roundup.psfhosted.org> Marco Sulla added the comment: > Do you have some concrete use case for this? Yes, for EWA: https://marco-sulla.github.io/ewa/ Since it's a code generator, it uses templates a lot, and much times I feel the need for a partial substitution. In the end I solved with some ugly tricks. Furthermore, if the method exists in the stdlib for `string.Template`, I suppose it was created because it was of some utility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:02:47 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Mar 2020 19:02:47 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583348567.71.0.841606053558.issue39842@roundup.psfhosted.org> Eric V. Smith added the comment: I suggest using the version I posted here and see if it meets your needs. It uses the str.format parser to break the string into pieces, so it should be accurate as far as that goes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:10:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Mar 2020 19:10:16 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583349016.87.0.500957340787.issue39842@roundup.psfhosted.org> Serhiy Storchaka added the comment: What would "{} {}".partial_format({}) return? It is not possible to implement a "safe" variant of str.format(), because in difference to Template it can call arbitrary code and allows easily to produce arbitrary large strings. Template is more appropriate if the template came from untrusted source or if it is composed by inexperienced user. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:21:51 2020 From: report at bugs.python.org (Matej Cepl) Date: Wed, 04 Mar 2020 19:21:51 +0000 Subject: [issue39855] test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment Message-ID: <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org> New submission from Matej Cepl : When testing Python from Python-3.9.0a3.tar.xz two test cases file in the limited build environment for openSUSE. We have very limited number of users there: stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 # cat /etc/passwd root:x:0:0:root:/root:/bin/bash abuild:x:399:399:Autobuild:/home/abuild:/bin/bash stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 # So, tests which expect existence of the user 'nobody' fail: [ 747s] ====================================================================== [ 747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=False) [ 747s] ---------------------------------------------------------------------- [ 747s] Traceback (most recent call last): [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user [ 747s] output = subprocess.check_output( [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output [ 747s] return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run [ 747s] with Popen(*popenargs, **kwargs) as process: [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__ [ 747s] uid = pwd.getpwnam(user).pw_uid [ 747s] KeyError: "getpwnam(): name not found: 'nobody'" [ 747s] [ 747s] ====================================================================== [ 747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=True) [ 747s] ---------------------------------------------------------------------- [ 747s] Traceback (most recent call last): [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user [ 747s] output = subprocess.check_output( [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output [ 747s] return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run [ 747s] with Popen(*popenargs, **kwargs) as process: [ 747s] File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__ [ 747s] uid = pwd.getpwnam(user).pw_uid [ 747s] KeyError: "getpwnam(): name not found: 'nobody'" [ 747s] [ 747s] ---------------------------------------------------------------------- [ 747s] I am not sure what is the proper solution here. Whether test should be skipped if nobody doesn?t exist, or the test should switch to user 0, or the current user? ---------- components: Tests messages: 363380 nosy: mcepl, vstinner priority: normal severity: normal status: open title: test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:25:30 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Mar 2020 19:25:30 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset In-Reply-To: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> Message-ID: <1583349930.56.0.258449779232.issue39854@roundup.psfhosted.org> Batuhan Taskaya added the comment: This looks like a duplicate of issue 35212 ---------- nosy: +BTaskaya, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:28:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Mar 2020 19:28:51 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583350131.19.0.595179083038.issue39837@roundup.psfhosted.org> Brett Cannon added the comment: Yes, I can do it. And to answer Victor's question on the PR that he closed, we can make any individual status check required. So probably: - Docs - Ubuntu - Windows x86 - Windows x64 Just let me know when we are ready to merge a PR and I will switch off Azure Pipelines and make these checks required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:30:06 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Mar 2020 19:30:06 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583350206.04.0.228082923395.issue39682@roundup.psfhosted.org> Brett Cannon added the comment: @Antoine I just quite follow what you mean. Are you saying ditch _closed and just leave the context manager to be a no-op? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:45:25 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Mar 2020 19:45:25 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583351125.5.0.724276706617.issue39520@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:48:30 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 04 Mar 2020 19:48:30 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583351310.18.0.206314405543.issue39837@roundup.psfhosted.org> Steve Dower added the comment: There's no PR required. We need to change the required check so when I disable new builds from running it won't break existing PRs. As for actually changing the files in the repo, I don't see any hurry there. We can clean up a few of them, and maybe I can move the release build scripts into the PC folder (though would have to backport that through to 3.7). But I'm ready to disable the builds from running as soon as they're not a required check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:52:23 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 19:52:23 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1583351543.06.0.313026595265.issue19610@roundup.psfhosted.org> Marco Sulla added the comment: This is IMHO broken. 1. _ensure_list() allows strings, because, documentation says, they are split in finalize_options(). But finalize_options() does only split keywords and platforms. It does _not_ split classifiers. 2. there's no need that keywords, platforms and classifiers must be a list. keywords and platforms can be any iterable, and classifiers can be any non text-like iterable. Indeed, keywords are written to file using ','.join(), and platforms and classifiers are written using DistributionMetadata._write_list(). They both accepts any iterable, so I do not understand why such a strict requirement. ---------- nosy: +Marco Sulla _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:54:42 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 19:54:42 +0000 Subject: [issue39848] Warning: 'classifiers' should be a list, got type 'tuple' In-Reply-To: <1583333790.29.0.541399000683.issue39848@roundup.psfhosted.org> Message-ID: <1583351682.77.0.0110631482953.issue39848@roundup.psfhosted.org> Change by Marco Sulla : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 14:58:04 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Mar 2020 19:58:04 +0000 Subject: [issue39760] ast.FormattedValue.format_spec unnecessarily wrapped in JoinedStr In-Reply-To: <1582720982.96.0.367799860574.issue39760@roundup.psfhosted.org> Message-ID: <1583351884.18.0.755871303005.issue39760@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 15:36:21 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 20:36:21 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583354181.7.0.843827024871.issue39844@roundup.psfhosted.org> Terry J. Reedy added the comment: This is almost certainly a tcl/tk/tkinter on Catalina issue, not an IDLE issue. Screenshots are missing headlight colors, and that should be impossible to cause from Python. In standard python, try >>> import tkinter as tk >>> r = tk.Tk() Should see small (about 2"x2") box. If not, add >>> r.mainloop() And/or, try $ python3 -m turtledemo ---------- assignee: terry.reedy -> components: +Tkinter -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 15:40:19 2020 From: report at bugs.python.org (Luca) Date: Wed, 04 Mar 2020 20:40:19 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583354419.87.0.491797484066.issue39809@roundup.psfhosted.org> Luca added the comment: I opened two issues regarding the mypy error, I understand it is going to be fixed in typeshed: https://github.com/python/mypy/issues/8487 https://github.com/python/typeshed/issues/3806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 15:43:09 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 20:43:09 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583354589.01.0.620132346659.issue39842@roundup.psfhosted.org> Marco Sulla added the comment: > What would "{} {}".partial_format({}) return? `str.partial_format()` was proposed exactly to avoid such tricks. > It is not possible to implement a "safe" variant of str.format(), > because in difference to Template it can call arbitrary code If you read the documentation of `Template.safe_substitute()`, you can read also this function is not safe at all. But Python, for example, does not implement private class attributes. Because Python is for adult and consciousness people, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 15:44:56 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 04 Mar 2020 20:44:56 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583354696.24.0.791424983659.issue39842@roundup.psfhosted.org> Marco Sulla added the comment: @Eric V. Smith: that you for your effort, but I'll never use an API marked as private, that is furthermore undocumented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 16:23:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 21:23:10 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583356990.79.0.707938979464.issue39844@roundup.psfhosted.org> Terry J. Reedy added the comment: I just upgraded to 10.14.6 and 3.8.2 and python/IDLE is normal. (I have so far closed the every login 'upgrade to Catalina' box because of reports like this.) Ned, is current 8.6.10 any better than 8.6.9? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 16:25:26 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Mar 2020 21:25:26 +0000 Subject: [issue39842] partial_format() In-Reply-To: <1583279879.75.0.642484587376.issue39842@roundup.psfhosted.org> Message-ID: <1583357126.12.0.652306316561.issue39842@roundup.psfhosted.org> Eric V. Smith added the comment: Well, I'm the one who made them private, I can make them public if they're useful. But I won't do that if you're not willing to look at it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 16:37:40 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 04 Mar 2020 21:37:40 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583357860.98.0.409124459745.issue39844@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 16:39:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Mar 2020 21:39:27 +0000 Subject: [issue39852] IDLE: Copy/Paste behaves like Cut/Paste In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583357967.71.0.438590931943.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: The standard and expected behavior is that pasting *without* a selection inserts, pasting *with* a selection replaces. Pasting with key, Edit menu, or context menu should be the same. This is what I see and what I *think* you are describing. If so, please close. If not, please specify OS and version, how you installed Python, and more concretely what you did and whether line numbers or code context were present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 16:42:03 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 04 Mar 2020 21:42:03 +0000 Subject: [issue39851] tarfile: Exception ignored in (... stdout ...) BrokenPipeError In-Reply-To: <1583344986.43.0.320216561528.issue39851@roundup.psfhosted.org> Message-ID: <1583358123.56.0.709806140817.issue39851@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:03:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 22:03:55 +0000 Subject: [issue39855] test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment In-Reply-To: <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org> Message-ID: <1583359435.89.0.683849760148.issue39855@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18139 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:11:56 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 04 Mar 2020 22:11:56 +0000 Subject: [issue5319] stdout error at interpreter shutdown fails to return OS error status In-Reply-To: <1235065081.04.0.732738239861.issue5319@psf.upfronthosting.co.za> Message-ID: <1583359916.28.0.654117300244.issue5319@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 10.0 -> 11.0 pull_requests: +18140 pull_request: https://github.com/python/cpython/pull/18779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:12:57 2020 From: report at bugs.python.org (Jan Christoph) Date: Wed, 04 Mar 2020 22:12:57 +0000 Subject: [issue27793] Double underscore variables in module are mangled when used in class In-Reply-To: <1471523246.01.0.475585276103.issue27793@psf.upfronthosting.co.za> Message-ID: <1583359977.61.0.378639876187.issue27793@roundup.psfhosted.org> Jan Christoph added the comment: I would argue to reopen this. Seeing I and other people run into that issue (e.g. https://stackoverflow.com/q/40883083/789308) quiet frequently. Especially since it breaks the `global` keyword, e.g.: __superprivate = "mahog" class AClass(object): def __init__(self, value): global __superprivate __superprivate = value @staticmethod def get_sp(): return __superprivate if __name__ == "__main__": print(__superprivate) # mahog try: print(AClass.get_sp()) except NameError as e: print(e) # NameError: name '_AClass__superprivate' is not defined' cl = AClass("bla") print(cl.get_sp()) # bla __superprivate = 1 print(cl.get_sp()) # bla print(AClass.get_sp()) # bla ---------- nosy: +con-f-use _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:15:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 22:15:45 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583360145.18.0.286774132584.issue39837@roundup.psfhosted.org> STINNER Victor added the comment: > And to answer Victor's question on the PR that he closed, we can make any individual status check required. Great! I saw a macOS failure this week which was caused by an internal CI error. I hope that it will be fixed soon. In the meanwhile, I would suggest to not make the macOS job mandatory, but pay attention manually to its status ;-) Apart of macOS, other jobs look reliable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:16:00 2020 From: report at bugs.python.org (Jan Christoph) Date: Wed, 04 Mar 2020 22:16:00 +0000 Subject: [issue27793] Double underscore variables in module are mangled when used in class In-Reply-To: <1471523246.01.0.475585276103.issue27793@psf.upfronthosting.co.za> Message-ID: <1583360160.3.0.870605663175.issue27793@roundup.psfhosted.org> Jan Christoph added the comment: Just because it is documented, doesn't mean it's not a bug or illogical and unexpected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:23:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Mar 2020 22:23:11 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1583360591.91.0.406998965005.issue32592@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:27:00 2020 From: report at bugs.python.org (Je GeVa) Date: Wed, 04 Mar 2020 22:27:00 +0000 Subject: [issue39856] glob : some 'unix style' glob items are not supported Message-ID: <1583360820.43.0.706736327816.issue39856@roundup.psfhosted.org> New submission from Je GeVa : some common Unix style pathname pattern expansions are not supported : ~/ for $HOME ~user/ for $HOME of user {1,abc,999} for enumeration ex: lets say $ls ~ hello1.a hello2.a helli3.c then : $echo ~/hell*{1,3}.* hello1.a helli3.c while >> glob.glob("~/hel*") [] >> glob.glob("/home/jegeva/hel*") ['hello1.a','hello2.a','helli3.c >> glob.glob("/home/jegeva/hell*{1,3}.*") [] ---------- components: Library (Lib) messages: 363396 nosy: Je GeVa priority: normal severity: normal status: open title: glob : some 'unix style' glob items are not supported versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:31:46 2020 From: report at bugs.python.org (Jack O'Connor) Date: Wed, 04 Mar 2020 22:31:46 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1583361106.26.0.493402190567.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: I've just published some Python bindings for the Rust implementation on PyPI: https://pypi.org/project/blake3 > I'm guessing Python is gonna hold off until BLAKE3 reaches 1.0. That's very fair. The spec and test vectors are set in stone at this point, but the implementations are new, and I don't see any reason to rush things out. (Especially since early adopters can now use the library above.) That said, there aren't really any expected implementation changes that would be a natural moment for the implementations to tag 1.0. I'll probably end up tagging 1.0 as soon as a caller appears who needs it to be tagged to meet their own stability requirements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:42:40 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 22:42:40 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583361760.98.0.418776468873.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: I've attached the output of the test.pythoninfo as requested. I am in Dark mode all the time. I did try Light mode first thing as sometimes apps aren't updated to work in Dark mode but the same exact issue happened. --- bin % /usr/local/bin/python3 Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter as tk >>> r = tk.Tk() >>> ^D ---------- Added file: https://bugs.python.org/file48951/test.pythoninfo.output.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:42:56 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Wed, 04 Mar 2020 22:42:56 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583361776.7.0.234194686193.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: tk window showing black ---------- Added file: https://bugs.python.org/file48952/Screen Shot 2020-03-04 at 2.42.10 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:51:57 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Mar 2020 22:51:57 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583362317.86.0.411303869001.issue39808@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 67152d0ed670227b61b5df683655b196ab04ca1a by Brett Cannon in branch 'master': bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719) https://github.com/python/cpython/commit/67152d0ed670227b61b5df683655b196ab04ca1a ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:52:29 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Mar 2020 22:52:29 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583362349.34.0.0452271780195.issue39808@roundup.psfhosted.org> Brett Cannon added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:52:54 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Mar 2020 22:52:54 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583362374.59.0.32489840774.issue39808@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18141 pull_request: https://github.com/python/cpython/pull/18782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:53:02 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Mar 2020 22:53:02 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583362382.25.0.506166357455.issue39808@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18142 pull_request: https://github.com/python/cpython/pull/18783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 17:57:53 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 04 Mar 2020 22:57:53 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583362673.32.0.468896555576.issue13487@roundup.psfhosted.org> Gregory P. Smith added the comment: fyi - we just had a test run into this (in a flaky manner - definitely a race condition) at work: ``` ... for f in inspect.stack(context=0) File "/inspect.py", line 1499, in stack return getouterframes(sys._getframe(1), context) File "/inspect.py", line 1476, in getouterframes frameinfo = (frame,) + getframeinfo(frame, context) File "/inspect.py", line 1446, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/inspect.py", line 696, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/inspect.py", line 732, in getmodule for modname, module in list(sys.modules.items()): RuntimeError: dictionary changed size during iteration ``` We haven't diagnosed what was leading to it though. Trust in the ability to use inspect.stack() -> ... -> inspect.getmodule() in multithreaded code is on the way out as a workaround. (this was on 3.6.7) A workaround we could checkin without consequences should be to change list(sys.modules.items()) into list(sys.modules.copy().items()). I was a bit surprised to see this happen at all, list(dict.items()) seems like it should've been done entirely in C with the GIL held the entire time. but maybe I'm just missing where the GIL would be released in the calls to exhause the iterator made by https://github.com/python/cpython/blob/master/Objects/listobject.c ? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 18:00:59 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 04 Mar 2020 23:00:59 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583362859.53.0.304421114261.issue13487@roundup.psfhosted.org> Gregory P. Smith added the comment: Serhiy: Why is dict.copy() not thread safe? if what you say of list(dict) being safe, iterating over that and looking up the keys would work. But all of this is entirely non-obvious to the reader of the code. all of these _look_ like they should be safe. We should make dict.copy() safe and document the guarantee as such as that one could at least be explained when used for that purpose. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 18:06:47 2020 From: report at bugs.python.org (Ryan Ware) Date: Wed, 04 Mar 2020 23:06:47 +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: <1583363207.51.0.831428765069.issue39503@roundup.psfhosted.org> Change by Ryan Ware : ---------- nosy: +ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 18:17:46 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Mar 2020 23:17:46 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583363866.41.0.974260751915.issue39808@roundup.psfhosted.org> miss-islington added the comment: New changeset 6bb67452d4f21e2d948dafce7644b1d66e5efcb8 by Miss Islington (bot) in branch '3.7': [3.7] bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719) (GH-18782) https://github.com/python/cpython/commit/6bb67452d4f21e2d948dafce7644b1d66e5efcb8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 18:56:31 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Mar 2020 23:56:31 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583366191.63.0.272736729586.issue39837@roundup.psfhosted.org> Brett Cannon added the comment: Actually, I just realized we can't make these status checks required because they don't always run. :) Our Actions are smart enough to not run when they aren't necessary, i.e. doc changes don't run the rest of the checks. And so making the OS-specific tests required would block doc tests. Basically we would either have to waste runs on things that aren't really necessary but then be able to require runs, or we have to just rely on people paying attention to failures. I'm personally for the latter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:13:42 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 05 Mar 2020 00:13:42 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583367222.27.0.677362736654.issue13487@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +18143 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/18786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:42:46 2020 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 05 Mar 2020 00:42:46 +0000 Subject: [issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id In-Reply-To: <1582817113.42.0.194070983198.issue39776@roundup.psfhosted.org> Message-ID: <1583368966.11.0.255772825233.issue39776@roundup.psfhosted.org> Yury Selivanov added the comment: Thank you so much, Stefan, for looking into this. Really appreciate the help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:45:36 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 05 Mar 2020 00:45:36 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583369136.41.0.620612844982.issue13487@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 85cf1d514b84dc9a4bcb40e20a12e1d82ff19f20 by Gregory P. Smith in branch 'master': bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) https://github.com/python/cpython/commit/85cf1d514b84dc9a4bcb40e20a12e1d82ff19f20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:45:39 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Mar 2020 00:45:39 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583369139.87.0.12383753941.issue13487@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18145 pull_request: https://github.com/python/cpython/pull/18788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:45:33 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Mar 2020 00:45:33 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583369133.74.0.588771277659.issue13487@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +18144 pull_request: https://github.com/python/cpython/pull/18787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 19:50:55 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 05 Mar 2020 00:50:55 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583369455.73.0.882095579906.issue13487@roundup.psfhosted.org> Gregory P. Smith added the comment: Testing by changing list(sys.modules.items()) to sys.modules.copy().items() internally with a large integration test that was reliably flaky on this line before shows that the .copy().items() worked. The test is reliable again. So I've gone ahead and pushed those changes in. PyDict_Copy()'s implementation at first ~5 minute glance did not appear to have calls to code I'd expect to re-enter Python releasing the GIL. But I didn't try to do a deep dive. It works for us and is logically equivalent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 20:03:35 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Mar 2020 01:03:35 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583370215.87.0.168514806503.issue13487@roundup.psfhosted.org> miss-islington added the comment: New changeset a12381233a243ba7d5151ebf060feb57dd540bef by Miss Islington (bot) in branch '3.7': bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) https://github.com/python/cpython/commit/a12381233a243ba7d5151ebf060feb57dd540bef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 20:04:42 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Mar 2020 01:04:42 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583370282.02.0.216168802694.issue13487@roundup.psfhosted.org> miss-islington added the comment: New changeset 6b452ff97f70eca79ab956987cc04b6586feca00 by Miss Islington (bot) in branch '3.8': bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) https://github.com/python/cpython/commit/6b452ff97f70eca79ab956987cc04b6586feca00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 20:07:10 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 05 Mar 2020 01:07:10 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583370430.97.0.917080097192.issue13487@roundup.psfhosted.org> Gregory P. Smith added the comment: If anyone else has a way to reproduce this issue, please run your tests with a 3.7/3.8/3.9 interpreter with the fix I committed applied and report back if you still see this failure on that line. I believe this to be fixed based on my own testing so I am closing it out. ---------- assignee: eric.araujo -> gregory.p.smith resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 21:01:55 2020 From: report at bugs.python.org (Mike Frysinger) Date: Thu, 05 Mar 2020 02:01:55 +0000 Subject: [issue3548] subprocess.pipe function In-Reply-To: <1218561839.36.0.810217326739.issue3548@psf.upfronthosting.co.za> Message-ID: <1583373715.54.0.662964445371.issue3548@roundup.psfhosted.org> Mike Frysinger added the comment: this would have been nice to have more than once in my personal projects, and in build/infra tooling for Chromium OS. our alternatives so far have been the obvious ones: use subprocess.run to capture & return the output, then manually feed that as the input to the next command, and so on. we know it has obvious overhead so we've avoided with large output. we strongly discourage/ban attempts to write shell code, so the vast majority of our commands are argv style (list of strings), so the pipes module wouldn't help us. handling of SIGPIPE tends to be where things get tricky. that'll have to be handled by the API explicitly i think. ---------- nosy: +vapier _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 21:10:18 2020 From: report at bugs.python.org (Mike Frysinger) Date: Thu, 05 Mar 2020 02:10:18 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg Message-ID: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> New submission from Mike Frysinger : a common idiom i run into is wanting to add/set one or two env vars when running a command via subprocess. the only thing the API allows currently is inherting the current environment, or specifying the complete environment. this means a lot of copying & pasting of the pattern: env = os.environ.copy() env['FOO'] = ... env['BAR'] = ... subprocess.run(..., env=env, ...) it would nice if we could simply express this incremental behavior: subprocess.run(..., extra_env={'FOO': ..., 'BAR': ...}, ...) then the subprocess API would take care of copying & merging. if extra_env: assert env is None env = os.environ.copy() env.update(extra_env) this is akin to subprocess.run's capture_output shortcut. it's unclear to me whether this would be in both subprocess.Popen & subprocess.run, or only subprocess.run. it seems like subprocess.Popen elides convenience APIs. ---------- components: Library (Lib) messages: 363413 nosy: vapier priority: normal severity: normal status: open title: subprocess.run: add an extra_env kwarg to complement existing env kwarg type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 21:48:05 2020 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 05 Mar 2020 02:48:05 +0000 Subject: [issue39762] PyLong_AS_LONG missing from longobject.h In-Reply-To: <1582741168.61.0.124981854369.issue39762@roundup.psfhosted.org> Message-ID: <1583376485.41.0.183284435668.issue39762@roundup.psfhosted.org> Petr Viktorin added the comment: No, in Python 2 the PyInt object (`int` in Python 2) always did fit into a C long -- that was the underlying storage. If it didn't fit, a PyLong object (`long` in Python 2) was used. Python 3 doesn't have PyInt, it only has PyLong (`int` in Python 3). ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 22:39:26 2020 From: report at bugs.python.org (Jacin Ferreira) Date: Thu, 05 Mar 2020 03:39:26 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583379566.77.0.256950860791.issue39844@roundup.psfhosted.org> Jacin Ferreira added the comment: Screenshot showing results of turtle demo ---------- Added file: https://bugs.python.org/file48953/Screen Shot 2020-03-04 at 7.39.02 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 4 22:58:45 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 05 Mar 2020 03:58:45 +0000 Subject: [issue39856] glob : some 'unix style' glob items are not supported In-Reply-To: <1583360820.43.0.706736327816.issue39856@roundup.psfhosted.org> Message-ID: <1583380725.56.0.158676351374.issue39856@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be similar to issue9584. Below are the results in my zsh and bash in Mac. bash bash-3.2$ cd /tmp/ bash-3.2$ ls *py hello_1.py hello_2.py hello_3.py bash-3.2$ ls hell*{1-2}.* ls: hell*{1-2}.*: No such file or directory bash-3.2$ ls hell*[1-2].* hello_1.py hello_2.py zsh ? /tmp ls *py hello_1.py hello_2.py hello_3.py ? /tmp ls hell*{1-2}.* zsh: no matches found: hell*{1-2}.* ? /tmp ls hell*[1-2].* hello_1.py hello_2.py Try using [] >>> import glob >>> glob.glob("hell*[1-2].*") ['hello_2.py', 'hello_1.py'] ---------- nosy: +serhiy.storchaka, xtreak type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 00:22:36 2020 From: report at bugs.python.org (Sam Price) Date: Thu, 05 Mar 2020 05:22:36 +0000 Subject: [issue39858] bitfield layout wrong in ctypes Message-ID: <1583385756.4.0.955468761993.issue39858@roundup.psfhosted.org> New submission from Sam Price : if 8 1 byte fields are included in a ctype field, it allows an extra byte to be included in the packing when there is no room left for the next field. If I put the bitfields in a child structure then I get expected results. In [35]: run ctypeSizeTest.py Size is 4 Expected 3 0 0x10000 a0 0 0x10001 a1 0 0x10002 a2 0 0x10003 a3 0 0x10004 a4 0 0x10005 a5 0 0x10006 a6 0 0x10007 a7 0 0x40008 b0 <- Expected to be at offset 1, not 0. 2 0xc0000 b1 <- Expected to be at offset 1, not 2 Size is 3 Expected 3 0 0x1 a 1 0x40000 b0 1 0xc0004 b1 ---------- components: ctypes files: ctypeSizeTest.py messages: 363417 nosy: thesamprice priority: normal severity: normal status: open title: bitfield layout wrong in ctypes type: behavior versions: Python 2.7, Python 3.5, Python 3.6 Added file: https://bugs.python.org/file48954/ctypeSizeTest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 00:28:43 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 05 Mar 2020 05:28:43 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583386123.5.0.412072753936.issue39573@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18146 pull_request: https://github.com/python/cpython/pull/18789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 00:49:49 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 05 Mar 2020 05:49:49 +0000 Subject: [issue39859] set_herror should not throw away constness of hstrerror Message-ID: <1583387389.29.0.102450533864.issue39859@roundup.psfhosted.org> New submission from Andy Lester : set_herror builds a string by calling hstrerror but downcasts its return value to char *. It should be const char *. ---------- components: Interpreter Core messages: 363418 nosy: petdance priority: normal severity: normal status: open title: set_herror should not throw away constness of hstrerror _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 00:56:10 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 05 Mar 2020 05:56:10 +0000 Subject: [issue39859] set_herror should not throw away constness of hstrerror In-Reply-To: <1583387389.29.0.102450533864.issue39859@roundup.psfhosted.org> Message-ID: <1583387769.99.0.676473085425.issue39859@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18147 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 01:45:43 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 05 Mar 2020 06:45:43 +0000 Subject: [issue39851] tarfile: Exception ignored in (... stdout ...) BrokenPipeError In-Reply-To: <1583344986.43.0.320216561528.issue39851@roundup.psfhosted.org> Message-ID: <1583390743.07.0.64895265043.issue39851@roundup.psfhosted.org> Dong-hee Na added the comment: I will take look at this issue :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 03:37:43 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Mar 2020 08:37:43 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583397463.42.0.65628896029.issue39844@roundup.psfhosted.org> Terry J. Reedy added the comment: The black one from 2.42 shows that the disfunction in your system is not in tkinter app and is likely upstream from that (the relationship between tk and mac). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 04:07:57 2020 From: report at bugs.python.org (Ben Griffin) Date: Thu, 05 Mar 2020 09:07:57 +0000 Subject: [issue39860] configparser - no support for cascading defaults (as defined by MySQL) Message-ID: <1583399277.82.0.801521222284.issue39860@roundup.psfhosted.org> New submission from Ben Griffin : While there is now support for a single default group, mysql documentation is clear that there is a cascade of groups for option settings, normally starting with [client], and including version numbers.. This allows generic settings to be overridden by specific settings, and it's an important feature when building an architecture around a mysql/mariadb environment. A typical configuration chain may look like this. [client] -> [mysql] -> [mysql-5.6] -> [pymysql] -> [my_custom_app] Currently, the implementation of configparser only allows the programmer to define the default group (typically [client]) and then the group to read from [my_custom_app]. In terms of a proposed approach to the library, I suggest two changes (both backwards compatible). (1) Extend the 'default_section' initializer such that it supports both a string (current implementation) and an iterable (ordered from specialised to general). (2) Likewise extend the 'section' parameter of get() such that it supports both a string (current implementation) and an iterable (ordered from specialised to general), as above. Mysql's own docs are as follows. https://dev.mysql.com/doc/refman/8.0/en/option-files.html#option-file-syntax "List more general option groups first and more specific groups later. For example, a [client] group is more general because it is read by all client programs, whereas a [mysqldump] group is read only by mysqldump. Options specified later override options specified earlier, so putting the option groups in the order [client], [mysqldump] enables mysqldump-specific options to override [client] options." ---------- components: Library (Lib) messages: 363421 nosy: Ben Griffin priority: normal severity: normal status: open title: configparser - no support for cascading defaults (as defined by MySQL) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 04:39:55 2020 From: report at bugs.python.org (Dorian) Date: Thu, 05 Mar 2020 09:39:55 +0000 Subject: [issue39861] French doc __futur__: Bad URL Message-ID: <1583401195.98.0.339356939479.issue39861@roundup.psfhosted.org> New submission from Dorian : Hello, In the French page: https://docs.python.org/fr/3/library/__future__.html There is a bad URL in the table at the end of the page: division/2.2.0a2/3.0/PEP 328 : Changement de l'op?rateur de division It's supposed to be PEP 238, not 328. The URL is https://www.python.org/dev/peps/pep-0328 It's supposed to be https://www.python.org/dev/peps/pep-0238 Should be easy to fix. Keep the good work. Regards, Dorian ---------- assignee: docs at python components: 2to3 (2.x to 3.x conversion tool), Documentation messages: 363422 nosy: Narann, docs at python priority: normal severity: normal status: open title: French doc __futur__: Bad URL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 04:50:14 2020 From: report at bugs.python.org (Ion Cebotari) Date: Thu, 05 Mar 2020 09:50:14 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash In-Reply-To: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> Message-ID: <1583401814.93.0.053077511778.issue39845@roundup.psfhosted.org> Ion Cebotari added the comment: Yes, the problem seems to be with sys.argv.: Windows output: python .\main.py -d Z:\tmp\test\DJI\ 'C:\unu doi\' sys.argv: ['.\\CamCardOrganizer.py', '-d', 'Z:\\tmp\\test\\DJI\\', 'C:\\unu doi"'] args namespace: Namespace(capturedatefmt='%y.%m.%d', capturetimefmt_full='%y.%m.%d_%H-%M-%S', ca pturetimefmt_short='%y.%m.%d_%H', dest_dir='C:\\unu doi"', dry_run=True, output_ file='stdout', processes=2, src_dir='Z:\\tmp\\test\\DJI\\', tl_interval_threshol d=30, tl_numimages_threshold=75, verbose=False, version=None) Linux output: python main.py --verbose ~/tmp/test/DJI/ /tmp/123 sys.argv: ['CamCardOrganizer.py', '--verbose', '/home/ion/tmp/test/DJI/', '/tmp/123'] args namespace: Namespace(capturedatefmt='%y.%m.%d', capturetimefmt_full='%y.%m.%d_%H-%M-%S', capturetimefmt_short='%y.%m.%d_%H', dest_dir='/tmp/123', dry_run=False, output_file='stdout', processes=2, src_dir='/home/ion/tmp/test/DJI/', tl_interval_threshold=30, tl_numimages_threshold=75, verbose=True, version=None) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 05:18:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Mar 2020 10:18:35 +0000 Subject: [issue27743] Python 2 has a wrong artificial limit on the amount of memory that can be allocated in ctypes In-Reply-To: <1470994963.77.0.387843517386.issue27743@psf.upfronthosting.co.za> Message-ID: <1583403515.05.0.00703622680916.issue27743@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was fixed in issue16865. ---------- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 05:26:15 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 05 Mar 2020 10:26:15 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583403975.68.0.741195237592.issue39837@roundup.psfhosted.org> Steve Dower added the comment: Are you sure the required check isn't just for failures? Surely GitHub is smarter than requiring checks that it can tell aren't required (as it's their logic to include/exclude, not ours). If they're not, I now have many internal contacts there, so we can probably get it fixed :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 05:29:41 2020 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 05 Mar 2020 10:29:41 +0000 Subject: =?utf-8?q?=5Bissue39862=5D_Why_are_the_union_relationships_not_implemente?= =?utf-8?b?ZCBieSBkZWZhdWx0IGZvciDiiaQgYW5kIOKJpT8=?= Message-ID: <1583404181.09.0.848601767593.issue39862@roundup.psfhosted.org> New submission from G?ry : Mathematically, the [binary relation](https://en.wikipedia.org/wiki/Binary_relation) ? is the [union](https://en.wikipedia.org/wiki/Binary_relation#Union) of the binary relations < and =, while the binary relation ? is the union of the binary relations > and =. So is there a reason why Python does not implement `__le__` in terms of `__lt__` and `__eq__` by default, and `__ge__` in terms of `__gt__` and `__eq__` by default? The default implementation would be like this (but probably in C for performance, like `__ne__`): ```python def __le__(self, other): result_1 = self.__lt__(other) result_2 = self.__eq__(other) if result_1 is not NotImplemented and result_2 is not NotImplemented: return result_1 or result_2 return NotImplemented def __ge__(self, other): result_1 = self.__gt__(other) result_2 = self.__eq__(other) if result_1 is not NotImplemented and result_2 is not NotImplemented: return result_1 or result_2 return NotImplemented ``` This would save users from implementing these two methods all the time. Here is the relevant paragraph in the [Python documentation](https://docs.python.org/3/reference/datamodel.html#object.__lt__) (emphasis mine): > By default, `__ne__()` delegates to `__eq__()` and inverts the result > unless it is `NotImplemented`. There are no other implied > relationships among the comparison operators, **for example, the truth > of `(x is the complement of ?. These complementary relationships can be easily implemented by users when they are valid with the [`functools.total_ordering`](https://docs.python.org/3/library/functools.html#functools.total_ordering) class decorator provided by the Python standard library. ---------- components: Interpreter Core messages: 363426 nosy: maggyero priority: normal severity: normal status: open title: Why are the union relationships not implemented by default for ? and ?? type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 05:48:00 2020 From: report at bugs.python.org (Roundup Robot) Date: Thu, 05 Mar 2020 10:48:00 +0000 Subject: [issue39860] configparser - no support for cascading defaults (as defined by MySQL) In-Reply-To: <1583399277.82.0.801521222284.issue39860@roundup.psfhosted.org> Message-ID: <1583405280.95.0.898687886411.issue39860@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +18148 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 06:11:19 2020 From: report at bugs.python.org (Ben Griffin) Date: Thu, 05 Mar 2020 11:11:19 +0000 Subject: [issue39860] configparser - no support for cascading defaults (as defined by MySQL) In-Reply-To: <1583399277.82.0.801521222284.issue39860@roundup.psfhosted.org> Message-ID: <1583406679.71.0.555982275048.issue39860@roundup.psfhosted.org> Ben Griffin added the comment: Having looked at the code, I believe that it is best NOT to interfere with the 'default_section' value of the class, as it is used as a proxy to _defaults, whereas the section parameter of get() is easily extended. The actual changes are all to the method _unify_values, and it is trivial to extend that method to allow for multiple dictionaries to be passed to _ChainMap. This is what I did in PR-18791 ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 06:46:29 2020 From: report at bugs.python.org (Martin Ni) Date: Thu, 05 Mar 2020 11:46:29 +0000 Subject: [issue33347] zlibmodule undefined reference In-Reply-To: <1524567960.98.0.682650639539.issue33347@psf.upfronthosting.co.za> Message-ID: <1583408789.55.0.261863485868.issue33347@roundup.psfhosted.org> Martin Ni added the comment: Hello sir! I got exactly same issue when compile some ipk in Openwrt. Would tell how to add "-lz" to python-config? I am not so familiar with Python coding. Thanks! ---------- nosy: +Martin Ni _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 07:37:08 2020 From: report at bugs.python.org (Inada Naoki) Date: Thu, 05 Mar 2020 12:37:08 +0000 Subject: [issue39863] Add trimend option to readline() and readlines() Message-ID: <1583411828.43.0.97175305903.issue39863@roundup.psfhosted.org> New submission from Inada Naoki : str.splitlines() has `keepends` option. Like that, `IOBase.readline([trimend=False])` and `IOBase.readlines([trimends=False])` would be useful. ---------- components: IO messages: 363430 nosy: inada.naoki priority: normal severity: normal status: open title: Add trimend option to readline() and readlines() versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 08:29:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Mar 2020 13:29:02 +0000 Subject: [issue39855] test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment In-Reply-To: <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org> Message-ID: <1583414942.24.0.0985943831035.issue39855@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f7b5d419bf871d9cc898982c7b6b4c043f7d5e9d by Victor Stinner in branch 'master': bpo-39855: Fix test_subprocess if nobody user doesn't exist (GH-18781) https://github.com/python/cpython/commit/f7b5d419bf871d9cc898982c7b6b4c043f7d5e9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 08:30:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Mar 2020 13:30:17 +0000 Subject: [issue39855] test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment In-Reply-To: <1583349711.75.0.193414352095.issue39855@roundup.psfhosted.org> Message-ID: <1583415017.95.0.0124103162848.issue39855@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.8 is not affected. I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 09:46:47 2020 From: report at bugs.python.org (A.M. Kuchling) Date: Thu, 05 Mar 2020 14:46:47 +0000 Subject: [issue8840] truncate() semantics changed in 3.1.2 In-Reply-To: <1275005546.82.0.0795236723796.issue8840@psf.upfronthosting.co.za> Message-ID: <1583419607.47.0.0333715661897.issue8840@roundup.psfhosted.org> Change by A.M. Kuchling : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:06:50 2020 From: report at bugs.python.org (Ningyi Du) Date: Thu, 05 Mar 2020 15:06:50 +0000 Subject: [issue39864] IndexError gives wrong axis info Message-ID: <1583420810.46.0.335329049767.issue39864@roundup.psfhosted.org> New submission from Ningyi Du : IndexError: index 11 is out of bounds for axis 0 with size 11 The actual error is not with axis 0, but axis 3. error message: 168 if iJ>=9: 169 print(iE,iE0,iEtemp,iJ,li,lf,mlf+lf) --> 170 SS[iEtemp][iJ][li][lf][mlf+lf]= FF(jf,mf,lf,mlf,ji,mi,li,J)*SJ[iCh][jCh] 171 172 sumSJ1 += np.abs(SJ0[iCh][jCh])**2 IndexError: index 11 is out of bounds for axis 0 with size 11 ---------- messages: 363433 nosy: ningyidu priority: normal severity: normal status: open title: IndexError gives wrong axis info _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:18:35 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 05 Mar 2020 15:18:35 +0000 Subject: [issue39864] IndexError gives wrong axis info In-Reply-To: <1583420810.46.0.335329049767.issue39864@roundup.psfhosted.org> Message-ID: <1583421515.96.0.414573968193.issue39864@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Please include a sample script to reproduce the program along with a description of why you think it's an error in CPython. This seems to be a custom exception raised by a library. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:19:30 2020 From: report at bugs.python.org (Ningyi Du) Date: Thu, 05 Mar 2020 15:19:30 +0000 Subject: [issue39864] IndexError gives wrong axis info In-Reply-To: <1583420810.46.0.335329049767.issue39864@roundup.psfhosted.org> Message-ID: <1583421570.3.0.829313669448.issue39864@roundup.psfhosted.org> Ningyi Du added the comment: This is a simple test: test=np.zeros((2,3,4)) print(test[1][3][1]) IndexError Traceback (most recent call last) in 1 test=np.zeros((2,3,4)) ----> 2 print(test[1][3][1]) IndexError: index 3 is out of bounds for axis 0 with size 3 ---------- nosy: -xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:41:24 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Mar 2020 15:41:24 +0000 Subject: [issue39864] IndexError gives wrong axis info In-Reply-To: <1583420810.46.0.335329049767.issue39864@roundup.psfhosted.org> Message-ID: <1583422884.09.0.100884761154.issue39864@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a numpy issue, you will need to report it to the numpy developers. But first you need to check that it really is a bug. What makes you think it is a bug? In your example, index 3 looks out of bounds to me. Remember that indexes start at 0, not 1. In any case, this has nothing to do with us, numpy is an independent project, you will need to report it to them. ---------- nosy: +steven.daprano resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:42:26 2020 From: report at bugs.python.org (Peter Otten) Date: Thu, 05 Mar 2020 15:42:26 +0000 Subject: [issue39864] IndexError gives wrong axis info In-Reply-To: <1583420810.46.0.335329049767.issue39864@roundup.psfhosted.org> Message-ID: <1583422946.86.0.274704131552.issue39864@roundup.psfhosted.org> Peter Otten <__peter__ at web.de> added the comment: This is not a bug (and if it were you would have to report to numpy, not cpython). Consider: >>> import numpy >>> a = numpy.zeros((2,2,2)) >>> a[0,2] Traceback (most recent call last): File "", line 1, in IndexError: index 2 is out of bounds for axis 1 with size 2 This is probably the message you expect. However, if you write >>> a[0][2] Traceback (most recent call last): File "", line 1, in IndexError: index 2 is out of bounds for axis 0 with size 2 you split the operation into two steps, and the second axis of a is effectively the first axis of a[0]. ---------- nosy: +peter.otten -steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 10:57:41 2020 From: report at bugs.python.org (Sam Price) Date: Thu, 05 Mar 2020 15:57:41 +0000 Subject: [issue39858] bitfield layout wrong in ctypes In-Reply-To: <1583385756.4.0.955468761993.issue39858@roundup.psfhosted.org> Message-ID: <1583423861.69.0.103989515875.issue39858@roundup.psfhosted.org> Sam Price added the comment: Does not happen on windows. Error is in cfield.c ``` #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ && dict->size * 8 >= *pfield_size && (*pbitofs + bitsize) <= dict->size * 8) { /* expand bit field */ fieldtype = EXPAND_BITFIELD; #endif ``` Specifically dict->size * 8 >= *pfield_size if *bitofs == *pfield_size then the current field is filled, and expanding the bitfield should not be done. Consider adding this *pfield_size != *bitofs #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ && *pfield_size != *pbitofs /* Current field has been filled, start new one */ && dict->size * 8 >= *pfield_size && (*pbitofs + bitsize) <= dict->size * 8) { /* expand bit field */ fieldtype = EXPAND_BITFIELD; #endif ---------- versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:05:13 2020 From: report at bugs.python.org (Dave Liptack) Date: Thu, 05 Mar 2020 16:05:13 +0000 Subject: [issue39852] IDLE: Copy/Paste behaves like Cut/Paste In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583424313.51.0.0200207094093.issue39852@roundup.psfhosted.org> Dave Liptack added the comment: OS: Windows 10 Pro Version: 1909 OS Build: 18363.657 Python 2.7.17 and 3.8.1 were installed from https://www.python.org/downloads/ using the Windows x86-64 executable installer (3.8.1) and Windows x86-64 MSI installer (2.7.17) Both line numbers and code context are not present To reproduce: 1) Position cursor at the start of a line of text 2) Type Shift+down arrow (to select line of text) 3) Type Ctrl+c 4) Type Alt+g (IDLE) or Ctrl+g (Notepad, Notepad++) 5) Enter line number (for example below line number = 2) 6) Type Enter 7) Type Ctrl+v Example initial text: # This is line 1 # additional line # This is a line I wish to duplicate # another additional line Resulting text in IDLE: # This is line 1 # This is a line I wish to duplicate # additional line # another additional line Resulting text in Notepad and Notepad++: # This is line 1 # This is a line I wish to duplicate # additional line # This is a line I wish to duplicate # another additional line My workaround in IDLE is to add a step between #6 and #7 above, where I mouse click at the desired paste location ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:19:19 2020 From: report at bugs.python.org (Sam Price) Date: Thu, 05 Mar 2020 16:19:19 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1583425159.02.0.416151613526.issue29753@roundup.psfhosted.org> Sam Price added the comment: I ran into this bug on mac and submitted a duplicate issue of 39858 If you add the check *pfield_size != *pbitofs it fixes this bug. #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ && *pfield_size != *pbitofs /* Current field has been filled, start new one */ && dict->size * 8 >= *pfield_size && (*pbitofs + bitsize) <= dict->size * 8) { /* expand bit field */ fieldtype = EXPAND_BITFIELD; #endif However this would not fix the results where you expand a bitfield around 3 bytes. clang produces the 3 bytes if you try and expand around. #include #include typedef struct testA{ uint8_t a0 : 7; uint8_t a1 : 7; uint8_t a2 : 7; uint8_t a3 : 3; } __attribute__((packed)) testA; int main(){ printf("%d\n", sizeof(testA)); /* Prints out 3 */ return 0; } python prints out a size of 4. ---------- nosy: +thesamprice _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:34:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Mar 2020 16:34:39 +0000 Subject: [issue1294959] Problems with /usr/lib64 builds. Message-ID: <1583426079.27.0.9200921218.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-24871: "freeze.py doesn't work on x86_64 Linux out of the box". > On 64-bit Linux freeze.py uses lib instead of lib64 when constructing > path to Makefile etc. Using sysconfig fixes this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:41:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Mar 2020 16:41:09 +0000 Subject: [issue35537] use os.posix_spawn in subprocess In-Reply-To: <1545238079.48.0.788709270274.issue35537@psf.upfronthosting.co.za> Message-ID: <1583426469.88.0.00287543451809.issue35537@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18150 pull_request: https://github.com/python/cpython/pull/18792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:49:42 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Mar 2020 16:49:42 +0000 Subject: =?utf-8?q?=5Bissue39862=5D_Why_are_the_union_relationships_not_implemente?= =?utf-8?b?ZCBieSBkZWZhdWx0IGZvciDiiaQgYW5kIOKJpT8=?= In-Reply-To: <1583404181.09.0.848601767593.issue39862@roundup.psfhosted.org> Message-ID: <1583426982.79.0.620799097492.issue39862@roundup.psfhosted.org> Raymond Hettinger added the comment: See https://www.python.org/dev/peps/pep-0207/ ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 11:50:16 2020 From: report at bugs.python.org (Alexander Stohr) Date: Thu, 05 Mar 2020 16:50:16 +0000 Subject: [issue31652] make install fails: no module _ctypes In-Reply-To: <1506812661.87.0.213398074469.issue31652@psf.upfronthosting.co.za> Message-ID: <1583427016.42.0.433751128414.issue31652@roundup.psfhosted.org> Alexander Stohr added the comment: Ubuntu 16.04 in a very bare naked setup. Similar/same problem profile by message and other lines in the log. Installed libffi6 and libffi-dev => worked. Not sure if both were needed (or interdependent, 2nd to 1st). ---------- nosy: +Alexander Stohr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 13:22:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Mar 2020 18:22:59 +0000 Subject: [issue39863] Add trimend option to readline() and readlines() In-Reply-To: <1583411828.43.0.97175305903.issue39863@roundup.psfhosted.org> Message-ID: <1583432579.52.0.570442340309.issue39863@roundup.psfhosted.org> Serhiy Storchaka added the comment: It would be better to name it keepends and set it True by default. I wanted this feature. The problem is that it is not just concrete implementation, it is an interface. Adding new parameters for IOBase methods will break all IOBase subclasses. And there are IOBase subclasses in third-party code. It is also not good for file-like classes which do not inherit IOBase, but implement a part of methods. You can't start to use new arguments in your code if you accepted arbitrary file-like objects that have methods read() and readline(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 13:36:38 2020 From: report at bugs.python.org (Brett Cannon) Date: Thu, 05 Mar 2020 18:36:38 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583433398.47.0.719762665503.issue39808@roundup.psfhosted.org> Brett Cannon added the comment: Thanks, swgmma! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 13:37:02 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Mar 2020 18:37:02 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583433421.99.0.379400108569.issue39808@roundup.psfhosted.org> miss-islington added the comment: New changeset 7b39c474e4ce7057a9e16b06d40261ff563b1e9d by Miss Islington (bot) in branch '3.8': [3.8] bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719) (GH-18783) https://github.com/python/cpython/commit/7b39c474e4ce7057a9e16b06d40261ff563b1e9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 13:40:44 2020 From: report at bugs.python.org (Brett Cannon) Date: Thu, 05 Mar 2020 18:40:44 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583433644.27.0.714504131542.issue39837@roundup.psfhosted.org> Brett Cannon added the comment: It was an old issue that if required checks didn't run it would block, but hopefully it's fixed. :) I have gone ahead and removed the Azure Pipelines requirement from 3.7, 3.8, and master and flipped on the check requirements for the ones I listed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 13:57:03 2020 From: report at bugs.python.org (Ryan McCampbell) Date: Thu, 05 Mar 2020 18:57:03 +0000 Subject: [issue34305] inspect.getsourcefile and inspect.getcomments do not work with decorated functions In-Reply-To: <1533108053.89.0.56676864532.issue34305@psf.upfronthosting.co.za> Message-ID: <1583434623.01.0.383906406923.issue34305@roundup.psfhosted.org> Ryan McCampbell added the comment: This seems like a pretty straightforward fix. What's holding it up? ---------- nosy: +rmccampbell7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 14:24:01 2020 From: report at bugs.python.org (pasenor) Date: Thu, 05 Mar 2020 19:24:01 +0000 Subject: [issue39865] getattr silences an unrelated AttributeError Message-ID: <1583436241.07.0.803311507701.issue39865@roundup.psfhosted.org> New submission from pasenor : if a class has a descriptor and a defined __getattr__ method, and an AttributeError (unrelated to the descriptor lookup) is raised inside the descriptor, it will be silenced: class A: @property def myprop(self): print("property called") a = 1 a.foo # <-- AttributeError that should not be silenced def __getattr__(self, attr_name): print("__getattr__ called") a = A() a.myprop In this example myprop() is called, the error silenced, then __getattr__() is called. This can lead to rather subtle bugs. Probably an explicit AttributeError should be raised instead. ---------- messages: 363449 nosy: pasenor priority: normal severity: normal status: open title: getattr silences an unrelated AttributeError versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 15:14:16 2020 From: report at bugs.python.org (Joey) Date: Thu, 05 Mar 2020 20:14:16 +0000 Subject: [issue39866] get_type_hints raises inconsistent TypeError Message-ID: <1583439256.25.0.955408580796.issue39866@roundup.psfhosted.org> New submission from Joey : If you pass in an instance of an object without type annotations, you get an error that states "XXX is not a module, class, method, or function." This correctly describes the situation ? typing.get_type_hints(object()) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/typing.py", line 1252, in get_type_hints raise TypeError('{!r} is not a module, class, method, ' TypeError: is not a module, class, method, or function. However, if you pass in an instance of a class that _does_ have type annotations... >class Bar: ... foo: int >typing.get_type_hints(Bar()) {'foo': } You don't get an error even though the message of the first exception would suggest you do. Fix should be pretty easy, either just have the get_type_hints always return a dictionary, and return an empty dictionary if the type of the object has no __annotations__ defined (my preferred solution), or actually check to see if the object is an instance of `_allowed_types` before checking whether the object has annotations. ---------- components: Library (Lib) messages: 363450 nosy: j.tran4418 priority: normal severity: normal status: open title: get_type_hints raises inconsistent TypeError versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 15:15:39 2020 From: report at bugs.python.org (jfbu) Date: Thu, 05 Mar 2020 20:15:39 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds Message-ID: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> New submission from jfbu : We generate quadruples of random integers using randrange(n) and randrange(m) and count how many times the quadruples are identical, using the same random seed. Of course for nearby n and m (the real life example was with n==95 and m==97) we do expect matches. But we found orders of magnitude more than was expected. The attached file demonstrates this by comparison with random()*n (with rounding) as alternative method to generate the random integers (we are aware this gives less uniformity for a given range, but these effects are completely negligible in comparison to the effect we test). For the latter the probability of matches is non-vanishing but orders of magnitude smaller than using randrange(n). Here is an excerpt of our testing result. Each trial uses a random seed (selected via randrange(100000000)). Then 4 random integers in two given ranges are generated and compared. A hit is when all 4 match. - with randrange(): n = 99, m = 124, 4135 hits among 10000 trials n = 99, m = 125, 3804 hits among 10000 trials n = 99, m = 126, 3803 hits among 10000 trials n = 99, m = 127, 3892 hits among 10000 trials n = 99, m = 128, 0 hits among 10000 trials n = 99, m = 129, 0 hits among 10000 trials n = 99, m = 130, 0 hits among 10000 trials n = 99, m = 131, 0 hits among 10000 trials - with random(): n = 99, m = 124, 0 hits among 10000 trials n = 99, m = 125, 0 hits among 10000 trials n = 99, m = 126, 0 hits among 10000 trials n = 99, m = 127, 0 hits among 10000 trials n = 99, m = 128, 0 hits among 10000 trials n = 99, m = 129, 0 hits among 10000 trials n = 99, m = 130, 0 hits among 10000 trials n = 99, m = 131, 0 hits among 10000 trials The test file has some hard-coded random seeds for reproductibility. Although I did only limited testing it is flagrant there is completely abnormal correlation between randrange(n) and randrange(m) when the two integers have the same length in base 2. Tested with 3.6 and 3.8. ---------- files: testrandrange.py messages: 363451 nosy: jfbu priority: normal severity: normal status: open title: randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds versions: Python 3.8 Added file: https://bugs.python.org/file48955/testrandrange.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 15:29:34 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 05 Mar 2020 20:29:34 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583440174.0.0.37624615164.issue39867@roundup.psfhosted.org> Mark Dickinson added the comment: These results are hardly surprising, given the algorithms used. But why would you consider this a problem? If you want your randrange(n) and randrange(m) results to be independent, don't generate them from the exact same random source, starting with the same seed. Use different seeds, or generate one set of results followed by the other without resetting the seed in between. ---------- nosy: +mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 15:33:13 2020 From: report at bugs.python.org (paul j3) Date: Thu, 05 Mar 2020 20:33:13 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash In-Reply-To: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> Message-ID: <1583440393.62.0.706349546766.issue39845@roundup.psfhosted.org> paul j3 added the comment: Then this isn't an argparse issue. Probably not even a Python one. The windows shell (which one? cmd.exe? power? some batch) is making the substitution. I see lots of discussion about Windows use of backslash, both as directory separator and escape. None seems to exactly apply. For your application the use of a custom 'type' function might well be appropriate, but it's not something we want to add to argparse. It's a user specific patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 16:18:11 2020 From: report at bugs.python.org (jfbu) Date: Thu, 05 Mar 2020 21:18:11 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583443091.31.0.0371254331329.issue39867@roundup.psfhosted.org> jfbu added the comment: Yes indeed the source code of _randbelow_with_getrandbits generates this effect. And I understand the puzzlement about my test file setting the same random seed and then complaining about correlations. But there is some non-uniformity which is enormous between what happens for say n=99 and m=127 versus n=99 and m=128. Now that I looked at the actual source code, I have in other programming contexts available manners of reducing from a power of 2 to an arbitrary range which should not show this artefact. I will need to translate it into Python and may submit a PR for evaluation after having tested. My test file illustrates that if randrange() proceeded from a pseudo-random variable emulating the uniform distribution in (0,1) and rescaled and rounded to an integer range, correlations between distinct ranges would be of a completely different nature than what the CPython method leads to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 16:24:45 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 05 Mar 2020 21:24:45 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583443485.57.0.204300125386.issue39837@roundup.psfhosted.org> Steve Dower added the comment: Looks like it isn't fixed... https://github.com/python/cpython/pull/18774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 16:54:08 2020 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 05 Mar 2020 21:54:08 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). Message-ID: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> New submission from Brandt Bucher : It looks like https://docs.python.org/3/reference/expressions.html and https://docs.python.org/3/reference/compound_stmts.html were never updated for named expressions. Because this change has to be backported, it's sort of a blocker for my PEP 614 doc updates in issue 39702, which need to use the missing node in 3.9 only (I'd rather have this get a clean backport now than a messy one later)! Is somebody more familiar with PEP 572 willing to take this? Should be pretty straightforward. Pinging Emily since it looks like you've done some grammar/doc work for this in the past. ---------- assignee: docs at python components: Documentation keywords: easy messages: 363456 nosy: brandtbucher, docs at python, emilyemorehouse priority: normal severity: normal status: open title: Stale Python Language Reference docs (no walrus). versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 17:18:12 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Mar 2020 22:18:12 +0000 Subject: [issue39852] IDLE: Goto should remove any selection In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583446692.62.0.708271696728.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: This is much clearer. To expand on what I said before, inserting *anything*, such as by hitting a key, replaces a selection. I verified that this is normal behavior, at least on Windows, with Notepad, Notepad++, and this Firefox entry box I am typing in. So either of your steps 6 or 7 delete the still selected line, after the goto. (And so a click is needed before 6 to stop the deletion.) I see the continued selection as the problem. Both Notepad and Notepad++ unselect any selection upon goto, the same as if one moved the cursor by clicking instead of goto. I will try adding text.selection_clear() to the goto code. ---------- stage: -> needs patch title: IDLE: Copy/Paste behaves like Cut/Paste -> IDLE: Goto should remove any selection versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 17:21:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Mar 2020 22:21:40 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583446900.09.0.913153949008.issue39837@roundup.psfhosted.org> STINNER Victor added the comment: Instead of not running the job, is it technically possible to modify the jobs to do nothing for docs only changes? .travis.yml works like that: before_install: - set -e - | # Check short-circuit conditions if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]] then if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] then echo "Not a PR, doing full build." else # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE # may include more changes than desired if the history is convoluted. # Instead, explicitly fetch the base branch and compare against the # merge-base commit. git fetch -q origin +refs/heads/$TRAVIS_BRANCH changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD)) echo "Files changed:" echo "$changes" if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)' then echo "Only docs were updated, stopping build process." exit fi fi fi ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 17:25:06 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 05 Mar 2020 22:25:06 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583447106.47.0.3878471367.issue39867@roundup.psfhosted.org> Tim Peters added the comment: Sorry, I don't see "a problem" here either. Rounding instead can change the precise nature of the correlations if you insist on starting from the same seed, but it hardly seems a real improvement; e.g., >>> random.seed(12) >>> [round(random.random() * 100) for i in range(10)] [47, 66, 67, 14, 1, 37, 27, 81, 69, 60] >>> random.seed(12) >>> [round(random.random() * 101) for i in range(10)] [48, 66, 67, 14, 1, 38, 28, 82, 70, 61] That is, while there are fewer identical values, the correlation is nevertheless obvious and extreme. Not only not a bug, it's not even surprising ;-) ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 17:42:08 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 05 Mar 2020 22:42:08 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583448128.85.0.981719210103.issue39837@roundup.psfhosted.org> Steve Dower added the comment: Adding a screenshot here so I can point people at it. Let's not rush into complicating the build steps yet - AP is basically fine. We should switch back the required checks (@Brett?) If anything, let's add a "condition: false" to the macOS build to disable it and rely on the non-required GH check for now. ---------- Added file: https://bugs.python.org/file48956/Annotation 2020-03-05 223851.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 18:00:34 2020 From: report at bugs.python.org (jfbu) Date: Thu, 05 Mar 2020 23:00:34 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583449234.64.0.135571531821.issue39867@roundup.psfhosted.org> jfbu added the comment: @tim.peters yes, a uniform random variable rescaled to two nearby scales N and M will display strong correlations. The CPython randrange() exhibits however orders of magnitude higher such correlations, but only in relation to a common bitlength. A randrange() function should a priori not be so strongly tied to the binary base. The example you show would not be counted as a hit by my test for the randomseed 12. >>> s = 0 >>> for t in range(100000): ... random.seed(t) ... x = [round(random.random() * 100) for i in range(10)] ... random.seed(t) ... y = [round(random.random() * 101) for i in range(10)] ... if x == y: ... s += 1 ... >>> s 94 >>> s = 0 >>> for t in range(100000): ... random.seed(t) ... x = [random.randrange(100) for i in range(10)] ... random.seed(t) ... y = [random.randrange(101) for i in range(10)] ... if x == y: ... s += 1 ... >>> s 90432 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 18:46:03 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Thu, 05 Mar 2020 23:46:03 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583451963.43.0.858154665436.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: Can I take this issue? ---------- nosy: +shankarj67 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 18:52:49 2020 From: report at bugs.python.org (Mariatta) Date: Thu, 05 Mar 2020 23:52:49 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation Message-ID: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> New submission from Mariatta : In https://docs.python.org/3.9/tutorial/classes.html#instance-objects, it says: > There are two kinds of valid attribute names, data attributes and methods. Replace the comma with a colon > There are two kinds of valid attribute names: data attributes and methods. Reported in docs mailing list: https://mail.python.org/archives/list/docs at python.org/thread/BWXLZM4OLWF5XVBI4S2WK3LFUIEBI6M6/ ---------- assignee: docs at python components: Documentation keywords: newcomer friendly messages: 363463 nosy: Mariatta, docs at python priority: normal severity: normal stage: needs patch status: open title: Improve Instance Objects tutorial documentation versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 19:24:25 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 00:24:25 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583454265.99.0.931752407378.issue39868@roundup.psfhosted.org> Brandt Bucher added the comment: Sorry, I hadn't seen your comment... :( I've already finished the grammar specification bit, but not the prose description of how assignment expressions work, etc. How about I leave that empty in my PR and you can actually do the documentation part afterward that's merged? Cool? I'd be happy to review it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 19:27:06 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 00:27:06 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583454426.16.0.673008201655.issue39868@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +18151 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 19:43:18 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Fri, 06 Mar 2020 00:43:18 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583455398.87.0.669257604491.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: Thank you for that!!! Can you please provide some pointers to what exactly I have to do? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 19:45:00 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 00:45:00 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583455500.44.0.717522791395.issue39837@roundup.psfhosted.org> Brett Cannon added the comment: I've turned off the required checks for GH Actions and flipped Azure Pipelines back on. And to answer Victor's question, yes, you can make things conditional at the workflow, job, and job step level. I don't know what would happen if the check was moved from workflow to job level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 20:39:09 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 01:39:09 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583458749.2.0.6597844206.issue39868@roundup.psfhosted.org> Brandt Bucher added the comment: Of course. After my PR is merged, you can make another PR that replaces the ".. TODO: BPO-39868" line with a description of how assignment expressions work. Likely much of the language can be borrowed from the PEP. Let me know if you need help with any of the steps. Have you written RST / made a CPython PR on GitHub before? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 20:46:13 2020 From: report at bugs.python.org (Isaac Muse) Date: Fri, 06 Mar 2020 01:46:13 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583459173.8.0.428115119706.issue39682@roundup.psfhosted.org> Isaac Muse added the comment: Brace expansion does not currently exist in Python's glob. You'd have to use a third party module to expand the braces and then run glob on each returned pattern, or use a third party module that implements a glob that does it for you. Shameless plug: Brace expansion: https://github.com/facelessuser/bracex Glob that does it for you (when the feature is enabled): https://github.com/facelessuser/wcmatch Now whether Python should integrate such behavior by default is another question. ---------- nosy: +Isaac Muse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 20:46:48 2020 From: report at bugs.python.org (Isaac Muse) Date: Fri, 06 Mar 2020 01:46:48 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583459208.85.0.362631411232.issue39682@roundup.psfhosted.org> Isaac Muse added the comment: Wrong thread sorry ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 20:47:18 2020 From: report at bugs.python.org (Isaac Muse) Date: Fri, 06 Mar 2020 01:47:18 +0000 Subject: [issue39856] glob : some 'unix style' glob items are not supported In-Reply-To: <1583360820.43.0.706736327816.issue39856@roundup.psfhosted.org> Message-ID: <1583459238.55.0.146877482928.issue39856@roundup.psfhosted.org> Isaac Muse added the comment: Brace expansion does not currently exist in Python's glob. You'd have to use a third party module to expand the braces and then run glob on each returned pattern, or use a third party module that implements a glob that does it for you. Shameless plug: Brace expansion: https://github.com/facelessuser/bracex Glob that does it for you (when the feature is enabled): https://github.com/facelessuser/wcmatch Now whether Python should integrate such behavior by default is another question. ---------- nosy: +Isaac Muse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 20:54:00 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 06 Mar 2020 01:54:00 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583459640.7.0.523251123183.issue39867@roundup.psfhosted.org> Tim Peters added the comment: This is where you're not getting traction: "A randrange() function should a priori not be so strongly tied to the binary base." That's a raw assertion. _Why_ shouldn't it be? "Because I keep saying so" isn't changing minds ;-) I understand you're looking at exact equality of t-tuples. I wasn't in my example: I was looking at the individual values, one pair at a time. The extreme correlation is dead obvious by eyeball either way, despite that the only test you seem to have in mind (exact equality of t-tuples) is blind to it. Why is that test so important? Why does it not matter that, e.g., number of inversions, number of runs, distribution of run-lengths (etc) remain highly correlated regardless? Nobody else has had a problem with this, and it remains unclear why you do: what's your objection to Mark's suggestions (use different seeds, or _don't_ reset the seed)? That's the obvious approach: use the facilities in straightforward ways. In any case, we can't/won't make changes on a whim. As far as possible, we strive to keep results bit-for-bit identical across releases for people who save/set seeds, hoping to get reproducible results. Changing the results from any random module function requires strong justification. So far, I don't see that here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:07:55 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 06 Mar 2020 02:07:55 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583460475.68.0.98826868868.issue39689@roundup.psfhosted.org> Gregory P. Smith added the comment: FYI - I updated the ubsan buildbot to clang 9 so this one shows up in there now: /var/lib/buildbot/workers/clang-ubsan/3.x.gps-clang-ubsan.clang-ubsan/build/Modules/_struct.c:487:28: runtime error: load of value 116, which is not a valid value for type '_Bool' Objects/memoryobject.c:1702:15: runtime error: load of value 116, which is not a valid value for type '_Bool' Objects/memoryobject.c:2704:15: runtime error: load of value 116, which is not a valid value for type '_Bool' Objects/memoryobject.c:2704:15: runtime error: load of value 116, which is not a valid value for type '_Bool' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:21:57 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Fri, 06 Mar 2020 02:21:57 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583461317.59.0.578700993816.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: This is my first contribution to Python. This is why I am looking for some guidance, just point me to some resource, and then I will look into it thoroughly. I am reading this https://www.python.org/dev/peps/pep-0572/ for better understanding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:25:56 2020 From: report at bugs.python.org (Ningyi Du) Date: Fri, 06 Mar 2020 02:25:56 +0000 Subject: [issue39864] IndexError gives wrong axis info In-Reply-To: <1583422946.86.0.274704131552.issue39864@roundup.psfhosted.org> Message-ID: Ningyi Du added the comment: I believe it's a bug. The axis 0 is misleading. However, it is a problem for numpy developers. Thank you for your time. On Thu, Mar 5, 2020, 10:42 AM Peter Otten wrote: > > Peter Otten <__peter__ at web.de> added the comment: > > This is not a bug (and if it were you would have to report to numpy, not > cpython). > > Consider: > > >>> import numpy > >>> a = numpy.zeros((2,2,2)) > >>> a[0,2] > Traceback (most recent call last): > File "", line 1, in > IndexError: index 2 is out of bounds for axis 1 with size 2 > > This is probably the message you expect. However, if you write > >>> a[0][2] > Traceback (most recent call last): > File "", line 1, in > IndexError: index 2 is out of bounds for axis 0 with size 2 > > you split the operation into two steps, and the second axis of a is > effectively the first axis of a[0]. > > ---------- > nosy: +peter.otten -steven.daprano > > _______________________________________ > Python tracker > > _______________________________________ > ---------- title: IndexError gives wrong axis info -> IndexError gives wrong axis info _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:33:47 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 02:33:47 +0000 Subject: [issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument Message-ID: <1583462027.48.0.887856173941.issue39870@roundup.psfhosted.org> New submission from Andy Lester : sys_displayhook_unencodable in Python/sysmodule.c doesn't need its first argument. Remove it. ---------- messages: 363475 nosy: petdance priority: normal severity: normal status: open title: sys_displayhook_unencodable takes an unnecessary PyThreadState * argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:33:57 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 02:33:57 +0000 Subject: [issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument In-Reply-To: <1583462027.48.0.887856173941.issue39870@roundup.psfhosted.org> Message-ID: <1583462037.57.0.538986900677.issue39870@roundup.psfhosted.org> Change by Andy Lester : ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:36:36 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 02:36:36 +0000 Subject: [issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument In-Reply-To: <1583462027.48.0.887856173941.issue39870@roundup.psfhosted.org> Message-ID: <1583462196.98.0.989598383627.issue39870@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18152 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18796 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:47:51 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Mar 2020 02:47:51 +0000 Subject: [issue27115] IDLE goto should always update status bar line & column In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583462871.37.0.103778651543.issue27115@roundup.psfhosted.org> Terry J. Reedy added the comment: I changed the title to reflect the intended user-visible behavior, which was always the real issue. The original title proposed a solution that would not work. The revised title gave an alternate solution that should not work. The discrepancy between clicking [Ok] and and pressing arises because pressing Enter in the query box leaks to the text, which happens to trigger a status bar update. I regard this somewhat accidental side-effect to be a bug to be fixed. Changing the text and status bar are the responsibility of the event handler. The line number query box should just return a positive int or None, without side-effect. So we should make sure that Query boxes do not leak key events and create a subclass to get a positive int. But such a replacement is somewhat independent of triggering <>. A related issue is that goto does not clear selections. #39844. I may fix that and this with one PR. ---------- title: IDLE: replace uses of tkinter simpledialog with query.Query -> IDLE goto should always update status bar line & column _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:54:59 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 06 Mar 2020 02:54:59 +0000 Subject: [issue39866] get_type_hints raises inconsistent TypeError In-Reply-To: <1583439256.25.0.955408580796.issue39866@roundup.psfhosted.org> Message-ID: <1583463299.23.0.321317957555.issue39866@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 21:59:01 2020 From: report at bugs.python.org (David Vo) Date: Fri, 06 Mar 2020 02:59:01 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y Message-ID: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> New submission from David Vo : If math.copysign(x, y) is passed an x that cannot be converted to a float and a y that implements __float__() in Python, math.copysign() will raise a SystemError from the TypeError resulting from the attempted float conversion of x. math.copysign() should probably return immediately if converting the first argument to a float raises an error. Example: >>> import math >>> from fractions import Fraction >>> float(Fraction(-1, 1)) # this is needed to avoid an AttributeError? -1.0 >>> math.copysign((-1) ** 0.5, Fraction(-1, 1)) TypeError: can't convert complex to float The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/numbers.py", line 291, in __float__ return self.numerator / self.denominator SystemError: PyEval_EvalFrameEx returned a result with an error set ---------- components: Extension Modules messages: 363477 nosy: auscompgeek priority: normal severity: normal status: open title: math.copysign raises SystemError with non-float x and custom y type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 22:36:26 2020 From: report at bugs.python.org (Matheus Vieira Portela) Date: Fri, 06 Mar 2020 03:36:26 +0000 Subject: [issue39861] French doc __futur__: Bad URL In-Reply-To: <1583401195.98.0.339356939479.issue39861@roundup.psfhosted.org> Message-ID: <1583465786.0.0.824949968121.issue39861@roundup.psfhosted.org> Matheus Vieira Portela added the comment: I just opened a PR for that: https://github.com/python/python-docs-fr/pull/1176 ---------- nosy: +matheus.v.portela _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 23:34:42 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 06 Mar 2020 04:34:42 +0000 Subject: [issue39870] sys_displayhook_unencodable takes an unnecessary PyThreadState * argument In-Reply-To: <1583462027.48.0.887856173941.issue39870@roundup.psfhosted.org> Message-ID: <1583469282.53.0.700818535819.issue39870@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset da4d656e951b00580d135ae6345656ecedf9d8d4 by Andy Lester in branch 'master': closes bpo-39870: Remove unused arg from sys_displayhook_unencodable. (GH-18796) https://github.com/python/cpython/commit/da4d656e951b00580d135ae6345656ecedf9d8d4 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 5 23:43:43 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 04:43:43 +0000 Subject: [issue39859] set_herror should not throw away constness of hstrerror In-Reply-To: <1583387389.29.0.102450533864.issue39859@roundup.psfhosted.org> Message-ID: <1583469823.07.0.600410389821.issue39859@roundup.psfhosted.org> miss-islington added the comment: New changeset e63117a84ef11083be86db7afb2ac2789491ca09 by Andy Lester in branch 'master': closes bpo-39859: Do not downcast result of hstrerror (GH-18790) https://github.com/python/cpython/commit/e63117a84ef11083be86db7afb2ac2789491ca09 ---------- nosy: +miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:00:26 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 06 Mar 2020 05:00:26 +0000 Subject: [issue39866] get_type_hints raises inconsistent TypeError In-Reply-To: <1583439256.25.0.955408580796.issue39866@roundup.psfhosted.org> Message-ID: <1583470826.36.0.950470981715.issue39866@roundup.psfhosted.org> Guido van Rossum added the comment: It should definitely not return {} for objects without __annotations__ attributes -- get_type_hints(42) should raise TypeError. One could argue that get_type_hints(Bar()) incorrectly returns a dict, but we want to allow for some duck typing here, and, honestly, I don't see this is a big problem. The error message tries to convey the most likely cause of the problem (and it does so nicely for things like get_type_hints(42)). I think we needn't fix this. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:13:47 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Mar 2020 05:13:47 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583471627.14.0.697999025945.issue39867@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Tim and Mark. This isn't a bug. The randomization occurs at the getrandbits() level. The downstream functions, such as randbelow and randrange, have no responsibility to create additional dispersion; instead, their role is to map the upstream scattering to the desired target distributions. The correlations found by the OP are indeed unsurprising. They disappear entirely when using two difference seeds or by making successive selections from a single stream. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:19:25 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 06 Mar 2020 05:19:25 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583471965.54.0.448805305768.issue39868@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8bae21962bab2fac7630982abd73676b89930902 by Brandt Bucher in branch 'master': bpo-39868: Update Language Reference for PEP 572. (#18793) https://github.com/python/cpython/commit/8bae21962bab2fac7630982abd73676b89930902 ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:19:35 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 05:19:35 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583471975.08.0.789369899431.issue39868@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18153 pull_request: https://github.com/python/cpython/pull/18797 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:25:18 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 05:25:18 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583472318.41.0.929812391414.issue39868@roundup.psfhosted.org> miss-islington added the comment: New changeset 0c71770eeee9c1b19b6f146b56db5f10bab3f09c by Miss Islington (bot) in branch '3.8': bpo-39868: Update Language Reference for PEP 572. (GH-18793) https://github.com/python/cpython/commit/0c71770eeee9c1b19b6f146b56db5f10bab3f09c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:35:01 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 06 Mar 2020 05:35:01 +0000 Subject: [issue39863] Add trimend option to readline() and readlines() In-Reply-To: <1583411828.43.0.97175305903.issue39863@roundup.psfhosted.org> Message-ID: <1583472901.88.0.588666193969.issue39863@roundup.psfhosted.org> Inada Naoki added the comment: > It would be better to name it keepends and set it True by default. .readline() returns only one line. Should we use plural form for consistency? > It is also not good for file-like classes which do not inherit IOBase, but implement a part of methods. You can't start to use new arguments in your code if you accepted arbitrary file-like objects that have methods read() and readline(). OK. It should be added to only concrete types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:51:27 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 05:51:27 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583473887.28.0.64411321304.issue39573@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18154 pull_request: https://github.com/python/cpython/pull/18798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 00:52:26 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 05:52:26 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583473946.55.0.357859513914.issue39573@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18155 pull_request: https://github.com/python/cpython/pull/18799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:31:53 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 06:31:53 +0000 Subject: [issue39872] Remove unused args from four functions in Python/symtable.c Message-ID: <1583476312.99.0.496322079949.issue39872@roundup.psfhosted.org> New submission from Andy Lester : These four functions have unused arguments that can be removed: symtable_exit_block -> void *ast symtable_visit_annotations -> stmt_ty s symtable_exit_block -> void *ast symtable_visit_annotations -> stmt_ty s PR is forthcoming. ---------- components: Interpreter Core messages: 363486 nosy: petdance priority: normal severity: normal status: open title: Remove unused args from four functions in Python/symtable.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:36:51 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Mar 2020 06:36:51 +0000 Subject: [issue39852] IDLE: Goto should remove any selection In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583476611.42.0.442544292356.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: selection_clear only partially clears a selection. That it does something is proven by selection_clear.py. It disables selection_get. But run the file in IDLE and when it finishes, click the tk window, select a line, click Shell, and manually repeat the last 3 lines. selection_get is disabled again, but upon clicking the title bar of the tk window (to not affect selection in the window), the selection is still highlighted. Further experiments showed that the insertion-deletion bug of this issue remains when using selection_own and selection_clear in IDLE. The alternative of simulating a click on the moved insert cursor is harder by works, at least on Windows. This also triggers a status-bar update -- see #27115. ---------- Added file: https://bugs.python.org/file48957/selection_clear.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:43:29 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 06:43:29 +0000 Subject: [issue39872] Remove unused args from two functions in Python/symtable.c In-Reply-To: <1583476312.99.0.496322079949.issue39872@roundup.psfhosted.org> Message-ID: <1583477009.44.0.288397672839.issue39872@roundup.psfhosted.org> Andy Lester added the comment: Two functions. It's only two functions. ---------- title: Remove unused args from four functions in Python/symtable.c -> Remove unused args from two functions in Python/symtable.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:48:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Mar 2020 06:48:12 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583477292.17.0.416884486119.issue39871@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +easy (C) stage: -> needs patch versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:49:44 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 06:49:44 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583477384.57.0.97527028081.issue39868@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks for offering to help, Shankar! For this change, you can look at the other sections of the Doc/reference/expressions.rst file for an idea of what we're looking for. I think a few sentences and maybe a small code snippet should probably be fine. The devguide has all of the information that you need to get started. Specifically, you'll want to look at: - https://devguide.python.org/docquality/ - https://devguide.python.org/documenting/ - https://devguide.python.org/pullrequest/ Also, you should sign the CLA *as soon as possible* (https://www.python.org/psf/contrib/contrib-form/)! Once you've made a PR, please request a review from me so I can make sure it moves along quickly. Let me know if you have any questions... I know it can be really tricky at first! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:54:13 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 06:54:13 +0000 Subject: [issue39872] Remove unused args from two functions in Python/symtable.c In-Reply-To: <1583476312.99.0.496322079949.issue39872@roundup.psfhosted.org> Message-ID: <1583477653.55.0.474875671215.issue39872@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18156 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 01:59:47 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Mar 2020 06:59:47 +0000 Subject: [issue39852] IDLE: Goto should remove any selection In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583477987.6.0.710957789919.issue39852@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +18157 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:07:23 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 07:07:23 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583478443.52.0.0672864146981.issue39702@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +18158 pull_request: https://github.com/python/cpython/pull/18802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:10:22 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Mar 2020 07:10:22 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583478622.39.0.746084726842.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: I am expanding this issue to include the part of #27115 that the PR will fix. (I will also change the scope of the latter). ---------- stage: patch review -> needs patch title: IDLE: Goto should remove any selection -> IDLE: Goto should remove selection and update the status bar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:23:45 2020 From: report at bugs.python.org (jfbu) Date: Fri, 06 Mar 2020 07:23:45 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583479425.14.0.120087578316.issue39867@roundup.psfhosted.org> jfbu added the comment: "bug" is a strong word, which I did never employ myself, apart from using this channel of report. I rather think of a (non-documented) "deficiency", but I expect the consensus will again be that I am expressing a "raw expression". However reading more than once that "the correlations are indeed unsurprising" it is my turn to see there a raw expression. The correlations are unsurprising *only* if one looks at the source code and understand how a (to a very high degree) uniform distribution on a power of 2 range is reduced to distribution on the smaller range (keeping the extremely high uniformity). Thus, sorry, the correlations are to the contrary *very surprising* to the end user who has no knowledge of the internals. Donald Knuth for example many decades ago in his work on MetaPost used a RNG which is a kind a primitive ancestor (in the family of those commented upon in AOCP) of the much more sophisticated one used nowadays by Python. He used the rescaling with rounding method to go from power of 2 range to non power of 2 range. That method induces some non-uniformity and if I understand (without having checked) it was the one from Python < 3.2. At some point Python changed its way to another way, to cure non-uniformity (and other artefacts of the simple minded rescaling method). But there are other ways to reduce the non-uniformity to negligible levels which are not the choice made currently in Python code. (which for people not having _randbelow_with_getrandbits before their eyes is simply to draw a random integer with at most the number of bits of the limit N until one is found at most equal to N). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:31:35 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Mar 2020 07:31:35 +0000 Subject: [issue39865] getattr silences an unrelated AttributeError In-Reply-To: <1583436241.07.0.803311507701.issue39865@roundup.psfhosted.org> Message-ID: <1583479895.85.0.113031433426.issue39865@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:44:55 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 06 Mar 2020 07:44:55 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583480695.63.0.483262655094.issue39871@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:48:46 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 06 Mar 2020 07:48:46 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583480926.39.0.675162922784.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: Nice find. This affects not just copysign, but all of the math module functions that use FUNC2 under the hood. (I think that's just "remainder", "atan2" and "copysign".) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 02:49:46 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 06 Mar 2020 07:49:46 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583480986.52.0.747583979597.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: @David: do you have any interest in creating a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 03:04:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 08:04:05 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583481845.0.0.577887246108.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8767ce92d24d3687405848442e6c67cf0af1c657 by Andy Lester in branch 'master': bpo-39573: Make Py_IS_TYPE() take constant parameters (GH-18799) https://github.com/python/cpython/commit/8767ce92d24d3687405848442e6c67cf0af1c657 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 03:24:12 2020 From: report at bugs.python.org (David Vo) Date: Fri, 06 Mar 2020 08:24:12 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583483052.84.0.345722802591.issue39871@roundup.psfhosted.org> David Vo added the comment: I'm currently rather busy with other work, but if this happens to still be open in a couple of months I might pick it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 03:26:26 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 06 Mar 2020 08:26:26 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583483186.86.0.132593843576.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: No problem; I'll likely pick it up (if no-one else does) in the next few days. ---------- assignee: -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 03:54:33 2020 From: report at bugs.python.org (Je GeVa) Date: Fri, 06 Mar 2020 08:54:33 +0000 Subject: [issue39856] glob : some 'unix style' glob items are not supported In-Reply-To: <1583380725.56.0.158676351374.issue39856@roundup.psfhosted.org> Message-ID: Je GeVa added the comment: well ; 1) tilde expansion this is an issue 2) brace expansion have no clue how the engineers at the fruity company maimed your bash and zsh man but brace expansion is core to both of them. https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html http://zsh.sourceforge.net/Doc/Release/Expansion.html#Brace-Expansion hence : BASH /tmp/testdir_issue39856$ $SHELL --version|head -n1 GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu) /tmp/testdir_issue39856$ ls hello_1.py hello_2.py hello_3.py /tmp/testdir_issue39856$ ls hell*{1,2}.* hello_1.py hello_2.py /tmp/testdir_issue39856$ ls hell*{1..3}.* hello_1.py hello_2.py hello_3.py ZSH nocte% $SHELL --version|head -n1 zsh 5.8 (x86_64-debian-linux-gnu) nocte% ls hell*{1,2}.* hello_1.py hello_2.py nocte% ls hell*{1..3}.* hello_1.py hello_2.py hello_3.py TCSH nocte:/tmp/testdir_issue39856> /bin/tcsh --version tcsh 6.21.00 (Astron) 2019-05-08 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,nd,color,filec nocte:/tmp/testdir_issue39856> ls hell*{1,2}.* hello_1.py hello_2.py for history sake : https://unix.stackexchange.com/questions/92819/why-is-brace-expansion-not-supported Apparently : "While brace expansion like {1,2} originates in csh in the late 70s, and found its way to Bourne-like shells in bash/zsh/pdksh in the late 80s, early 90s, the {n1..n2} variant came later first in zsh in 1995 (2.6-beta4). bash copied it in 2004 (3.0) and ksh93 in 2005 (ksh93r)." since glob claims the "unix style" and bash is the default unix shell, i believe it should support it (or maybe change the tatile to 'unix from 40 years ago style' ), i stand by the issue, and Kart, on a side note i would sincerely update my base tools if i were you, bash 3.2 is vulnerable to shellshock for exemple... Le jeu. 5 mars 2020 ? 04:58, Karthikeyan Singaravelan < report at bugs.python.org> a ?crit : > > Karthikeyan Singaravelan added the comment: > > This seems to be similar to issue9584. Below are the results in my zsh and > bash in Mac. > > bash > > bash-3.2$ cd /tmp/ > bash-3.2$ ls *py > hello_1.py hello_2.py hello_3.py > bash-3.2$ ls hell*{1-2}.* > ls: hell*{1-2}.*: No such file or directory > bash-3.2$ ls hell*[1-2].* > hello_1.py hello_2.py > > zsh > > ? /tmp ls *py > hello_1.py hello_2.py hello_3.py > ? /tmp ls hell*{1-2}.* > zsh: no matches found: hell*{1-2}.* > ? /tmp ls hell*[1-2].* > hello_1.py hello_2.py > > Try using [] > > >>> import glob > >>> glob.glob("hell*[1-2].*") > ['hello_2.py', 'hello_1.py'] > > ---------- > nosy: +serhiy.storchaka, xtreak > type: -> behavior > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:10:36 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 06 Mar 2020 09:10:36 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583485836.2.0.0989462628746.issue39837@roundup.psfhosted.org> Steve Dower added the comment: It would make the job definition significantly more complicated, and I don't want to do that just to work around an issue with github until we've got positive confirmation that the behaviour is intentional and won't change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:24:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:24:50 +0000 Subject: [issue39873] Debug mode: check if objects are valid Message-ID: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> New submission from STINNER Victor : One of the worst issue that I had to debug is a crash in the Python garbage collector. It is usually a crash in visit_decref(). See my notes: https://pythondev.readthedocs.io/debug_tools.html#debug-crash-in-garbage-collection-visit-decref My previous attempt to help debugging such issue failed: bpo-36389 "Add gc.enable_object_debugger(): detect corrupted Python objects in the GC". The idea was to check frequently if all objects tracked by the GC are valid. The problem is that even if the check looked trivial, checking all objects made Python way slower. Even when I tried to only check objects of the "young" GC generation (generation 0), it was still too slow. Here I propose a different approach: attempt to only check objects when they are accessed. Recently, I started to replace explicit cast to (PyObject *) type with an indirection: a new _PyObject_CAST() macro which should be the only way to cast any object pointer to (PyObject *). /* Cast argument to PyObject* type. */ #define _PyObject_CAST(op) ((PyObject*)(op)) This macro is used in many "core" macros like Py_TYPE(op), Py_REFCNT(op), Py_SIZE(op), Py_SETREF(op, op2), Py_VISIT(op), etc. The idea here is to inject code in _PyObject_CAST(op) when Python is built in debug mode to ensure that the object is valid. The intent is to detect corrupted objects earlier than a garbage collection, to ease debugging C extensions. The checks should be limited to reduce the performance overhead. Attached PR implemnts this idea. ---------- components: Interpreter Core messages: 363499 nosy: vstinner priority: normal severity: normal status: open title: Debug mode: check if objects are valid versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:36:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:36:08 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583487368.36.0.0608247037354.issue39873@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18159 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:39:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:39:24 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583487564.44.0.792357226006.issue39873@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18160 pull_request: https://github.com/python/cpython/pull/18804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:40:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:40:54 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583487654.46.0.743186791126.issue39873@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-38392: "Ensure that objects entering the GC are valid". I fixed this one with commit 1b1845569539db5c1a6948a5d32daea381f1e35f. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:41:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:41:09 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583487669.24.0.314702664116.issue39873@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +inada.naoki, pablogsal, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 04:43:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 09:43:06 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583487786.24.0.26459793877.issue39573@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18161 pull_request: https://github.com/python/cpython/pull/18804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 05:11:51 2020 From: report at bugs.python.org (BongK) Date: Fri, 06 Mar 2020 10:11:51 +0000 Subject: [issue39874] Heappush of Maxheap version does not exist Message-ID: <1583489511.06.0.0647402677335.issue39874@roundup.psfhosted.org> New submission from BongK : heappush of maxheap version does not exist in heapq.py ---------- messages: 363501 nosy: vbnmzx1 priority: normal severity: normal status: open title: Heappush of Maxheap version does not exist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 05:12:06 2020 From: report at bugs.python.org (BongK) Date: Fri, 06 Mar 2020 10:12:06 +0000 Subject: [issue39874] Heappush of Maxheap version does not exist In-Reply-To: <1583489511.06.0.0647402677335.issue39874@roundup.psfhosted.org> Message-ID: <1583489526.49.0.317011500993.issue39874@roundup.psfhosted.org> Change by BongK : ---------- components: +Library (Lib) type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 05:23:14 2020 From: report at bugs.python.org (BongK) Date: Fri, 06 Mar 2020 10:23:14 +0000 Subject: [issue3874] documentation bug: HTMLParser needs to document unknown_decl In-Reply-To: <1221515609.61.0.396859142368.issue3874@psf.upfronthosting.co.za> Message-ID: <1583490194.76.0.913516967389.issue3874@roundup.psfhosted.org> Change by BongK : ---------- nosy: +vbnmzx1 nosy_count: 4.0 -> 5.0 pull_requests: +18162 pull_request: https://github.com/python/cpython/pull/18805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 05:32:49 2020 From: report at bugs.python.org (BongK) Date: Fri, 06 Mar 2020 10:32:49 +0000 Subject: [issue39874] Heappush of Maxheap version does not exist In-Reply-To: <1583489511.06.0.0647402677335.issue39874@roundup.psfhosted.org> Message-ID: <1583490769.65.0.74837391174.issue39874@roundup.psfhosted.org> Change by BongK : ---------- keywords: +patch pull_requests: +18163 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 06:45:28 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 11:45:28 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string Message-ID: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> New submission from henrik242 : curl correctly posts data to Solr: $ curl -v 'http://solr.example.no:12699/solr/my_coll/update?commit=true' \ --data 'KEY__9927.1\ {"result":0,"jobId":"9459695","jobNumber":"9927.1"}' The solr query log says: [20200306T111354,131] [my_coll_shard1_replica_n85] webapp=/solr path=/update params={commit=true} status=0 QTime=96 I'm trying to do the same thing with Python: >>> import urllib.request >>> data='KEY__9927.1{"result":0,"jobId":"9459695","jobNumber":"9927.1"}' >>> url='http://solr.example.no:12699/solr/my_coll/update?commit=true' >>> req = urllib.request.Request(url=url, data=data.encode('utf-8'), method='POST') >>> res = urllib.request.urlopen(req) But now the solr query log shows that the POST data has been added to the query param string: [20200306T112358,780] [my_coll_shard1_replica_n87] webapp=/solr path=/update params={commit=true&KEY__9927.1{"result":0,"jobId":"9459695","jobNumber":"9927.1"}} status=0 QTime=30 What is happening here? $ python3 -VV Python 3.7.6 (default, Dec 30 2019, 19:38:26) [Clang 11.0.0 (clang-1100.0.33.16)] ---------- components: Library (Lib) messages: 363502 nosy: henrik242 priority: normal severity: normal status: open title: urllib.request.urlopen sends POST data as query string type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:14:20 2020 From: report at bugs.python.org (Adrian Petrescu) Date: Fri, 06 Mar 2020 13:14:20 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583500460.18.0.925528089796.issue39875@roundup.psfhosted.org> Adrian Petrescu added the comment: This is not a bug, you've just misunderstood the urllib API. If you want to pass POST data as a payload, it's the second `data` parameter to `urlopen`: https://bugs.python.org/?@action=confrego&otk=KX9AqsI0JnOLkplIY1AGKXAmDKa38COy ---------- nosy: +apetresc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:16:04 2020 From: report at bugs.python.org (Adrian Petrescu) Date: Fri, 06 Mar 2020 13:16:04 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583500564.49.0.829654466784.issue39875@roundup.psfhosted.org> Adrian Petrescu added the comment: (Oops, that was a bad paste! I meant this link: https://docs.python.org/2/library/urllib.html#urllib.urlopen) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:16:39 2020 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 06 Mar 2020 13:16:39 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583500599.94.0.384829018908.issue39871@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +18164 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:18:16 2020 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 06 Mar 2020 13:18:16 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1583500696.2.0.451495687607.issue39871@roundup.psfhosted.org> Zackery Spytz added the comment: I have created a pull request to fix this issue. Please consider taking a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:41:31 2020 From: report at bugs.python.org (Andreas Spar) Date: Fri, 06 Mar 2020 13:41:31 +0000 Subject: [issue39876] csv.DictReader.fieldnames interprets unicode as ascii Message-ID: <1583502091.92.0.330932178287.issue39876@roundup.psfhosted.org> New submission from Andreas Spar : with open(filename, "rt") as csvfile: csv_reader = csv.DictReader(csvfile, delimiter=csv_delimiter) filednames = csv_reader.fieldnames In Python 3.8 csv expects utf-8 encoded files but apperently doens't read the header with utf-8 format. If the csv file has an header named 'Franz?sisch' it will be saved as 'Franz??sisch'. ---------- components: Library (Lib) messages: 363506 nosy: sparan priority: normal severity: normal status: open title: csv.DictReader.fieldnames interprets unicode as ascii type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 08:54:53 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Fri, 06 Mar 2020 13:54:53 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583502893.03.0.246780137212.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: Thank you for helping me out brandtbucher. As per my understanding, I am looking into the code (https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst) and finding where the code doesn't follow the pattern described in (https://www.python.org/dev/peps/pep-0572/.) Please let me know if I am correct so that I will quickly go through everything and send you a pull request as soon as possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:04:23 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 14:04:23 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583503463.71.0.298645029811.issue39875@roundup.psfhosted.org> henrik242 added the comment: But why can't the payload be in the Request object? >From the api docs: class urllib.request.Request(url, data=None, headers={}, origin_req_host=None, unverifiable=False, method=None) data must be an object specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data. The supported object types include bytes, file-like objects, and iterables. https://docs.python.org/3.7/library/urllib.request.html#urllib.request.Request ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:05:18 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Fri, 06 Mar 2020 14:05:18 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583503518.2.0.624978200632.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: I am also checking your commit for this: (https://github.com/python/cpython/commit/8bae21962bab2fac7630982abd73676b89930902) and see that you are changing the "expression: to "assignment_expression". Do I have to fill what assignment expression does with some examples? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:05:44 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 14:05:44 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583503544.87.0.24766317499.issue39875@roundup.psfhosted.org> henrik242 added the comment: Further: method should be a string that indicates the HTTP request method that will be used (e.g. 'HEAD'). If provided, its value is stored in the method attribute and is used by get_method(). The default is 'GET' if data is None or 'POST' otherwise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:15:27 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 14:15:27 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583504127.46.0.516661941769.issue39875@roundup.psfhosted.org> henrik242 added the comment: Also, it seems that urllib.urlopen just creates a similar Request object when given a data paramenter: def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): # accept a URL or a Request object if isinstance(fullurl, str): req = Request(fullurl, data) else: req = fullurl if data is not None: req.data = data >From https://github.com/python/cpython/blob/3.7/Lib/urllib/request.py#L507 via https://github.com/python/cpython/blob/3.7/Lib/urllib/request.py#L222 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:22:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:22:28 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process Message-ID: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> New submission from STINNER Victor : Sometimes, test_multiprocessing_spawn does crash in PyEval_RestoreThread() on FreeBSD with a coredump. This issue should be the root cause of bpo-39088: "test_concurrent_futures crashed with python.core core dump on AMD64 FreeBSD Shared 3.x", where the second comment is a test_multiprocessing_spawn failure with "... After: ['python.core'] ..." # Thread 1 (gdb) frame #0 0x00000000003b518c in PyEval_RestoreThread (tstate=0x801f23790) at Python/ceval.c:387 387 _PyRuntimeState *runtime = tstate->interp->runtime; (gdb) p tstate->interp $3 = (PyInterpreterState *) 0xdddddddddddddddd (gdb) info threads Id Target Id Frame * 1 LWP 100839 0x00000000003b518c in PyEval_RestoreThread (tstate=0x801f23790) at Python/ceval.c:387 2 LWP 100230 0x00000008006fbcfc in _fini () from /lib/libm.so.5 3 LWP 100192 _accept4 () at _accept4.S:3 # Thread 2 (gdb) thread 2 [Switching to thread 2 (LWP 100230)] #0 0x00000008006fbcfc in _fini () from /lib/libm.so.5 (gdb) where (...) #4 0x0000000800859431 in exit (status=0) at /usr/src/lib/libc/stdlib/exit.c:74 #5 0x000000000048f3d8 in Py_Exit (sts=0) at Python/pylifecycle.c:2349 (...) The problem is that Python already freed the memory of all PyThreadState structures, whereas PyEval_RestoreThread(tstate) dereferences tstate to get the _PyRuntimeState structure: void PyEval_RestoreThread(PyThreadState *tstate) { assert(tstate != NULL); _PyRuntimeState *runtime = tstate->interp->runtime; // <==== HERE === struct _ceval_runtime_state *ceval = &runtime->ceval; assert(gil_created(&ceval->gil)); int err = errno; take_gil(ceval, tstate); exit_thread_if_finalizing(tstate); errno = err; _PyThreadState_Swap(&runtime->gilstate, tstate); } I modified PyEval_RestoreThread(tstate) to get runtime from tstate: commit 01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a. Extract of the change: diff --git a/Python/ceval.c b/Python/ceval.c index 9f4b43615e..ee13fd1ad7 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -384,7 +386,7 @@ PyEval_SaveThread(void) void PyEval_RestoreThread(PyThreadState *tstate) { - _PyRuntimeState *runtime = &_PyRuntime; + _PyRuntimeState *runtime = tstate->interp->runtime; struct _ceval_runtime_state *ceval = &runtime->ceval; if (tstate == NULL) { @@ -394,7 +396,7 @@ PyEval_RestoreThread(PyThreadState *tstate) int err = errno; take_gil(ceval, tstate); - exit_thread_if_finalizing(runtime, tstate); + exit_thread_if_finalizing(tstate); errno = err; _PyThreadState_Swap(&runtime->gilstate, tstate); By the way, exit_thread_if_finalizing(tstate) also get runtime from state. Before 01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a, it was possible to call PyEval_RestoreThread() from a daemon thread even if tstate was a dangling pointer, since tstate wasn't dereferenced: _PyRuntime variable was accessed directly. -- One simple fix is to access directly _PyRuntime in PyEval_RestoreThread() with a comment explaining why runtime is not get from tstate. I'm concerned by the fact that only FreeBSD buildbot spotted the crash. test_multiprocessing_spawn seems to silently ignore crashes. The bug was only spotted because Python produced a coredump in the current directory. My Fedora 31 doesn't write coredump files in the current files, and so the issue is silently ignored even when using --fail-env-changed. IMHO the most reliable solution is to drop support for daemon threads: they are dangerous by design. But that would be an incompatible change. Maybe we should at least deprecate daemon threads. Python 3.9 now denies spawning a daemon thread in a Python subinterpreter: bpo-37266. ---------- components: Interpreter Core messages: 363512 nosy: eric.snow, nanjekyejoannah, ncoghlan, pablogsal, vstinner priority: normal severity: normal status: open title: Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:25:57 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 14:25:57 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583504757.52.0.54105742031.issue39875@roundup.psfhosted.org> henrik242 added the comment: The following gives the same failing result too :( >>> import urllib.request >>> data = 'KEY__9927.1{"result":0,"jobId":"9459695","jobNumber":"9927.1"}' >>> url = 'http://solr.example.no:12699/solr/my_coll/update?commit=true' >>> res = urllib.request.urlopen(url, data.encode('utf-8')) I guess I'll have to whip out Wireshark and see what's going on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:33:17 2020 From: report at bugs.python.org (Dave Liptack) Date: Fri, 06 Mar 2020 14:33:17 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583505197.67.0.466200697172.issue39852@roundup.psfhosted.org> Dave Liptack added the comment: Like goto, right-click also exhibits this behavior. Should selection_clear also be added to right-click code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:44:41 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 14:44:41 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583505881.83.0.278097590183.issue39875@roundup.psfhosted.org> henrik242 added the comment: Here's the wireshark output. It seems that urllib adds a "Connection: close" which curl doesn't. Solr doesn't seem to like that. Curl message: POST /solr/my_coll/update?commit=true HTTP/1.1 Host: solr.example.no:12699 User-Agent: curl/7.64.1 Accept: */* Content-Length: 138 Content-Type: application/x-www-form-urlencoded KEY__9927.1{"result":0,"jobId":"9459695","jobNumber":"9927.1"} Python message: POST /solr/my_coll/update?commit=true HTTP/1.1 Accept-Encoding: identity Content-Type: application/x-www-form-urlencoded Content-Length: 138 Host: solr.example.no:12699 User-Agent: Python-urllib/3.7 Connection: close KEY__9927.1{"result":0,"jobId":"9459695","jobNumber":"9927.1"} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:49:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:49:43 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583506183.32.0.152815722881.issue39877@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file48958/daemon_threads_exit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:50:31 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Fri, 06 Mar 2020 14:50:31 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583506231.43.0.281899647619.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: I got it that I have to fill the "Assignment expression" section in the code. I am working on it and send you the for review once I am done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:51:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:51:15 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583506275.98.0.437066930012.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: To reproduce the bug on Linux: * apply attached slow_exit.patch to sleep 1 second just before exiting the process, in the main() function * run: ./python daemon_threads_exit.py # attached file Example: --- $ ./python daemon_threads_exit.py Start 100 daemon threads Exit Python main thread Erreur de segmentation (core dumped) --- ---------- keywords: +patch Added file: https://bugs.python.org/file48959/slow_exit.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:51:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:51:46 +0000 Subject: [issue39088] test_concurrent_futures crashed with python.core core dump on AMD64 FreeBSD Shared 3.x In-Reply-To: <1576690668.17.0.971544115619.issue39088@roundup.psfhosted.org> Message-ID: <1583506306.07.0.194801792776.issue39088@roundup.psfhosted.org> STINNER Victor added the comment: I identified the root cause: bpo-39877. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:52:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:52:22 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583506342.43.0.530088796036.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: > This issue should be the root cause of bpo-39088: "test_concurrent_futures crashed with python.core core dump on AMD64 FreeBSD Shared 3.x", (...) I marked bpo-39088 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:53:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:53:16 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583506396.46.0.676310852477.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: Patch to get a cleaner error if the bug occurs, but also to make the bug more reliable: diff --git a/Python/ceval.c b/Python/ceval.c index ef4aac2f9a..8bf1e4766d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -382,7 +382,8 @@ PyEval_SaveThread(void) void PyEval_RestoreThread(PyThreadState *tstate) { - assert(tstate != NULL); + assert(!_PyMem_IsPtrFreed(tstate)); + assert(!_PyMem_IsPtrFreed(tstate->interp)); _PyRuntimeState *runtime = tstate->interp->runtime; struct _ceval_runtime_state *ceval = &runtime->ceval; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 09:55:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 14:55:35 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583506535.74.0.0587906836832.issue39873@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1fb5a9f394a6fdf62e21b96080c3257c959cf8c9 by Victor Stinner in branch 'master': bpo-39873: PyObject_Init() uses PyObject_INIT() (GH-18804) https://github.com/python/cpython/commit/1fb5a9f394a6fdf62e21b96080c3257c959cf8c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 10:13:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 15:13:13 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583507593.05.0.467611030078.issue39873@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18165 pull_request: https://github.com/python/cpython/pull/18807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 10:14:24 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Mar 2020 15:14:24 +0000 Subject: [issue39876] csv.DictReader.fieldnames interprets unicode as ascii In-Reply-To: <1583502091.92.0.330932178287.issue39876@roundup.psfhosted.org> Message-ID: <1583507664.03.0.569910962639.issue39876@roundup.psfhosted.org> Serhiy Storchaka added the comment: csv.DictReader does not work with encodings. It works with already decoded strings. You have to specify the correct encoding in open() (and "t" in mode is ignored): with open(filename, "r", encoding="utf-8") as csvfile: By default open() uses locale encoding. It is likely 'cp1252' on American and Western European Windows. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 10:46:10 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 06 Mar 2020 15:46:10 +0000 Subject: [issue39872] Remove unused args from two functions in Python/symtable.c In-Reply-To: <1583476312.99.0.496322079949.issue39872@roundup.psfhosted.org> Message-ID: <1583509570.31.0.242822915853.issue39872@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 9566842e892c1f600e1dcfadaab4643be8f32901 by Andy Lester in branch 'master': closes bpo-39872: Remove unused args from symtable_exit_block and symtable_visit_annotations. (GH-18800) https://github.com/python/cpython/commit/9566842e892c1f600e1dcfadaab4643be8f32901 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 11:01:56 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Mar 2020 16:01:56 +0000 Subject: [issue39874] Heappush of Maxheap version does not exist In-Reply-To: <1583489511.06.0.0647402677335.issue39874@roundup.psfhosted.org> Message-ID: <1583510516.22.0.127140166741.issue39874@roundup.psfhosted.org> Raymond Hettinger added the comment: The maxheap is not part of the public API. It is for internal use by merge() and nsmallest(). ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 11:13:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 16:13:24 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583511204.29.0.10284105815.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18166 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 11:51:38 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 16:51:38 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583513498.0.0.937085681068.issue39573@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18167 pull_request: https://github.com/python/cpython/pull/18809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:06:48 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 17:06:48 +0000 Subject: [issue39878] Remove unused args in Python/formatter_unicode.c Message-ID: <1583514408.07.0.994530274834.issue39878@roundup.psfhosted.org> New submission from Andy Lester : The following functions have unused args: calc_number_widths -> PyObject *number fill_number -> Py_ssize_t d_end ---------- components: Interpreter Core messages: 363525 nosy: petdance priority: normal severity: normal status: open title: Remove unused args in Python/formatter_unicode.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:09:54 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 17:09:54 +0000 Subject: [issue39878] Remove unused args in Python/formatter_unicode.c In-Reply-To: <1583514408.07.0.994530274834.issue39878@roundup.psfhosted.org> Message-ID: <1583514594.32.0.0460646756293.issue39878@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18168 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:24:14 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 06 Mar 2020 17:24:14 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583515454.38.0.330733658836.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 57c9d1725689dde068a7fccaa7500772ecd16d2e by Brandt Bucher in branch 'master': bpo-36144: Implement defaultdict union (GH-18729) https://github.com/python/cpython/commit/57c9d1725689dde068a7fccaa7500772ecd16d2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:31:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 17:31:16 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583515876.46.0.230972559936.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18169 pull_request: https://github.com/python/cpython/pull/18811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:34:15 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 06 Mar 2020 17:34:15 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583516055.45.0.21845144613.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: Still waiting for ChainMap -- what else? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:51:08 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 17:51:08 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583517068.46.0.173868581324.issue36144@roundup.psfhosted.org> Brandt Bucher added the comment: My brother will have a ChainMap PR up soon. I'm just finishing up MappingProxyType, myself. Probably both this weekend. Then I'll move on to OrderedDict, which looks like it could be tricky. I'll need to familiarize myself with the implementation better (unless there's somebody who is already familiar with it who wants to take over). It looks well-commented, though. I think we can pass on the http.cookies subclasses since there don't appear to be any experts/maintainers for that module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 12:57:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 17:57:51 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1583517471.95.0.916781116327.issue39873@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9a73705a1d0cb8b89d0a20add2ffa2c4d32950ed by Victor Stinner in branch 'master': bpo-39873: Cleanup _PyObject_CheckConsistency() (GH-18807) https://github.com/python/cpython/commit/9a73705a1d0cb8b89d0a20add2ffa2c4d32950ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:20:52 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 18:20:52 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583518852.18.0.412417098828.issue17422@roundup.psfhosted.org> miss-islington added the comment: New changeset e59334ebc9308b0f3ad048ef293c6b49e6456d1a by Caleb Donovick in branch 'master': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/e59334ebc9308b0f3ad048ef293c6b49e6456d1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:21:15 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 18:21:15 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583518875.19.0.0615346222294.issue17422@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18170 pull_request: https://github.com/python/cpython/pull/18812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:21:21 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 18:21:21 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583518881.55.0.807776798692.issue17422@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18171 pull_request: https://github.com/python/cpython/pull/18813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:25:54 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 18:25:54 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583519154.76.0.29844990846.issue17422@roundup.psfhosted.org> miss-islington added the comment: New changeset f1b79645cf18b2c212cd26d547cd1762fd534d4b by Miss Islington (bot) in branch '3.7': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/f1b79645cf18b2c212cd26d547cd1762fd534d4b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:26:56 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Mar 2020 18:26:56 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583519216.32.0.0498687359496.issue17422@roundup.psfhosted.org> miss-islington added the comment: New changeset 6df0c47669031c6a8e9b1a07ec2c5813e4c10ee0 by Miss Islington (bot) in branch '3.8': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/6df0c47669031c6a8e9b1a07ec2c5813e4c10ee0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:33:48 2020 From: report at bugs.python.org (Eric Snow) Date: Fri, 06 Mar 2020 18:33:48 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. Message-ID: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> New submission from Eric Snow : As of 3.7 [1], dict is guaranteed to preserve insertion order: the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec. However, at least one key part of the language reference [2] was not updated to reflect this: "3.2. The standard type hierarchy" > "Mappings" > "Dictionaries". Note that the library docs [3] *were* updated. [1] https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights [2] https://docs.python.org/3/reference/datamodel.html#index-30 [3] https://docs.python.org/3/library/stdtypes.html#typesmapping ---------- assignee: docs at python components: Documentation keywords: easy messages: 363533 nosy: docs at python, eric.snow priority: normal severity: normal stage: needs patch status: open title: Update language reference to specify that dict is insertion-ordered. versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:38:42 2020 From: report at bugs.python.org (Eric Snow) Date: Fri, 06 Mar 2020 18:38:42 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583519922.47.0.466544963265.issue17422@roundup.psfhosted.org> Eric Snow added the comment: Thanks for fixing that, Caleb! FWIW, I've opened a separate issue (#39879) for adding a note in the language reference about dict ordering. Sorry for the confusion. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 13:44:06 2020 From: report at bugs.python.org (Eric Snow) Date: Fri, 06 Mar 2020 18:44:06 +0000 Subject: [issue37497] Add inspect.Signature.from_text(). In-Reply-To: <1562199086.77.0.800086984204.issue37497@roundup.psfhosted.org> Message-ID: <1583520246.91.0.500487213011.issue37497@roundup.psfhosted.org> Eric Snow added the comment: Honestly, I don't recall exactly the concrete use case for which I opened this. :) I *think* it was related to applying a more restrictive signature onto an existing function (e.g. with a decorator). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:13:51 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 19:13:51 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583522031.76.0.87305651827.issue36144@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +18172 pull_request: https://github.com/python/cpython/pull/18814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:19:01 2020 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 06 Mar 2020 19:19:01 +0000 Subject: [issue39810] Generic script for finding bugs in get_source_segment In-Reply-To: <1583063945.36.0.652749436793.issue39810@roundup.psfhosted.org> Message-ID: <1583522341.62.0.90589490577.issue39810@roundup.psfhosted.org> Change by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:40:53 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 19:40:53 +0000 Subject: [issue16845] warnings.simplefilter should validate input In-Reply-To: <1357173726.64.0.0586309357998.issue16845@psf.upfronthosting.co.za> Message-ID: <1583523653.24.0.419989353998.issue16845@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:47:18 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 19:47:18 +0000 Subject: [issue16891] Fix docs about module search order In-Reply-To: <1357632871.49.0.196561776247.issue16891@psf.upfronthosting.co.za> Message-ID: <1583524038.32.0.305338125939.issue16891@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:50:01 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 19:50:01 +0000 Subject: [issue16894] Function attribute access doesn't invoke methods in dict subclasses In-Reply-To: <1357670592.25.0.470525675752.issue16894@psf.upfronthosting.co.za> Message-ID: <1583524201.83.0.869799450628.issue16894@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 14:54:02 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 19:54:02 +0000 Subject: [issue16981] ImportError hides real error when there too many open files during an import In-Reply-To: <1358353085.87.0.599698387339.issue16981@psf.upfronthosting.co.za> Message-ID: <1583524442.14.0.641822445095.issue16981@roundup.psfhosted.org> Brett Cannon added the comment: Now that importlib is import and it would raise OSError I'm closing this as fixed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:00:35 2020 From: report at bugs.python.org (Matt Wozniski) Date: Fri, 06 Mar 2020 20:00:35 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583524835.18.0.230178099237.issue38894@roundup.psfhosted.org> Matt Wozniski added the comment: A simple test case for this issue: ~>mkdir tmp ~>cd tmp tmp>touch 1.txt tmp>ln -s subdir/file 2.txt tmp>touch 3.txt tmp>ls -l total 0 -rw-rw-r-- 1 mwoznisk general 0 Mar 6 14:52 1.txt lrwxrwxrwx 1 mwoznisk general 11 Mar 6 14:52 2.txt -> subdir/file -rw-rw-r-- 1 mwoznisk general 0 Mar 6 14:52 3.txt tmp>python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt'), PosixPath('2.txt'), PosixPath('3.txt')] tmp>mkdir subdir tmp>python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt'), PosixPath('2.txt'), PosixPath('3.txt'), PosixPath('subdir')] So far so good, but if the subdirectory isn't readable, things fall apart: tmp>chmod 000 subdir tmp>python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt')] Looks like this is caused by entry.is_dir() in pathlib._WildcardSelector raising a PermissionError when trying to check if a symlink pointing into an unreadable directory is or isn't a directory. EACCESS isn't in IGNORED_ERROS (sic) and so the loop over directory entries is broken out of, and the "except PermissionError:" block in _select_from swallows the exception so that the failure is silent. ---------- nosy: +Matt Wozniski versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:01:35 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:01:35 +0000 Subject: [issue17004] Expand zipimport to include other compression methods In-Reply-To: <1358707302.86.0.811743649739.issue17004@psf.upfronthosting.co.za> Message-ID: <1583524895.18.0.714705178105.issue17004@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:03:29 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:03:29 +0000 Subject: [issue17231] Mark __del__ not being called in cycles as an impl detail In-Reply-To: <1361254972.69.0.594313111975.issue17231@psf.upfronthosting.co.za> Message-ID: <1583525009.67.0.930680554756.issue17231@roundup.psfhosted.org> Brett Cannon added the comment: I believe this is covered in the latest docs for (at least) 3.9. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:04:29 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:04:29 +0000 Subject: [issue17296] Cannot unpickle classes derived from 'Exception' In-Reply-To: <1361811616.55.0.878692548703.issue17296@psf.upfronthosting.co.za> Message-ID: <1583525069.71.0.374258232876.issue17296@roundup.psfhosted.org> Brett Cannon added the comment: As this was fixed in 3.3 that means all actively maintained versions have the fix, and so closing as fixed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:05:16 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:05:16 +0000 Subject: [issue17620] Python interactive console doesn't use sys.stdin for input In-Reply-To: <1364921954.86.0.527255608282.issue17620@psf.upfronthosting.co.za> Message-ID: <1583525116.28.0.017596600071.issue17620@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:07:40 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Mar 2020 20:07:40 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583525260.2.0.262520800928.issue38894@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- assignee: -> pablogsal nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:14:11 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:14:11 +0000 Subject: [issue17716] From ... import fails when parent package failed but child module succeeded, yet works in std import case In-Reply-To: <1365869097.02.0.582677403017.issue17716@psf.upfronthosting.co.za> Message-ID: <1583525651.05.0.223755617798.issue17716@roundup.psfhosted.org> Brett Cannon added the comment: Import now has proper messaging of the failure in the package and not an error about being unable to import the submodule. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:14:29 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:14:29 +0000 Subject: [issue17848] can't compile with clang and build a shared lib due to libffi In-Reply-To: <1366961546.37.0.678140272964.issue17848@psf.upfronthosting.co.za> Message-ID: <1583525669.47.0.146781999096.issue17848@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:18:13 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:18:13 +0000 Subject: [issue18114] Update PyImport_ImportFrozenModuleObject() to set __package__ In-Reply-To: <1370056399.99.0.692031308648.issue18114@psf.upfronthosting.co.za> Message-ID: <1583525893.03.0.0592928189604.issue18114@roundup.psfhosted.org> Brett Cannon added the comment: Since there's work to drop __package__, closing as "won't fix". ---------- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:19:38 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:19:38 +0000 Subject: [issue18269] Add new parameter format for converter function w/ position number In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1583525978.97.0.668866047648.issue18269@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:21:57 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:21:57 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1583526117.8.0.553151789408.issue18275@roundup.psfhosted.org> Brett Cannon added the comment: After 6 years and no really movement I don't think we are going to bother to change the semantics for this. :) ---------- resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:24:31 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:24:31 +0000 Subject: [issue18307] Relative path in co_filename for zipped modules In-Reply-To: <1372256829.94.0.0966099631525.issue18307@psf.upfronthosting.co.za> Message-ID: <1583526271.95.0.4259125154.issue18307@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:24:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:24:51 +0000 Subject: [issue18717] test for request.urlretrieve In-Reply-To: <1376336214.18.0.793709816185.issue18717@psf.upfronthosting.co.za> Message-ID: <1583526291.52.0.676810513673.issue18717@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:28:16 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:28:16 +0000 Subject: [issue18831] importlib.import_module() bypasses builtins.__import__ In-Reply-To: <1377443801.78.0.926402532335.issue18831@psf.upfronthosting.co.za> Message-ID: <1583526496.06.0.911228093046.issue18831@roundup.psfhosted.org> Brett Cannon added the comment: I'm calling it and saying people are not expecting these semantics. ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:28:30 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:28:30 +0000 Subject: [issue18834] Add Clang to distutils to build C/C++ extensions In-Reply-To: <1377459226.15.0.775642351727.issue18834@psf.upfronthosting.co.za> Message-ID: <1583526510.81.0.129363882338.issue18834@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:29:42 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:29:42 +0000 Subject: [issue18862] Implement __subclasshook__() for Finders and Loaders in importlib.abc In-Reply-To: <1377659436.77.0.0929523139133.issue18862@psf.upfronthosting.co.za> Message-ID: <1583526582.47.0.962310636067.issue18862@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:30:24 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:30:24 +0000 Subject: [issue18961] Non-UTF8 encoding line In-Reply-To: <1378568149.13.0.824239204214.issue18961@psf.upfronthosting.co.za> Message-ID: <1583526624.03.0.309521768923.issue18961@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:30:44 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:30:44 +0000 Subject: [issue19081] zipimport behaves badly when the zip file changes while the process is running In-Reply-To: <1379995203.41.0.89812771706.issue19081@psf.upfronthosting.co.za> Message-ID: <1583526644.25.0.390987527163.issue19081@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:33:16 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 20:33:16 +0000 Subject: [issue12849] Cannot override 'connection: close' in urllib2 headers In-Reply-To: <1314559168.55.0.630424901631.issue12849@psf.upfronthosting.co.za> Message-ID: <1583526796.81.0.382304594368.issue12849@roundup.psfhosted.org> henrik242 added the comment: That mandatory "Connection: close" makes it impossible to POST a data request to Solr, as described in https://bugs.python.org/issue39875 It would be very helpful if it could be made optional. ---------- nosy: +henrik242 versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:33:53 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:33:53 +0000 Subject: [issue19257] Sub-optimal error message when importing a non-package In-Reply-To: <1381735755.7.0.417601101762.issue19257@psf.upfronthosting.co.za> Message-ID: <1583526833.25.0.272232629613.issue19257@roundup.psfhosted.org> Brett Cannon added the comment: I'm going to make a call and say the chained exception should stay. If people want to start the discussion again they can. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:34:35 2020 From: report at bugs.python.org (henrik242) Date: Fri, 06 Mar 2020 20:34:35 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583526875.55.0.684438006916.issue39875@roundup.psfhosted.org> henrik242 added the comment: Root cause for this seems to be https://bugs.python.org/issue12849 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:36:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:36:51 +0000 Subject: [issue19298] Use __attribute__(cleanup ...) to detect refleaks In-Reply-To: <1382193451.78.0.278113981899.issue19298@psf.upfronthosting.co.za> Message-ID: <1583527011.14.0.16778789225.issue19298@roundup.psfhosted.org> Brett Cannon added the comment: This is still a neat idea. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:37:44 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Mar 2020 20:37:44 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583527064.11.0.877684847755.issue38894@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I fail to reproduce this last example: ~/github/python/master master* ? mkdir tmp ~/github/python/master master* ? cd tmp ~/github/python/master/tmp master* ? touch 1.txt ~/github/python/master/tmp master* ? ln -s subdir/file 2.txt ~/github/python/master/tmp master* ? touch 3.txt ~/github/python/master/tmp master* ? python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt'), PosixPath('3.txt'), PosixPath('2.txt')] ~/github/python/master/tmp master* ? mkdir subdir ~/github/python/master/tmp master* ? python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt'), PosixPath('subdir'), PosixPath('3.txt'), PosixPath('2.txt')] ~/github/python/master/tmp master* ? chmod 000 subdir ~/github/python/master/tmp master* ? python3.8 -c "import pathlib; print(list(pathlib.Path('.').glob('*')))" [PosixPath('1.txt'), PosixPath('subdir'), PosixPath('3.txt')] ---------- keywords: +3.7regression, 3.8regression versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:40:08 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:40:08 +0000 Subject: [issue19531] Loading -OO bytecode files if -O was requested can lead to problems In-Reply-To: <1383976647.12.0.628513721742.issue19531@psf.upfronthosting.co.za> Message-ID: <1583527208.43.0.719742531478.issue19531@roundup.psfhosted.org> Brett Cannon added the comment: .pyc files now include their optimization levels in their file names. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:43:24 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:43:24 +0000 Subject: [issue19533] Unloading docstrings from memory if -OO is given In-Reply-To: <1383980059.61.0.697157457336.issue19533@psf.upfronthosting.co.za> Message-ID: <1583527404.46.0.0342713368097.issue19533@roundup.psfhosted.org> Brett Cannon added the comment: Do note that .pyc files now encode their optimization levels, so the only thing to potentially do here is change the compiler to toss docstrings out and make sure they are freed when they are parsed to avoid holding on to them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:43:28 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:43:28 +0000 Subject: [issue19533] Unloading docstrings from memory if -OO is given In-Reply-To: <1383980059.61.0.697157457336.issue19533@psf.upfronthosting.co.za> Message-ID: <1583527408.49.0.425006366832.issue19533@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:44:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:44:51 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1583527491.25.0.601744799434.issue19698@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: docs at python -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:46:18 2020 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 06 Mar 2020 20:46:18 +0000 Subject: [issue37497] Add inspect.Signature.from_text(). In-Reply-To: <1562199086.77.0.800086984204.issue37497@roundup.psfhosted.org> Message-ID: <1583527578.87.0.287795798885.issue37497@roundup.psfhosted.org> Yury Selivanov added the comment: I'd be fine with `Signature.from_text()`, but not with `Signature` constructor / `signature()` function accepting both callable and string arguments. Overall, I think that we ought to have a real need to add this new API, so unless there's a good (or any, really) use case I'd say we shouldn't merge this now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:47:02 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:47:02 +0000 Subject: [issue19941] python -m imports non-ASCII .py file without encoding declaration In-Reply-To: <1386673497.85.0.313178291575.issue19941@psf.upfronthosting.co.za> Message-ID: <1583527622.56.0.497712771627.issue19941@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:50:35 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:50:35 +0000 Subject: [issue21031] [patch] Add AlpineLinux to the platform module's supported distributions list In-Reply-To: <1395547536.87.0.0316178193706.issue21031@psf.upfronthosting.co.za> Message-ID: <1583527835.78.0.239326502284.issue21031@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:51:30 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:51:30 +0000 Subject: [issue12238] Readline module loading in interactive mode In-Reply-To: <1307015860.03.0.129842780518.issue12238@psf.upfronthosting.co.za> Message-ID: <1583527890.58.0.853972348712.issue12238@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:52:34 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:52:34 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583527954.27.0.282838676985.issue14126@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 15:52:42 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Mar 2020 20:52:42 +0000 Subject: [issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons In-Reply-To: <1398880816.89.0.350834147614.issue21401@psf.upfronthosting.co.za> Message-ID: <1583527962.04.0.661459664923.issue21401@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:00:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Mar 2020 21:00:29 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583528429.5.0.936776711987.issue38894@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg363548 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:01:22 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Mar 2020 21:01:22 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583528482.45.0.780756285409.issue38894@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, I managed to reproduce. This seems a regression introduced by https://github.com/python/cpython/pull/11988 in issue https://bugs.python.org/issue36035. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:08:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Mar 2020 21:08:05 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583528885.23.0.83667752529.issue38894@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +18173 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:10:21 2020 From: report at bugs.python.org (Jan Christoph) Date: Fri, 06 Mar 2020 21:10:21 +0000 Subject: [issue27793] Double underscore variables in module are mangled when used in class In-Reply-To: <1471523246.01.0.475585276103.issue27793@psf.upfronthosting.co.za> Message-ID: <1583529021.99.0.809788078794.issue27793@roundup.psfhosted.org> Jan Christoph added the comment: In particular, this might conflict with the documentation of global, which states: > If the target is an identifier (name): > > If the name does not occur in a global statement in the current code block: the name is bound to the object in the current local namespace. > > Otherwise: the name is bound to the object in the current global namespace. There is no exception of names that are within the body of a class object and start (but not end) with double underscores. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:14:13 2020 From: report at bugs.python.org (Matheus Vieira Portela) Date: Fri, 06 Mar 2020 21:14:13 +0000 Subject: [issue39861] French doc __futur__: Bad URL In-Reply-To: <1583401195.98.0.339356939479.issue39861@roundup.psfhosted.org> Message-ID: <1583529253.7.0.17855962052.issue39861@roundup.psfhosted.org> Matheus Vieira Portela added the comment: The PR has already been merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:14:18 2020 From: report at bugs.python.org (Clayton Bingham) Date: Fri, 06 Mar 2020 21:14:18 +0000 Subject: [issue39880] string.lstrip() with leading '3's Message-ID: <1583529258.07.0.323990026349.issue39880@roundup.psfhosted.org> New submission from Clayton Bingham : Code to reproduce the behavior: ``` string = 'h.pt3dadd(3333.994527806812,7310.741605031661,-152.492,0.2815384615384615,sec=sectionList[1396])\n' print(string.lstrip('h.pt3dadd(').split(',')) ``` The lstrip method removed 'h.pt3dadd(' but also removes the 3's before the first decimal in the remaining string. ---------- messages: 363555 nosy: Clayton Bingham priority: normal severity: normal status: open title: string.lstrip() with leading '3's versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:27:28 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 06 Mar 2020 21:27:28 +0000 Subject: [issue39791] New `files()` api from importlib_resources. In-Reply-To: <1582949490.73.0.868974160192.issue39791@roundup.psfhosted.org> Message-ID: <1583530048.27.0.456260639574.issue39791@roundup.psfhosted.org> Jason R. Coombs added the comment: The latest release, 1.3.0, includes extensibility support and has been merged with the cpython branch of the importlib_resources project. I believe that code is now synced with this project and ready to be applied here. I'm hoping benthayer can apply the changes and submit the pr. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:34:21 2020 From: report at bugs.python.org (Luca) Date: Fri, 06 Mar 2020 21:34:21 +0000 Subject: [issue39809] argparse: add max_text_width parameter to ArgumentParser In-Reply-To: <1583060059.73.0.28112169594.issue39809@roundup.psfhosted.org> Message-ID: <1583530461.04.0.995107135688.issue39809@roundup.psfhosted.org> Luca added the comment: The issue has been fixed in `typeshed`, so the following is now allowed: width = min(80, shutil.get_terminal_size().columns - 2) formatter_class = lambda prog: argparse.RawDescriptionHelpFormatter(prog, width=width) https://github.com/python/typeshed/issues/3806#event-3104796040 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:36:39 2020 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Fri, 06 Mar 2020 21:36:39 +0000 Subject: [issue39880] string.lstrip() with leading '3's In-Reply-To: <1583529258.07.0.323990026349.issue39880@roundup.psfhosted.org> Message-ID: <1583530599.53.0.973318223523.issue39880@roundup.psfhosted.org> L?szl? Kiss Koll?r added the comment: The argument in lstrip() is a set of characters which are stripped from the string and not a full substring. As the documentation states: "The chars argument is not a prefix; rather, all combinations of its values are stripped" See https://docs.python.org/3/library/stdtypes.html#str.lstrip. ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:40:27 2020 From: report at bugs.python.org (R. David Murray) Date: Fri, 06 Mar 2020 21:40:27 +0000 Subject: [issue27793] Double underscore variables in module are mangled when used in class In-Reply-To: <1471523246.01.0.475585276103.issue27793@psf.upfronthosting.co.za> Message-ID: <1583530827.01.0.789784759809.issue27793@roundup.psfhosted.org> R. David Murray added the comment: You are welcome to open a doc-enhancement issue for the global docs. For the other, as noted already if you want to advocate for a change to this behavior you need to start on python-ideas, but I don't think you will get any traction. Another possible enhancement you could propose (in a new issue) is to have the global statement check for variables that start with '__' and do something appropriate such as issue a warning...although I don't really know how hard that would be to implement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:44:52 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 06 Mar 2020 21:44:52 +0000 Subject: [issue39127] _Py_HashPointer's void * argument should be const In-Reply-To: <1577162580.85.0.922460323342.issue39127@roundup.psfhosted.org> Message-ID: <1583531092.65.0.103684700123.issue39127@roundup.psfhosted.org> Andy Lester added the comment: Is there more to do here or can it be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:50:45 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 06 Mar 2020 21:50:45 +0000 Subject: [issue39881] Multiple Interpreters in the Stdlib (PEP 554) - High-level Implementation Message-ID: <1583531445.05.0.495452199299.issue39881@roundup.psfhosted.org> New submission from Joannah Nanjekye : This is to track the high-level implementation of PEP 554. Please see the PEP here: https://www.python.org/dev/peps/pep-0554/ *** Note: PEP not accepted yet. ---------- assignee: nanjekyejoannah components: Interpreter Core messages: 363561 nosy: eric.snow, nanjekyejoannah, ncoghlan, vstinner priority: normal severity: normal status: open title: Multiple Interpreters in the Stdlib (PEP 554) - High-level Implementation versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:53:00 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 06 Mar 2020 21:53:00 +0000 Subject: [issue39880] string.lstrip() with leading '3's In-Reply-To: <1583529258.07.0.323990026349.issue39880@roundup.psfhosted.org> Message-ID: <1583531580.2.0.40566192129.issue39880@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:56:03 2020 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Mar 2020 21:56:03 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583531763.53.0.330428146993.issue39868@roundup.psfhosted.org> Brandt Bucher added the comment: Great. Just replacing the TODO line with your new description (and maybe an example) should be perfect! ---------- keywords: -patch stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 16:59:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 21:59:06 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583531946.79.0.147312553842.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18174 pull_request: https://github.com/python/cpython/pull/18816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:06:44 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 06 Mar 2020 22:06:44 +0000 Subject: [issue39881] Multiple Interpreters in the Stdlib (PEP 554) - High-level Implementation In-Reply-To: <1583531445.05.0.495452199299.issue39881@roundup.psfhosted.org> Message-ID: <1583532404.72.0.822852825597.issue39881@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +18175 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:12:29 2020 From: report at bugs.python.org (SilentGhost) Date: Fri, 06 Mar 2020 22:12:29 +0000 Subject: [issue39861] French doc __futur__: Bad URL In-Reply-To: <1583401195.98.0.339356939479.issue39861@roundup.psfhosted.org> Message-ID: <1583532749.9.0.215554568717.issue39861@roundup.psfhosted.org> Change by SilentGhost : ---------- assignee: docs at python -> components: -2to3 (2.x to 3.x conversion tool), Documentation resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:16:16 2020 From: report at bugs.python.org (SilentGhost) Date: Fri, 06 Mar 2020 22:16:16 +0000 Subject: [issue21031] [patch] Add AlpineLinux to the platform module's supported distributions list In-Reply-To: <1395547536.87.0.0316178193706.issue21031@psf.upfronthosting.co.za> Message-ID: <1583532976.17.0.26464375008.issue21031@roundup.psfhosted.org> Change by SilentGhost : ---------- versions: +Python 3.9 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:30:42 2020 From: report at bugs.python.org (Ryan Gonzalez) Date: Fri, 06 Mar 2020 22:30:42 +0000 Subject: [issue18834] Add Clang to distutils to build C/C++ extensions In-Reply-To: <1377459226.15.0.775642351727.issue18834@psf.upfronthosting.co.za> Message-ID: <1583533842.71.0.312254730713.issue18834@roundup.psfhosted.org> Ryan Gonzalez added the comment: Oh my god this was still open? I think you can just use the CC variable, not sure what 6-years-younger-and-more-stupid me was thinking here. Sorry about the noise. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:44:58 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 06 Mar 2020 22:44:58 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583534698.18.0.805131163418.issue39837@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18176 pull_request: https://github.com/python/cpython/pull/18818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:53:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 22:53:21 +0000 Subject: [issue39573] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1583535201.47.0.495013819668.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 557287075c264d2458cd3e1b45e9b8ee5341e0a1 by Andy Lester in branch 'master': bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809) https://github.com/python/cpython/commit/557287075c264d2458cd3e1b45e9b8ee5341e0a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 17:54:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 22:54:10 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name Message-ID: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> New submission from STINNER Victor : Attached PR modify Py_FatalError() to log automatically the function name. ---------- components: C API messages: 363565 nosy: vstinner priority: normal severity: normal status: open title: Py_FatalError(): log automatically the function name versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 18:02:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 23:02:34 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name In-Reply-To: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> Message-ID: <1583535754.17.0.0272877230666.issue39882@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18177 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 18:24:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 23:24:26 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583537066.37.0.808753039559.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520 by Victor Stinner in branch 'master': bpo-39877: _PyRuntimeState.finalizing becomes atomic (GH-18816) https://github.com/python/cpython/commit/7b3c252dc7f44d4bdc4c7c82d225ebd09c78f520 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 18:54:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Mar 2020 23:54:24 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name In-Reply-To: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> Message-ID: <1583538864.37.0.292274122264.issue39882@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9e5d30cc99e34f4c3e7b2cd851de20816c9d1927 by Victor Stinner in branch 'master': bpo-39882: Py_FatalError() logs the function name (GH-18819) https://github.com/python/cpython/commit/9e5d30cc99e34f4c3e7b2cd851de20816c9d1927 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:11:50 2020 From: report at bugs.python.org (Steve Dower) Date: Sat, 07 Mar 2020 00:11:50 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583539910.85.0.336890704426.issue39837@roundup.psfhosted.org> Steve Dower added the comment: New changeset 31350f9af09dcff7cf6ff4b0a0a7ea595942372e by Steve Dower in branch 'master': bpo-39837: Disable macOS tests on Azure Pipelines (GH-18818) https://github.com/python/cpython/commit/31350f9af09dcff7cf6ff4b0a0a7ea595942372e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:12:00 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 00:12:00 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583539920.45.0.848700616203.issue39837@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18178 pull_request: https://github.com/python/cpython/pull/18820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:12:09 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 00:12:09 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583539929.61.0.181362235487.issue39837@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18179 pull_request: https://github.com/python/cpython/pull/18821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:14:10 2020 From: report at bugs.python.org (Steve Dower) Date: Sat, 07 Mar 2020 00:14:10 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583540050.65.0.142775539437.issue39837@roundup.psfhosted.org> Steve Dower added the comment: I've disabled macOS builds on Pipelines, so now they're essentially advisory through the GitHub Actions build. I also pinged some contacts about the not-very-useful behaviour of required checks vs. path filters. So will see what they say. ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:29:55 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 00:29:55 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583540995.78.0.827919259343.issue39837@roundup.psfhosted.org> miss-islington added the comment: New changeset 47b7c227048f2cb019cc3ec2fef7e867f1b232f3 by Miss Islington (bot) in branch '3.7': bpo-39837: Disable macOS tests on Azure Pipelines (GH-18818) https://github.com/python/cpython/commit/47b7c227048f2cb019cc3ec2fef7e867f1b232f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 19:30:13 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 00:30:13 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583541013.54.0.415069032015.issue39837@roundup.psfhosted.org> miss-islington added the comment: New changeset d692d52f4aaeb6feaabb18f18d49907dd578fbeb by Miss Islington (bot) in branch '3.8': bpo-39837: Disable macOS tests on Azure Pipelines (GH-18818) https://github.com/python/cpython/commit/d692d52f4aaeb6feaabb18f18d49907dd578fbeb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 21:10:21 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 07 Mar 2020 02:10:21 +0000 Subject: [issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds In-Reply-To: <1583439339.66.0.539160874229.issue39867@roundup.psfhosted.org> Message-ID: <1583547021.75.0.564913035588.issue39867@roundup.psfhosted.org> Tim Peters added the comment: I've been involved - usually very lightly, but sometimes deeply - with PRNGs for over 40 years. I've never seen anyone raise the kinds of concerns you're raising here, and, frankly, they don't make sense to me. But on the chance that I've missed recent fundamental developments, I did some searching. The state of the art for uniform selection from a range appears to be what the Go language recently adopted, shown as Algorithm 5 in this paper (which also surveys what other languages do): https://arxiv.org/pdf/1805.10941.pdf Nobody gives a rip about "correlations" when reusing an internal state. What they're aiming at is a combination of "no bias" and "peak speed". Python's job is harder, because we couldn't care less what the native machine word size is. For example, randrange(10**500) works fine. Approaches based on chopping back multiplication with a "random" C double can't get more than 53 bits (on most machines), the limit of IEEE-754 format double precision. Python dropped that approach not only because it was slightly biased, but also because it didn't scale to unbounded ranges. The Go approach works like this Python code, where NBITS would be hard coded in C to 32 or 64, depending on the machine word size. Its advantage is that it _usually_ needs no arbitrary divisions (implied by "%") at all, just masking and shifting. At worst, it _may_ need one for-real division. But it's built to work with native machine integer precision, and requires full double-width integer multiplication: from random import randrange NBITS = 64 # need NBITS x NBITS full-precision multiply POWER = 1 << NBITS MASK = POWER - 1 def rr(s): # uniform random int in range(s) assert 0 < s <= POWER x = randrange(POWER) # i.e., a random bitstring with NBITS bits m = x * s # full double-width product r = m & MASK if r < s: t = (POWER - s) % s # the expensive line while r < t: x = randrange(POWER) m = x * s r = m & MASK return m >> NBITS In a nutshell, in each [i * POWER, (i+1) * POWER) clopen interval, it rejects the first POWER % s values, leaving exactly floor(POWER/s) multiples of s in the interval. Of course that suffers "correlations" too if you reuse the seed - although not of the exact microscopic kind you're talking about. You haven't responded to questions about why that specific test is thought to be especially important, or to why you believe you can't do an obvious thing instead (use different seeds, or don't reset the seed at all). As to who's making raw assertions here, the situation isn't symmetric ;-) If you want a change, you have to _make a case_ for it. And a good one. Every core Python developer who has knowledge of this code has now told you they personally don't see any case for it. So, sorry, but the status quo is always favored in the absence of compelling reason to change. There were compelling reasons to switch to the current scheme. As you said yourself: """ And I understand the puzzlement about my test file setting the same random seed and then complaining about correlations. """ That was insightful. The difference is we never got over that puzzlement ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 22:50:57 2020 From: report at bugs.python.org (Todd Jennings) Date: Sat, 07 Mar 2020 03:50:57 +0000 Subject: [issue39883] Use BSD0 license for code in docs Message-ID: <1583553057.27.0.724137569708.issue39883@roundup.psfhosted.org> New submission from Todd Jennings : Currently using code examples and recipes from the documentation is complicated by the fact that they are all under the Python 2.0 license. Putting them under a more permissive license, particular the BSD0 license, would make them much easier to use in other projects. ---------- assignee: docs at python components: Documentation messages: 363573 nosy: docs at python, toddrjen priority: normal pull_requests: 18180 severity: normal status: open title: Use BSD0 license for code in docs type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 23:00:50 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 07 Mar 2020 04:00:50 +0000 Subject: [issue39127] _Py_HashPointer's void * argument should be const In-Reply-To: <1577162580.85.0.922460323342.issue39127@roundup.psfhosted.org> Message-ID: <1583553650.27.0.717206467287.issue39127@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 23:01:46 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 07 Mar 2020 04:01:46 +0000 Subject: [issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons In-Reply-To: <1398880816.89.0.350834147614.issue21401@psf.upfronthosting.co.za> Message-ID: <1583553706.98.0.235218492084.issue21401@roundup.psfhosted.org> Benjamin Peterson added the comment: Python 2 is done. ---------- nosy: +benjamin.peterson resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 23:11:34 2020 From: report at bugs.python.org (Enji Cooper) Date: Sat, 07 Mar 2020 04:11:34 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug Message-ID: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> New submission from Enji Cooper : When a body of C extensions needs to be ported from python <3.8 to 3.8, one of the issues one might run into is improperly defined methods in a C extension, which results in SystemErrors stating: >>> SystemError: bad call flags This new behavior was added as part of Issue # 33012. While the issues definitely need to be resolved in the C extensions, where to start is not completely clear. I had to put `printfs` in PyCFunction_NewEx and PyDescr_NewMethod to track down the issues, e.g., >>> printf("method name: %s\n", method->ml_name); While this might be misleading for duplicate method definitions, it definitely helps narrow down the offending code. Adding the method name to the SystemError would be a big step in the right direction in terms of making it easier to resolve these issues. PS I realize that this might be masked by casting PyCFunction on methods or by not using gcc 8+, but I'd argue that C extensions need to have developer issues like this be clearer to the end-reader. ---------- components: Extension Modules messages: 363575 nosy: ngie priority: normal severity: normal status: open title: "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 6 23:13:26 2020 From: report at bugs.python.org (Ammar Askar) Date: Sat, 07 Mar 2020 04:13:26 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583554406.72.0.223122231931.issue14126@roundup.psfhosted.org> Ammar Askar added the comment: I believe this was implemented in issue33234 ---------- nosy: +ammar2 resolution: -> fixed stage: needs patch -> resolved status: open -> closed superseder: -> Improve list() pre-sizing for inputs with known lengths _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:00:35 2020 From: report at bugs.python.org (Andy Lester) Date: Sat, 07 Mar 2020 05:00:35 +0000 Subject: [issue39878] Remove unused args in Python/formatter_unicode.c In-Reply-To: <1583514408.07.0.994530274834.issue39878@roundup.psfhosted.org> Message-ID: <1583557235.07.0.430291180016.issue39878@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18181 pull_request: https://github.com/python/cpython/pull/18822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:08:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 05:08:09 +0000 Subject: [issue39885] IDLE right click should unselect Message-ID: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> New submission from Terry J. Reedy : In text editors, right click commonly brings up a context menu, often including Cut, Copy, Paste, and Delete, with inapplicable entries grayed out. There are at least 2 'standard' behaviors (at least on Windows) with respect to the cursor and selections. 0 (Examples: Windows Notepad and Firefox entry box). The cursor stays where it is and a selection stays selected, even if one has scrolled the cursor and possible selection off the screen with mousewheel or scrollbar. Paste inserts at the possibly hidden cursor, deleting any possibly hidden selection. The view jumps back to the cursor after Paste but not after Copy and Close (Esc). 1 (Examples: Windows Notepad++ and Libre Office). The cursor jumps to the spot of the click, the same as with a left click. Any selection, possibly not visible, is unselected, the same as with a left click. Exception: a right click within an exception leaves the selection and cursor (at one of the ends) alone. IDLE follows a bit of each pattern and neither. Right click always moves the cursor, even within a selection, but never clears a selection. I believe that this is an accident of history. Originally, context menus only had 'Go to file/line' in Shell and grep output and 'Set/Clear Breakpoint' in editors. There was no reason to touch a selection even if the cursor was moved. Cut/Copy/Paste were added in 2012 because they are standard. To really be standard, right click should consistently act like left click and unselect. This prevents accidental deletion. This would also be consistent with making 'Go to line' act the same. Also, right click within a selection should not move the cursor. ---------- assignee: terry.reedy components: IDLE messages: 363577 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE right click should unselect type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:11:38 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 05:11:38 +0000 Subject: [issue39885] IDLE right click should unselect In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583557898.09.0.553398221693.issue39885@roundup.psfhosted.org> Terry J. Reedy added the comment: Spinoff from #39852. At least the selection clear code added there should be pulled into a module level function and tested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:15:44 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 05:15:44 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583558144.02.0.911110964781.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: Agreed about right clicks. See new issue #39885. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:17:21 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 05:17:21 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583558241.48.0.389393358015.issue39885@roundup.psfhosted.org> Terry J. Reedy added the comment: (Mozilla) Thunderbird, unlike (Mozilla) Firefox, has move/clear right clicks. ---------- title: IDLE right click should unselect -> IDLE right click should clear any selection _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 00:29:07 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 05:29:07 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583558947.19.0.479268071.issue39885@roundup.psfhosted.org> Terry J. Reedy added the comment: I believe the following is true: when only one selection is allowed, the cursor is normally at one end or the other, and any cursor movement either clear the selection or changes its range. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 01:19:50 2020 From: report at bugs.python.org (Andy Lester) Date: Sat, 07 Mar 2020 06:19:50 +0000 Subject: [issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c Message-ID: <1583561990.84.0.843551382535.issue39886@roundup.psfhosted.org> New submission from Andy Lester : config_get_stdio_errors(const PyConfig *config) does not use its arg. Delete it. ---------- components: Interpreter Core messages: 363582 nosy: petdance priority: normal severity: normal status: open title: Remove unused arg in config_get_stdio_errors in Python/initconfig.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 01:23:35 2020 From: report at bugs.python.org (Andy Lester) Date: Sat, 07 Mar 2020 06:23:35 +0000 Subject: [issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c In-Reply-To: <1583561990.84.0.843551382535.issue39886@roundup.psfhosted.org> Message-ID: <1583562215.99.0.48993276365.issue39886@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18182 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 01:40:17 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Mar 2020 06:40:17 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583563217.44.0.573190738335.issue34822@roundup.psfhosted.org> Guido van Rossum added the comment: Haven?t looked at the code but I welcome the simplification. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 03:49:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 08:49:00 +0000 Subject: [issue39887] Duplicate C object description of vectorcallfunc Message-ID: <1583570940.02.0.236043511606.issue39887@roundup.psfhosted.org> New submission from Serhiy Storchaka : $ make html ... Warning, treated as error: /home/serhiy/py/cpython/Doc/c-api/call.rst:71:duplicate C object description of vectorcallfunc, other instance in /home/serhiy/py/cpython/Doc/c-api/typeobj.rst ---------- assignee: docs at python components: Documentation messages: 363584 nosy: docs at python, jdemeyer, petr.viktorin, serhiy.storchaka priority: high severity: normal status: open title: Duplicate C object description of vectorcallfunc type: compile error versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 04:17:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 09:17:47 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583572667.19.0.665234478288.issue39199@roundup.psfhosted.org> Serhiy Storchaka added the comment: Would not be better to use mode='eval' for expression nodes? >>> print(ast.dump(ast.parse('123', mode='eval'), indent=4)) Expression( body=Constant(value=123, kind=None)) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 04:22:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 07 Mar 2020 09:22:27 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583572947.6.0.0709221420175.issue14126@roundup.psfhosted.org> STINNER Victor added the comment: > I believe this was implemented in issue33234 I don't think so. The bytecode in Python 3.9 still uses "BUILD_LIST 0": Python 3.9.0a4+ (heads/daemon_thread_runtime2-dirty:48652767d5, Mar 7 2020, 00:56:07) >>> def f(): ... for i in range(10000): ... [j for j in range(10000)] ... >>> import dis; dis.dis(f) (...) Disassembly of at 0x7ffab2c9fd40, file "", line 3>: 3 0 BUILD_LIST 0 2 LOAD_FAST 0 (.0) >> 4 FOR_ITER 8 (to 14) 6 STORE_FAST 1 (j) 8 LOAD_FAST 1 (j) 10 LIST_APPEND 2 12 JUMP_ABSOLUTE 4 >> 14 RETURN_VALUE ---------- resolution: fixed -> status: closed -> open superseder: Improve list() pre-sizing for inputs with known lengths -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 04:22:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 07 Mar 2020 09:22:57 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1583572977.56.0.59377589024.issue33234@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-14126: "Speed up list comprehensions by preallocating the list where possible". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 04:42:03 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 09:42:03 +0000 Subject: [issue39792] Two Ctrl+C is required to terminate when a pipe is blocking In-Reply-To: <1582956260.49.0.773143606041.issue39792@roundup.psfhosted.org> Message-ID: <1583574123.45.0.390804353918.issue39792@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 04:49:43 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 09:49:43 +0000 Subject: [issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar In-Reply-To: <1583161890.16.0.234726594776.issue39827@roundup.psfhosted.org> Message-ID: <1583574583.22.0.860740326176.issue39827@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 05:23:44 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 10:23:44 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1583576624.28.0.748495207141.issue39829@roundup.psfhosted.org> Terry J. Reedy added the comment: The only specification is that len(ob) calls ob.__len__ and that ob.__len__ should return an 'integer >= 0'. (Adding side effects goes beyond that spec.) I agree that a detectable internal in list is not a bug. Unless there is a realistic performance enhancement in caching the result of the first call, this issue should be closed. ---------- nosy: +terry.reedy type: behavior -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 05:25:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 10:25:32 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS In-Reply-To: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> Message-ID: <1583576732.47.0.399620539239.issue39832@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 05:27:55 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Sat, 07 Mar 2020 10:27:55 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583576875.45.0.979902660217.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: I have created my draft with an example but I am confused about where exactly do I have to add the code and push it. I have cloned these two repositories in my system and setup everything: https://github.com/python/cpython https://github.com/python/devguide 1. Please tell me where I should be adding my code. Do I have to add code here https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst and push it? 2. I am working on the master branch only. Is there any specific branch I have to select? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 05:30:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Mar 2020 10:30:31 +0000 Subject: [issue39861] French doc __futur__: Bad URL In-Reply-To: <1583401195.98.0.339356939479.issue39861@roundup.psfhosted.org> Message-ID: <1583577031.29.0.113924013627.issue39861@roundup.psfhosted.org> Terry J. Reedy added the comment: b.p.o is for the cpython repository, which includes the English docs. Translations are in separate repositories (like python-docs-fr) with their own trackers, with issues handled by the corresponding translators. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 07:22:22 2020 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 07 Mar 2020 12:22:22 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583583742.59.0.11361543648.issue39824@roundup.psfhosted.org> Nick Coghlan added the comment: One of the intended use cases for Py_mod_create is to return instances of ModuleType subclasses rather than straight ModuleType instances. And those are definitely legal to define: >>> import __main__ >>> class MyModule(type(__main__)): pass ... >>> m = MyModule('example') >>> m So it isn't valid to skip calling the cleanup functions just because md_state is NULL - we have no idea what Py_mod_create might have done that needs to be cleaned up. It would *probably* be legitimate to skip calling the cleanup functions when there's no Py_mod_create slot defined, but then the rules for "Do I need to account for md_state potentially being NULL or not?" are getting complicated enough that the safest option for a module author is to always assume that md_state might be NULL and handle that case appropriately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 08:12:05 2020 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 07 Mar 2020 13:12:05 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583586725.95.0.79720935221.issue34822@roundup.psfhosted.org> Nick Coghlan added the comment: The one thing in the PR that makes me slightly wary is the point Vedran raised: in the old AST _Unparser code, the fact that index tuples containing slices should be printed without parentheses was encapsulated in the ExtSlice node type, but with Index and ExtSlice removed, that behaviour is now instead implemented by duplicating the visit_Tuple logic directly in visit_Subscript, purely to omit the surrounding parens. So I agree that the parse tree simplification is an improvement, but I'm wondering if it might make sense to add an "is_subscript" attribute to expression nodes. That way the Tuple vs ExtSlice and Expr vs Index distinctions would be preserved, but the representation of those distinctions would change in a way that meant that most consuming code didn't need to care that the distinctions existed (ExtSlice would become a Tuple with is_subscript set to True, and similarly, Index would become Expr instances with is_subscript set to True). It's been so long since I changed the AST, though, that I'm not sure how painful adding that attribute would be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 08:35:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 13:35:00 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583588100.07.0.21873298237.issue34822@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was added to produce nicer output. Currently: >>> print(ast.unparse(ast.parse('a[i, j]'))) a[(i, j)] With PR 9605: >>> print(ast.unparse(ast.parse('a[i, j]'))) a[i, j] The current code is not consistent with outputting parenthesis: >>> print(ast.unparse(ast.parse('a[i:j, k]'))) a[i:j, k] It also produces the same output for a[i:j] and a[i:j,] which have different AST and compiled to different bytecode (this is a bug). >>> print(ast.unparse(ast.parse('a[i:j,]'))) a[i:j] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 09:00:48 2020 From: report at bugs.python.org (Ammar Askar) Date: Sat, 07 Mar 2020 14:00:48 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583589648.55.0.30873697953.issue14126@roundup.psfhosted.org> Ammar Askar added the comment: Aah, thanks for the catcher Victor. Missed that this was about list /comprehensions/, not the list constructor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 09:32:48 2020 From: report at bugs.python.org (Mageshkumar) Date: Sat, 07 Mar 2020 14:32:48 +0000 Subject: [issue39888] modules not install Message-ID: <1583591568.44.0.104219514979.issue39888@roundup.psfhosted.org> New submission from Mageshkumar : pls kindly rectify it ---------- components: Windows files: modules install issues.txt messages: 363595 nosy: magesh, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: modules not install type: compile error versions: Python 3.8 Added file: https://bugs.python.org/file48960/modules install issues.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 09:41:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 14:41:32 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples Message-ID: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> New submission from Serhiy Storchaka : ast.unparse() produces incorrect output for ExtSlice containing a single element: >>> print(ast.unparse(ast.parse('a[i:j,]'))) a[i:j] It also produces redundant parenthesis for Index containing Tuple: >>> print(ast.unparse(ast.parse('a[i, j]'))) a[(i, j)] ---------- components: Demos and Tools, Library (Lib) messages: 363596 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix ast.unparse() for subscription by extended slices and tuples type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 09:46:53 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 14:46:53 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583592413.12.0.146592898873.issue39889@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 09:57:40 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 07 Mar 2020 14:57:40 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583593060.25.0.933010423179.issue34822@roundup.psfhosted.org> Vedran ?a?i? added the comment: Agree with the idea, but think the name is too narrow. How about `parethesized`? There are many contexts where parentheses look weird and can be omitted (e.g. after return statement), although subscripts are currently the only place where they are an outright error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 10:00:33 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 07 Mar 2020 15:00:33 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583593233.22.0.228287842587.issue34822@roundup.psfhosted.org> Batuhan Taskaya added the comment: Yes, there is an already PR about that the bug. Related PR: https://github.com/python/cpython/pull/17892 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 10:16:49 2020 From: report at bugs.python.org (hai shi) Date: Sat, 07 Mar 2020 15:16:49 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583594209.02.0.574724732246.issue39824@roundup.psfhosted.org> hai shi added the comment: > we have no idea what Py_mod_create might have done that needs to be cleaned up. Looks like no extension module author use `Py_mod_create` slots now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 10:18:48 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 07 Mar 2020 15:18:48 +0000 Subject: [issue39888] modules not install In-Reply-To: <1583591568.44.0.104219514979.issue39888@roundup.psfhosted.org> Message-ID: <1583594328.39.0.520753391294.issue39888@roundup.psfhosted.org> Eric V. Smith added the comment: This looks like a network problem on your end, not a python bug. The bug tracker is not the place to get help for such an issue. You might try the python-list mailing list, although your best bet is to find someone locally who can help you debug your network problem. https://mail.python.org/mailman/listinfo/python-list ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 10:25:39 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 15:25:39 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583594739.01.0.791053377474.issue39889@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset c4928fc1a853f3f84e2b4ec1253d0349137745e5 by Serhiy Storchaka in branch 'master': bpo-39889: Fix ast.unparse() for subscript. (GH-18824) https://github.com/python/cpython/commit/c4928fc1a853f3f84e2b4ec1253d0349137745e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 11:06:05 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 16:06:05 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583597165.81.0.791956007511.issue39889@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18184 pull_request: https://github.com/python/cpython/pull/18826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 11:55:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Mar 2020 16:55:35 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583600135.78.0.746129582397.issue39889@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 92b72788ecf2ee5dfac780c7dfb5ee5350fc641d by Serhiy Storchaka in branch '3.8': [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826) https://github.com/python/cpython/commit/92b72788ecf2ee5dfac780c7dfb5ee5350fc641d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 11:55:56 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 16:55:56 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583600156.29.0.200850195806.issue39889@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +18185 pull_request: https://github.com/python/cpython/pull/18827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:09:52 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 17:09:52 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583600992.18.0.0351187930711.issue14126@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Isn't this the same as https://bugs.python.org/issue36551 ? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:12:08 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 17:12:08 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583601128.55.0.386547359965.issue39199@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Would not be better to use mode='eval' for expression nodes? Agreed! I will prepare a PR soon to simplify the expression examples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:13:35 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 17:13:35 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583601215.38.0.265204713694.issue39889@roundup.psfhosted.org> miss-islington added the comment: New changeset 65b031090161331470827ec809732008b15030d5 by Miss Islington (bot) in branch '3.7': [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826) https://github.com/python/cpython/commit/65b031090161331470827ec809732008b15030d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:25:20 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 17:25:20 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583601920.26.0.169112420359.issue39199@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18186 pull_request: https://github.com/python/cpython/pull/18828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:29:14 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 07 Mar 2020 17:29:14 +0000 Subject: [issue39878] Remove unused args in Python/formatter_unicode.c In-Reply-To: <1583514408.07.0.994530274834.issue39878@roundup.psfhosted.org> Message-ID: <1583602154.22.0.321651810161.issue39878@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset ad0c775ea24bb827410f01ece9f191309292bb95 by Andy Lester in branch 'master': closes bpo-39878: Remove unused arguments from static functions. (GH-18822) https://github.com/python/cpython/commit/ad0c775ea24bb827410f01ece9f191309292bb95 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:36:08 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 07 Mar 2020 17:36:08 +0000 Subject: [issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c In-Reply-To: <1583561990.84.0.843551382535.issue39886@roundup.psfhosted.org> Message-ID: <1583602568.33.0.044089869266.issue39886@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset aa450a0364b6160be7dd61ec2d378abb0652f014 by Andy Lester in branch 'master': closes bpo-39886: Remove unused arg from config_get_stdio_errors. (GH-18823) https://github.com/python/cpython/commit/aa450a0364b6160be7dd61ec2d378abb0652f014 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:53:23 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 17:53:23 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583603603.97.0.311210093954.issue38894@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset eb7560a73d46800e4ade4a8869139b48e6c92811 by Pablo Galindo in branch 'master': bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815) https://github.com/python/cpython/commit/eb7560a73d46800e4ade4a8869139b48e6c92811 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:53:40 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 17:53:40 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583603620.39.0.480206673188.issue38894@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18188 pull_request: https://github.com/python/cpython/pull/18831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 12:53:33 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 17:53:33 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583603613.59.0.352017820877.issue38894@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18187 pull_request: https://github.com/python/cpython/pull/18830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 13:10:13 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 18:10:13 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583604613.75.0.57035721672.issue38894@roundup.psfhosted.org> miss-islington added the comment: New changeset cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f by Miss Islington (bot) in branch '3.7': bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815) https://github.com/python/cpython/commit/cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 13:11:28 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Mar 2020 18:11:28 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583604688.04.0.898019699791.issue38894@roundup.psfhosted.org> miss-islington added the comment: New changeset 928b4dd0edf0022190a8a296c8ea65e7ef55c694 by Miss Islington (bot) in branch '3.8': bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815) https://github.com/python/cpython/commit/928b4dd0edf0022190a8a296c8ea65e7ef55c694 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 13:12:08 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 18:12:08 +0000 Subject: [issue38894] Path.glob() sometimes misses files that match In-Reply-To: <1574431567.77.0.580808736749.issue38894@roundup.psfhosted.org> Message-ID: <1583604728.67.0.386706306537.issue38894@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 13:23:03 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Mar 2020 18:23:03 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583605383.85.0.0118627325325.issue39199@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 02f64cb79175902705b40e3eaa8ea6c7038754ef by Pablo Galindo in branch 'master': bpo-39199: Use 'eval' mode for the examples with expression nodes (GH-18828) https://github.com/python/cpython/commit/02f64cb79175902705b40e3eaa8ea6c7038754ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 13:23:52 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Mar 2020 18:23:52 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583605432.97.0.621220769639.issue39702@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8f130536926a30237b5297780d61ef4232e88577 by Brandt Bucher in branch 'master': bpo-39702: Update the Language Reference (PEP 614) (GH-18802) https://github.com/python/cpython/commit/8f130536926a30237b5297780d61ef4232e88577 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 14:03:14 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Mar 2020 19:03:14 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583607794.01.0.550294350131.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 4663f66f3554dd8e2ec130e40f6abb3c6a514775 by Brandt Bucher in branch 'master': bpo-36144: Update MappingProxyType with PEP 584's operators (#18814) https://github.com/python/cpython/commit/4663f66f3554dd8e2ec130e40f6abb3c6a514775 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 14:13:10 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 07 Mar 2020 19:13:10 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583608390.13.0.021325705316.issue39702@roundup.psfhosted.org> Change by Brandt Bucher : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 14:38:52 2020 From: report at bugs.python.org (Curtis Bucher) Date: Sat, 07 Mar 2020 19:38:52 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583609932.58.0.098050348049.issue36144@roundup.psfhosted.org> Change by Curtis Bucher : ---------- nosy: +curtisbucher nosy_count: 11.0 -> 12.0 pull_requests: +18189 pull_request: https://github.com/python/cpython/pull/18832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 14:51:12 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Mar 2020 19:51:12 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS In-Reply-To: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> Message-ID: <1583610672.05.0.484591537022.issue39832@roundup.psfhosted.org> Ned Deily added the comment: This seems like more an import issue than a uniquely macOS issue. Also, a quick search found Issue10952 which appears to be similar. ---------- nosy: +brett.cannon, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 15:31:57 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Mar 2020 20:31:57 +0000 Subject: [issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows In-Reply-To: <1583308402.69.0.97352724615.issue39844@roundup.psfhosted.org> Message-ID: <1583613117.45.0.314367384069.issue39844@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the pythoninfo output. I didn't see anything unusual there. So I remain perplexed. The thing is the macOS Tk 8.6.8 we supply with current python.org installers doesn't support Dark Mode at all, AFAIK. That was added in 8.6.9. I normally have macOS Dark Mode enabled on all of macOS systems, both real and virtual and, with the python.org Tk 8.6.8, Tk windows are always in Light mode, including on 10.15.3, regardless of the settings in System Preferences -> General. I do have at hand a MacPorts Python 3.8.2 that uses a MacPorts-supplied Tk 8.6.10; in that case, the Tk windows do follow the System Preferences Dark Mode preference and IDLE's Preference windows looks fine as one would expect it to in Dark mode. (Unfortunately, there are other problems with IDLE using Tk 8.6.10 that need to be resolved before we can move to it.) There is this relevant discussion in the Apple Developer documentation: https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app?language=objc Since the python.org macOS Pythons are built with a pre-10.14 SDK, they should be automatically opted out of Dark mode unless you add the NSRequiresAquaSystemAppearance key to the app bundle plist of IDLE.app or Python.app. And that is consistent with the behavior I observe. I verified that, by modifying the python.org IDLE.app plist to include a key NSRequiresAquaSystemAppearance with value NO, IDLE's Tk windows are displayed in Dark mode with the text windows completely dark as in your screen shots. So ... assuming we aren't missing something somewhere and you are not really executing the python.org supplied Python / IDLE when you see this behavior, my only guess at this point is that you have some extension or some system variable set that overrides this automatic opt-out of dark mode for older apps. There is also some discussion in various forums of a system-wide preference, NSRequiresAquaSystemAppearance, that could be used in macOS Mojave to force dark mode. I tried playing with it on both 10.14 and 10.15 and saw no change in (unmodified) IDLE.app Tk behavior but perhaps I'm missing something. Maybe all this rings a bell or two for you about customizations you might have made on your system? Otherwise, I don't know what else to suggest at this point. I guess you *could* try tweaking the IDLE.app plist to explicitly disable the dark mode opt-in and see if that makes a difference but, of course, that wouldn't find the root cause. And the other thing would be to try running the python.org in a vanilla 10.15 environment, perhaps in a Fusion VM. I'm going to close this bug report since it seems unlikely to be a Python or even Tk 8.6.8 issue. But feel free to update or re-open if you find more information. Good luck! ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 15:35:12 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 07 Mar 2020 20:35:12 +0000 Subject: [issue39890] The AST is mangled when compiling starred assignments. Message-ID: <1583613312.45.0.490677035056.issue39890@roundup.psfhosted.org> New submission from Brandt Bucher : It looks like assignment_helper is the only place where we actually change the semantic meaning of the AST during compilation (a starred name is changed to a regular name as a shortcut). This probably isn't a great idea, and it would bite us later if we started making multiple passes or reusing the AST or something. ---------- assignee: brandtbucher components: Interpreter Core messages: 363616 nosy: brandtbucher priority: normal severity: normal status: open title: The AST is mangled when compiling starred assignments. versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 15:37:31 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 07 Mar 2020 20:37:31 +0000 Subject: [issue39890] The AST is mangled when compiling starred assignments. In-Reply-To: <1583613312.45.0.490677035056.issue39890@roundup.psfhosted.org> Message-ID: <1583613451.3.0.704772672918.issue39890@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +18190 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 17:15:24 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 07 Mar 2020 22:15:24 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583619324.85.0.294829810532.issue39868@roundup.psfhosted.org> Brandt Bucher added the comment: > I have created my draft with an example but I am confused about where exactly do I have to add the code and push it. > I have cloned these two repositories in my system and setup everything: > https://github.com/python/cpython > https://github.com/python/devguide Great! It's not necessary to clone the devguide though; CPython is the only one you're going to edit. Make sure you've "forked" the repo on GitHub, and are working on a local clone of your fork. Otherwise things will be trickier. > 1. Please tell me where I should be adding my code. Do I have to add code here https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst and push it? Yes, you'll add the new documentation to line 1652, where the "TODO" comment is. You should make the changes in your own fork of the repo, and push. Then you'll be ready for a PR. > 2. I am working on the master branch only. Is there any specific branch I have to select? Working from master in your own fork is fine, but frequent contributors often prefer to branch from master and work on those branches instead. The pages I've linked to in the devguide walk you through every step of making a PR (including an intro on how to use Git). If it's easier for you, though, you can attach a copy of your edits to this issue and I can make a PR on your behalf. I just wouldn't count on repeating that workflow if you plan on contributing in the future; regular contributors should feel comfortable branching, committing, opening a PR, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 18:27:55 2020 From: report at bugs.python.org (brian.gallagher) Date: Sat, 07 Mar 2020 23:27:55 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different Message-ID: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> New submission from brian.gallagher : Currently difflib's get_close_matches() doesn't match similar words that differ in their casing very well. Example: user at host:~$ python3 Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import difflib >>> difflib.get_close_matches("apple", "APPLE") [] >>> difflib.get_close_matches("apple", "APpLe") [] >>> These seem like they should be considered close matches for each other, given the SequenceMatcher used in difflib.py attempts to produce a "human-friendly diff" of two words in order to yield "intuitive difference reports". One solution would be for the user of the function to perform their own transformation of the supplied data, such as converting all strings to lower-case for example. However, it seems like this might be a surprise to a user of the function if they weren't aware of this limitation. It would be preferable to provide this functionality by default in my eyes. If this is an issue the relevant maintainer(s) consider worth pursuing, I'd love to try my hand at preparing a patch for this. ---------- messages: 363618 nosy: brian.gallagher priority: normal severity: normal status: open title: [difflib] Improve get_close_matches() to better match when casing of words are different versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 19:25:34 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 08 Mar 2020 00:25:34 +0000 Subject: [issue39890] The AST is mangled when compiling starred assignments In-Reply-To: <1583613312.45.0.490677035056.issue39890@roundup.psfhosted.org> Message-ID: <1583627134.58.0.0934999955984.issue39890@roundup.psfhosted.org> Change by Brandt Bucher : ---------- title: The AST is mangled when compiling starred assignments. -> The AST is mangled when compiling starred assignments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 19:53:33 2020 From: report at bugs.python.org (Kyle Stanley) Date: Sun, 08 Mar 2020 00:53:33 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1583628813.13.0.241630321771.issue39812@roundup.psfhosted.org> Kyle Stanley added the comment: I spent some further time considering the solution to the problem, and I still think something like a `threading.register_atexit()` (see https://bugs.python.org/issue37266#msg362960) would be the most suitable. However, I'm not certain regarding the exact details. The simplest pure Python implementation I can think of would be through a global list in `Lib/threading.py`, which is only initialized when `threading.register_atexit()` is called for the first time (to avoid unneeded overhead when threading exit functions aren't needed). In order to preserve keyword arguments, each registered function would be appended to the list as a partial. Then, in the private `_shutdown()`, each registered atexit function is called just after the main thread is finished, but just before the non-daemon threads are joined: ``` _threading_atexits = None def register_atexit(func, *args, **kwargs): global _threading_atexits if _threading_atexits is None: _threading_atexits = [] call = functools.partial(func, *args, **kwargs) _threading_atexits.append(call) # [snip] def _shutdown(): if _main_thread._is_stopped: # _shutdown() was already called return # Main thread tlock = _main_thread._tstate_lock # The main thread isn't finished yet, so its thread state lock can't have # been released. assert tlock is not None assert tlock.locked() tlock.release() _main_thread._stop() # Call registered threading atexit functions for atexit_call in _threading_atexits: atexit_call() # Join all non-deamon threads # [snip] ``` Could something like the above pure Python implementation be adequate for our purposes? It seems like it would be to me, but I could very well be missing something. I'll of course have to test if it works as intended for replacing the daemon threads in concurrent.futures. Another factor to consider is whether or not something like this would be widely useful enough to consider adding `threading.register_atexit()` to the public API for the threading module, or if it should just be an internal _function with a docstring. I could see it being useful in similar cases where daemon threads are no longer a viable option (due to subinterepter compatibility or any other reason). But, I suspect the demand for it won't be overly high from users until PEP 554 is completed. Thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 19:53:52 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 08 Mar 2020 00:53:52 +0000 Subject: [issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main() Message-ID: <1583628832.97.0.582883450111.issue39892@roundup.psfhosted.org> New submission from Gregory P. Smith : Recurring theme: The stdlib has the issue of DeprecationWarning being added to APIs we are changing or removing a few versions in the future yet we perceive that many people never actually bother to try checking their code for deprecation warnings. Only raising issues with a documented, warned, planned in advance API change when it actually happens. Could we reduce the chances of this by enabling DeprecationWarnings by default for processes started via unittest.main() and other common unittest entrypoints? (other test frameworks like pytest should also consider this if they don't already; do we have any existing external implementations of this for inspiration?) One issue with this is that some important warnings are at _parse_ time or _import_ time. But we can deal with import time ones if we are able to have the unittest entrypoint re-exec the process with the same args but with warnings enabled. (and _could_ surface parse time ones if we're willing to accept slower process startup by disabling use of pycs; i wouldn't go that far) Related work: https://www.python.org/dev/peps/pep-0565/ has this idea already been discussed? I don't remember and haven't searched backwards... ---------- components: Library (Lib), Tests messages: 363620 nosy: gregory.p.smith, ncoghlan, vstinner priority: normal severity: normal stage: needs patch status: open title: Enable DeprecationWarnings by default when not explicit in unittest.main() type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 19:55:46 2020 From: report at bugs.python.org (Kyle Stanley) Date: Sun, 08 Mar 2020 00:55:46 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1583628946.32.0.297814485698.issue39812@roundup.psfhosted.org> Change by Kyle Stanley : ---------- assignee: -> aeros _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 20:30:03 2020 From: report at bugs.python.org (Caleb Hattingh) Date: Sun, 08 Mar 2020 01:30:03 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583631003.63.0.947436100729.issue39857@roundup.psfhosted.org> Caleb Hattingh added the comment: dict syntax tools make it fairy easy to compose new dicts from old ones with overrides: subprocess.run(..., env={**os.environ, 'FOO': ..., 'BAR', ...}, ...) Would this be sufficient to avoid the copy/pasting boilerplate? ---------- nosy: +cjrh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 20:45:28 2020 From: report at bugs.python.org (wyz23x2) Date: Sun, 08 Mar 2020 01:45:28 +0000 Subject: [issue39893] Add set_terminate() to logging Message-ID: <1583631928.08.0.636438153182.issue39893@roundup.psfhosted.org> New submission from wyz23x2 : Sometimes, we want to remove the ending \n and sometimes replace it wit something else, like print(). But logging doesn't support that. I'd want a set_terminate() (Or set_end()) function that does that. I think it's easy. Just insert this at line 1119 of __init__ of 3.8.2: def set_terminator(string='\n'): StreamHandler.terminator = string Thanks! ---------- components: Library (Lib) messages: 363622 nosy: wyz23x2 priority: normal severity: normal status: open title: Add set_terminate() to logging type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 20:48:58 2020 From: report at bugs.python.org (wyz23x2) Date: Sun, 08 Mar 2020 01:48:58 +0000 Subject: [issue39893] Add set_terminate() to logging In-Reply-To: <1583631928.08.0.636438153182.issue39893@roundup.psfhosted.org> Message-ID: <1583632138.7.0.973079710577.issue39893@roundup.psfhosted.org> wyz23x2 added the comment: typo: "with something else", not "wit something else". Sorry for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 20:53:25 2020 From: report at bugs.python.org (wyz23x2) Date: Sun, 08 Mar 2020 01:53:25 +0000 Subject: [issue39768] remove tempfile.mktemp() In-Reply-To: <1582772221.62.0.0102658338874.issue39768@roundup.psfhosted.org> Message-ID: <1583632405.61.0.938593208338.issue39768@roundup.psfhosted.org> Change by wyz23x2 : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 21:30:01 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 02:30:01 +0000 Subject: [issue39659] pathlib calls `os.getcwd()` without using accessor In-Reply-To: <1581901062.0.0.795874471606.issue39659@roundup.psfhosted.org> Message-ID: <1583634601.66.0.977410962715.issue39659@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 21:33:17 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 08 Mar 2020 02:33:17 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583634797.3.0.186980563791.issue39857@roundup.psfhosted.org> Brandt Bucher added the comment: Caleb's answer, using PEP 584's merge operator: newenv = os.environ | {'FOO': ..., 'BAR': ...} subprocess.run(..., env=new_env, ...) ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 21:36:48 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 08 Mar 2020 02:36:48 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583635008.93.0.882914247554.issue36144@roundup.psfhosted.org> Brandt Bucher added the comment: Issue 39857 just reminded me that we should update os._Environ as well (the type of os.environ and os.environb). I have another first-timer who will probably want to take it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 21:51:17 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 08 Mar 2020 02:51:17 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different In-Reply-To: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> Message-ID: <1583635877.37.0.0526228473723.issue39891@roundup.psfhosted.org> Tim Peters added the comment: If you pursue this, please introduce a new function for it. You immediately have an idea about how to change the current function precisely because it _doesn't_ try to guess what you really wanted. That lack of magic is valuable - you're not actually confused by what it does, because it doesn't do anything to the strings you give it ;-) By the same token, if you have a crisp idea of how it should treat strings instead, it's straightforward to write a wrapper that does so. The existing function won't fight you by trying to impose its own ideas. Guessing what people really wanted tends to become a bottomless pit. For example, do you know all the rules for what "case" even means in a Unicode world? What about diacritical marks? And so on. I don't. Not saying it shouldn't be pursued. Am saying it may be hard to reach consensus on what's "really" wanted. By some people, some of the time. Never - alas - by all people all the time. ---------- nosy: +tim.peters stage: -> needs patch type: -> enhancement versions: +Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:05:16 2020 From: report at bugs.python.org (Roundup Robot) Date: Sun, 08 Mar 2020 03:05:16 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583636716.95.0.533728004879.issue39837@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +18192 pull_request: https://github.com/python/cpython/pull/18835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:19:28 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 08 Mar 2020 03:19:28 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583637568.5.0.649819127437.issue39857@roundup.psfhosted.org> Brandt Bucher added the comment: Ah, I didn't realize that os.environ and os.environ b aren't dict subclasses. I've added a ticket to update them with the new operators! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:44:25 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 08 Mar 2020 03:44:25 +0000 Subject: [issue39890] The AST is mangled when compiling starred assignments In-Reply-To: <1583613312.45.0.490677035056.issue39890@roundup.psfhosted.org> Message-ID: <1583639065.38.0.302384672682.issue39890@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d5aa2e941ccc44412b95d0e3f0a1789fbcccf403 by Brandt Bucher in branch 'master': bpo-39890: Don't mutate the AST when compiling starred assignments (GH-18833) https://github.com/python/cpython/commit/d5aa2e941ccc44412b95d0e3f0a1789fbcccf403 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:44:53 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 08 Mar 2020 03:44:53 +0000 Subject: [issue39890] The AST is mangled when compiling starred assignments In-Reply-To: <1583613312.45.0.490677035056.issue39890@roundup.psfhosted.org> Message-ID: <1583639093.33.0.443979711394.issue39890@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the great catch, Brandt! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:44:49 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 03:44:49 +0000 Subject: [issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor Message-ID: <1583639089.94.0.893422780833.issue39894@roundup.psfhosted.org> New submission from Barney Gale : `Path.samefile()` calls `os.stat()` directly. It should use the path's accessor object, as `Path.stat()` does. ---------- components: Library (Lib) messages: 363629 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.samefile()` calls `os.stat()` without using accessor versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:48:01 2020 From: report at bugs.python.org (Ben Thayer) Date: Sun, 08 Mar 2020 03:48:01 +0000 Subject: [issue39791] New `files()` api from importlib_resources. In-Reply-To: <1582949490.73.0.868974160192.issue39791@roundup.psfhosted.org> Message-ID: <1583639281.86.0.873034495069.issue39791@roundup.psfhosted.org> Change by Ben Thayer : ---------- nosy: +benthayer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:48:51 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 03:48:51 +0000 Subject: [issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor In-Reply-To: <1583639089.94.0.893422780833.issue39894@roundup.psfhosted.org> Message-ID: <1583639331.47.0.332298744441.issue39894@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18193 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:53:09 2020 From: report at bugs.python.org (Andy Lester) Date: Sun, 08 Mar 2020 03:53:09 +0000 Subject: [issue39896] Const args and remove unused args in Python/compile.c Message-ID: <1583639589.56.0.292367890565.issue39896@roundup.psfhosted.org> New submission from Andy Lester : Remove unused args from: * binop * compiler_next_instr * inplace_binop Const arguments for: * assemble_jump_offsets * blocksize * check_caller * check_compare * check_index * check_is_arg * check_subscripter * compiler_error * compiler_new_block * compiler_pop_fblock * compiler_push_fblock * compiler_warn * compute_code_flags * dfs * find_ann * get_ref_type * merge_const_tuple * stackdepth ---------- components: Interpreter Core messages: 363632 nosy: petdance priority: normal severity: normal status: open title: Const args and remove unused args in Python/compile.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:52:39 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 03:52:39 +0000 Subject: [issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor Message-ID: <1583639559.65.0.730763804779.issue39895@roundup.psfhosted.org> New submission from Barney Gale : `Path.touch()` does a lot of os-specific /stuff/ that should probably live in the accessor. Perhaps most importantly, is calls `os.close()` on whatever `accessor.open()` returns, which is problematic for those wishing to write their own accessor that doesn't work on a file descriptor level. ---------- components: Library (Lib) messages: 363631 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.touch()` calls `os.close()` without using accessor versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 22:56:43 2020 From: report at bugs.python.org (Andy Lester) Date: Sun, 08 Mar 2020 03:56:43 +0000 Subject: [issue39896] Const args and remove unused args in Python/compile.c In-Reply-To: <1583639589.56.0.292367890565.issue39896@roundup.psfhosted.org> Message-ID: <1583639803.85.0.451610449398.issue39896@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 23:01:28 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 04:01:28 +0000 Subject: [issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor In-Reply-To: <1583639559.65.0.730763804779.issue39895@roundup.psfhosted.org> Message-ID: <1583640088.27.0.623895004309.issue39895@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18195 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 23:11:08 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 04:11:08 +0000 Subject: [issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses Message-ID: <1583640668.8.0.328631342101.issue39897@roundup.psfhosted.org> New submission from Barney Gale : `pathlib.Path.is_mount()` calls `Path(self.parent)`, which: - Is needless, as `self.parent` is already a Path instance! - Prevents effective subclassing, as `self.parent` may be a `Path` subclass with its own `stat()` implementation ---------- components: Library (Lib) messages: 363633 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 23:14:26 2020 From: report at bugs.python.org (Andy Lester) Date: Sun, 08 Mar 2020 04:14:26 +0000 Subject: [issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c Message-ID: <1583640866.93.0.894372784953.issue39898@roundup.psfhosted.org> New submission from Andy Lester : append_formattedvalue() has an unused bool is_format_spec. ---------- components: Interpreter Core messages: 363634 nosy: petdance priority: normal severity: normal status: open title: Remove unused arg from append_formattedvalue in Python/ast_unparse.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 23:15:58 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 04:15:58 +0000 Subject: [issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses In-Reply-To: <1583640668.8.0.328631342101.issue39897@roundup.psfhosted.org> Message-ID: <1583640958.86.0.731938448321.issue39897@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18196 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 7 23:16:55 2020 From: report at bugs.python.org (Andy Lester) Date: Sun, 08 Mar 2020 04:16:55 +0000 Subject: [issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c In-Reply-To: <1583640866.93.0.894372784953.issue39898@roundup.psfhosted.org> Message-ID: <1583641015.43.0.996441103248.issue39898@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18197 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 00:06:12 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 05:06:12 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` Message-ID: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> New submission from Barney Gale : `pathlib.Path.expanduser()` does not call `os.path.expanduser()`, but instead re-implements it. The implementations look pretty similar and I can't see a good reason for the duplication. The only difference is that `pathlib.Path.expanduser()` raises `RuntimeError` when a home directory cannot be resolved, whereas `os.path.expanduser()` returns the path unchanged. ---------- components: Library (Lib) messages: 363635 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.expanduser()` does not call `os.path.expanduser()` versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 00:37:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 05:37:54 +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: <1583645874.4.0.316250511726.issue39899@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are two reasons: 1. os.path.expanduser() returns the path unchanged when a home directory cannot be resolved, pathlib.Path.expanduser() raises an error. The latter behavior looks more robust, but we can't change os.path.expanduser(). 2. os.path.expanduser() needs to split the path on components while pathlib.Path.expanduser() already has ready components. In some cases it may be more efficient. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 00:58:22 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 05:58:22 +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: <1583647102.9.0.377918818607.issue39899@roundup.psfhosted.org> Barney Gale added the comment: We can check whether `os.path.expanduser()` returned a path beginning with "~" and raise a RuntimeError if so, right? On point #2, I'm not sure this optimization alone justifies the duplication. PR incoming... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 01:01:45 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 06:01:45 +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: <1583647305.43.0.538977384751.issue39899@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18198 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 01:10:32 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 06:10:32 +0000 Subject: [issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor Message-ID: <1583647831.98.0.39095900929.issue39900@roundup.psfhosted.org> New submission from Barney Gale : `pathlib.Path.__bytes__()` calls `os.fsencode()` without using path's accessor. To properly isolate Path objects from the underlying local filesystem, this should be routed via the accessor object. ---------- messages: 363638 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 01:18:38 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 06:18:38 +0000 Subject: [issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor In-Reply-To: <1583647831.98.0.39095900929.issue39900@roundup.psfhosted.org> Message-ID: <1583648318.03.0.205090251073.issue39900@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18199 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 03:57:20 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 07:57:20 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583654240.26.0.30243885989.issue36287@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18200 pull_request: https://github.com/python/cpython/pull/18843 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 04:20:29 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 08:20:29 +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: <1583655629.24.0.316999047292.issue39899@roundup.psfhosted.org> Serhiy Storchaka added the comment: I see no reason to change the current code. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 04:33:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 08:33:57 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583656437.03.0.466201450722.issue36287@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 18843 solves this issue by setting None as class attributes for optional fields and attributes (like "kind" or "end_col_offset"). It is not so easy for fields like "type_ignores". They are mutable lists, so this approach cannot be applied to them. I want to get rid also from "ctx=Load()", but it is more complex change. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 04:56:12 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 08:56:12 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583657772.82.0.98883305442.issue36287@roundup.psfhosted.org> Batuhan Taskaya added the comment: > It is not so easy for fields like "type_ignores". They are mutable lists, so this approach cannot be applied to them. What about keeping ASDL signatures in the nodes (). If we know the type of a field (can be parsed in runtime) we can infer the default value of a field. For type_ignores, it is a sequence so if it is empty we can just crop that part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 04:56:35 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 08:56:35 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583657795.36.0.752601213841.issue36287@roundup.psfhosted.org> Batuhan Taskaya added the comment: Related issue: issue 39638 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:26:58 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 09:26:58 +0000 Subject: [issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly Message-ID: <1583659618.45.0.720570374465.issue39901@roundup.psfhosted.org> New submission from Barney Gale : The implementations of `Path.owner()` and `Path.group()` directly import and use the `pwd` and `grp` modules. Given these modules provide information about the *local* system, I believe these implementations should instead live in `pathlib._NormalAccessor` for consistency with other methods that do "impure" things. ---------- components: Library (Lib) messages: 363643 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:35:17 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 09:35:17 +0000 Subject: [issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly In-Reply-To: <1583659618.45.0.720570374465.issue39901@roundup.psfhosted.org> Message-ID: <1583660117.92.0.579065514784.issue39901@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18201 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:42:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 09:42:12 +0000 Subject: [issue39638] Keep ASDL signatures for AST nodes In-Reply-To: <1581766346.86.0.0377348739096.issue39638@roundup.psfhosted.org> Message-ID: <1583660532.98.0.514573866492.issue39638@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:47:00 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 09:47:00 +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: <1583660820.05.0.861616323934.issue39899@roundup.psfhosted.org> Barney Gale added the comment: I see no reason for the duplication, and I can point to one concrete bug affecting your re-implementation of `expanduser` that doesn't affect the original, i.e. that a `KeyError` is raised on Windows when `"USERNAME"` is not present in `os.environ`, whereas all similar cases raise `RuntimeError`. These sorts of issues sneak in when you duplicate code - better to stick with the battle-hardened version rather than an inherently risky rewrite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:50:41 2020 From: report at bugs.python.org (hai shi) Date: Sun, 08 Mar 2020 09:50:41 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1583661041.45.0.56237224761.issue39337@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch nosy: +shihai1991 nosy_count: 3.0 -> 4.0 pull_requests: +18202 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 05:55:01 2020 From: report at bugs.python.org (hai shi) Date: Sun, 08 Mar 2020 09:55:01 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1583661301.77.0.775117175119.issue39337@roundup.psfhosted.org> hai shi added the comment: > I would prefer that codecs.lookup() and encodings.normalize_encoding() behave the same. Either always ignore or always copy. How about calling `encodings.normalize_encoding() in codecs.normalizestring()` to keep same behavior?(I create PR18845) > Maybe we should just add a private function for test in _testcapi I can try to add some test cases in next weekend ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:09:21 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 10:09:21 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1583662161.27.0.550710489371.issue39682@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:27:58 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 08 Mar 2020 10:27:58 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583663278.09.0.44872063411.issue39763@roundup.psfhosted.org> Michael Felt added the comment: The PR for 3.9 breaks AIX build (since https://buildbot.python.org/all/#/builders/119/builds/384) reporting the following: Traceback (most recent call last): File "/data/prj/python/python3-3.9/../git/python3-3.9/setup.py", line 69, in from distutils.command.build_ext import build_ext File "/data/prj/python/git/python3-3.9/Lib/distutils/command/build_ext.py", line 33, in class build_ext(Command): File "/data/prj/python/git/python3-3.9/Lib/distutils/command/build_ext.py", line 63, in build_ext "(default: %s)" % get_platform()), File "/data/prj/python/git/python3-3.9/Lib/distutils/util.py", line 107, in get_platform return get_host_platform() File "/data/prj/python/git/python3-3.9/Lib/distutils/util.py", line 83, in get_host_platform return aix_platform() File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 83, in aix_platform vrmf, bd = _aix_bosmp64() File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 53, in _aix_bosmp64 out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.mp64"]) AttributeError: module 'subprocess' has no attribute 'check_output' Will post a PR for this. The cause: Briefly, due to the addition of an importable subprocess must now test specifically for check_output during the early build process. ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:39:40 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 08 Mar 2020 10:39:40 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583663980.67.0.960959097579.issue39763@roundup.psfhosted.org> Change by Michael Felt : ---------- pull_requests: +18204 pull_request: https://github.com/python/cpython/pull/18847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:41:39 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 10:41:39 +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: <1583664099.39.0.71418049095.issue39899@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was discussed in issue19776. Having separate implementation we can avoid design flaws of os.path.expanduser(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:44:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 10:44:34 +0000 Subject: [issue39889] Fix ast.unparse() for subscription by extended slices and tuples In-Reply-To: <1583592092.92.0.938156350005.issue39889@roundup.psfhosted.org> Message-ID: <1583664274.34.0.614429618597.issue39889@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 Mar 8 06:51:36 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 10:51:36 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583664696.38.0.58757181845.issue34822@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, I did not know about your PR Batuhan and fixed this bug in issue39889. After fixing the bug in the current code PR 9605 only simplifies the code. So in this case the new code is not more complex than correctly written old code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:57:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 10:57:49 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583665069.26.0.942388132692.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e by Victor Stinner in branch 'master': bpo-39877: Fix PyEval_RestoreThread() for daemon threads (GH-18811) https://github.com/python/cpython/commit/eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 06:59:04 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 10:59:04 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583665144.86.0.18624866262.issue34822@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Sorry, I did not know about your PR Batuhan and fixed this bug in issue39889. No problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:15:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 11:15:55 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583666155.29.0.551891486185.issue19466@roundup.psfhosted.org> STINNER Victor added the comment: The change has been reverted in 2014. I reopen the issue since using daemon thraeds became safer in Python 3.9. As soon as a daemon thread attempts to take the GIL, it does exit immediately. With the commit eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e (bpo-39877), it should be even more reliable. Let me retry to fix this issue again. I reopen the issue and I wrote a new PR. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:18:25 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 11:18:25 +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: <1583666305.76.0.816159065635.issue39899@roundup.psfhosted.org> Barney Gale added the comment: The only design flaw mentioned in that thread is that `os.path.expanduser()` returns the input unchanged if expansion fails, which is not very pythonic. However, such a problem doesn't necessitate a rewrite of `os.path.expanduser()`. Checking `result[:1]` is enough. I think there's also a difference in the Windows heuristic in that pathlib checks whether `basename(%HOMEPATH%) == %USERNAME%` whereas `ntpath.expanduser` doesn't. But if that's really an issue it should probably be fixed in `ntpath` IMO, rather than having divergent implementations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:19:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 11:19:38 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583666378.43.0.587054525495.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: Ok, it should now be fixed. Let me try to revisit the old bpo-19466 issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:20:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 11:20:05 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583666405.05.0.534080994248.issue19466@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18205 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/18848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:29:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 11:29:18 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583666958.97.0.253833822545.issue19466@roundup.psfhosted.org> STINNER Victor added the comment: asyncio_gc.py: script to reproduce bpo-20526 (copied from there), but ported to Python 3.9 (replace asyncio.async with asyncio.ensure_future). Sadly, Python with PR 18848 does crash when running asyncio_gc.py if I press CTRL+c twice: * A thread does crash in _PyObject_GC_TRACK_impl() called indirectly by select_epoll_poll_impl(), in a Python thread * while main thread is exiting Python: Py_FinalizeEx() is calling _PyImport_Cleanup() which blocks on take_gil() It seems like the main thread does *not* hold the hold, the thread which crashed does. It should not happen: _PyRuntimeState_SetFinalizing(runtime, tstate) has been called and so no other thread should be able to take the GIL anymore, but exit immediately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 07:36:29 2020 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sun, 08 Mar 2020 11:36:29 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different In-Reply-To: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> Message-ID: <1583667389.89.0.526394981074.issue39891@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: It looks like Brian is expecting some kind of normalization of the strings before they enter the function, e.g. convert to lowercase, remove extra whitespace, convert diacritics to regular letters, combinations of such normalizations, etc. Since both "word" and "possibilities" would have to be normalized, I think it's better to let the application deal with this efficiently than try to come up with a new function or add a normalize keyword function parameter. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:15:59 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 12:15:59 +0000 Subject: [issue39902] dis.Bytecode objects should be comparable Message-ID: <1583669759.63.0.311622974712.issue39902@roundup.psfhosted.org> New submission from Batuhan Taskaya : import dis >>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)") False ---------- components: Library (Lib) messages: 363656 nosy: BTaskaya priority: normal severity: normal status: open title: dis.Bytecode objects should be comparable type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:19:34 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 12:19:34 +0000 Subject: [issue39902] dis.Bytecode objects should be comparable In-Reply-To: <1583669759.63.0.311622974712.issue39902@roundup.psfhosted.org> Message-ID: <1583669974.43.0.632116401673.issue39902@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18206 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:24:04 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 12:24:04 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ Message-ID: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> New submission from Serhiy Storchaka : There is very strange code in _elementtree.Element.__getstate__ which decrement references to elements of a list before decrementing a reference to the list itself. It happens only if creating a dict fails, so it is almost impossible to reproduce, but if it happens it will likely cause a crash. The proposed PR fixes the bug and also simplifies the code. ---------- components: Extension Modules, XML messages: 363657 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Double decref in _elementtree.Element.__getstate__ type: crash versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:27:20 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 12:27:20 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583670440.94.0.522705732357.issue39903@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18207 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:28:57 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Mar 2020 12:28:57 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583670537.68.0.261948004163.issue39850@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- stage: -> needs patch type: crash -> behavior versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:30:07 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Mar 2020 12:30:07 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583670607.03.0.933671902987.issue39850@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:31:50 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 12:31:50 +0000 Subject: [issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob() In-Reply-To: <1580977248.64.0.174366488821.issue39567@roundup.psfhosted.org> Message-ID: <1583670710.56.0.164114726863.issue39567@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset db283b32e7580741a8b6b7f27f616cc656634750 by Serhiy Storchaka in branch 'master': bpo-39567: Document audit for os.walk, os.fwalk, Path.glob and Path.rglob. (GH-18499) https://github.com/python/cpython/commit/db283b32e7580741a8b6b7f27f616cc656634750 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 08:33:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 12:33:01 +0000 Subject: [issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob() In-Reply-To: <1580977248.64.0.174366488821.issue39567@roundup.psfhosted.org> Message-ID: <1583670781.71.0.167484363756.issue39567@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 Mar 8 08:57:23 2020 From: report at bugs.python.org (brian.gallagher) Date: Sun, 08 Mar 2020 12:57:23 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different In-Reply-To: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> Message-ID: <1583672243.36.0.884165031963.issue39891@roundup.psfhosted.org> brian.gallagher added the comment: I agree that there is an appeal to leaving any normalization to the application and that trying guess what people want is a tough hole -- I hadn't even considered what casing would mean in a general sense for Unicode. I'm not entirely convinced that this should be pursued either, but I'll refine my proposal, provide a little context in which I thought it could be a problem and see what you guys think. 1. Some code is written that assumes get_close_matches() will match on a case-insensitive basis. Only a small bit of testing is done because the functionality is provided by the standard library not the application code, so we throw a few examples like 'apple' and 'ape' and decide it is okay. We later on discover we have a bug because we actually need to match against 'AppLE' too. 2. The extension I had in mind was to match on a case-insensitive basis for only the alphabet characters. I don't know much about Unicode, but there's definitely gotchas lurking in my previous statement (titlecase vs. uppercase) so copying the behaviour of string.upper()/string.lower() would seem reasonable to me. The functionality would only be extended to match the same strings it would anyways, but now ignore casing. We wouldn't be eliminating any existing matches. I guess this still has the potential to be a breaking change, since someone might indirectly be depending on this. For 1., not testing that your code can handle mixed case comparisons in the way you're assuming it will is probably your own fault. On the other hand, I think it is a reasonable assumption to think that get_close_matches() will match an uppercase/lowercase counterpart since the function's intent is to provide intuitive matches that "look right" to a human. Maybe this is more of a documentation issue than something that needs to be addressed in the code. If a caveat about the case sensitivity of the function is added to the documentation, then a developer can be aware of the limitation in order to provide any normalization they want in the application code. Let me know what you guys think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 09:28:29 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Sun, 08 Mar 2020 13:28:29 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1583674109.62.0.813749575118.issue39702@roundup.psfhosted.org> Change by SHANKAR JHA : ---------- nosy: +shankarj67 nosy_count: 2.0 -> 3.0 pull_requests: +18208 pull_request: https://github.com/python/cpython/pull/18851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 09:30:19 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Sun, 08 Mar 2020 13:30:19 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583674219.77.0.876953580541.issue39868@roundup.psfhosted.org> SHANKAR JHA added the comment: I have added the pull request: https://github.com/python/cpython/pull/18851. Please check it out and let me know if I need to change anything. Thank you everyone for your guidance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 09:32:30 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 08 Mar 2020 13:32:30 +0000 Subject: [issue39902] dis.Bytecode objects should be comparable In-Reply-To: <1583669759.63.0.311622974712.issue39902@roundup.psfhosted.org> Message-ID: <1583674350.25.0.76625010243.issue39902@roundup.psfhosted.org> Steven D'Aprano added the comment: What does it mean for two Bytecode objects to be equal? I know what equality means for ints: they have the same numeric value. I know what equality means for strings: they have the same sequence of Unicode code points. I have no concept of what it would mean for two Bytecode objects to be equal or unequal. Your patch compares the tuple: (codeobj, first_line, current_offset) but why do you compare those rather than, say, the source code, or the disassembled byte code, or something else? Before I read your patch, I guested that you would have defined `__eq__` as `self.dis() == other.dis()`. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 09:51:23 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 13:51:23 +0000 Subject: [issue37948] get_type_hints fails if there are un-annotated fields in a dataclass In-Reply-To: <1566800952.19.0.982220665774.issue37948@roundup.psfhosted.org> Message-ID: <1583675483.34.0.282455688333.issue37948@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 14166 does not fix this issue. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 10:01:08 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 08 Mar 2020 14:01:08 +0000 Subject: [issue39902] dis.Bytecode objects should be comparable In-Reply-To: <1583669759.63.0.311622974712.issue39902@roundup.psfhosted.org> Message-ID: <1583676068.98.0.142048756184.issue39902@roundup.psfhosted.org> Batuhan Taskaya added the comment: Code objects themselves supports equality comparisons, >>> compile("print(1)", "", "eval") == compile("print(1)", "", "eval") True So this patch basically compares the underlying code objects with 2 Bytecode specific attribute, first_line and current_offset. So these objects will be equal >>> import dis >>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)") True but these won't >>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)", first_line=2) False >>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)", current_offset=12) False A simple example that would be problamatic in .dis() method is code objects that contains other code objects import dis source = "def x(a, b): print(1)" print(dis.Bytecode(source).dis()) print(dis.Bytecode(source).dis()) print(dis.Bytecode(source).dis() == dis.Bytecode(source).dis()) 1 0 LOAD_CONST 0 (", line 1>) 2 LOAD_CONST 1 ('x') 4 MAKE_FUNCTION 0 6 STORE_NAME 0 (x) 8 LOAD_CONST 2 (None) 10 RETURN_VALUE 1 0 LOAD_CONST 0 (", line 1>) 2 LOAD_CONST 1 ('x') 4 MAKE_FUNCTION 0 6 STORE_NAME 0 (x) 8 LOAD_CONST 2 (None) 10 RETURN_VALUE False ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 10:43:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 14:43:01 +0000 Subject: [issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__() Message-ID: <1583678581.12.0.621267485575.issue39904@roundup.psfhosted.org> New submission from Serhiy Storchaka : The builtin type() serves two functions: 1. When called with a single positional argument it returns the type of the argument. >>> type(1) 2. Otherwise it acts as any class when called -- creates an instance of this class (a type). It includes calling corresponding __new__ and __init__ methods. >>> type('A', (str,), {'foo': lambda self: len(self)}) type is a class, and it can be subclassed. Subclasses of type serve only the latter function (the former was forbidden in issue27157). >>> class T(type): pass ... >>> T(1) Traceback (most recent call last): File "", line 1, in TypeError: type.__new__() takes exactly 3 arguments (1 given) >>> T('A', (str,), {'foo': lambda self: len(self)}) But surprisingly you can use the __new__ method for getting the type of the object. >>> type.__new__(type, 1) >>> T.__new__(T, 1) Traceback (most recent call last): File "", line 1, in TypeError: type.__new__() takes exactly 3 arguments (1 given) The proposed PR moves handling the special case of one-argument type() from type.__new__ to type.__call__. It does not fix any real bug, it does not add significant performance boost, it does not remove a lot of code, it just makes the code slightly more straightforward. It changes the behavior of type.__new__(type, obj) which is very unlikely called directly in real code. >>> type(1) >>> type.__new__(type, 1) Traceback (most recent call last): File "", line 1, in TypeError: type.__new__() takes exactly 3 arguments (1 given) ---------- components: Interpreter Core messages: 363664 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal status: open title: Move handling of one-argument call of type() from type.__new__() to type.__call__() versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 10:44:13 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 14:44:13 +0000 Subject: [issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__() In-Reply-To: <1583678581.12.0.621267485575.issue39904@roundup.psfhosted.org> Message-ID: <1583678653.48.0.65727126155.issue39904@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 10:44:20 2020 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 08 Mar 2020 14:44:20 +0000 Subject: =?utf-8?q?=5Bissue39862=5D_Why_are_the_union_relationships_not_implemente?= =?utf-8?b?ZCBieSBkZWZhdWx0IGZvciDiiaQgYW5kIOKJpT8=?= In-Reply-To: <1583404181.09.0.848601767593.issue39862@roundup.psfhosted.org> Message-ID: <1583678660.3.0.460032904848.issue39862@roundup.psfhosted.org> G?ry added the comment: Thanks for the reference @Raymond. I could not find any mention of the union relationships for ? and ? though. Since they are always valid for Boolean values, in the same way that ? is always the complement of = for Boolean values and default implemented as such in the interpreter, what do you think of default implementing these union relationships in the interpreter? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 12:08:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 16:08:12 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583683692.37.0.61329739988.issue39831@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 89fabe51af27a16ae71733334ad94921e3980e28 by Serhiy Storchaka in branch '3.7': [3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18765) https://github.com/python/cpython/commit/89fabe51af27a16ae71733334ad94921e3980e28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 12:09:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 16:09:01 +0000 Subject: [issue39831] Reference leak in PyErr_WarnEx() In-Reply-To: <1583178018.47.0.586114300252.issue39831@roundup.psfhosted.org> Message-ID: <1583683741.45.0.660754985773.issue39831@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 Mar 8 12:40:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 16:40:19 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583685619.47.0.741843888595.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18210 pull_request: https://github.com/python/cpython/pull/18848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 12:47:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 16:47:22 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583686042.94.0.00374248865864.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue, my change introduced a *new* issue. While trying to fix bpo-19466, work on PR 18848, I noticed that my commit eb4e2ae2b8486e8ee4249218b95d94a9f0cc513e introduced a race condition :-( The problem is that while the main thread is executing Py_FinalizeEx(), daemon threads can be waiting in take_gil(). Py_FinalizeEx() calls _PyRuntimeState_SetFinalizing(runtime, tstate). Later, Py_FinalizeEx() executes arbitrary Python code in _PyImport_Cleanup(tstate) which releases the GIL to give a chance to other threads to execute: if (_Py_atomic_load_relaxed(&ceval->gil_drop_request)) { /* Give another thread a chance */ if (_PyThreadState_Swap(&runtime->gilstate, NULL) != tstate) { Py_FatalError("tstate mix-up"); } drop_gil(ceval, tstate); /* Other threads may run now */ /* Check if we should make a quick exit. */ exit_thread_if_finalizing(tstate); take_gil(ceval, tstate); if (_PyThreadState_Swap(&runtime->gilstate, tstate) != NULL) { Py_FatalError("orphan tstate"); } } At this point, one daemon thread manages to get the GIL: take_gil() completes... even if runtime->finalizing is not NULL. I expected that exit_thread_if_finalizing() would exit the thread, but exit_thread_if_finalizing() is now called *after* take_gil(). -- It's unclear to me when the GIL (the lock object) is destroyed and how we are supposed to destroy it, if an unknown number of daemon threads are waiting for it. The GIL lock is created by PyEval_InitThreads(): create_gil() with MUTEX_INIT(gil->mutex). The GIL lock is destroyed by _PyEval_FiniThreads(): destroy_gil() with MUTEX_FINI(gil->mutex). ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 12:54:05 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 08 Mar 2020 16:54:05 +0000 Subject: [issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c In-Reply-To: <1583640866.93.0.894372784953.issue39898@roundup.psfhosted.org> Message-ID: <1583686445.23.0.115528560775.issue39898@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 28ca43b7e30e2eaa2997c3becd8b1a837484ae5c by Andy Lester in branch 'master': closes bpo-39898: Remove unused arg from append_formattedvalue. (GH-18840) https://github.com/python/cpython/commit/28ca43b7e30e2eaa2997c3becd8b1a837484ae5c ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 13:24:16 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 08 Mar 2020 17:24:16 +0000 Subject: [issue39798] Update and Improve README.AIX In-Reply-To: <1582984117.38.0.490903429644.issue39798@roundup.psfhosted.org> Message-ID: <1583688256.92.0.391412385222.issue39798@roundup.psfhosted.org> Michael Felt added the comment: Thanks for asking! Last December I was thinking about this - and what would be the best way to proceed. The reply I liked best suggested working on this - outside of CPython "bugfixes" - perhaps later moving bits into the core. So, motivated by your question I opened an area in github - https://github.com/aixtools/pythonAIXDOC. a) I have done a quick re-write of the current README.AIX - with stress on re-write. b) I have several years experience with packaging Python for AIX (for which I use the IBM compiler) and also manage a Python-buildbot that uses gcc. What I don't want to do is just pour forth lots of notes re: things I have discovered and learned. c) I would appreciate hearing your experiences re: using Python on AIX. Report issues via pythonAIXDOC or my packaging forums (http://forums.rootvg.net/aixtools) and I will reply, study, etc.. as much as I have time to. The experiences (especially frustrations when it works this way (...) on platform Y, but not (the same, or at all) on AIX. Hope this helps! ---------- versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 13:24:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 17:24:25 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583688265.74.0.843697895375.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18211 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/18854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 13:26:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 17:26:27 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583688387.24.0.555873114188.issue19466@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file48961/asyncio_gc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 13:26:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Mar 2020 17:26:52 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583688412.55.0.494637276683.issue19466@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18212 pull_request: https://github.com/python/cpython/pull/18854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 13:41:10 2020 From: report at bugs.python.org (SHANKAR JHA) Date: Sun, 08 Mar 2020 17:41:10 +0000 Subject: [issue39868] Stale Python Language Reference docs (no walrus). In-Reply-To: <1583445248.34.0.0516528795686.issue39868@roundup.psfhosted.org> Message-ID: <1583689270.74.0.135695897503.issue39868@roundup.psfhosted.org> Change by SHANKAR JHA : ---------- keywords: +patch pull_requests: +18213 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:32:47 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 18:32:47 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583692367.8.0.0565278330431.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 2522db11df102be3baf25ce9e816ebe8ffdb7fcc by Terry Jan Reedy in branch 'master': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/2522db11df102be3baf25ce9e816ebe8ffdb7fcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:32:54 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 18:32:54 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583692374.69.0.536020987181.issue39852@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18214 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:33:01 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 18:33:01 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583692381.31.0.251229482314.issue39852@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18215 pull_request: https://github.com/python/cpython/pull/18858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:49:47 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 18:49:47 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583693387.78.0.343452434437.issue39852@roundup.psfhosted.org> miss-islington added the comment: New changeset a5e821c7269ebed6e8b4b4eee3f2247ec41a9788 by Miss Islington (bot) in branch '3.8': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/a5e821c7269ebed6e8b4b4eee3f2247ec41a9788 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:50:41 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 18:50:41 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583693441.5.0.0607403025815.issue39852@roundup.psfhosted.org> miss-islington added the comment: New changeset ec61f53243a4455f41e37a5c645e668661952c28 by Miss Islington (bot) in branch '3.7': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/ec61f53243a4455f41e37a5c645e668661952c28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 14:51:40 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 18:51:40 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583693500.18.0.91143682199.issue39852@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 Sun Mar 8 14:57:34 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 18:57:34 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583693854.4.0.0845576178356.issue39885@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +18216 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/18859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:05:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 19:05:13 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583694313.81.0.287402065399.issue27115@roundup.psfhosted.org> Terry J. Reedy added the comment: Since PR-18801 fixed the status issue, I am returning this to the box replacement issue. ---------- title: IDLE goto should always update status bar line & column -> IDLE goto should use query.Query subclass _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:14:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 19:14:30 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583694870.63.0.698920597345.issue38249@roundup.psfhosted.org> Serhiy Storchaka added the comment: Updated the PR according to review comments. PyNumber_ToBase() now raises SystemError for unsupported base instead of crashing. unicode_eq() asserts that unicode strings are ready (it is only called for hashed strings and if we have a hash they should be ready). PyCode_Optimize() returns the malformed bytecode unmodified. Other potentially non-unreachable code call now Py_FatalError(). Feel free to propose better messages. All other cases look truly unreachable to me. Added support for the Intel and Microsoft compilers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:30:08 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 19:30:08 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583695808.16.0.649458069134.issue39885@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09 by Terry Jan Reedy in branch 'master': bpo-39885: IDLE context menu clears selection (#18859) https://github.com/python/cpython/commit/4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:30:21 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 19:30:21 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583695821.79.0.0541019574107.issue39885@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18218 pull_request: https://github.com/python/cpython/pull/18861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:30:15 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 19:30:15 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583695815.7.0.521386531784.issue39885@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +18217 pull_request: https://github.com/python/cpython/pull/18860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:46:41 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 19:46:41 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583696801.31.0.373793025087.issue39885@roundup.psfhosted.org> miss-islington added the comment: New changeset f9684d222effff0950c1ce206873a9c66dfd30ed by Miss Islington (bot) in branch '3.7': bpo-39885: IDLE context menu clears selection (GH-18859) https://github.com/python/cpython/commit/f9684d222effff0950c1ce206873a9c66dfd30ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 15:47:09 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 19:47:09 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583696829.15.0.342321838361.issue39885@roundup.psfhosted.org> miss-islington added the comment: New changeset b2e8240261aa879b8978d7add6dd1efc4318add1 by Miss Islington (bot) in branch '3.8': bpo-39885: IDLE context menu clears selection (GH-18859) https://github.com/python/cpython/commit/b2e8240261aa879b8978d7add6dd1efc4318add1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:01:08 2020 From: report at bugs.python.org (Yon Ar Chall) Date: Sun, 08 Mar 2020 20:01:08 +0000 Subject: [issue39905] Cannot load sub package having a 3-dot relative import Message-ID: <1583697668.13.0.326902035293.issue39905@roundup.psfhosted.org> New submission from Yon Ar Chall : Hi there ! I was trying to use importlib.util.spec_from_file_location() to import a nested package containing a 3-dot relative import. $ tree ~/myproj /home/yon/myproj ??? mypkg ??? __init__.py ??? subpkg ??? __init__.py ??? subsubpkg_abs ??? ??? __init__.py ??? subsubpkg_rel ??? __init__.py Relative import here : $ cat ~/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py from ... import subpkg Absolute import here (for comparison purpose) : $ cat ~/myproj/mypkg/subpkg/subsubpkg_abs/__init__.py import mypkg.subpkg $ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from importlib.util import spec_from_file_location >>> spec = spec_from_file_location("subsubpkg_abs", "/home/yon/myproj/mypkg/subpkg/subsubpkg_abs/__init__.py") >>> spec.loader.load_module() >>> spec = spec_from_file_location("subsubpkg_rel", "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py") >>> spec.loader.load_module() Traceback (most recent call last): File "", line 1, in File "", line 388, in _check_name_wrapper File "", line 809, in load_module File "", line 668, in load_module File "", line 268, in _load_module_shim File "", line 693, in _load File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py", line 1, in from ... import subpkg ValueError: attempted relative import beyond top-level package >>> Raw import just works (as importlib.import_module() does) : >>> import mypkg.subpkg.subsubpkg_rel >>> ---------- components: Library (Lib) messages: 363678 nosy: yon priority: normal severity: normal status: open title: Cannot load sub package having a 3-dot relative import versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:17:48 2020 From: report at bugs.python.org (Maor Kleinberger) Date: Sun, 08 Mar 2020 20:17:48 +0000 Subject: [issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0) In-Reply-To: <1581577789.38.0.529951784345.issue39622@roundup.psfhosted.org> Message-ID: <1583698668.18.0.0340025826542.issue39622@roundup.psfhosted.org> Maor Kleinberger added the comment: Hey there, it's been more than a week since I pushed the last changes, can anyone review them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:20:12 2020 From: report at bugs.python.org (Maor Kleinberger) Date: Sun, 08 Mar 2020 20:20:12 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583698812.21.0.118637635955.issue39517@roundup.psfhosted.org> Maor Kleinberger added the comment: Hey there, the PR was approved a week ago, is there a reason it is not merged yet? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:35:19 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 08 Mar 2020 20:35:19 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` Message-ID: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> New submission from Barney Gale : As of Python 3.3, `os.lstat()` and `os.lchmod()` are available as `os.stat(follow_symlinks=False)` and `os.chmod(follow_symlinks=False)`, but an equivalent change didn't make it into pathlib. I propose we add the `follow_symlinks` argument to `Path.stat()` and `Path.chmod()` for consistency with `os` and because the new notation is arguable clearer for people who don't know many system calls off by heart :) ---------- components: Library (Lib) messages: 363681 nosy: barneygale priority: normal severity: normal status: open title: pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:39:17 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 08 Mar 2020 20:39:17 +0000 Subject: [issue39905] Cannot load sub package having a 3-dot relative import In-Reply-To: <1583697668.13.0.326902035293.issue39905@roundup.psfhosted.org> Message-ID: <1583699957.6.0.34575236216.issue39905@roundup.psfhosted.org> Mark Dickinson added the comment: In this line: > spec = spec_from_file_location("subsubpkg_rel", "/home/yon/myproj/mypkg/subpkg/subsubpkg_rel/__init__.py") try providing the fully-qualified name, instead of just "subsubpkg_rel". That is: > spec = spec_from_file_location("mypkg.subpkg.subsubpkg_rel", "/Users/mdickinson/Desktop/test/mypkg/subpkg/subsubpkg_rel/__init__.py") ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:43:25 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 08 Mar 2020 20:43:25 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583700205.21.0.677184888199.issue39517@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0911ea5c172264eaefa3efe4a1788159c160920d by Maor Kleinberger in branch 'master': bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699) https://github.com/python/cpython/commit/0911ea5c172264eaefa3efe4a1788159c160920d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:43:30 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 20:43:30 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583700210.69.0.467717060754.issue39517@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18219 pull_request: https://github.com/python/cpython/pull/18862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:43:53 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 08 Mar 2020 20:43:53 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583700233.23.0.210958494819.issue39517@roundup.psfhosted.org> Steve Dower added the comment: Nope, just that I apparently forgot to merge (or forgot to come back after CI had finished). Thanks for the reminder! ---------- nosy: -miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 16:44:44 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 08 Mar 2020 20:44:44 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583700284.22.0.0294339399901.issue39517@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:00:03 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Mar 2020 21:00:03 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583701203.37.0.203123235857.issue39517@roundup.psfhosted.org> miss-islington added the comment: New changeset 0687bdf5def13ddca09e854113c0eac0772afea0 by Miss Islington (bot) in branch '3.8': bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699) https://github.com/python/cpython/commit/0687bdf5def13ddca09e854113c0eac0772afea0 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:08:28 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 21:08:28 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583701708.62.0.108337596967.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +18220 pull_request: https://github.com/python/cpython/pull/18863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:10:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 21:10:44 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583701844.96.0.988709649019.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:10:33 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 21:10:33 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583701833.66.0.994237852222.issue38643@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry Zackery, I did not know about this issue so I wrote different PR to fix this problem. And only after writing it I have found this issue. There are several differences between your PR and PR 18863. * SystemError is raised instead of ValueError because this is incorrect use of the C API. * The error message mentions also base 10. * The test is written mostly in Python. For these reasons I prefer my PR. Please let me know if you need a review for other PRs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:10:58 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Mar 2020 21:10:58 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583701858.31.0.161809429156.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +C API -Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:50:38 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 21:50:38 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583704238.9.0.671479442053.issue27115@roundup.psfhosted.org> Terry J. Reedy added the comment: The related issue is #39852. Since its PR-18801 fixed the status issue, I am returning this to the box replacement issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 17:53:00 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Mar 2020 21:53:00 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583704380.71.0.457860546947.issue39885@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 Sun Mar 8 18:29:20 2020 From: report at bugs.python.org (Maor Kleinberger) Date: Sun, 08 Mar 2020 22:29:20 +0000 Subject: [issue39517] runpy calls open_code with Path object In-Reply-To: <1580576532.94.0.922991847859.issue39517@roundup.psfhosted.org> Message-ID: <1583706560.53.0.757923965162.issue39517@roundup.psfhosted.org> Maor Kleinberger added the comment: Great, thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 20:05:01 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 00:05:01 +0000 Subject: [issue7479] os.lchmod is not present In-Reply-To: <1260534820.94.0.148252550457.issue7479@psf.upfronthosting.co.za> Message-ID: <1583712301.8.0.319668398238.issue7479@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 5.0 -> 6.0 pull_requests: +18222 pull_request: https://github.com/python/cpython/pull/18864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 20:05:01 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 00:05:01 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1583712301.7.0.619285237744.issue39906@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18221 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 20:17:57 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 00:17:57 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` Message-ID: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> New submission from Barney Gale : `pathlib.Path.iterdir()` uses `os.listdir()` rather than `os.scandir()`. I think this has a small performance cost, per PEP 471: > It returns a generator instead of a list, so that scandir acts as a true iterator instead of returning the full list immediately. As `scandir()` is already available from `_NormalAccessor` it's a simple patch to use `scandir()` instead. ---------- components: Library (Lib) messages: 363689 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 20:22:05 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 00:22:05 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583713325.14.0.551974495112.issue39907@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18223 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 21:45:25 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 01:45:25 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583718325.89.0.964977870104.issue39850@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch nosy: +pablogsal nosy_count: 2.0 -> 3.0 pull_requests: +18224 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 8 23:59:59 2020 From: report at bugs.python.org (Andy Lester) Date: Mon, 09 Mar 2020 03:59:59 +0000 Subject: [issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c Message-ID: <1583726399.05.0.763626668846.issue39908@roundup.psfhosted.org> New submission from Andy Lester : init_set_builtins_open(PyThreadState *tstate) -> unused arg _Py_FatalError_PrintExc(int fd) -> unused arg ---------- components: Interpreter Core messages: 363690 nosy: petdance priority: normal severity: normal status: open title: Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 00:10:23 2020 From: report at bugs.python.org (Andy Lester) Date: Mon, 09 Mar 2020 04:10:23 +0000 Subject: [issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c In-Reply-To: <1583726399.05.0.763626668846.issue39908@roundup.psfhosted.org> Message-ID: <1583727023.83.0.333870413702.issue39908@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 00:38:39 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 09 Mar 2020 04:38:39 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583728719.51.0.78986971932.issue39852@roundup.psfhosted.org> Guido van Rossum added the comment: I have a nit on the commit message used here (and also in issue 39885). *Please* don't use this style of commit message "IDLE context menu clears selection". That phrasing sounds like it is the description of a bug. Please always use a phrasing that makes it clear what the commit/PR changes. In this case, for example, it could be "IDLE: make context menu clear selection". I know there are projects that prefer this style. Python is not one of them. Please comply. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:14:47 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 05:14:47 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583730887.05.0.43999254691.issue27115@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +18226 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/18868 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:38:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 05:38:13 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583732293.79.0.973261150583.issue27115@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset e53a3932cb01683b0fa8a7448ca25a2e658c39e6 by Terry Jan Reedy in branch 'master': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/e53a3932cb01683b0fa8a7448ca25a2e658c39e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:38:22 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 05:38:22 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583732302.41.0.212106345433.issue27115@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18227 pull_request: https://github.com/python/cpython/pull/18869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:38:29 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 05:38:29 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583732309.0.0.962713673291.issue27115@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18228 pull_request: https://github.com/python/cpython/pull/18870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:54:37 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 05:54:37 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583733277.91.0.356495006482.issue27115@roundup.psfhosted.org> miss-islington added the comment: New changeset 9d5ed8355d4cb73ab13fa6094c9ab57798dff3be by Miss Islington (bot) in branch '3.7': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/9d5ed8355d4cb73ab13fa6094c9ab57798dff3be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 01:56:32 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 05:56:32 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583733392.02.0.0790450049735.issue27115@roundup.psfhosted.org> miss-islington added the comment: New changeset f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc by Miss Islington (bot) in branch '3.8': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 02:16:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 06:16:09 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583734569.47.0.402131520845.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: Is it the temporal ambiguity (fixed by adding 'now', which is in the blurbs) or the descriptive versus command style (as with 'Returns' versus 'Return') that you do not like? If the latter, the devguide could use augmentation. The only relevant 'guidance' I found is this descriptive example in https://devguide.python.org/pullrequest/#making-good-commits: "the spam module is now more spammy". This seems similar to "IDLE context menu now clears selection". I don't see anything about commit messages in https://devguide.python.org/committing/, which seems like another likely place for such. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 02:34:41 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 06:34:41 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583735681.78.0.584112508251.issue27115@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- dependencies: -Finish IDLE Query dialog appearance and behavior. stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 02:58:17 2020 From: report at bugs.python.org (henrik242) Date: Mon, 09 Mar 2020 06:58:17 +0000 Subject: [issue39875] urllib.request.urlopen sends POST data as query string In-Reply-To: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> Message-ID: <1583737097.86.0.991400971639.issue39875@roundup.psfhosted.org> henrik242 added the comment: Solved! The problem was Solr which it has special handling of POSTed data with the User-Agent starts with 'curl/': https://github.com/apache/lucene-solr/blob/40661489cd590947f513e553a20707d0c82b82e5/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java#L782 In all other cases Solr expects the Content-Type to be text/xml. Setting that with urrlib.request makes the request work fine: >>> req = urllib.request.Request(url, data.encode('utf-8'), headers={'Content-Type': 'text/xml'}) >>> res = urllib.request.urlopen(req) A big thanks to https://stackoverflow.com/a/60586102/13365 for figuring this out ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 03:00:08 2020 From: report at bugs.python.org (henrik242) Date: Mon, 09 Mar 2020 07:00:08 +0000 Subject: [issue12849] Cannot override 'connection: close' in urllib2 headers In-Reply-To: <1314559168.55.0.630424901631.issue12849@psf.upfronthosting.co.za> Message-ID: <1583737208.61.0.432968838566.issue12849@roundup.psfhosted.org> henrik242 added the comment: Correction: My problem in Issue 39875 was not related to Connection: Close, but with weird POST handling in Solr. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 03:18:55 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 07:18:55 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583738335.34.0.853334533215.issue27115@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +18229 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/18871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 03:26:04 2020 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQuNC7INCa0YvRiNGC0YvQvNC+0LI=?=) Date: Mon, 09 Mar 2020 07:26:04 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError Message-ID: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> New submission from ?????? ???????? : Assignment expression in assert causes SyntaxError Minimal case: ``` assert var := None ``` Error: ``` File "", line 1 assert var := None ^ SyntaxError: invalid syntax ``` Workaround: ``` assert (var := None) ``` My use case: ``` my_dict = dict() assert value := my_dict.get('key') ``` ---------- components: Interpreter Core messages: 363698 nosy: ?????? ???????? priority: normal severity: normal status: open title: Assignment expression in assert causes SyntaxError type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:14:11 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 09 Mar 2020 08:14:11 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError In-Reply-To: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> Message-ID: <1583741651.9.0.80543823783.issue39909@roundup.psfhosted.org> Eric V. Smith added the comment: I believe this is by design, as is the same restriction on statement-level assignment expressions. And if requiring parens discourages the use of assignment expressions in asserts, I think that's a good thing. Why not just use the workaround you've already identified? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:21:48 2020 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQuNC7INCa0YvRiNGC0YvQvNC+0LI=?=) Date: Mon, 09 Mar 2020 08:21:48 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError In-Reply-To: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> Message-ID: <1583742108.65.0.684023186783.issue39909@roundup.psfhosted.org> ?????? ???????? added the comment: if this is by design i'm fine with somebody closing this issue. i've not found mention of such case in pep so i though it's not by design. docs say `assert` just takes "expression" and "assignment expression" has "expression" in it's name. https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement workaraund does not look as cool because of parentheses. again, if this is "as intended" i'm fine with closing issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:23:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 08:23:02 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError In-Reply-To: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> Message-ID: <1583742182.61.0.534173229884.issue39909@roundup.psfhosted.org> STINNER Victor added the comment: > assert var := None It's good that this syntax is rejected: it looks like a typo (assert var == None). Moreover, it's part of of the PEP 572 design. https://www.python.org/dev/peps/pep-0572/#exceptional-cases Python works as expected, I suggest to close the issue as not a bug. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:25:00 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 09 Mar 2020 08:25:00 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError In-Reply-To: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> Message-ID: <1583742300.81.0.508591863849.issue39909@roundup.psfhosted.org> Eric V. Smith added the comment: I'm going to close this, since I can't imagine this restriction being relaxed. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:25:09 2020 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQuNC7INCa0YvRiNGC0YvQvNC+0LI=?=) Date: Mon, 09 Mar 2020 08:25:09 +0000 Subject: [issue39909] Assignment expression in assert causes SyntaxError In-Reply-To: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org> Message-ID: <1583742309.45.0.897349015455.issue39909@roundup.psfhosted.org> ?????? ???????? added the comment: ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:40:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 08:40:03 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583743203.01.0.679749683133.issue38249@roundup.psfhosted.org> STINNER Victor added the comment: Antoine: "I agree with Serhiy. If you hit a rare situation that you don't want to handle, use Py_FatalError(), not Py_UNREACHABLE()." Py_UNREACHABLE() documentation still says "Use this when you have a code path that you do not expect to be reached." and "Use this in places where you might be tempted to put an assert(0) or abort() call." https://docs.python.org/dev/c-api/intro.html#c.Py_UNREACHABLE Can we clarify when Py_UNREACHABLE() must *not* be used? I understand that there are two cases: * Code path very unlikely to reach, but can be reached in some exceptional case. If it's reached, Python must report an error. Example: _PyTime_GetSystemClock(). * Code path which cannot be technically reached: compiler complains but it's a compiler/linter false alarm. Example: lookdict_index(). I propose to rephrase the Py_UNREACHABLE() macro documentation: "Use this when you have a code path that cannot be reached by design. For example, in the default: clause in a switch statement for which all possible values are covered in case statements. Use this in places where you might be tempted to put an assert(0) or abort() call. Don't use this macro for very unlikely code path if it can be reached under exceptional case. For example, under low memory condition or if a system call returns a value out of the expected range." I suggest to update the doc as part of PR 16329. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:43:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 08:43:02 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583743382.43.0.0875918901595.issue38249@roundup.psfhosted.org> STINNER Victor added the comment: The GCC documentation contains a good example: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html """ Another use for __builtin_unreachable is following a call a function that never returns but that is not declared __attribute__((noreturn)), as in this example: void function_that_never_returns (void); int g (int c) { if (c) { return 1; } else { function_that_never_returns (); __builtin_unreachable (); } } """ This example is more explicit than a function which gets an "unexpected" value: such case should use Py_FatalError() if I understand correctly. By the way, Py_FatalError() should be avoided: it's always better to report the failure to the caller :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 04:48:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 08:48:03 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583743683.98.0.967296515681.issue38249@roundup.psfhosted.org> STINNER Victor added the comment: """ Use this when you have a code path that cannot be reached by design. For example, in the default: clause in a switch statement for which all possible values are covered in case statements. Use this in places where you might be tempted to put an assert(0) or abort() call. In release mode, the macro helps the compiler to optimize the code, and avoids a warning about unreachable code. For example, the macro is implemented with __builtin_unreachable() on GCC in release mode. An use for Py_UNREACHABLE() is following a call a function that never returns but that is not declared _Py_NO_RETURN. If a code path is very unlikely code but can be reached under exceptional case, this macro must not be used. For example, under low memory condition or if a system call returns a value out of the expected range. In this case, it's better to report the error to the caller. If the error cannot be reported to caller, :c:func:`Py_FatalError` can be used. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 05:10:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 09:10:58 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1583745058.34.0.21453447928.issue14126@roundup.psfhosted.org> STINNER Victor added the comment: > Isn't this the same as https://bugs.python.org/issue36551 ? Yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 05:15:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 09:15:56 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583745356.03.0.66635695917.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: > So it isn't valid to skip calling the cleanup functions just because md_state is NULL - we have no idea what Py_mod_create might have done that needs to be cleaned up. In your example, I don't see what m_clear/m_free would be supposed to clear/free. I don't see how a module can store data without md_state which would require m_clear/m_free to clear/free such data. module_clear() continue to clear Python objects of the PyModuleObject structure with PR 18738. Would you mind to elaborate? The intent of PR 18738 is to simplify the implementation of C extension modules which implements the PEP 489 and uses a module state (md_state > 0). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 05:51:22 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 09 Mar 2020 09:51:22 +0000 Subject: [issue39905] Cannot load sub package having a 3-dot relative import In-Reply-To: <1583697668.13.0.326902035293.issue39905@roundup.psfhosted.org> Message-ID: <1583747482.29.0.872746750354.issue39905@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:05:34 2020 From: report at bugs.python.org (=?utf-8?b?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?=) Date: Mon, 09 Mar 2020 10:05:34 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1583748334.74.0.14250043805.issue26227@roundup.psfhosted.org> ???????? ????????? added the comment: I have Python 3.7.4 and have the same exception: print (socket.gethostbyaddr("127.0.0.1")) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 6: invalid continuation byte My OS is Win7 and my computer name contains cyrillic characters. ---------- nosy: +???????? ????????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:15:36 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 09 Mar 2020 10:15:36 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1583748936.38.0.398822839144.issue26227@roundup.psfhosted.org> Steve Dower added the comment: Looks like what was actually applied was changed to PyUnicode_DecodeFSDefault, which was later changed on Windows to be always UTF-8. They'll need to be normalised throughout Modules/socketmodule.c (I can't tell at a quick glance which need updating). We should also figure out some kind of test that can catch this sort of issue. Sorry for guiding you wrong a few years ago, Victor! ---------- resolution: fixed -> stage: -> test needed status: closed -> open versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:15:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 10:15:51 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583748951.76.0.778841195761.issue39763@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18230 pull_request: https://github.com/python/cpython/pull/18872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:16:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 10:16:36 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583748996.39.0.2338286254.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: > AttributeError: module 'subprocess' has no attribute 'check_output' I wrote PR 18872 to implement it for setup.py. Michael Felt: Can you please test it on AIX? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:17:33 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 09 Mar 2020 10:17:33 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1583749053.14.0.47693154897.issue26227@roundup.psfhosted.org> Steve Dower added the comment: If someone wants to do the extra work to use the native Windows socket functions on Windows instead of the POSIX-ey wrappers, that should happen under a new issue. This bug is for a regression that we ought to fix back as far as we can. ---------- priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:53:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 10:53:14 +0000 Subject: [issue23592] SIGSEGV on interpreter shutdown, with daemon threads running wild In-Reply-To: <1425585415.3.0.819286404467.issue23592@psf.upfronthosting.co.za> Message-ID: <1583751194.83.0.46113357818.issue23592@roundup.psfhosted.org> STINNER Victor added the comment: I believe that this issue cannot occur in Python 3.8 thanks for bpo-36475. According to the backtrace, a thread does crash in PyEval_EvalFrameEx(). I understand that it's a daemon thread. To execute PyEval_EvalFrameEx(), a daemon thread must hold the GIL. With bpo-36475, a daemon thread now exits immediately instead of taking the GIL. ---------- nosy: +vstinner resolution: -> fixed stage: -> resolved status: open -> closed superseder: -> PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 06:53:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 10:53:27 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1583751207.82.0.88672128682.issue36475@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-23592 as duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:14:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:14:13 +0000 Subject: [issue30519] [threading] Add daemon argument to Timer In-Reply-To: <1496199253.36.0.456621970472.issue30519@psf.upfronthosting.co.za> Message-ID: <1583752453.48.0.259671085787.issue30519@roundup.psfhosted.org> STINNER Victor added the comment: Daemon threads are very fragile by design. I would prefer to not promote their usage. See for example bpo-39877 for a recent example. I would prefer to remove support for daemon threads, rather than adding more daemon threads! I reject the issue. Moreover, PR 1878 has been closed. ---------- nosy: +vstinner resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:18:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:18:22 +0000 Subject: [issue26037] Crash when reading sys.stdin.buffer in a daemon thread In-Reply-To: <1452170624.64.0.0901256170606.issue26037@psf.upfronthosting.co.za> Message-ID: <1583752702.51.0.684798849658.issue26037@roundup.psfhosted.org> STINNER Victor added the comment: The problem is that Py_FinalizeEx() tries to close the sys.stdin object in _PyImport_Cleanup(), but closing the buffered object requires the object lock which is hold by _thread(). _thread() is blocked on waiting for a newline character. I suggest to use non-blocking read in a loop, to be able to properly stop your thread at Python exit. You may want to give a try using the asyncio module. Python works as expected. I don't see any bug here. I close the issue. ---------- nosy: +vstinner resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:19:49 2020 From: report at bugs.python.org (Mingye Wang) Date: Mon, 09 Mar 2020 11:19:49 +0000 Subject: [issue39910] os.ftruncate on Windows should be sparse Message-ID: <1583752789.13.0.677978816709.issue39910@roundup.psfhosted.org> New submission from Mingye Wang : Consider this interaction: cmd> echo > 1.txt cmd> python -c "__import__('os').truncate('1.txt', 1024 ** 3)" cmd> fsutil sparse queryFlag 1.txt Not only takes a long time as is typical for a zero-write, but also reports non-sparse as an actual write would suggest. This is because internally, _chsize_s and friends enlarges files using a loop.[1] [1]: https://github.com/leelwh/clib/blob/master/c/chsize.c On Unix systems, ftruncate for enlarging is described as "... as if the extra space is zero-filled", but this is not to be taken literally. In practice, sparse files are used whenever available (GNU dd expects that) and people do expect the operation to be very fast without a lot of real writes. A FreeBSD bug exists around how ftruncate is too slow on UFS. The aria2 downloader gives a good example of how to truncate into a sparse file on Windows.[2] First a FSCTL_SET_SPARSE control is issued, and then a seek + SetEndOfFile would finish the job. Of course, a lseek to the end would be required to first determine the size of the file, so we know whether we are enlarging (sparse) or shrinking (don't sparse). [2]: https://github.com/aria2/aria2/blob/master/src/AbstractDiskWriter.cc#L507 ---------- components: Library (Lib) messages: 363717 nosy: Artoria2e5, steve.dower priority: normal severity: normal status: open title: os.ftruncate on Windows should be sparse versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:20:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:20:17 +0000 Subject: [issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode In-Reply-To: <1566808952.7.0.710040972846.issue37951@roundup.psfhosted.org> Message-ID: <1583752817.4.0.294697901884.issue37951@roundup.psfhosted.org> STINNER Victor added the comment: > I'm reducing the severity from release blocker to high and keep the ticket in pending to give Eric a change to review the commits. Python 3.8.0 is released with the fix. It's now time to close the issue. ---------- stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:28:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:28:30 +0000 Subject: [issue13077] Windows: Unclear behavior of daemon threads on main thread exit In-Reply-To: <1317396642.03.0.535538271179.issue13077@psf.upfronthosting.co.za> Message-ID: <1583753310.06.0.661830729888.issue13077@roundup.psfhosted.org> STINNER Victor added the comment: I can only reproduce the behavior (other thread continues to run after CTRL+C) on Windows, not on Linux. ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, vstinner, zach.ware title: Unclear behavior of daemon threads on main thread exit -> Windows: Unclear behavior of daemon threads on main thread exit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:58:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:58:00 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1583755080.14.0.627824553943.issue38691@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fc72ab6913f2b5337ae7fda711f2de846d38f479 by idomic in branch 'master': bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627) https://github.com/python/cpython/commit/fc72ab6913f2b5337ae7fda711f2de846d38f479 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 07:58:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 11:58:15 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1583755095.81.0.504755806021.issue38691@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:03:14 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 12:03:14 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583755394.43.0.606028272102.issue39907@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This optimisation was also hinted at https://bugs.python.org/issue26032#msg257653 ---------- nosy: +pitrou, serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:04:39 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 12:04:39 +0000 Subject: [issue39659] pathlib calls `os.getcwd()` without using accessor In-Reply-To: <1581901062.0.0.795874471606.issue39659@roundup.psfhosted.org> Message-ID: <1583755479.48.0.264659055534.issue39659@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:05:48 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 12:05:48 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1583755548.3.0.564640325764.issue39906@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:25:05 2020 From: report at bugs.python.org (wyz23x2) Date: Mon, 09 Mar 2020 12:25:05 +0000 Subject: [issue39893] Add set_terminate() to logging In-Reply-To: <1583631928.08.0.636438153182.issue39893@roundup.psfhosted.org> Message-ID: <1583756705.88.0.0178383204135.issue39893@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: +Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:31:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 12:31:45 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583757105.2.0.0872227280182.issue36184@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18231 pull_request: https://github.com/python/cpython/pull/18873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:32:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 12:32:55 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583757175.24.0.792639940983.issue36184@roundup.psfhosted.org> STINNER Victor added the comment: > So I changed 'pthread_cond_timedwait' to 'take_gil' and this didn't seem to have an effect on the unit test. Maybe you forgot to run "make" to copy Tools/gdb/libpython.py as python-gdb.py. Anyway, I wrote PR 18873 and I tested manually that it does fix test_gdb on FreeBSD. I tested "GNU gdb (GDB) 8.3.1 [GDB v8.3.1 for FreeBSD]" on FreeBSD 12.1-RELEASE-p2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:32:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 12:32:54 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583757174.44.0.0872094649917.issue39907@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not so easy. There was reason why it was not done earlier. scandir() wastes more limited resource than memory -- file descriptors. It should also be properly closed and do not depend on the garbage collector. Consider the example: def traverse(path, visit): for child in path.iterdir(): if child.is_dir(): traverse(path, visit) else: visit(child) With your optimization it may fail with OSError: Too many open files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:37:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 12:37:12 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583757432.97.0.00763755176412.issue39903@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 88944a44aa84b0f3674939019b1befbc7a9dc874 by Serhiy Storchaka in branch 'master': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/88944a44aa84b0f3674939019b1befbc7a9dc874 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:37:24 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 12:37:24 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583757444.64.0.961291224687.issue39903@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18232 pull_request: https://github.com/python/cpython/pull/18874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:37:32 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 12:37:32 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583757452.23.0.433941252011.issue39903@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18233 pull_request: https://github.com/python/cpython/pull/18875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:53:32 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 12:53:32 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583758412.79.0.916600843841.issue39903@roundup.psfhosted.org> miss-islington added the comment: New changeset 80be9c344f9fa619c24712c699b70126fc202315 by Miss Islington (bot) in branch '3.7': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/80be9c344f9fa619c24712c699b70126fc202315 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 08:55:21 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 12:55:21 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583758521.05.0.279072537052.issue39903@roundup.psfhosted.org> miss-islington added the comment: New changeset 97bbdb28b4ab9519780f924e3267ac70af1cd5b8 by Miss Islington (bot) in branch '3.8': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/97bbdb28b4ab9519780f924e3267ac70af1cd5b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:10:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 13:10:21 +0000 Subject: [issue39903] Double decref in _elementtree.Element.__getstate__ In-Reply-To: <1583670244.74.0.393826922537.issue39903@roundup.psfhosted.org> Message-ID: <1583759421.83.0.828232501451.issue39903@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 Mar 9 09:13:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 13:13:00 +0000 Subject: [issue39822] Use NULL instead of None for empty attrib in C implementation of Element In-Reply-To: <1583134745.29.0.697381999553.issue39822@roundup.psfhosted.org> Message-ID: <1583759580.58.0.894754721424.issue39822@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e by Serhiy Storchaka in branch 'master': bpo-39822: Use NULL instead of None for empty attrib in Element. (GH-18735) https://github.com/python/cpython/commit/dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:14:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 13:14:54 +0000 Subject: [issue39822] Use NULL instead of None for empty attrib in C implementation of Element In-Reply-To: <1583134745.29.0.697381999553.issue39822@roundup.psfhosted.org> Message-ID: <1583759694.21.0.27248226826.issue39822@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 Mar 9 09:34:01 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 13:34:01 +0000 Subject: [issue39893] Add set_terminate() to logging In-Reply-To: <1583631928.08.0.636438153182.issue39893@roundup.psfhosted.org> Message-ID: <1583760841.87.0.243815117603.issue39893@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:37:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 13:37:20 +0000 Subject: [issue1294959] Problems with /usr/lib64 builds. Message-ID: <1583761040.36.0.159008297067.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: lib64_tests-2.py: Updated test for PR 18381. It now uses sys.platlibdir and it tests also Makefile LIBPL variable. ---------- Added file: https://bugs.python.org/file48962/lib64_tests-2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:37:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 13:37:49 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583761069.91.0.169319903647.issue1294959@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Problems with /usr/lib64 builds. -> Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:37:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 13:37:56 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583761076.94.0.544387710927.issue1294959@roundup.psfhosted.org> Change by STINNER Victor : ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:42:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 13:42:23 +0000 Subject: [issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore Message-ID: <1583761343.44.0.373306188217.issue39911@roundup.psfhosted.org> New submission from STINNER Victor : "AMD64 Windows7 SP1 3.x" buildbot worker fails to build Python. It should either be fixed, or the worker should be removed. ---------- components: Build, Tests messages: 363729 nosy: pablogsal, steve.dower, vstinner priority: normal severity: normal status: open title: "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:48:06 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 13:48:06 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583761686.24.0.913499747779.issue39850@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6012f30beff7fa8396718dfb198ccafc333c565b by Pablo Galindo in branch 'master': bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) https://github.com/python/cpython/commit/6012f30beff7fa8396718dfb198ccafc333c565b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:51:20 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 13:51:20 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583761880.01.0.411361735651.issue39850@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18234 pull_request: https://github.com/python/cpython/pull/18876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:57:09 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 13:57:09 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583762229.69.0.464908969016.issue39850@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18235 pull_request: https://github.com/python/cpython/pull/18877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 09:58:49 2020 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 09 Mar 2020 13:58:49 +0000 Subject: [issue39893] Add set_terminate() to logging In-Reply-To: <1583631928.08.0.636438153182.issue39893@roundup.psfhosted.org> Message-ID: <1583762329.9.0.332661579204.issue39893@roundup.psfhosted.org> Vinay Sajip added the comment: There's no need for a method to do this. You can do any of: 1. Set the terminator attribute to whatever you need in logging.StreamHandler (if all code you ever use must use a different terminator). 2. Set it in individual instances of StreamHandler. 3. Set it in a subclass of StreamHandler which you then use instead of StreamHandler. Since only a few cases will want a different terminator, there's no need to add a special mechanism to override it, when you can just use an assignment statement. ---------- resolution: -> rejected stage: -> resolved status: open -> closed versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:05:45 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 09 Mar 2020 14:05:45 +0000 Subject: [issue39912] warnings.py should not raise AssertionError when validating arguments Message-ID: <1583762744.97.0.386872091092.issue39912@roundup.psfhosted.org> New submission from R?mi Lapeyre : Currently simplefilter() and filterwarnings() don't validate their arguments when using -O and AssertionError is not the most appropriate exception to raise. I will post a PR shortly. ---------- components: Library (Lib) messages: 363732 nosy: remi.lapeyre priority: normal severity: normal status: open title: warnings.py should not raise AssertionError when validating arguments versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:15:03 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 09 Mar 2020 14:15:03 +0000 Subject: [issue39912] warnings.py should not raise AssertionError when validating arguments In-Reply-To: <1583762744.97.0.386872091092.issue39912@roundup.psfhosted.org> Message-ID: <1583763303.06.0.902585393877.issue39912@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- keywords: +patch pull_requests: +18236 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:20:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 14:20:01 +0000 Subject: [issue39321] AMD64 FreeBSD Non-Debug 3.x: main regrtest process killed by SIGKILL (Signal 9) In-Reply-To: <1578925087.43.0.642221025557.issue39321@roundup.psfhosted.org> Message-ID: <1583763601.19.0.157118174092.issue39321@roundup.psfhosted.org> STINNER Victor added the comment: > If it fails again in the same manner, please re-open The issue is back. Two examples. -- Today: https://buildbot.python.org/all/#/builders/214/builds/405 (...) 0:15:40 load avg: 3.11 [366/420] test_pickletools passed -- running: test_multiprocessing_forkserver (2 min 43 sec), test_multiprocessing_fork (1 min 17 sec) 0:15:40 load avg: 3.11 [367/420] test_webbrowser passed -- running: test_multiprocessing_forkserver (2 min 43 sec), test_multiprocessing_fork (1 min 18 sec) 0:15:42 load avg: 3.11 [368/420] test_codecmaps_hk passed -- running: test_multiprocessing_forkserver (2 min 45 sec), test_multiprocessing_fork (1 min 19 sec) fetching http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT ... 0:15:43 load avg: 3.11 [369/420] test_pprint passed -- running: test_multiprocessing_forkserver (2 min 45 sec), test_multiprocessing_fork (1 min 20 sec) *** Signal 9 -- 1 day ago: https://buildbot.python.org/all/#/builders/214/builds/395 (...) 0:14:53 load avg: 3.29 [269/420/1] test_keywordonlyarg passed -- running: test_multiprocessing_forkserver (2 min 25 sec) 0:15:00 load avg: 2.94 [270/420/1] test_pprint passed -- running: test_multiprocessing_forkserver (2 min 31 sec) 0:15:00 load avg: 2.94 [271/420/2] test_io crashed (Exit code -9) -- running: test_multiprocessing_forkserver (2 min 31 sec) 0:15:05 load avg: 2.87 [272/420/2] test_positional_only_arg passed -- running: test_multiprocessing_forkserver (2 min 37 sec) *** Signal 9 ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:30:19 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 14:30:19 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583764219.73.0.117622250301.issue39907@roundup.psfhosted.org> Barney Gale added the comment: Ah, right you are! The globbing helpers call `list(os.scandir(...))` - perhaps we should do the same here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:35:53 2020 From: report at bugs.python.org (daniel hahler) Date: Mon, 09 Mar 2020 14:35:53 +0000 Subject: [issue39913] Document warnings.WarningMessage ? Message-ID: <1583764553.02.0.37062728089.issue39913@roundup.psfhosted.org> New submission from daniel hahler : I've noticed that `warnings.WarningMessage` is not documented, i.e. it does not show up in the intersphinx object list. I'm not sure how to document it best, but maybe just describing its attributes? Ref: https://github.com/blueyed/cpython/blob/598d29c51c7b5a77f71eed0f615eb0b3865a4085/Lib/warnings.py#L398-L417 ---------- assignee: docs at python components: Documentation messages: 363735 nosy: blueyed, docs at python priority: normal severity: normal status: open title: Document warnings.WarningMessage ? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:46:13 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 14:46:13 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583765173.17.0.785491946192.issue39907@roundup.psfhosted.org> Serhiy Storchaka added the comment: It would be slower and less reliable implementation of os.listdir(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:47:55 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 14:47:55 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583765275.17.0.0401977401833.issue39850@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2235e04170503673471d5ec2e7c693cdadcbdc65 by Pablo Galindo in branch '3.7': [3.7] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18877) https://github.com/python/cpython/commit/2235e04170503673471d5ec2e7c693cdadcbdc65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:48:08 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 14:48:08 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583765288.0.0.946314727984.issue39850@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3ede1bc794a575a73c6cc74addb5586f4e33a1f5 by Pablo Galindo in branch '3.8': [3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876) https://github.com/python/cpython/commit/3ede1bc794a575a73c6cc74addb5586f4e33a1f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:48:23 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 14:48:23 +0000 Subject: [issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name. In-Reply-To: <1583338573.65.0.873634219459.issue39850@roundup.psfhosted.org> Message-ID: <1583765303.28.0.574858214859.issue39850@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:54:03 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 09 Mar 2020 14:54:03 +0000 Subject: [issue39913] Document warnings.WarningMessage ? In-Reply-To: <1583764553.02.0.37062728089.issue39913@roundup.psfhosted.org> Message-ID: <1583765643.67.0.214228950934.issue39913@roundup.psfhosted.org> R?mi Lapeyre added the comment: warnings.WarningMessage was added in https://bugs.python.org/issue26568 at the same time than _showwarnmsg_impl() and _formatwarnmsg_impl(). The goal was to have public functions that took them instead of multiple arguments so it could be easily extended in the future. It looks like it never happened and as of today there is no way to use warnings.WarningMessage in user code. Maybe it is time to bikeshed the names and add them? ---------- nosy: +remi.lapeyre, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:55:44 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 09 Mar 2020 14:55:44 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583734569.47.0.402131520845.issue39852@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I guess it's similar to the 'return' vs. 'returns' issue, but I feel much stronger about it here. I would have written that as "make the spam module more spammy". Just read a bunch of commits using e.g. `git log --oneline` to see what the prevailing style is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 10:56:02 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 14:56:02 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583765762.55.0.929163165364.issue39907@roundup.psfhosted.org> Barney Gale added the comment: Less reliable how? Doesn't appear any slower: barney.gale at heilbron:~$ python3 -m timeit -s "import os; os.listdir('/usr/local')" 100000000 loops, best of 3: 0.0108 usec per loop barney.gale at heilbron:~$ python3 -m timeit -s "import os; list(os.scandir('/usr/local'))" 100000000 loops, best of 3: 0.00919 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 11:19:36 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 09 Mar 2020 15:19:36 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583767176.64.0.312342022467.issue39907@roundup.psfhosted.org> R?mi Lapeyre added the comment: This is not how timeit works, you just measured the time taken by an empty loop, you can look at `python3 -m timeit -h` to get help how to call it. I think a correct invocation would be: (venv) ? ~ python3 -m timeit -s 'from os import scandir' "list(scandir('/usr/local'))" 10000 loops, best of 5: 24.3 usec per loop (venv) ? ~ python3 -m timeit -s 'from os import listdir' "listdir('/usr/local')" 10000 loops, best of 5: 22.2 usec per loop so it looks like scandir as a small overhead when accumulating all results and not using the extra info it returns. ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 11:30:54 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 09 Mar 2020 15:30:54 +0000 Subject: [issue35775] Add a general selection function to statistics In-Reply-To: <1547820289.72.0.450290663887.issue35775@roundup.psfhosted.org> Message-ID: <1583767854.22.0.945152278788.issue35775@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 11:54:43 2020 From: report at bugs.python.org (Julin) Date: Mon, 09 Mar 2020 15:54:43 +0000 Subject: [issue21041] pathlib.PurePath.parents rejects negative indexes In-Reply-To: <1395613011.22.0.29152070109.issue21041@psf.upfronthosting.co.za> Message-ID: <1583769283.16.0.0171697127214.issue21041@roundup.psfhosted.org> Julin added the comment: Can't this be implemented? This is something that a user would expect. Intuitive. And it looks as if it is an easy change to make that doesn't disturb anything else. ---------- nosy: +ju-sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 11:59:34 2020 From: report at bugs.python.org (Yuta Okamoto) Date: Mon, 09 Mar 2020 15:59:34 +0000 Subject: [issue39914] logging.config: '.' (dot) as a key is not documented Message-ID: <1583769574.27.0.968534931359.issue39914@roundup.psfhosted.org> New submission from Yuta Okamoto : I noticed that Configurators in logging.config module accepts '.' (dot) as a key to fill attributes for filters, formatters, and handlers directly like the following: handlers: syslog: class: logging.handlers.SysLogHandler .: ident: 'app-name: ' https://github.com/python/cpython/blob/46abfc1416ff8e450999611ef8f231ff871ab133/Lib/logging/config.py#L742 But it seems this functionality is not documented in https://docs.python.org/3/library/logging.config.html ---------- assignee: docs at python components: Documentation messages: 363744 nosy: Yuta Okamoto, docs at python priority: normal severity: normal status: open title: logging.config: '.' (dot) as a key is not documented type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:02:04 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 16:02:04 +0000 Subject: [issue39914] logging.config: '.' (dot) as a key is not documented In-Reply-To: <1583769574.27.0.968534931359.issue39914@roundup.psfhosted.org> Message-ID: <1583769724.69.0.597276616506.issue39914@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:09:26 2020 From: report at bugs.python.org (Eric Snow) Date: Mon, 09 Mar 2020 16:09:26 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1583770166.77.0.861734982748.issue39829@roundup.psfhosted.org> Eric Snow added the comment: FWIW, I encouraged Kim to file this. Thanks Kim! While it isn't part of any specification, it is an unexpected change in behavior that led to some test failures. So I figured it would be worth bringing up. :) I did find it surprising that we were not caching the result, but don't think that's necessarily a problem. All that said, the change did not actually break anything other than some tests (not the code they were testing). So I don't have a problem with closing this. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:12:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 16:12:29 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1583770349.17.0.503425162441.issue39829@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Kim and Eric! I think it still makes sense to do some quick benchmarking and research on passing down the calculated length. I can try to produce a draft PR so we can discuss with something more tangible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:20:31 2020 From: report at bugs.python.org (Eric Snow) Date: Mon, 09 Mar 2020 16:20:31 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1583770831.23.0.254125624329.issue39829@roundup.psfhosted.org> Eric Snow added the comment: I'm not opposed. :) I just don't want to impose on your time. ---------- assignee: -> pablogsal resolution: not a bug -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:29:08 2020 From: report at bugs.python.org (Mads Sejersen) Date: Mon, 09 Mar 2020 16:29:08 +0000 Subject: [issue39915] AsyncMock doesn't work with asyncio.gather Message-ID: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> New submission from Mads Sejersen : When calling asyncio.gather the await_args_list is not correct. In the attached minimal example it contains only the latest call and not each of the three actual calls. Expected output: [call(0), call(1), call(2)] [call(1), call(2), call(3)] # or any permutation hereof Actual output: [call(0), call(1), call(2)] [call(3), call(3), call(3)] ---------- components: asyncio files: fail.py messages: 363748 nosy: Mads Sejersen, asvetlov, yselivanov priority: normal severity: normal status: open title: AsyncMock doesn't work with asyncio.gather type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48963/fail.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:54:04 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 09 Mar 2020 16:54:04 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583772844.97.0.207117794377.issue39763@roundup.psfhosted.org> Michael Felt added the comment: Almost. The command is run, but not enough of the bootstrap is finished - it seems. File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 54, in _aix_bosmp64 out = out.decode("utf-8").strip().split(":") # type: ignore AttributeError: 'str' object has no attribute 'decode' Just skipping the subprocess bit (which is what the original does, waiting for better moments) is sufficient for the bootstrap phase. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:54:33 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 16:54:33 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() Message-ID: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> New submission from Serhiy Storchaka : Path.glob() uses os.scandir() in the following code. entries = list(scandir(parent_path)) It properly closes the internal file descriptor opened by scandir() if success because it is automatically closed closed when the iterator is exhausted. But if it was interrupted (by KeyboardInterrupt, MemoryError or OSError), the file descriptor will be closed only when the iterator be collected by the garbage collector. It is unreliable on implementations like PyPy and emits a ResourceWarning. The proposed code uses more reliable code with scandir(parent_path) as scandir_it: entries = list(scandir_it) which is used in other sites (in the shutil module). I have no idea why I did not write it in this form at first place. ---------- components: Library (Lib) messages: 363750 nosy: serhiy.storchaka priority: normal severity: normal status: open title: More reliable use of scandir in Path.glob() type: resource usage versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 12:58:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 16:58:44 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583773124.76.0.969401084005.issue39916@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18237 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:01:09 2020 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 09 Mar 2020 17:01:09 +0000 Subject: [issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore In-Reply-To: <1583761343.44.0.373306188217.issue39911@roundup.psfhosted.org> Message-ID: <1583773269.47.0.211418611502.issue39911@roundup.psfhosted.org> Jeremy Kloth added the comment: Well, it only doesn't build on 3.9+ (master) due to not being supported going forward. The *buildmaster* needs to be fixed to stop submitting those jobs to unsupported platforms. We need to continue testing 3.7 and 3.8 on Win7 until they go EOL to ensure that no platform breaking changes get backported. This same issue will come up again (on different builders) as Win8 becomes unsupported (3.10, I believe). As to this builder directly, I am working on a replacement machine that will have the latest tooling installed which should be done before before 3.9 goes gold (real-life permitting, of course). ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:07:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 17:07:32 +0000 Subject: [issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore In-Reply-To: <1583761343.44.0.373306188217.issue39911@roundup.psfhosted.org> Message-ID: <1583773652.01.0.98232820356.issue39911@roundup.psfhosted.org> STINNER Victor added the comment: Ah, "x86 Windows7 3.x" worker has the same issue: https://buildbot.python.org/all/#/builders/150/builds/434 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:07:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 17:07:40 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583773660.11.0.97698305007.issue39907@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Less reliable how? See issue39916. > so it looks like scandir as a small overhead when accumulating all results and not using the extra info it returns. Try with larger directories. The difference may be not so small. $ python3 -m timeit -s 'from os import scandir' "list(scandir('/usr/include'))" 10000 loops, best of 3: 176 usec per loop $ python3 -m timeit -s 'from os import listdir' "listdir('/usr/include')" 10000 loops, best of 3: 114 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:10:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 17:10:43 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583773843.4.0.0382417228476.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: > AttributeError: 'str' object has no attribute 'decode' Oops, it should now be fixed by my second commit. Please retry PR 18872. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:17:00 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 09 Mar 2020 17:17:00 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1583774220.73.0.695229847135.issue12782@roundup.psfhosted.org> Guido van Rossum added the comment: If we introduce a PEG-based parser, we can do this without hacking the tokenizer. See https://github.com/gvanrossum/pegen/issues/229 I'd propose to aim for Python 3.10 (if the PEG parser happens). ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:17:12 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 09 Mar 2020 17:17:12 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1583774232.69.0.930279822112.issue12782@roundup.psfhosted.org> Change by Guido van Rossum : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:47:06 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 09 Mar 2020 17:47:06 +0000 Subject: [issue39915] AsyncMock doesn't work with asyncio.gather In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583776026.22.0.386169750547.issue39915@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lisroach, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:51:40 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 09 Mar 2020 17:51:40 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583776300.79.0.228099339163.issue34822@roundup.psfhosted.org> Guido van Rossum added the comment: I'm going to review the actual code next. Regarding the omission of parentheses in various contexts, I am all for that, but I consider it a separate issue (as it only pertains to ast.unparse()). The fix in https://github.com/python/cpython/pull/17892 should go in regardless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 13:59:09 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 17:59:09 +0000 Subject: [issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__() In-Reply-To: <1583678581.12.0.621267485575.issue39904@roundup.psfhosted.org> Message-ID: <1583776749.77.0.268650086937.issue39904@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 413f01352a8268fb62bb47bde965462d7b82a06a by Serhiy Storchaka in branch 'master': bpo-39904: Move handling of one-argument call of type() from type.__new__() to type.__call__(). (GH-18852) https://github.com/python/cpython/commit/413f01352a8268fb62bb47bde965462d7b82a06a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:03:45 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 18:03:45 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583777025.96.0.891744321114.issue38643@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e5ccc94bbb153431698b2391df625e8d47a93276 by Serhiy Storchaka in branch 'master': bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863) https://github.com/python/cpython/commit/e5ccc94bbb153431698b2391df625e8d47a93276 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:29:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 18:29:44 +0000 Subject: [issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__() In-Reply-To: <1583678581.12.0.621267485575.issue39904@roundup.psfhosted.org> Message-ID: <1583778584.55.0.979635838584.issue39904@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 Mar 9 14:35:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 18:35:33 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583778933.54.0.123307205611.issue36184@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6d0ee60740f2862a878f009671b1aaa75aeb0c2a by Victor Stinner in branch 'master': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/6d0ee60740f2862a878f009671b1aaa75aeb0c2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:35:41 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 18:35:41 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583778941.59.0.388319335319.issue36184@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18238 pull_request: https://github.com/python/cpython/pull/18881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:35:50 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 18:35:50 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583778950.2.0.507945286259.issue36184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18239 pull_request: https://github.com/python/cpython/pull/18882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:49:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 18:49:56 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583779796.7.0.386046826956.issue38249@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset eebaa9bfc593d5a46b293c1abd929fbfbfd28199 by Serhiy Storchaka in branch 'master': bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329) https://github.com/python/cpython/commit/eebaa9bfc593d5a46b293c1abd929fbfbfd28199 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:50:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 18:50:16 +0000 Subject: [issue38249] Optimize out Py_UNREACHABLE in the release mode In-Reply-To: <1569145626.92.0.408422678201.issue38249@roundup.psfhosted.org> Message-ID: <1583779816.95.0.878440218042.issue38249@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 Mar 9 14:51:47 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 18:51:47 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583779907.6.0.607391225233.issue36184@roundup.psfhosted.org> miss-islington added the comment: New changeset 1695836123609a8ae97f2cfbe180a028dcd650a3 by Miss Islington (bot) in branch '3.7': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/1695836123609a8ae97f2cfbe180a028dcd650a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 14:52:31 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 18:52:31 +0000 Subject: [issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583779951.24.0.0699273353701.issue36184@roundup.psfhosted.org> miss-islington added the comment: New changeset 5854d451cb35ac38bc07b95afeb077e8a35d5c7d by Miss Islington (bot) in branch '3.8': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/5854d451cb35ac38bc07b95afeb077e8a35d5c7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:14:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 19:14:38 +0000 Subject: [issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583781278.13.0.487205639527.issue36184@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: -easy resolution: -> fixed stage: patch review -> resolved status: open -> closed title: [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD -> test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:17:55 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 19:17:55 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583781475.78.0.190128131526.issue39907@roundup.psfhosted.org> Change by Barney Gale : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:21:58 2020 From: report at bugs.python.org (Barney Gale) Date: Mon, 09 Mar 2020 19:21:58 +0000 Subject: [issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()` In-Reply-To: <1583713077.79.0.39541814988.issue39907@roundup.psfhosted.org> Message-ID: <1583781718.78.0.428374020174.issue39907@roundup.psfhosted.org> Barney Gale added the comment: Thanks R?mi and Serhiy! Closing this ticket as the patch doesn't provide any sort of improvement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:31:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 19:31:36 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583782296.66.0.439734826577.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18240 pull_request: https://github.com/python/cpython/pull/18883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:57:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 19:57:05 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583783825.76.0.119172662941.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3225b9f9739cd4bcca372d0fa939cea1ae5c6402 by Victor Stinner in branch 'master': bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883) https://github.com/python/cpython/commit/3225b9f9739cd4bcca372d0fa939cea1ae5c6402 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 15:59:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 19:59:07 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583783947.75.0.494446500796.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18241 pull_request: https://github.com/python/cpython/pull/18884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:01:52 2020 From: report at bugs.python.org (Todd Levi) Date: Mon, 09 Mar 2020 20:01:52 +0000 Subject: [issue39917] new_compiler() called 2nd time causes error Message-ID: <1583784112.25.0.514690253102.issue39917@roundup.psfhosted.org> New submission from Todd Levi : Action: Run the following command in py36, py37, and py3 for package uvloop python setup.py build_ext --inline bdist_wheel Expected behavior: The package is built and bundled as a wheel. Observed behavior: The build fails at the bdist_wheel stage with the following error: error: don't know how to compile C/C++ code on platform 'posix' with '' compiler Additional Notes: If I split the two commands (build_ext and bdist_wheel) into separate invocations (e.g. python setup.py build_ext --inline && python setup.py bdist_wheel) then the wheel is successfully built. It only (and always) fails when build_ext and bdist_wheel are on the same command line. What "seems" to be happening is that bdist_wheel is somehow inheriting the existing CCompiler object that was used by build_ext and is then passing that back to distutils.compiler.new_compiler(). The new_compiler() function simply checks to see if compiler is None and, if not, uses its value as a key to the compiler_class dict. The distutils/command/build_ext build_ext object initially sets self.compiler to None so the first invocation of new_compiler() in build_ext.run() will work as expected. In build_ext.run() at around line 306 (in master), however, it simply does self.compiler = new_compiler(compiler=self.compiler,...) so any subsequent invocation of run() seems like it will fail and produce the error message I'm seeing. new_compiler() is the only place I see that error message being emitted. The package I'm building (uvloop) is being built with Cython but all the object paths I've been able to track come back to distutils.ccompiler.py. That packages setup.py file doesn't seem to do anything weird that I can see (which doesn't mean it isn't doing something weird). It sets the sdist and build_ext cmdclass entries to their own methods (that don't seem to set compiler - just compiler options) and also registers an extension via ext_modules. The setup.py code is here: https://github.com/MagicStack/uvloop/blob/master/setup.py Possible Fix: Two simple possibilities come to mind. 1) In run, see if self.compiler is not None and alter the call to new_compiler() to use self.compiler.compiler_type. 2) In new_compiler(), check the type of compiler and simply return if its a CCompiler object. ---------- components: Distutils messages: 363765 nosy: dstufft, eric.araujo, televi priority: normal severity: normal status: open title: new_compiler() called 2nd time causes error type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:21:50 2020 From: report at bugs.python.org (Jerry James) Date: Mon, 09 Mar 2020 20:21:50 +0000 Subject: [issue39918] random.Random(False) weird error Message-ID: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> New submission from Jerry James : Python 3.8: >>> import random >>> r = random.Random(False) >>> r Python 3.9 alpha 4: >>> import random >>> r = random.Random(False) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.9/random.py", line 100, in __init__ self.seed(x) File "/usr/lib64/python3.9/random.py", line 163, in seed super().seed(a) TypeError: descriptor '__abs__' of 'int' object needs an argument This arose in the context of Fedora builds with python 3.9. The networkx project reversed two arguments, resulting in False being passed to random.Random instead of the intended seed value. I'm glad we noticed the problem with 3.9 so the intended value will now be used, but that TypeError message doesn't really indicate the nature of the problem. Could you arrange for a better message? ---------- components: Library (Lib) messages: 363766 nosy: loganjerry priority: normal severity: normal status: open title: random.Random(False) weird error type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:24:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 20:24:23 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583785463.52.0.700371773158.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 111e4ee52a1739e7c7221adde2fc364ef4954af2 by Victor Stinner in branch 'master': bpo-39877: Py_Initialize() pass tstate to PyEval_InitThreads() (GH-18884) https://github.com/python/cpython/commit/111e4ee52a1739e7c7221adde2fc364ef4954af2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:27:11 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 20:27:11 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1583785631.91.0.101730698352.issue38870@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e7cab7f780ac253999512ee86374fc3454342811 by Batuhan Ta?kaya in branch 'master': bpo-38870: Simplify sequence interleaves in ast.unparse (GH-17892) https://github.com/python/cpython/commit/e7cab7f780ac253999512ee86374fc3454342811 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:34:32 2020 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 09 Mar 2020 20:34:32 +0000 Subject: [issue39917] new_compiler() called 2nd time causes error In-Reply-To: <1583784112.25.0.514690253102.issue39917@roundup.psfhosted.org> Message-ID: <1583786072.59.0.259511500147.issue39917@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:44:49 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 09 Mar 2020 20:44:49 +0000 Subject: [issue39918] random.Random(False) weird error In-Reply-To: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> Message-ID: <1583786689.35.0.44224599472.issue39918@roundup.psfhosted.org> Miro Hron?ok added the comment: Possibly related to https://bugs.python.org/issue32554 https://github.com/python/cpython/pull/15382 Deprecate hashing arbitrary types in random.seed() ---------- nosy: +hroncok, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:45:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 20:45:15 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583786715.17.0.546967738603.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18242 pull_request: https://github.com/python/cpython/pull/18885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:46:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 20:46:16 +0000 Subject: [issue39918] random.Random(False) weird error In-Reply-To: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> Message-ID: <1583786776.44.0.0587411149279.issue39918@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:46:53 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 20:46:53 +0000 Subject: [issue39852] IDLE: Goto should remove selection and update the status bar In-Reply-To: <1583345537.82.0.492123275621.issue39852@roundup.psfhosted.org> Message-ID: <1583786813.14.0.096764152891.issue39852@roundup.psfhosted.org> Terry J. Reedy added the comment: https://github.com/python/devguide/issues/577 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:51:28 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Mar 2020 20:51:28 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583787088.36.0.809194067572.issue27115@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 363fab83b8a0e6d924c7a7c577feec6a2812bb8c by Terry Jan Reedy in branch 'master': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/363fab83b8a0e6d924c7a7c577feec6a2812bb8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:51:34 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 20:51:34 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583787094.47.0.305817420067.issue27115@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18243 pull_request: https://github.com/python/cpython/pull/18886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:51:41 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 20:51:41 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583787101.19.0.60151857273.issue27115@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18244 pull_request: https://github.com/python/cpython/pull/18887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 16:54:52 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 09 Mar 2020 20:54:52 +0000 Subject: [issue39918] random.Random(False) weird error In-Reply-To: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> Message-ID: <1583787292.35.0.0284879593513.issue39918@roundup.psfhosted.org> Mark Dickinson added the comment: The lines here look odd to me: https://github.com/python/cpython/blob/363fab83b8a0e6d924c7a7c577feec6a2812bb8c/Modules/_randommodule.c#L290-L291 args[0] = arg; n = PyObject_Vectorcall(_randomstate_global->Long___abs__, args, 0, NULL); Should that 0 in the PyObject_Vectorcall be a 1 instead? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:12:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 21:12:11 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583788331.22.0.348018949372.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 85f5a69ae1541271286bb0f0e0303aabf792dd5c by Victor Stinner in branch 'master': bpo-39877: Refactor take_gil() function (GH-18885) https://github.com/python/cpython/commit/85f5a69ae1541271286bb0f0e0303aabf792dd5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:22:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 21:22:24 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583788944.25.0.974519466488.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18245 pull_request: https://github.com/python/cpython/pull/18888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:44:48 2020 From: report at bugs.python.org (Antoine Wecxsteen) Date: Mon, 09 Mar 2020 21:44:48 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583790288.52.0.692330112355.issue39869@roundup.psfhosted.org> Change by Antoine Wecxsteen : ---------- keywords: +patch nosy: +awecx nosy_count: 2.0 -> 3.0 pull_requests: +18246 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:50:41 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 09 Mar 2020 21:50:41 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS In-Reply-To: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> Message-ID: <1583790641.06.0.250344676071.issue39832@roundup.psfhosted.org> Brett Cannon added the comment: The import system makes no attempt at normalizing Unicode strings for path comparisons. One would have to probably update FileFinder (https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L1392) somehow (assuming the appropriate codec support is available to importlib during start-up). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:50:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 21:50:58 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583790658.87.0.532893395929.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18247 pull_request: https://github.com/python/cpython/pull/18890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 17:51:24 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 09 Mar 2020 21:51:24 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583790684.81.0.118404454161.issue36287@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:07:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 22:07:54 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1583791674.49.0.800165376943.issue36287@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4 by Serhiy Storchaka in branch 'master': bpo-36287: Make ast.dump() not output optional fields and attributes with default values. (GH-18843) https://github.com/python/cpython/commit/b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:10:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 22:10:56 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583791856.7.0.599056789314.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9229eeee105f19705f72e553cf066751ac47c7b7 by Victor Stinner in branch 'master': bpo-39877: take_gil() checks tstate_must_exit() twice (GH-18890) https://github.com/python/cpython/commit/9229eeee105f19705f72e553cf066751ac47c7b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:29:51 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Mar 2020 22:29:51 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583792991.33.0.252153109606.issue39199@roundup.psfhosted.org> Serhiy Storchaka added the comment: As you worked much with ast.dump(), what multi-line formatting do you prefer, the current Module( body=[ If( test=Name(id='x', ctx=Load()), body=[ Expr( value=Constant(value=Ellipsis))], orelse=[ If( test=Name(id='y', ctx=Load()), body=[ Expr( value=Constant(value=Ellipsis))], orelse=[ Expr( value=Constant(value=Ellipsis))])])], type_ignores=[]) or with closing brackets on separate lines? Module( body=[ If( test=Name(id='x', ctx=Load()), body=[ Expr( value=Constant(value=Ellipsis) ) ], orelse=[ If( test=Name(id='y', ctx=Load()), body=[ Expr( value=Constant(value=Ellipsis) ) ], orelse=[ Expr( value=Constant(value=Ellipsis) ) ] ) ] ) ], type_ignores=[] ) The latter make contain long stairs of closing brackets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:33:52 2020 From: report at bugs.python.org (Ethan Furman) Date: Mon, 09 Mar 2020 22:33:52 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1583793232.42.0.664059596634.issue28577@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 8e9c47a947954c997d4b725f4551d50a1d896722 by Pete Wicken in branch 'master': bpo-28577: Special case added to IP v4 and v6 hosts for /32 and /128 networks (GH-18757) https://github.com/python/cpython/commit/8e9c47a947954c997d4b725f4551d50a1d896722 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:35:17 2020 From: report at bugs.python.org (Ethan Furman) Date: Mon, 09 Mar 2020 22:35:17 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1583793317.38.0.347572076539.issue28577@roundup.psfhosted.org> Change by Ethan Furman : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:37:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 22:37:53 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583793473.09.0.496810626337.issue19466@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 by Victor Stinner in branch 'master': bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848) https://github.com/python/cpython/commit/9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:44:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 22:44:45 +0000 Subject: [issue19466] Clear state of threads earlier in Python shutdown In-Reply-To: <1383262786.4.0.00831923947445.issue19466@psf.upfronthosting.co.za> Message-ID: <1583793885.68.0.0435586370007.issue19466@roundup.psfhosted.org> STINNER Victor added the comment: I merged more changes in bpo-39877 which made possible to finally fix this issue. ---------- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:44:45 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 09 Mar 2020 22:44:45 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583793885.26.0.916565687534.issue39763@roundup.psfhosted.org> Michael Felt added the comment: Comes further. The build finishes, but socket and asyncio are missing... At least a build will proceed, and I can look into this new, perhaps unrelated issue re: socket later. *** WARNING: renaming "_asyncio" since importing it failed: No module named '_socket' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:46:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 22:46:07 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583793967.54.0.982398689888.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset addaaaa946855ad59c8f5c698aa0891d7e44f018 by Victor Stinner in branch 'master': bpo-39763: Add _bootsubprocess to build Python on AIX (GH-18872) https://github.com/python/cpython/commit/addaaaa946855ad59c8f5c698aa0891d7e44f018 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:46:36 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Mar 2020 22:46:36 +0000 Subject: [issue39199] Improve the AST documentation In-Reply-To: <1578056721.05.0.299258437761.issue39199@roundup.psfhosted.org> Message-ID: <1583793996.73.0.30188675951.issue39199@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The first one looks on first inspection "cleaner" but then I tried to look at a random closed bracket/parenthesis like the ones in value=Constant(value=Ellipsis))])])], and trying to guess where that closes and is confusing to say the least so I think I would prefer the second one as is less "dense". Additionally, I was curious and I have asked several people with different examples and almost everyone prefers the second one, being the only reason someone preferred the first the fact that "fits vertically in the screen and you need less scrolling to read it all". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 18:47:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 22:47:32 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583794052.51.0.910629334569.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: > At least a build will proceed, and I can look into this new, perhaps unrelated issue re: socket later. > *** WARNING: renaming "_asyncio" since importing it failed: No module named '_socket' Do you see any error when the _socket module is built? Please open a new issue with full logs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:15:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:15:14 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583795714.14.0.486763997012.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18248 pull_request: https://github.com/python/cpython/pull/18891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:15:35 2020 From: report at bugs.python.org (Enji Cooper) Date: Mon, 09 Mar 2020 23:15:35 +0000 Subject: [issue39919] C extension code reliant on static flags/behavior with PY_DEBUG (Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert Message-ID: <1583795735.01.0.546271118334.issue39919@roundup.psfhosted.org> New submission from Enji Cooper : Looking at Py_SAFE_DOWNCAST, it seems that the code could (in theory) leverage _Static_assert on C11 capable compilers [1]. Looking at some other code APIs, like module initialization with METH_VARARGS, etc, there are ways to determine whether or not the values are valid at compile-time with C11 capable compilers, instead of figuring out the issues on the tail end at runtime and having to play whackamole figuring out which offending methods are triggering issues (see also: bpo-39884). 1. https://en.cppreference.com/w/c/language/_Static_assert ---------- components: C API messages: 363785 nosy: ngie priority: normal severity: normal status: open title: C extension code reliant on static flags/behavior with PY_DEBUG (Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:22:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:22:05 +0000 Subject: [issue37776] Test Py_Finalize() from a subinterpreter In-Reply-To: <1565113410.42.0.547052767114.issue37776@roundup.psfhosted.org> Message-ID: <1583796125.24.0.984127598488.issue37776@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-38865. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:23:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:23:57 +0000 Subject: [issue24415] SIGINT always reset to SIG_DFL by Py_Finalize() In-Reply-To: <1433853006.37.0.519208037884.issue24415@psf.upfronthosting.co.za> Message-ID: <1583796237.93.0.831542360206.issue24415@roundup.psfhosted.org> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-30654. If it's not the case, please add a comment/reopen the issue. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:24:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:24:11 +0000 Subject: [issue30654] signal module always overwrites SIGINT on interpreter shutdown In-Reply-To: <1497359164.84.0.615765342748.issue30654@psf.upfronthosting.co.za> Message-ID: <1583796251.61.0.0410231065379.issue30654@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-24415 as duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:28:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:28:59 +0000 Subject: [issue36818] Add PyInterpreterState.runtime. In-Reply-To: <1557168344.92.0.643564511932.issue36818@roundup.psfhosted.org> Message-ID: <1583796539.16.0.197160677054.issue36818@roundup.psfhosted.org> STINNER Victor added the comment: I added PyInterpreterState.runtime in bpo-36710: commit 01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a Author: Victor Stinner Date: Wed Nov 20 02:27:56 2019 +0100 bpo-36710: Add PyInterpreterState.runtime field (GH-17270) Add PyInterpreterState.runtime field: reference to the _PyRuntime global variable. This field exists to not have to pass runtime in addition to tstate to a function. Get runtime from tstate: tstate->interp->runtime. Remove "_PyRuntimeState *runtime" parameter from functions already taking a "PyThreadState *tstate" parameter. _PyGC_Init() first parameter becomes "PyThreadState *tstate". -- > This change introduced a regression: > https://bugs.python.org/issue37135#msg344511 Funny/not funny, I introduced the same bug and I fixed it in bpo-39877. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:30:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:30:42 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583796642.54.0.433879901558.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: > The problem is that Python already freed the memory of all PyThreadState structures, whereas PyEval_RestoreThread(tstate) dereferences tstate to get the _PyRuntimeState structure: Funny/not funny, bpo-36818 added a similar bug with commit 396e0a8d9dc65453cb9d53500d0a620602656cfe in June 2019: bpo-37135. I reverted the change to fix the issue. Hopefully, it should now be fixed and the rationale for accessing directly _PyRuntime should now be better documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:36:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:36:28 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583796988.75.0.796021859858.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: I tested (run multiple times) daemon_threads_exit.py with slow_exit.patch: no crash. I also tested (run multiple times) stress.py + sleep_at_exit.patch of bpo-37135: no crash. And I tested asyncio_gc.py of bpo-19466: no crash neither. Python finalization now looks reliable. I'm not sure if it's "more" reliable than previously, but at least, I cannot get a crash anymore, even after bpo-19466 has been fixed (clear Python thread states of daemon threads earlier). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:37:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:37:52 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583797072.11.0.742800570678.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 175a704abfcb3400aaeb66d4f098d92ca7e30892 by Victor Stinner in branch 'master': bpo-39877: PyGILState_Ensure() don't call PyEval_InitThreads() (GH-18891) https://github.com/python/cpython/commit/175a704abfcb3400aaeb66d4f098d92ca7e30892 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:40:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Mar 2020 23:40:31 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1583797231.14.0.00193694713421.issue37127@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:45:22 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 23:45:22 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583797522.7.0.773531697384.issue27115@roundup.psfhosted.org> miss-islington added the comment: New changeset cadfe52a006abb46ea0948c6ae2e006064b4a091 by Miss Islington (bot) in branch '3.8': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/cadfe52a006abb46ea0948c6ae2e006064b4a091 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 19:45:40 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Mar 2020 23:45:40 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583797540.63.0.853246164956.issue27115@roundup.psfhosted.org> miss-islington added the comment: New changeset f8345358bcdd276eb470778daf05d343da9f1290 by Miss Islington (bot) in branch '3.7': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/f8345358bcdd276eb470778daf05d343da9f1290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 20:00:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 00:00:55 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583798455.94.0.587670375197.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18249 pull_request: https://github.com/python/cpython/pull/18892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 20:29:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 00:29:00 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583800140.85.0.0736621246665.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 by Victor Stinner in branch 'master': bpo-39877: Deprecate PyEval_InitThreads() (GH-18892) https://github.com/python/cpython/commit/b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 21:04:55 2020 From: report at bugs.python.org (Charles Machalow) Date: Tue, 10 Mar 2020 01:04:55 +0000 Subject: [issue39920] Pathlib path methods do not work with Window Dos devices Message-ID: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> New submission from Charles Machalow : I ran the following as admin in the Python interpreter (on Windows): >>> d = pathlib.Path(r'\\.\PHYSICALDRIVE0') >>> print(d) \\.\PHYSICALDRIVE0\ >>> d.exists() Traceback (most recent call last): File "", line 1, in File "C:\Python37\lib\pathlib.py", line 1318, in exists self.stat() File "C:\Python37\lib\pathlib.py", line 1140, in stat return self._accessor.stat(self) PermissionError: [WinError 31] A device attached to the system is not functioning: '\\\\.\\PHYSICALDRIVE0\\' >>> d.is_char_device() Traceback (most recent call last): File "", line 1, in File "C:\Python37\lib\pathlib.py", line 1403, in is_char_device return S_ISCHR(self.stat().st_mode) File "C:\Python37\lib\pathlib.py", line 1140, in stat return self._accessor.stat(self) PermissionError: [WinError 31] A device attached to the system is not functioning: '\\\\.\\PHYSICALDRIVE0\\' >>> d.is_block_device() Traceback (most recent call last): File "", line 1, in File "C:\Python37\lib\pathlib.py", line 1390, in is_block_device return S_ISBLK(self.stat().st_mode) File "C:\Python37\lib\pathlib.py", line 1140, in stat return self._accessor.stat(self) PermissionError: [WinError 31] A device attached to the system is not functioning: '\\\\.\\PHYSICALDRIVE0\\' I think that exists(), is_char_device(), and is_block_device() should be able to work on Windows in some form or fashion. At least without a traceback. ---------- messages: 363796 nosy: Charles Machalow priority: normal severity: normal status: open title: Pathlib path methods do not work with Window Dos devices type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 21:07:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 10 Mar 2020 01:07:06 +0000 Subject: [issue27115] IDLE goto should use query.Query subclass In-Reply-To: <1464132389.32.0.350798699754.issue27115@psf.upfronthosting.co.za> Message-ID: <1583802426.95.0.101751010434.issue27115@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 22:53:52 2020 From: report at bugs.python.org (Mageshkumar) Date: Tue, 10 Mar 2020 02:53:52 +0000 Subject: [issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue Message-ID: <1583808832.46.0.617584210611.issue39921@roundup.psfhosted.org> New submission from Mageshkumar : C:\WINDOWS\system32>pip install jsonlib Collecting jsonlib Using cached jsonlib-1.6.1.tar.gz (43 kB) Installing collected packages: jsonlib Running setup.py install for jsonlib ... error ERROR: Command errored out with exit status 1: command: 'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib' cwd: C:\Users\Mageshkumar\AppData\Local\Temp\pip-install-dz8cos59\jsonlib\ Complete output (41 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 copying jsonlib.py -> build\lib.win-amd64-3.8 running build_ext building '_jsonlib' extension creating build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\mageshkumar\appdata\local\programs\python\python38\include -Ic:\users\mageshkumar\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_jsonlib.c /Fobuild\temp.win-amd64-3.8\Release\_jsonlib.obj _jsonlib.c _jsonlib.c(99): warning C4996: 'PyUnicode_GetSize': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\unicodeobject.h(177): note: see declaration of 'PyUnicode_GetSize' _jsonlib.c(450): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106): note: see declaration of 'PyLong_FromUnicode' _jsonlib.c(550): warning C4018: '<': signed/unsigned mismatch _jsonlib.c(643): warning C4020: 'PyFloat_FromString': too many actual parameters _jsonlib.c(655): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106): note: see declaration of 'PyLong_FromUnicode' _jsonlib.c(1186): warning C4013: 'PyString_CheckExact' undefined; assuming extern returning int _jsonlib.c(1188): warning C4013: 'PyString_Check' undefined; assuming extern returning int _jsonlib.c(1208): warning C4013: 'PyObject_Unicode' undefined; assuming extern returning int _jsonlib.c(1208): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int' _jsonlib.c(1406): warning C4013: 'PyInt_CheckExact' undefined; assuming extern returning int _jsonlib.c(1517): warning C4013: 'PyString_AS_STRING' undefined; assuming extern returning int _jsonlib.c(1517): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1517): warning C4024: 'ascii_constant': different types for formal and actual parameter 1 _jsonlib.c(1539): warning C4013: 'PyInt_Check' undefined; assuming extern returning int _jsonlib.c(1931): warning C4047: '=': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1970): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1970): warning C4024: 'serializer_append_ascii': different types for formal and actual parameter 2 _jsonlib.c(2089): warning C4996: 'PyUnicode_Encode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791): note: see declaration of 'PyUnicode_Encode' _jsonlib.c(2123): warning C4996: 'PyUnicode_Encode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791): note: see declaration of 'PyUnicode_Encode' _jsonlib.c(2161): warning C4013: 'Py_InitModule3' undefined; assuming extern returning int C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\libs /LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__jsonlib build\temp.win-amd64-3.8\Release\_jsonlib.obj /OUT:build\lib.win-amd64-3.8\_jsonlib.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\_jsonlib.cp38-win_amd64.lib LINK : error LNK2001: unresolved external symbol PyInit__jsonlib build\temp.win-amd64-3.8\Release\_jsonlib.cp38-win_amd64.lib : fatal error LNK1120: 1 unresolved externals error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120 ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib' Check the logs for full command output. C:\WINDOWS\system32> ---------- components: Installation files: json error.txt messages: 363797 nosy: magesh priority: normal severity: normal status: open title: json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue type: compile error versions: Python 3.8 Added file: https://bugs.python.org/file48964/json error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:07:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 10 Mar 2020 03:07:26 +0000 Subject: [issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue In-Reply-To: <1583808832.46.0.617584210611.issue39921@roundup.psfhosted.org> Message-ID: <1583809646.69.0.155496007133.issue39921@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The tracker is for issues related to CPython. It seems like this is a problem with jsonlib. I would suggest following up on their tracker or other forums. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:17:44 2020 From: report at bugs.python.org (Andy Lester) Date: Tue, 10 Mar 2020 03:17:44 +0000 Subject: [issue39922] Remove unused args in Python/compile.c Message-ID: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> New submission from Andy Lester : These functions have unnecessary args that can be removed: * binop * compiler_add_o * compiler_next_instr * inplace_binop ---------- components: Interpreter Core messages: 363799 nosy: petdance priority: normal severity: normal status: open title: Remove unused args in Python/compile.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:18:43 2020 From: report at bugs.python.org (Andy Lester) Date: Tue, 10 Mar 2020 03:18:43 +0000 Subject: [issue39896] Const args and remove unused args in Python/compile.c In-Reply-To: <1583639589.56.0.292367890565.issue39896@roundup.psfhosted.org> Message-ID: <1583810323.43.0.842280782805.issue39896@roundup.psfhosted.org> Andy Lester added the comment: Replaced by https://bugs.python.org/issue39922 ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:20:14 2020 From: report at bugs.python.org (Mageshkumar) Date: Tue, 10 Mar 2020 03:20:14 +0000 Subject: [issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue In-Reply-To: <1583809646.69.0.155496007133.issue39921@roundup.psfhosted.org> Message-ID: Mageshkumar added the comment: what i do now *Thanks & Regards* *M.Mageshkumar* On Tue, Mar 10, 2020 at 8:37 AM Karthikeyan Singaravelan < report at bugs.python.org> wrote: > > Karthikeyan Singaravelan added the comment: > > The tracker is for issues related to CPython. It seems like this is a > problem with jsonlib. I would suggest following up on their tracker or > other forums. > > ---------- > nosy: +xtreak > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:26:56 2020 From: report at bugs.python.org (Andy Lester) Date: Tue, 10 Mar 2020 03:26:56 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583810816.8.0.715898673793.issue39922@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18250 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 9 23:45:41 2020 From: report at bugs.python.org (Mageshkumar) Date: Tue, 10 Mar 2020 03:45:41 +0000 Subject: [issue39923] Command errored out with exit status 1: while jsonlib Message-ID: New submission from Mageshkumar : hi i have detail issue of while i was install jsonlib, pls kindly provide the solutions *Thanks & Regards* *M.Mageshkumar* ---------- files: json error.txt messages: 363802 nosy: magesh priority: normal severity: normal status: open title: Command errored out with exit status 1: while jsonlib Added file: https://bugs.python.org/file48965/json error.txt _______________________________________ Python tracker _______________________________________ -------------- next part -------------- ??? C:\WINDOWS\system32>pip install jsonlib Collecting jsonlib Using cached jsonlib-1.6.1.tar.gz (43 kB) Installing collected packages: jsonlib Running setup.py install for jsonlib ... error ERROR: Command errored out with exit status 1: command: 'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib' cwd: C:\Users\Mageshkumar\AppData\Local\Temp\pip-install-dz8cos59\jsonlib\ Complete output (41 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 copying jsonlib.py -> build\lib.win-amd64-3.8 running build_ext building '_jsonlib' extension creating build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\mageshkumar\appdata\local\programs\python\python38\include -Ic:\users\mageshkumar\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_jsonlib.c /Fobuild\temp.win-amd64-3.8\Release\_jsonlib.obj _jsonlib.c _jsonlib.c(99): warning C4996: 'PyUnicode_GetSize': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\unicodeobject.h(177): note: see declaration of 'PyUnicode_GetSize' _jsonlib.c(450): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106): note: see declaration of 'PyLong_FromUnicode' _jsonlib.c(550): warning C4018: '<': signed/unsigned mismatch _jsonlib.c(643): warning C4020: 'PyFloat_FromString': too many actual parameters _jsonlib.c(655): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106): note: see declaration of 'PyLong_FromUnicode' _jsonlib.c(1186): warning C4013: 'PyString_CheckExact' undefined; assuming extern returning int _jsonlib.c(1188): warning C4013: 'PyString_Check' undefined; assuming extern returning int _jsonlib.c(1208): warning C4013: 'PyObject_Unicode' undefined; assuming extern returning int _jsonlib.c(1208): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int' _jsonlib.c(1406): warning C4013: 'PyInt_CheckExact' undefined; assuming extern returning int _jsonlib.c(1517): warning C4013: 'PyString_AS_STRING' undefined; assuming extern returning int _jsonlib.c(1517): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1517): warning C4024: 'ascii_constant': different types for formal and actual parameter 1 _jsonlib.c(1539): warning C4013: 'PyInt_Check' undefined; assuming extern returning int _jsonlib.c(1931): warning C4047: '=': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1970): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int' _jsonlib.c(1970): warning C4024: 'serializer_append_ascii': different types for formal and actual parameter 2 _jsonlib.c(2089): warning C4996: 'PyUnicode_Encode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791): note: see declaration of 'PyUnicode_Encode' _jsonlib.c(2123): warning C4996: 'PyUnicode_Encode': deprecated in 3.3 c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791): note: see declaration of 'PyUnicode_Encode' _jsonlib.c(2161): warning C4013: 'Py_InitModule3' undefined; assuming extern returning int C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\libs /LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__jsonlib build\temp.win-amd64-3.8\Release\_jsonlib.obj /OUT:build\lib.win-amd64-3.8\_jsonlib.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\_jsonlib.cp38-win_amd64.lib LINK : error LNK2001: unresolved external symbol PyInit__jsonlib build\temp.win-amd64-3.8\Release\_jsonlib.cp38-win_amd64.lib : fatal error LNK1120: 1 unresolved externals error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120 ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib' Check the logs for full command output. C:\WINDOWS\system32> From report at bugs.python.org Mon Mar 9 23:55:22 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 10 Mar 2020 03:55:22 +0000 Subject: [issue39923] Command errored out with exit status 1: while jsonlib In-Reply-To: Message-ID: <1583812522.06.0.68049810798.issue39923@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Please stop creating duplicate issues. You have already reported it at https://bugs.python.org/issue39921. There is also a stack overflow question on this https://stackoverflow.com/questions/60610913/json-module-install-error-i-was-use-windows-10-pro-64-bit-pls-give-solutions-re ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 01:19:30 2020 From: report at bugs.python.org (Norbert) Date: Tue, 10 Mar 2020 05:19:30 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS In-Reply-To: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> Message-ID: <1583817570.87.0.740517233044.issue39832@roundup.psfhosted.org> Norbert added the comment: Yes, if the Python runtime caches file names and determines based on the cache whether a file exists, then it needs to normalize both the file names in the cache and the name of the file it?s looking for. As far as I know, both HFS and APFS do this themselves when asked for a file by name, but if you ask for a list of available files, they don?t know what you?re comparing against. I don?t think codecs would be involved here; I?d use unicodedata.normalize with either NFC or NFD ? doesn?t matter which one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 02:57:33 2020 From: report at bugs.python.org (Mike Frysinger) Date: Tue, 10 Mar 2020 06:57:33 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583823453.88.0.815267644533.issue39857@roundup.psfhosted.org> Mike Frysinger added the comment: personally i still like having the extra_env setting explicitly broken out, but i agree that those operators help ease the majority of the pain. i hadn't come across them before as they aren't in Python 2. i wouldn't be upset if people declined the FR considering those options will be available in Python 3.9+. thx for the tips. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 02:58:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Mar 2020 06:58:32 +0000 Subject: [issue39923] Command errored out with exit status 1: while jsonlib In-Reply-To: Message-ID: <1583823512.14.0.601833529652.issue39923@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 02:58:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Mar 2020 06:58:56 +0000 Subject: [issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue In-Reply-To: <1583808832.46.0.617584210611.issue39921@roundup.psfhosted.org> Message-ID: <1583823536.46.0.00734528874011.issue39921@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:41:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 07:41:50 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583826110.84.0.46033514757.issue39828@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 700cb587303461d5a96456c56902cfdd8ad50e2d by Dong-hee Na in branch 'master': bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779) https://github.com/python/cpython/commit/700cb587303461d5a96456c56902cfdd8ad50e2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:48:52 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 07:48:52 +0000 Subject: [issue17422] language reference should specify restrictions on class namespace In-Reply-To: <1363293215.19.0.289288553848.issue17422@psf.upfronthosting.co.za> Message-ID: <1583826532.52.0.428249867393.issue17422@roundup.psfhosted.org> Ned Deily added the comment: New changeset 22448149a05b5bc3e3a2ffdc0682bcd01995ce2a by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/22448149a05b5bc3e3a2ffdc0682bcd01995ce2a ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:48:53 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 07:48:53 +0000 Subject: [issue13487] inspect.getmodule fails when module imports change sys.modules In-Reply-To: <1322363209.24.0.0935380803772.issue13487@psf.upfronthosting.co.za> Message-ID: <1583826533.65.0.779662888343.issue13487@roundup.psfhosted.org> Ned Deily added the comment: New changeset 7058d2d96c5ca4dfc6c754c5cd737c6eb2a8fd67 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) https://github.com/python/cpython/commit/7058d2d96c5ca4dfc6c754c5cd737c6eb2a8fd67 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:48:53 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 07:48:53 +0000 Subject: [issue39808] pathlib: reword docs for stat() In-Reply-To: <1583058421.39.0.192820451754.issue39808@roundup.psfhosted.org> Message-ID: <1583826533.01.0.50156001987.issue39808@roundup.psfhosted.org> Ned Deily added the comment: New changeset c157edb73b234409263ca0d7b6b41ad5f0b455d6 by Ned Deily (Miss Islington (bot)) in branch '3.7': [3.7] bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719) (GH-18782) https://github.com/python/cpython/commit/c157edb73b234409263ca0d7b6b41ad5f0b455d6 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:48:52 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 07:48:52 +0000 Subject: [issue39837] Remove Azure Pipelines from GitHub PRs In-Reply-To: <1583255119.77.0.277327127951.issue39837@roundup.psfhosted.org> Message-ID: <1583826532.91.0.58206070192.issue39837@roundup.psfhosted.org> Ned Deily added the comment: New changeset b092892f9afd37fd3355b1e91fc5835f196ea914 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-39837: Disable macOS tests on Azure Pipelines (GH-18818) https://github.com/python/cpython/commit/b092892f9afd37fd3355b1e91fc5835f196ea914 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 03:56:54 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 10 Mar 2020 07:56:54 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583827014.85.0.245931162354.issue39828@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18251 pull_request: https://github.com/python/cpython/pull/18894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:05:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 08:05:41 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583827541.2.0.0318649487099.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: lib64_tests-3.py: Updated script to handle different ABI flags (release vs debug mode). ---------- Added file: https://bugs.python.org/file48966/lib64_tests-3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:12:56 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 10 Mar 2020 08:12:56 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583827976.2.0.400179152641.issue39828@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18252 pull_request: https://github.com/python/cpython/pull/18895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:14:11 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 08:14:11 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583828051.71.0.171394761367.issue39828@roundup.psfhosted.org> miss-islington added the comment: New changeset caec8a0dfbed04bdb8567782fdff7537529d2232 by Dong-hee Na in branch '3.8': [3.8] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18894) https://github.com/python/cpython/commit/caec8a0dfbed04bdb8567782fdff7537529d2232 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:30:55 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 08:30:55 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583829055.78.0.582011353572.issue39828@roundup.psfhosted.org> miss-islington added the comment: New changeset 633957d7e3f926e20fed023c635ae2216efd2198 by Dong-hee Na in branch '3.7': [3.7] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18895) https://github.com/python/cpython/commit/633957d7e3f926e20fed023c635ae2216efd2198 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:37:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 08:37:56 +0000 Subject: [issue39828] json.tool should catch BrokenPipeError In-Reply-To: <1583163028.53.0.26021214856.issue39828@roundup.psfhosted.org> Message-ID: <1583829476.74.0.42938007386.issue39828@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Dong-hee Na for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:38:51 2020 From: report at bugs.python.org (Jacob Middag) Date: Tue, 10 Mar 2020 08:38:51 +0000 Subject: [issue32803] smtplib: LMTP broken in the case of multiple RCPT In-Reply-To: <1518132309.75.0.467229070634.issue32803@psf.upfronthosting.co.za> Message-ID: <1583829531.57.0.674203719339.issue32803@roundup.psfhosted.org> Change by Jacob Middag : ---------- keywords: +patch nosy: +middag nosy_count: 2.0 -> 3.0 pull_requests: +18253 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:46:18 2020 From: report at bugs.python.org (Mads Sejersen) Date: Tue, 10 Mar 2020 08:46:18 +0000 Subject: [issue39915] AsyncMock doesn't work with asyncio.gather In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583829978.21.0.846827401797.issue39915@roundup.psfhosted.org> Mads Sejersen added the comment: It can actually be boiled down to an even more minimal example. It looks like the problem is that the function call is stored for later when called, then overwritten by other subsequent calls. Then, once awaited, the latest registered call is added to the await_args_list instead of the call that actually happened. ``` import asyncio from unittest.mock import AsyncMock async def main(): foo = AsyncMock() foo1 = foo(1) foo2 = foo(2) await foo1 await foo2 print(foo.await_args_list) asyncio.run(main()) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 04:53:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 08:53:13 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583830393.02.0.847536690279.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8510f430781118d9b603c3a2f06945d6ebc5fe42 by Victor Stinner in branch 'master': bpo-1294959: Add sys.platlibdir attribute (GH-18381) https://github.com/python/cpython/commit/8510f430781118d9b603c3a2f06945d6ebc5fe42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 05:20:14 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 10 Mar 2020 09:20:14 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583832014.22.0.607731044642.issue39915@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the report. At [0] self.call_args is used. This value is always the last call. So when the object is awaited it will be always the last call object and gets appended. The id of the call objects remain the same. The fix would be to construct the call object with args and kwargs in asynchronous definition of _execute_mock_call like [1]. This would need tests too. It seems there is only test for one await call and assertion over await_args_list. Having different args and kwargs with multiple await to assert await_args_list would help here. In synchronous case the call object is eagerly appended so it won't be an issue. [0] https://github.com/python/cpython/blob/8510f430781118d9b603c3a2f06945d6ebc5fe42/Lib/unittest/mock.py#L2174 [1] https://github.com/python/cpython/blob/8510f430781118d9b603c3a2f06945d6ebc5fe42/Lib/unittest/mock.py#L1106 A potential patch would be as below : diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 9e692981a2..20daf724c1 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2171,7 +2171,7 @@ class AsyncMockMixin(Base): # This is nearly just like super(), except for special handling # of coroutines - _call = self.call_args + _call = _Call((args, kwargs), two=True) self.await_count += 1 self.await_args = _call self.await_args_list.append(_call) ---------- nosy: +cjw296, mariocj89, michael.foord title: AsyncMock doesn't work with asyncio.gather -> await_args_list in AsyncMock always refers to the last awaited call object _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 05:31:11 2020 From: report at bugs.python.org (Caleb Hattingh) Date: Tue, 10 Mar 2020 09:31:11 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583832671.77.0.26229355323.issue39857@roundup.psfhosted.org> Caleb Hattingh added the comment: The dict unpacking generalizations that I posted were added in Python 3.5, which is pretty old by now. (But, true, is in Python 3 and not Python 2). This is the PEP: https://www.python.org/dev/peps/pep-0448/ The new syntax that Brandt posted will indeed only be available from 3.9 on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 06:46:06 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 10 Mar 2020 10:46:06 +0000 Subject: [issue39920] Pathlib path methods do not work with Window Dos devices In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1583837166.02.0.973296217143.issue39920@roundup.psfhosted.org> Eric V. Smith added the comment: I know it's of limited use, but for me, this code works (returns True) on Cygwin versions 3.8.0b4 and 3.7.4. On a native Windows build 3.8.0a0, I get the exception the OP shows. I'll try and install comparable versions when I'm at a location with better connectivity. ---------- components: +Windows nosy: +eric.smith, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 06:54:10 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 10 Mar 2020 10:54:10 +0000 Subject: [issue39920] Pathlib path methods do not work with Window Dos devices In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1583837650.5.0.413602589492.issue39920@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 07:50:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 11:50:29 +0000 Subject: [issue38075] Make random module PEP-384 compatible In-Reply-To: <1568044678.81.0.091085634764.issue38075@roundup.psfhosted.org> Message-ID: <1583841029.77.0.549443325274.issue38075@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18255 pull_request: https://github.com/python/cpython/pull/18897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 07:50:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 11:50:55 +0000 Subject: [issue39918] random.Random(False) weird error In-Reply-To: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> Message-ID: <1583841055.65.0.494282911534.issue39918@roundup.psfhosted.org> STINNER Victor added the comment: > Should that 0 in the PyObject_Vectorcall be a 1 instead? Right. I proposed PR 18897 to fix it and add an unit test on seed(False). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 07:58:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 11:58:18 +0000 Subject: [issue38075] Make random module PEP-384 compatible In-Reply-To: <1568044678.81.0.091085634764.issue38075@roundup.psfhosted.org> Message-ID: <1583841498.32.0.491591373598.issue38075@roundup.psfhosted.org> STINNER Victor added the comment: Commit 04f0bbfbedf8d2bb69b012f853de6648b1a9f27f introduced a regression: bpo-39918. I proposed PR 18897 to fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 09:18:52 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 10 Mar 2020 13:18:52 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583846332.82.0.211903059644.issue39857@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 09:26:31 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 10 Mar 2020 13:26:31 +0000 Subject: [issue39920] os.lstat() does not work with Window Dos devices In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1583846791.6.0.659049120839.issue39920@roundup.psfhosted.org> Steve Dower added the comment: This is an os.lstat() limitation, nothing to do with pathlib. I'll defer to Eryk for suggestions here, since he probably knows the right answer already :) (if not, I'll go do the research to figure out what we're currently missing). ---------- title: Pathlib path methods do not work with Window Dos devices -> os.lstat() does not work with Window Dos devices _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 09:26:37 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 10 Mar 2020 13:26:37 +0000 Subject: [issue39920] os.lstat() does not work with Window Dos devices In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1583846797.82.0.903883250739.issue39920@roundup.psfhosted.org> Change by Steve Dower : ---------- versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:15:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 14:15:35 +0000 Subject: [issue38075] Make random module PEP-384 compatible In-Reply-To: <1568044678.81.0.091085634764.issue38075@roundup.psfhosted.org> Message-ID: <1583849735.27.0.971408250736.issue38075@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 00d7cd8ab8db2c1e1f591ade828f88a1a973d70f by Victor Stinner in branch 'master': bpo-38075: Fix random_seed(): use PyObject_CallOneArg() (GH-18897) https://github.com/python/cpython/commit/00d7cd8ab8db2c1e1f591ade828f88a1a973d70f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:15:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 14:15:58 +0000 Subject: [issue39918] random.Random(False) weird error In-Reply-To: <1583785310.79.0.724541627547.issue39918@roundup.psfhosted.org> Message-ID: <1583849758.97.0.648524791117.issue39918@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by: New changeset 00d7cd8ab8db2c1e1f591ade828f88a1a973d70f by Victor Stinner in branch 'master': bpo-38075: Fix random_seed(): use PyObject_CallOneArg() (GH-18897) https://github.com/python/cpython/commit/00d7cd8ab8db2c1e1f591ade828f88a1a973d70f ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:18:00 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 14:18:00 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583849880.51.0.0564167202256.issue39869@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18256 pull_request: https://github.com/python/cpython/pull/18898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:17:44 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 14:17:44 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583849864.58.0.313189718994.issue39869@roundup.psfhosted.org> miss-islington added the comment: New changeset e5e56328afac50aad6d8893185d8e7ba8928afe2 by Antoine in branch 'master': bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) https://github.com/python/cpython/commit/e5e56328afac50aad6d8893185d8e7ba8928afe2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:20:48 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 14:20:48 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583850048.05.0.698183701071.issue39869@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18257 pull_request: https://github.com/python/cpython/pull/18899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:20:55 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 14:20:55 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583850055.85.0.910491522691.issue39869@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18258 pull_request: https://github.com/python/cpython/pull/18900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:22:43 2020 From: report at bugs.python.org (Mariatta) Date: Tue, 10 Mar 2020 14:22:43 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583850163.9.0.728927097355.issue39869@roundup.psfhosted.org> Change by Mariatta : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:25:49 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 14:25:49 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1583850349.39.0.894614188054.issue39869@roundup.psfhosted.org> miss-islington added the comment: New changeset 5b29a82b13b65ca785bf296c91f253f3b5d6d694 by Miss Islington (bot) in branch '3.7': bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) https://github.com/python/cpython/commit/5b29a82b13b65ca785bf296c91f253f3b5d6d694 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 10:34:06 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 10 Mar 2020 14:34:06 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583850846.62.0.933923731939.issue38662@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: +hroncok nosy_count: 7.0 -> 8.0 pull_requests: +18259 pull_request: https://github.com/python/cpython/pull/18901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 12:08:45 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 10 Mar 2020 16:08:45 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583856525.34.0.994928639622.issue39922@roundup.psfhosted.org> Batuhan Taskaya added the comment: IMHO if you are going to proceed with this kind of issues, it would be cool to create a meta issue and post updates/link PRs to it. You are creating an extra (and unnecessary) traffic in the "new bugs announce" list. ---------- nosy: +Batuhan Taskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 12:12:21 2020 From: report at bugs.python.org (Andy Lester) Date: Tue, 10 Mar 2020 16:12:21 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583856741.78.0.499046655494.issue39922@roundup.psfhosted.org> Andy Lester added the comment: Sorry about the noise. I will do that. Yes, I have a bunch more to submit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 12:52:55 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Mar 2020 16:52:55 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583859175.75.0.591213483944.issue34822@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 13d52c268699f199a8e917a0f1dc4c51e5346c42 by Serhiy Storchaka in branch 'master': bpo-34822: Simplify AST for subscription. (GH-9605) https://github.com/python/cpython/commit/13d52c268699f199a8e917a0f1dc4c51e5346c42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 12:54:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Mar 2020 16:54:21 +0000 Subject: [issue34822] Simplify AST for slices In-Reply-To: <1538065060.28.0.545547206417.issue34822@psf.upfronthosting.co.za> Message-ID: <1583859261.86.0.637486118119.issue34822@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:07:32 2020 From: report at bugs.python.org (chrysn) Date: Tue, 10 Mar 2020 17:07:32 +0000 Subject: [issue35569] OSX: Enable IPV6_RECVPKTINFO In-Reply-To: <1545566447.14.0.0770528567349.issue35569@roundup.psfhosted.org> Message-ID: <1583860052.29.0.974767515663.issue35569@roundup.psfhosted.org> chrysn added the comment: Testing the application to current git master (on a borrowed machine with Darwin Kernel Version 18.5.0), the provided patch does enable the desired IPV6_RECVPKTINFO flag, and the received pktinfo struct complies to the spec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:14:05 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 10 Mar 2020 17:14:05 +0000 Subject: [issue35569] OSX: Enable IPV6_RECVPKTINFO In-Reply-To: <1545566447.14.0.0770528567349.issue35569@roundup.psfhosted.org> Message-ID: <1583860445.13.0.916745797339.issue35569@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks for testing @chrysn. I guess I should add unit tests if this is to be applied to master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:32:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 17:32:12 +0000 Subject: [issue38818] Modify PyInterpreterState.eval_frame to pass tstate (PyThreadState) In-Reply-To: <1573863093.89.0.126489580733.issue38818@roundup.psfhosted.org> Message-ID: <1583861532.94.0.944590010654.issue38818@roundup.psfhosted.org> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-38500. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:33:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 17:33:49 +0000 Subject: [issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583861629.96.0.740813810094.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-38818 "Modify PyInterpreterState.eval_frame to pass tstate (PyThreadState)" as a duplicate of this issue. It has been said earlier that if we choose to add a public C API to set the frame evaluation function, it's better to design it properly from the start: so include tstate. See https://vstinner.github.io/cpython-pass-tstate.html for the rationale behind passing tstate everywhere. See also multiple discussions on python-dev about passing explicitly tstate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:34:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 17:34:08 +0000 Subject: [issue38818] Modify PyInterpreterState.eval_frame to pass tstate (PyThreadState) In-Reply-To: <1573863093.89.0.126489580733.issue38818@roundup.psfhosted.org> Message-ID: <1583861648.64.0.273091551664.issue38818@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18260 pull_request: https://github.com/python/cpython/pull/17340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 13:45:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 17:45:43 +0000 Subject: [issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583862343.19.0.142588084948.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: I plan to merge my PR 17340 at the end of week to not miss Python 3.9 feature freeze deadline, unless someone speaks up and find a good reason to not merge this PR. The PR adds a public C API PyInterpreterState_SetEvalFrameFunc() and now pass tstate to the frame evaluation function. -- Mark Shannon is against the idea of providing a way to set the frame evaluation function (PEP 523), but Dino Viehland, Eric Snow, Brett Cannon and me want to provide a C API for that. -- I propose to properly fix this issue in Python 3.9: * Add a public C API to get and set the frame evaluation function * Pass tstate to this frame evaluation function Pass tstate is a backward incompatible change. But it's unclear to me if its API was part of the "public" C API in Python 3.7. In Python 3.8, PyInterpreterState structure moved to the internal C API which is clearly excluded from backward compatibility warranties of the public C API. Anyway, I expect that they are less than 10 projects in the world which use the frame evaluation function, which it should be doable to update all of them to support the C API for Python 3.9 that I'm proposing. -- > This is no longer possible because in 3.8 the PyInterpreterState is opaque, so, Py_BUILD_CORE_MODULE needs to be defined defined and "internal/pycore_pystate.h" must be included to set PyInterpreterState.eval_frame. The status quo is that Python 3.8.0, 3.8.1 and 3.8.2 have been released with that. If someone wants to support "Python 3.8", using Py_BUILD_CORE_MODULE to access the internal C API is the way to go. If we wanted to add a public C API in Python 3.8, IMHO we had to do it *before Python 3.8.0 release. Now it's way too late. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 14:06:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 18:06:56 +0000 Subject: [issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583863616.03.0.0204499006576.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: > Posted https://mail.python.org/archives/list/python-dev at python.org/thread/4UZJYAZL3NHRAGN5WAMJC4IHAHEXF3QF/ to see if anyone else wants to weigh in. Mark Shannon listed flaws in the PEP 532 and suggest to withdraw this PEP. Honestly, I'm open to any solution. But this issue is a concrete regression of Python 3.8 with a concrete use case, whereas Mark only lists theoretical enhancements. I would like to fix the regression first. There are users of the PEP 532, we cannot simply ignore them, withdraw the PEP and remove the feature immediately without warning users. If someone wants to withdraw the PEP, it has to go through the regular deprecation process with a slow transition. Last time we pushed too many incompatible changes (Python 2 to Python 3 transition), it was a mess. Moreover, I would prefer to have at least one Python release (if not two or more) which provides two options, deprecated way and a new better way, to have a smooth transition. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 14:07:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 18:07:43 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583863663.77.0.130241242851.issue38500@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals -> PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 14:09:08 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 10 Mar 2020 18:09:08 +0000 Subject: [issue39832] Modules with decomposable characters in module name not found on macOS In-Reply-To: <1583195116.72.0.709878882387.issue39832@roundup.psfhosted.org> Message-ID: <1583863748.64.0.224689928643.issue39832@roundup.psfhosted.org> Brett Cannon added the comment: Regardless of which module is proposed to solve this, there is still a bootstrapping issue to consider. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 14:18:32 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 10 Mar 2020 18:18:32 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583864312.09.0.386076827538.issue38500@roundup.psfhosted.org> Brett Cannon added the comment: > Mark Shannon listed flaws in the PEP 532 and suggest to withdraw this PEP. I think you mean PEP 352? And a more formal proposal to withdraw would need to be made and that has not happened, so assume the PEP is still accepted and final. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 14:21:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 18:21:26 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1583864486.27.0.564689857477.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: > I think you mean PEP 352? And a more formal proposal to withdraw would need to be made and that has not happened, so assume the PEP is still accepted and final. I mean PEP 523 "Adding a frame evaluation API to CPython" as I wrote in the title, sorry for the typo :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 15:01:08 2020 From: report at bugs.python.org (Nicholas Chammas) Date: Tue, 10 Mar 2020 19:01:08 +0000 Subject: [issue20039] Missing documentation for argparse.ArgumentTypeError In-Reply-To: <1387622425.21.0.562750433804.issue20039@psf.upfronthosting.co.za> Message-ID: <1583866868.46.0.700809274268.issue20039@roundup.psfhosted.org> Nicholas Chammas added the comment: Just a note that I also went looking for the docs for argparse.ArgumentTypeError after coming across it in this (highly viewed) post: https://stackoverflow.com/a/14117511/877069 ---------- nosy: +nchammas _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 15:01:23 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 10 Mar 2020 19:01:23 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583866883.38.0.112516241775.issue39763@roundup.psfhosted.org> Michael Felt added the comment: re: _socket - I'll start researching now, but it may still be related to this. a) if it looks like related to this issue I'll add a some report here b) in any case, as requested, I'll start a new issue - and leave it to you to decide to close that and continue here, or with the new issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 16:01:46 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 10 Mar 2020 20:01:46 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583870506.22.0.790500063277.issue39763@roundup.psfhosted.org> Michael Felt added the comment: OK. BEFORE I open a new issue, I am going to guess that something is wrong with finding _socket.so - because it exists, but "something" is not finding it. Following modules built successfully but were removed because they could not be imported:^M _asyncio ^M ^M running build_scripts^M copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/pydoc3 -> build/scripts-3.9^M copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/idle3 -> build/scripts-3.9^M copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/2to3 -> build/scripts-3.9^M changing mode of build/scripts-3.9/pydoc3 from 644 to 755^M changing mode of build/scripts-3.9/idle3 from 644 to 755^M changing mode of build/scripts-3.9/2to3 from 644 to 755^M renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9^M renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9^M renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9^M xlc_r -c -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I../git/python3-3.9/Include/internal -IObjects -IInclude -IPython -I. -I../git/python3-3.9/Include -I/opt/include -DPy_BUILD_CORE -o Programs/_testembed.o ../git /python3-3.9/Programs/_testembed.c^M ../git/python3-3.9/Modules/makexp_aix Modules/python.exp . libpython3.9.a; xlc_r /opt/lib/libintl.a -L/opt/lib -liconv -lexpat -Wl,-bE:Modules/python.exp -lld -o Programs/_testembed Programs/_testembed.o libpython3.9.so -lintl -l dl -lm -lm ^M NOTE: The module was built successfully, but not found. root at x065:[/data/prj/python/python3-3.9]find . -name _socket.so ./build/lib.aix-5307-0747-32-3.9/_socket.so ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 16:04:48 2020 From: report at bugs.python.org (Ben Boeckel) Date: Tue, 10 Mar 2020 20:04:48 +0000 Subject: [issue37588] Py_DEPRECATED and unavoidable warnings In-Reply-To: <1563040436.19.0.276806879722.issue37588@roundup.psfhosted.org> Message-ID: <1583870688.74.0.103584956635.issue37588@roundup.psfhosted.org> Ben Boeckel added the comment: I believe this to be a clang bug. I've filed an issue with upstream here: https://bugs.llvm.org/show_bug.cgi?id=45170 ---------- nosy: +mathstuf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 16:32:27 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 10 Mar 2020 20:32:27 +0000 Subject: [issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg In-Reply-To: <1583374218.17.0.443069658502.issue39857@roundup.psfhosted.org> Message-ID: <1583872347.1.0.757055143435.issue39857@roundup.psfhosted.org> Gregory P. Smith added the comment: I think those dict unpacking and merging options are sufficient that adding an extra_env= parameter would merely complicate the already over complex API. Thanks for the suggestions folks! ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 16:44:30 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 10 Mar 2020 20:44:30 +0000 Subject: [issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor In-Reply-To: <1583647831.98.0.39095900929.issue39900@roundup.psfhosted.org> Message-ID: <1583873070.92.0.708926195145.issue39900@roundup.psfhosted.org> Barney Gale added the comment: Closing after @pitrou clarified the meaning of __fspath__() here: https://discuss.python.org/t/make-pathlib-extensible/3428/12?u=barneygale ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:12:47 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 10 Mar 2020 21:12:47 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently Message-ID: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> New submission from Barney Gale : Small bug report encompassing some related issues in `pathlib._NormalAccessor`: - `link_to()` should be named `link()` for consistency with other methods - `symlink()` doesn't need to guard against `os.symlink()` not accepting `target_is_directory` on non-Windows platforms; this has been fixed since 3.3 - `readlink()` doesn't raise `NotImplementedError` when `os.readlink()` is unavailable Only the last of these has a user impact, and only on exotic systems. ---------- components: Library (Lib) messages: 363845 nosy: barneygale priority: normal severity: normal status: open title: pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:16:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:16:42 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875002.61.0.226420287446.issue38662@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 88f82b2b9ea3514359cb6e3218121f75334063ac by Miro Hron?ok in branch 'master': bpo-38662: ensurepip invokes pip via runpy (GH-18901) https://github.com/python/cpython/commit/88f82b2b9ea3514359cb6e3218121f75334063ac ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:18:30 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 21:18:30 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875110.54.0.668829808562.issue38662@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18262 pull_request: https://github.com/python/cpython/pull/18907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:18:22 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 21:18:22 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875102.76.0.875473382534.issue38662@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +18261 pull_request: https://github.com/python/cpython/pull/18906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:19:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:19:07 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875147.79.0.472614583182.issue38662@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Library (Lib) versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:23:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:23:36 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875416.93.0.929577618042.issue38662@roundup.psfhosted.org> STINNER Victor added the comment: While it's not a major issue in CPython, I can say that being tightly coupled to pip internals is a major in Fedora which updates pip frequently and tries to support multiple pip versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:26:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:26:47 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875607.27.0.663963962405.issue38662@roundup.psfhosted.org> STINNER Victor added the comment: Miro Hron?ok: "I wasn't even hoping for a backport. Thanks!" ( https://github.com/python/cpython/pull/18901#issuecomment-597324810 ) pip wheel files are still updated in stable 3.7 and 3.8 branches. Example in August 2018 in 3.7: * commit c1c1a3396391dcc948d332607a0f673e4434da97 * bpo-37664 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:29:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:29:22 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583875762.7.0.835373977719.issue38662@roundup.psfhosted.org> STINNER Victor added the comment: > Yes, pip will support 2.7 at least until CPython does (and likely longer). 2.7 is no longer supported in CPython. So I will not backport the fix to 2.7. And I removed the 2.7 from versions of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:31:06 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 10 Mar 2020 21:31:06 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order Message-ID: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> New submission from Barney Gale : `mylink.symlink_to(target)` and `mylink.link_to(target)` should both create a link (soft or hard) at *mylink* that points to *target*. But `link_to()` does the opposite - it creates *target* and points it towards *mylink*. Correct behaviour from `symlink_to()`: barney at acorn ~/projects/cpython $ touch /tmp/target barney at acorn ~/projects/cpython $ ./python Python 3.9.0a3+ (heads/bpo-39659-pathlib-getcwd-dirty:a4ba8a3, Feb 19 2020, 02:22:39) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pathlib >>> p = pathlib.Path('/tmp/link') >>> p.symlink_to('/tmp/target') >>> exit() barney at acorn ~/projects/cpython $ ls -l /tmp/link /tmp/target lrwxrwxrwx 1 barney barney 11 Mar 10 21:20 /tmp/link -> /tmp/target -rw-rw-r-- 1 barney barney 0 Mar 10 21:20 /tmp/target Incorrect behaviour from `link_to()`: barney at acorn ~/projects/cpython $ rm /tmp/link barney at acorn ~/projects/cpython $ ./python Python 3.9.0a3+ (heads/bpo-39659-pathlib-getcwd-dirty:a4ba8a3, Feb 19 2020, 02:22:39) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pathlib >>> p = pathlib.Path('/tmp/link') >>> p.link_to('/tmp/target') Traceback (most recent call last): File "", line 1, in File "/home/barney/projects/cpython/Lib/pathlib.py", line 1370, in link_to self._accessor.link_to(self, target) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/link' -> '/tmp/target' >>> # but... >>> p = pathlib.Path('/tmp/target') >>> p.link_to('/tmp/link') >>> exit() barney at acorn ~/projects/cpython $ ls -l /tmp/link /tmp/target -rw-rw-r-- 2 barney barney 0 Mar 10 21:20 /tmp/link -rw-rw-r-- 2 barney barney 0 Mar 10 21:20 /tmp/target ---------- components: Library (Lib) messages: 363850 nosy: barneygale priority: normal severity: normal status: open title: `pathlib.Path.link_to()` has the wrong argument order type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:34:54 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 21:34:54 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583876094.9.0.0638564185796.issue38662@roundup.psfhosted.org> miss-islington added the comment: New changeset 8d5c958ddebbb96c2de5d58da4c7aa1790629cf9 by Miss Islington (bot) in branch '3.7': bpo-38662: ensurepip invokes pip via runpy (GH-18901) https://github.com/python/cpython/commit/8d5c958ddebbb96c2de5d58da4c7aa1790629cf9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:37:53 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Mar 2020 21:37:53 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583876273.56.0.163785667499.issue38662@roundup.psfhosted.org> miss-islington added the comment: New changeset 212acf544a41a983aea7166d43d8dfe9a8296655 by Miss Islington (bot) in branch '3.8': bpo-38662: ensurepip invokes pip via runpy (GH-18901) https://github.com/python/cpython/commit/212acf544a41a983aea7166d43d8dfe9a8296655 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:38:45 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 10 Mar 2020 21:38:45 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583876325.7.0.523703955933.issue39763@roundup.psfhosted.org> Michael Felt added the comment: I am confused. The bot complains nearly immediately about missing _socket Following modules built successfully but were removed because they could not be imported: _asyncio running build_scripts copying and adjusting /home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Tools/scripts/pydoc3 -> build/scripts-3.9 copying and adjusting /home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Tools/scripts/idle3 -> build/scripts-3.9 copying and adjusting /home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Tools/scripts/2to3 -> build/scripts-3.9 changing mode of build/scripts-3.9/pydoc3 from 600 to 755 changing mode of build/scripts-3.9/idle3 from 600 to 755 changing mode of build/scripts-3.9/2to3 from 600 to 755 renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9 renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9 renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9 ./python -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml Traceback (most recent call last): File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/./Tools/scripts/run_tests.py", line 12, in import test.support File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/support/__init__.py", line 6, in import asyncio.events File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/asyncio/__init__.py", line 8, in from .base_events import * File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/asyncio/base_events.py", line 23, in import socket File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/socket.py", line 51, in import _socket ModuleNotFoundError: No module named '_socket' while if I use my (now closed) pr18847 I do not get the results immediately - it starts the whole test series, and then fails - but not because _socket does not exist, instead: 0:00:48 [ 53/420/2] test_socket failed (30.4 sec) -- running: test_multiprocessing_fork (48.3 sec) /data/prj/python/git/python3-3.9/Lib/test/test_socket.py:2557: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /data/prj/python/git/python3-3.9/Lib/test/test_socket.py:2648: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) test test_socket failed -- Traceback (most recent call last): File "/data/prj/python/git/python3-3.9/Lib/test/test_socket.py", line 1481, in testGetaddrinfo self.assertEqual(socktype, socket.SOCK_STREAM) AssertionError: 0 != In short, stumped... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:40:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:40:24 +0000 Subject: [issue38662] Decouple ensurepip from pip's internals using runpy In-Reply-To: <1572629064.24.0.519341934772.issue38662@roundup.psfhosted.org> Message-ID: <1583876424.09.0.1670953428.issue38662@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Pradyun Gedam and Miro Hron?ok for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:44:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 21:44:19 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583876659.52.0.491001686902.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: > OK. BEFORE I open a new issue, I am going to guess that something is wrong with finding _socket.so - because it exists, but "something" is not finding it. Did the build worked on AIX before the commit 1ec63b62035e73111e204a0e03b83503e1c58f2e which changed distutils to use subprocess? Try commit dffe4c07095e0c693e094d3c140e85a68bd8128e (parent of the other change). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:48:34 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 10 Mar 2020 21:48:34 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order In-Reply-To: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> Message-ID: <1583876914.27.0.22836065203.issue39925@roundup.psfhosted.org> Eric V. Smith added the comment: I think it's too late to change this. Is this a documentation issue? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 17:53:30 2020 From: report at bugs.python.org (Barney Gale) Date: Tue, 10 Mar 2020 21:53:30 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order In-Reply-To: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> Message-ID: <1583877210.86.0.401039399458.issue39925@roundup.psfhosted.org> Barney Gale added the comment: I'm not sure how it can be fixed on the documentation side - it's difficult to explain that `a.link_to(b)` creates a link from B to A, and not vice-versa. We could introduce a new method that does the right thing? `Path.hardlink_to()`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 18:03:17 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 10 Mar 2020 22:03:17 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583877797.81.0.877730579536.issue39763@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 18:21:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 22:21:35 +0000 Subject: [issue38631] Replace Py_FatalError() with regular Python exceptions In-Reply-To: <1572352735.51.0.915792481752.issue38631@roundup.psfhosted.org> Message-ID: <1583878895.01.0.8286241078.issue38631@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18263 pull_request: https://github.com/python/cpython/pull/18908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 18:49:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Mar 2020 22:49:20 +0000 Subject: [issue38631] Replace Py_FatalError() with regular Python exceptions In-Reply-To: <1572352735.51.0.915792481752.issue38631@roundup.psfhosted.org> Message-ID: <1583880560.36.0.642142151781.issue38631@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4e53abb0f4773e1cce68a4f41ddbb43e74364c5f by Victor Stinner in branch 'master': bpo-38631: _PyGILState_Init() returns PyStatus (GH-18908) https://github.com/python/cpython/commit/4e53abb0f4773e1cce68a4f41ddbb43e74364c5f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 18:52:02 2020 From: report at bugs.python.org (Zufu Liu) Date: Tue, 10 Mar 2020 22:52:02 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 Message-ID: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> New submission from Zufu Liu : Unicode 13.0.0 was released on March 10. https://www.unicode.org/versions/latest/ http://www.unicode.org/versions/Unicode13.0.0/ ---------- messages: 363859 nosy: zufuliu priority: normal severity: normal status: open title: unicodedata for Unicode 13.0.0 type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:11:19 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:11:19 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Message-ID: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> New submission from dd : I just upgraded my Mac OS to 10.15.3 and Python 3.8.2 install went fine. But IDLE doesn't launch at all. I have already gone to System Preferences and allowed it to allow apps from anywhere. When I go to the command line and do Python 3 I see the correct version. But clicking on the IDLE app does nothing. And previous python scripts don't run at all and I don't see errors. Super grateful to anyone who may know the answer! ---------- assignee: terry.reedy components: IDLE messages: 363860 nosy: dd789, terry.reedy priority: normal severity: normal status: open title: IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:15:53 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 23:15:53 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583882153.89.0.838832884088.issue39927@roundup.psfhosted.org> Ned Deily added the comment: Try running IDLE from the command line: python3.8 -m idlelib If that works, then open the Console.app, select the system log, and then try double-clicking the IDLE.app icon again and see if any messages appear there. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:21:37 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:21:37 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583882497.95.0.529389805724.issue39927@roundup.psfhosted.org> dd added the comment: Thanks @ned.deily That did not work. >>> python3.8 -m idlelib File "", line 1 python3.8 -m idlelib ^ SyntaxError: invalid syntax Also see this error on the system log >>> python3.8 -m idlelib File "", line 1 python3.8 -m idlelib ^ SyntaxError: invalid syntax ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:23:00 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:23:00 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583882580.94.0.572844463984.issue39927@roundup.psfhosted.org> dd added the comment: I see this error in the system.log Mar 10 17:18:25 DDs-MacBook-Pro com.apple.xpc.launchd[1] (org.python.IDLE.4188[1295]): Service exited with abnormal code: 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:23:40 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 23:23:40 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583882620.35.0.91470211168.issue39927@roundup.psfhosted.org> Ned Deily added the comment: You need to first exit out of the Python interpreter back to the Unix shell. Type: quit() Then try: python3.8 -m idlelib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:29:12 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:29:12 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583882952.93.0.936062373174.issue39927@roundup.psfhosted.org> dd added the comment: Thanks! That way IDLE does open. See this in the System log Mar 10 17:26:24 DDs-MacBook-Pro diagnosticd[1289]: Posting stream filter: "{ global = 47245099008; }" Mar 10 17:26:24 DDs-MacBook-Pro diagnosticd[1289]: System mode client started - Console (1418) - mode: 0xb, filter: "" Mar 10 17:26:36 DDs-MacBook-Pro Console[1418]: assertion failed: 19D76: libxpc.dylib + 95826 [51E3E807-9133-3605-BB5F-D59ED6404ABF]: 0x89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:31:49 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:31:49 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583883109.11.0.731159285664.issue39927@roundup.psfhosted.org> dd added the comment: Is the Unix shell the only way to open IDLE from now on? Seems like I can get it to open that way, but clicking on the app like I used to no longer works. Thank you so much! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:35:05 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Mar 2020 23:35:05 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583883305.38.0.275161533253.issue39927@roundup.psfhosted.org> Ned Deily added the comment: No, clicking on the app *should* work. I'm assuming you installed Python 3.8.2 from the python.org macOS installer? If so, you *could* try reinstalling it again. For what it's worth, I am not aware of any current problems with launching the app on 10.15.x; it works for me :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:39:54 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:39:54 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583883594.04.0.33230324341.issue39927@roundup.psfhosted.org> dd added the comment: Yes, installed Python from the mac installer on this page. I have done it multiple times already without any success. This is the error I keep seeing Mar 10 17:39:23 DDs-MacBook-Pro com.apple.xpc.launchd[1] (org.python.IDLE.4188[1615]): Service exited with abnormal code: 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 19:41:11 2020 From: report at bugs.python.org (dd) Date: Tue, 10 Mar 2020 23:41:11 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Service exited with abnormal code: 1 In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583883671.19.0.747409759462.issue39927@roundup.psfhosted.org> Change by dd : ---------- title: IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP -> IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Service exited with abnormal code: 1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 20:02:30 2020 From: report at bugs.python.org (Barney Gale) Date: Wed, 11 Mar 2020 00:02:30 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order In-Reply-To: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> Message-ID: <1583884950.08.0.762352185032.issue39925@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18264 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 20:03:33 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Mar 2020 00:03:33 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Service exited with abnormal code: 1 In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583885013.22.0.317074693517.issue39927@roundup.psfhosted.org> Ned Deily added the comment: That message just means that Python terminated with an error; the specific traceback is lost. But I just noticed one possible explanation. It appears that if the Files & Folder security setting is set to disallow access to your Documents Folder, IDLE.app will fail on startup but it will launch from the command line. Check the following in System Preferences. Apple Menu (upper left corner) -> System Preferences -> Security & Privacy. Then click on the Privacy tab, scroll to and click on Files and Folders, then look for a Python.app (not IDLE.app) entry. It should have a Documents Folder entry underneath it and it should be checked (enabled). If not, click it (you might need to click on the lock in the lower left corner to enable changes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 20:07:35 2020 From: report at bugs.python.org (Sandeep) Date: Wed, 11 Mar 2020 00:07:35 +0000 Subject: [issue39928] Pysftp Issue File Upload is not working - put command Message-ID: <1583885255.31.0.428229167076.issue39928@roundup.psfhosted.org> New submission from Sandeep : Hi We have requirement where we need to get file from client path and then upload the same to vendor directory path. I am not able to upload the file to vendor directory path , however when I tried to use the WINSCP it worked fine. So I thought of checking with Gurus what is wrong I am doing in my script. Appreciate your input. I will attach my script. Here is what I am doing. Step1. Clear the client directory path Step2. Make a call to HVAC Vault to get the username and password for client and vendor server Step3. Use the username and password to establish connection using pysftp for client. Step4. Store the file in local path. Step5. Segregate the file into different path based on file type Step6 Establish a connection to vendor and copy the file to vendor. Step7 Close the client and Vendor connection Please see the file attached. Also below is the error which I am getting --------------------------------------------------------- ERROR:root:Error in getting the file from EBS Outbound Server Traceback (most recent call last): File "FILE_TRANSFER_PROCESS.py", line 191, in file_transfer vendor.put(src_file, dst_file) File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 364, in put confirm=confirm) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 759, in put return self.putfo(fl, remotepath, file_size, callback, confirm) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 720, in putfo s = self.stat(remotepath) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 493, in stat t, msg = self._request(CMD_STAT, path) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 813, in _request return self._read_response(num) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 865, in _read_response self._convert_status(msg) File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", line 894, in _convert_status raise IOError(errno.ENOENT, text) FileNotFoundError: [Errno 2] /custom/OWO/ECE_OWO_20200303_143895.dat ---------- components: Tests files: File_Transfer_Process_Client.py messages: 363870 nosy: Sandeep priority: normal severity: normal status: open title: Pysftp Issue File Upload is not working - put command type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48967/File_Transfer_Process_Client.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 20:14:09 2020 From: report at bugs.python.org (dd) Date: Wed, 11 Mar 2020 00:14:09 +0000 Subject: [issue39927] IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Service exited with abnormal code: 1 In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583885649.46.0.810667206722.issue39927@roundup.psfhosted.org> dd added the comment: Thank you so much Ned Deily, that was it! FIXED IT! You're awesome!!! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 20:29:47 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Mar 2020 00:29:47 +0000 Subject: [issue39927] IDLE.app fails to launch on macOS 10.15 if denied access to user's Document Folder In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583886587.53.0.827308472151.issue39927@roundup.psfhosted.org> Ned Deily added the comment: Thanks for bringing it up! That was a new failure mode we haven't seen before. I was going to close this issue but then it struck me that we might be able to handle this situation a bit better; we should be able to catch an exception when IDLE tries to set the working directory to Documents. I'll leave it up to you, Terry, if you want to pursue this. I won't have time myself right now but maybe someone else would be willing to jump in. It may be a little tricky to test and certainly requires a macOS 10.15.x Catalina system. ---------- title: IDLE 3.8.2 doesn't launch on Catalina 10.15.3- HELP Service exited with abnormal code: 1 -> IDLE.app fails to launch on macOS 10.15 if denied access to user's Document Folder type: -> crash versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 21:04:59 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 11 Mar 2020 01:04:59 +0000 Subject: [issue39928] Pysftp Issue File Upload is not working - put command In-Reply-To: <1583885255.31.0.428229167076.issue39928@roundup.psfhosted.org> Message-ID: <1583888699.0.0.761249426835.issue39928@roundup.psfhosted.org> Eric V. Smith added the comment: This is the python bug tracker. What you are reporting is almost certainly not a bug in python. If you think it is a bug in python, please reproduce it in the smallest possible code fragment, and with no third party libraries installed. If you're seeking general help, you might try the python-list mailing list. If you think this is a bug in paramiko or pysftp, you should report it to their respective bug trackers. ---------- nosy: +eric.smith status: open -> pending type: crash -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 21:06:58 2020 From: report at bugs.python.org (Sandeep) Date: Wed, 11 Mar 2020 01:06:58 +0000 Subject: [issue39928] Pysftp Issue File Upload is not working - put command In-Reply-To: <1583885255.31.0.428229167076.issue39928@roundup.psfhosted.org> Message-ID: <1583888818.79.0.67445262209.issue39928@roundup.psfhosted.org> Sandeep added the comment: Eric how can I contact the python Mailing list ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 21:07:54 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 11 Mar 2020 01:07:54 +0000 Subject: [issue39928] Pysftp Issue File Upload is not working - put command In-Reply-To: <1583885255.31.0.428229167076.issue39928@roundup.psfhosted.org> Message-ID: <1583888874.4.0.00734981097986.issue39928@roundup.psfhosted.org> Eric V. Smith added the comment: Hi, Sandeep. For information see https://mail.python.org/mailman/listinfo/python-list ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 22:11:21 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 11 Mar 2020 02:11:21 +0000 Subject: [issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD In-Reply-To: <1551709428.6.0.389379055632.issue36184@roundup.psfhosted.org> Message-ID: <1583892681.58.0.0170287519115.issue36184@roundup.psfhosted.org> Kubilay Kocak added the comment: For our future reference/selves, GDB (currently 9.1 w/ python bindings) is now installed on the two FreeBSD buildbot workers ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 22:12:24 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 11 Mar 2020 02:12:24 +0000 Subject: [issue39321] AMD64 FreeBSD Non-Debug 3.x: main regrtest process killed by SIGKILL (Signal 9) In-Reply-To: <1578925087.43.0.642221025557.issue39321@roundup.psfhosted.org> Message-ID: <1583892744.09.0.847580544178.issue39321@roundup.psfhosted.org> Kubilay Kocak added the comment: Investigating ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 22:15:31 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 02:15:31 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583892931.35.0.113870578387.issue39926@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- keywords: +patch nosy: +benjamin.peterson nosy_count: 1.0 -> 2.0 pull_requests: +18265 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 22:18:16 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 02:18:16 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583893096.53.0.734524897278.issue39922@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 76d5877b72cbe66eb3b6d8caa8d19f89a938ada2 by Andy Lester in branch 'master': closes bpo-39922: Remove unused args from four functions. (GH-18893) https://github.com/python/cpython/commit/76d5877b72cbe66eb3b6d8caa8d19f89a938ada2 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 22:34:44 2020 From: report at bugs.python.org (Charles Burkland) Date: Wed, 11 Mar 2020 02:34:44 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583894084.61.0.761417863004.issue36144@roundup.psfhosted.org> Change by Charles Burkland : ---------- nosy: +chaburkland nosy_count: 12.0 -> 13.0 pull_requests: +18266 pull_request: https://github.com/python/cpython/pull/18911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 23:41:38 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 03:41:38 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583898098.57.0.428366403721.issue39926@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 051b9d08d1e6a8b1022a2bd9166be51c0b152698 by Benjamin Peterson in branch 'master': closes bpo-39926: Update Unicode to 13.0.0. (GH-18910) https://github.com/python/cpython/commit/051b9d08d1e6a8b1022a2bd9166be51c0b152698 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 10 23:58:33 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 03:58:33 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583899113.94.0.235003816668.issue39926@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- pull_requests: +18267 pull_request: https://github.com/python/cpython/pull/18913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 00:18:37 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 04:18:37 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583900317.09.0.183818471442.issue39926@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset c77aa2d60b420747886f4258cf159bdbb7354100 by Benjamin Peterson in branch 'master': bpo-39926: Update unicodedata checksum tests for Unicode 13.0 update. (GH-18913) https://github.com/python/cpython/commit/c77aa2d60b420747886f4258cf159bdbb7354100 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 01:00:23 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Mar 2020 05:00:23 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1583902823.68.0.3152064844.issue39107@roundup.psfhosted.org> Terry J. Reedy added the comment: https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm now displays the 8.6.10 pages, so the tcl folk consider this to be the current stable release. Zach or Steve or whowever can handle this for Windows, please upgrade pcbuild and whatever else 'soon' (by next release?). I have looked at https://sourceforge.net/projects/tcl/files/Tcl/8.6.10/tcltk-release-notes-8.6.10.txt/view and would like to check out one POTENTIAL INCOMPATIBILITY (mousewheel bindings) and a couple of new features. ---------- nosy: +serhiy.storchaka priority: normal -> high title: Consider building Tkinter with Tk 8.6.10 -> Upgrade tcl/tk to 8.6.10 (Windows and maxOS) versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 01:28:55 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Mar 2020 05:28:55 +0000 Subject: [issue22121] Start IDLE from icon in a better place. In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1583904535.62.0.134087370532.issue22121@roundup.psfhosted.org> Terry J. Reedy added the comment: See also #38775 about a configuration option. The two proposals need to be coordinated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 01:43:50 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 11 Mar 2020 05:43:50 +0000 Subject: [issue39928] Pysftp Issue File Upload is not working - put command In-Reply-To: <1583885255.31.0.428229167076.issue39928@roundup.psfhosted.org> Message-ID: <1583905430.03.0.100666680641.issue39928@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 02:06:08 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 06:06:08 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order In-Reply-To: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> Message-ID: <1583906768.52.0.0361128725952.issue39925@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be a duplicate of issue39291. ---------- nosy: +pitrou, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 02:13:03 2020 From: report at bugs.python.org (bscarlett) Date: Wed, 11 Mar 2020 06:13:03 +0000 Subject: [issue39929] dataclasses.asdict will mangle collection.Counter instances Message-ID: <1583907183.73.0.710103063731.issue39929@roundup.psfhosted.org> New submission from bscarlett : I noticed that dataclasses.asdict seems to incorrectly reconstruct collections.Counter objects with the counter values as tuple keys. eg: In [1]: from collections import Counter In [2]: from dataclasses import dataclass, asdict In [3]: c = Counter() In [4]: c['stuff'] += 1 In [5]: @dataclass ...: class Bob: ...: c: Counter ...: In [6]: b = Bob(c) In [7]: c Out[7]: Counter({'stuff': 1}) In [9]: b.c Out[9]: Counter({'stuff': 1}) In [10]: asdict(b) Out[10]: {'c': Counter({('stuff', 1): 1})} In [11]: asdict(b)['c'] Out[11]: Counter({('stuff', 1): 1}) The Counter gets reconstructed with its item tuples as keys. This problem seems to have similar aspects to https://bugs.python.org/issue35540 ---------- components: Library (Lib) messages: 363884 nosy: brad.scarlett at gmail.com priority: normal severity: normal status: open title: dataclasses.asdict will mangle collection.Counter instances type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 02:25:14 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Mar 2020 06:25:14 +0000 Subject: [issue39927] IDLE.app fails to launch on macOS 10.15 if denied access to user's Document Folder In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583907914.41.0.969654426885.issue39927@roundup.psfhosted.org> Terry J. Reedy added the comment: Ned> we should be able to catch an exception when IDLE tries to set the working directory to Documents. If IDLE did that, then I would consider the silent exit an IDLE bug. However, IDLE only calls os.chdir, when running a user script, in the user process, to change to the script directory, so imports work as expected. (In other words, to imitate what Python does.) There are only proposals, #22121 and #28775, to IDLE itself to change IDLE's working directory when starting. I presume a. that the switch results from how Python and IDLE are installed and how the icon is configured and b. that it happens before the first IDLE code is executed. If so, there is nothing IDLE can do. ---------- assignee: terry.reedy -> components: +Installation, macOS -IDLE nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 02:29:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Mar 2020 06:29:31 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583908171.37.0.937047220661.issue39927@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: IDLE.app fails to launch on macOS 10.15 if denied access to user's Document Folder -> IDLE.app fails on macOS 10.15 if denied access to Documents _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 03:12:34 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Mar 2020 07:12:34 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583910754.64.0.305294591714.issue39927@roundup.psfhosted.org> Ned Deily added the comment: Actually, IDLE *does* call os.chdir set the working directory when launched from IDLE.app on macOS: https://github.com/python/cpython/blob/master/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py#L8 While it's not in the idlelib directory, it's very much part of IDLE :) ---------- assignee: -> terry.reedy components: +IDLE -Installation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 03:18:37 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Mar 2020 07:18:37 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583911117.45.0.999533669317.issue39927@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: terry.reedy -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 03:43:52 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 07:43:52 +0000 Subject: [issue39929] dataclasses.asdict will mangle collection.Counter instances In-Reply-To: <1583907183.73.0.710103063731.issue39929@roundup.psfhosted.org> Message-ID: <1583912632.77.0.886195871809.issue39929@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 04:15:23 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 08:15:23 +0000 Subject: [issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main() In-Reply-To: <1583628832.97.0.582883450111.issue39892@roundup.psfhosted.org> Message-ID: <1583914523.63.0.834372206822.issue39892@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 04:48:30 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 11 Mar 2020 08:48:30 +0000 Subject: [issue39925] `pathlib.Path.link_to()` has the wrong argument order In-Reply-To: <1583875866.01.0.524310586519.issue39925@roundup.psfhosted.org> Message-ID: <1583916510.96.0.907177479191.issue39925@roundup.psfhosted.org> Eric V. Smith added the comment: Agreed it's a duplicate, so I'm closing this. For any further discussion, please use issue39291, or better yet, do as it suggests and discuss this on python-dev. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:04:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:04:58 +0000 Subject: [issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore In-Reply-To: <1583761343.44.0.373306188217.issue39911@roundup.psfhosted.org> Message-ID: <1583917498.94.0.261748011022.issue39911@roundup.psfhosted.org> STINNER Victor added the comment: > Well, it only doesn't build on 3.9+ (master) due to not being supported going forward. The *buildmaster* needs to be fixed to stop submitting those jobs to unsupported platforms. Ok, done: https://github.com/python/buildmaster-config/commit/c7fe98a920affcc025019b5e4f4e60e11bf622f3 I close the issue. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:14:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:14:19 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583918059.03.0.265799424303.issue36144@roundup.psfhosted.org> STINNER Victor added the comment: Once this issue will be done, would you mind to update PEP 584? Currently, it only says "This PEP proposes adding merge (|) and update (|=) operators to the built-in dict class." It doesn't mention that other types like OrderedDict, MappingProxy or ChainMap are updated as well. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:17:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:17:43 +0000 Subject: [issue24871] freeze.py doesn't work on x86_64 Linux out of the box In-Reply-To: <1439608426.85.0.852954620494.issue24871@psf.upfronthosting.co.za> Message-ID: <1583918263.9.0.130523832116.issue24871@roundup.psfhosted.org> STINNER Victor added the comment: bpo-1294959 has been fixed by commit 8510f430781118d9b603c3a2f06945d6ebc5fe42: Python 3.9 now has sys.platlibdir which will be equal to "lib64" on Fedora and SuSE on 64-bit systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:19:34 2020 From: report at bugs.python.org (Russell Keith-Magee) Date: Wed, 11 Mar 2020 09:19:34 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll Message-ID: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> New submission from Russell Keith-Magee : The Windows python-3.7.7-embed-amd64.zip installer (released Mar 11 2020) appears to be missing vcruntime140.dll. As a result, running the python.exe or pythonw.exe included in that installer fails with a system error notifying you of the missing DLL. The 3.7.6 embedded install included this file. ---------- components: Build, Windows messages: 363891 nosy: freakboy3742, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Embedded installer for Python 3.7.7 missing vcruntime140.dll versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:20:52 2020 From: report at bugs.python.org (agmt) Date: Wed, 11 Mar 2020 09:20:52 +0000 Subject: [issue39931] Global variables are not accessible from child processes (multiprocessing.Pool) Message-ID: <1583918452.53.0.6597480705.issue39931@roundup.psfhosted.org> New submission from agmt : Attached test works correctly on linux (3.7, 3.8) and mac (only 3.7). Mac python3.8 falls with exception: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "test.py", line 8, in work print(F"Work={arg} args={args}") NameError: name 'args' is not defined """ ---------- components: Library (Lib), macOS files: test.py messages: 363892 nosy: agmt, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Global variables are not accessible from child processes (multiprocessing.Pool) type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48968/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:24:12 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 11 Mar 2020 09:24:12 +0000 Subject: [issue39929] dataclasses.asdict will mangle collection.Counter instances In-Reply-To: <1583907183.73.0.710103063731.issue39929@roundup.psfhosted.org> Message-ID: <1583918652.54.0.405599130246.issue39929@roundup.psfhosted.org> Eric V. Smith added the comment: The asdict API was a mistake, because it's not possible for it to know how to create all possible sub-objects. I can't decide what to do about it. I might just "abandon it in place", by documenting its problems and suggesting it not be used. I should research what attrs does. ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:25:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:25:18 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583918718.89.0.690075079671.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: I chose to exclude setup.py changes from my commit 8510f430781118d9b603c3a2f06945d6ebc5fe42, whereas the Fedora downstream patch has a few changes: https://src.fedoraproject.org/rpms/python39/blob/master/f/00102-lib64.patch See also bpo-14791: "setup.py only adds /prefix/lib, not /prefix/lib64". diff --git a/setup.py b/setup.py index 51e67fe4a5..bafa0bf99a 100644 --- a/setup.py +++ b/setup.py @@ -649,7 +649,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not CROSS_COMPILING: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if CROSS_COMPILING: @@ -955,11 +955,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(self.lib_dirs + - ['/usr/lib/termcap'], + ['/usr/lib64/termcap'], 'termcap'): readline_libs.append('termcap') self.add(Extension('readline', ['readline.c'], - library_dirs=['/usr/lib/termcap'], + library_dirs=['/usr/lib64/termcap'], extra_link_args=readline_extra_link_args, libraries=readline_libs)) else: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:28:13 2020 From: report at bugs.python.org (Russell Keith-Magee) Date: Wed, 11 Mar 2020 09:28:13 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583918893.22.0.294155424685.issue39930@roundup.psfhosted.org> Russell Keith-Magee added the comment: It appears the 3.7.7RC1 embedded installer was also missing the file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:30:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:30:28 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583919028.82.0.60993403319.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: Another related issue is bpo-34058: "Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:42:28 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 09:42:28 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583919748.79.0.854029733134.issue39930@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the heads-up, I'll take a look. ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 05:50:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 09:50:57 +0000 Subject: [issue34058] Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/ In-Reply-To: <1530838420.77.0.56676864532.issue34058@psf.upfronthosting.co.za> Message-ID: <1583920257.68.0.770366507866.issue34058@roundup.psfhosted.org> STINNER Victor added the comment: bpo-1294959 has been fixed by commit 8510f430781118d9b603c3a2f06945d6ebc5fe42, but this issue is about "./configure with no parameters". This issue seems to be about OpenSuSE downstream patches: "just compiling and installing from source on OpenSUSE 42.3." I found multiple similar old issues. bpo-15631: "Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders", "error: ImportError: No module named 'atexit'". The reporter used downstream patch: "I applied the OpenSUSE patch". => closed as a duplicate of bpo-1294959 * bpo-18092: "Python 2.7.5 installation broken on OpenSuse 12.2", error: "ImportError: No module named _collections". The reporter never explained how Python was configured: "Please provide exactly what ./configure options you used to build Python and any "make install" options." => closed as a duplicate of bpo-1294959 * bpo-30633: "Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: No module named 'encodings'", error: "Fatal Python error: Py_Initialize: Unable to get the locale encoding". Same reporter name than bpo-18092 "Andreas Jung", but different bugs.python.org login name ("zopyx" vs "Andreas.Jung". The reporter says that he used "the standard ./configure --prefix=... --enable-optimizations" but not if he applied any OpenSuSE downstream patch. => closed as out of date in 2019 after 2 years of inactivity ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:01:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 10:01:32 +0000 Subject: [issue34058] Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/ In-Reply-To: <1530838420.77.0.56676864532.issue34058@psf.upfronthosting.co.za> Message-ID: <1583920892.99.0.321123832004.issue34058@roundup.psfhosted.org> STINNER Victor added the comment: This issuse is now 2 years old and it doesn't have a clear description. It started with "just compiling and installing from source on OpenSUSE 42.3", then switched to "I got the source directly from www.python.org" to finish with "I also have the same problem (...) on the latest version of CentOS 7". I close the issue. If someone wants to reopen the issue, please clearly explains: * how you get Python * did you apply any patch on it * how did you configure Python? (configure command) * how did you built Python? * how did you install Python? * how do you run Python? * what is your operating system? * what is your locale (LC_ALL, LC_CTYPE and LANG environment variable)? * do you have any environment variable with a name starting with PYTHON? So far, we only got unclear bug reports with partial information and we could only guess what the reporter did. Since this issue started with OpenSuSE downstream patches, I mark also this issue as a duplicate of bpo-1294959. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:01:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 10:01:58 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583920918.55.0.932695893768.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: > Another related issue is bpo-34058: "Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/". I marked bpo-34058 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:14:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 10:14:15 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583921655.62.0.932795382161.issue1294959@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18268 pull_request: https://github.com/python/cpython/pull/18917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:20:58 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 10:20:58 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583922058.58.0.0845867101029.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +18269 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:24:21 2020 From: report at bugs.python.org (Christian Heimes) Date: Wed, 11 Mar 2020 10:24:21 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1583922261.29.0.686783485693.issue1294959@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:25:27 2020 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 11 Mar 2020 10:25:27 +0000 Subject: [issue39931] Global variables are not accessible from child processes (multiprocessing.Pool) In-Reply-To: <1583918452.53.0.6597480705.issue39931@roundup.psfhosted.org> Message-ID: <1583922327.92.0.635365357474.issue39931@roundup.psfhosted.org> Thomas Grainger added the comment: yeah this is normal. on Python 3.8 mac multiprocessing switched to spawn you have to use https://docs.python.org/3/library/multiprocessing.shared_memory.html to share content between processes or pass it to be pickled in the args of imap_unordered https://bugs.python.org/issue33725 ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:36:52 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 10:36:52 +0000 Subject: [issue39326] Python-3.8.1 "test_importlib" failed In-Reply-To: <1578977546.19.0.0039726161306.issue39326@roundup.psfhosted.org> Message-ID: <1583923012.1.0.842122250808.issue39326@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 06:55:01 2020 From: report at bugs.python.org (agmt) Date: Wed, 11 Mar 2020 10:55:01 +0000 Subject: [issue39931] Global variables are not accessible from child processes (multiprocessing.Pool) In-Reply-To: <1583918452.53.0.6597480705.issue39931@roundup.psfhosted.org> Message-ID: <1583924101.54.0.618439788107.issue39931@roundup.psfhosted.org> agmt added the comment: Shared memory/pickle cannot send file descriptors ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:00:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:00:15 +0000 Subject: [issue39931] Global variables are not accessible from child processes (multiprocessing.Pool) In-Reply-To: <1583918452.53.0.6597480705.issue39931@roundup.psfhosted.org> Message-ID: <1583924415.87.0.111465271213.issue39931@roundup.psfhosted.org> STINNER Victor added the comment: > Shared memory/pickle cannot send file descriptors FYI Python 3.9 got new socket.send_fds() and socket.recv_fds() functions :-) https://docs.python.org/dev/library/socket.html#socket.socket.send_fds ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:18:30 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 11:18:30 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583925510.84.0.308716059369.issue39930@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18270 pull_request: https://github.com/python/cpython/pull/18919 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:18:33 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 11:18:33 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583925513.49.0.46494837132.issue39930@roundup.psfhosted.org> Steve Dower added the comment: New changeset 2dd41740c97bd77695ddcc590caa7f53e76dc35a by Steve Dower in branch 'master': bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918) https://github.com/python/cpython/commit/2dd41740c97bd77695ddcc590caa7f53e76dc35a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:21:03 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 11:21:03 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583925663.15.0.538880270678.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18271 pull_request: https://github.com/python/cpython/pull/18920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:38:22 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 11:38:22 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583926702.04.0.152677574244.issue39930@roundup.psfhosted.org> miss-islington added the comment: New changeset d01c5507e5f9bd5072d94f007d29b37f41c6e6b5 by Miss Islington (bot) in branch '3.8': bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918) https://github.com/python/cpython/commit/d01c5507e5f9bd5072d94f007d29b37f41c6e6b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:47:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:47:10 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583927230.34.0.736212373902.issue39926@roundup.psfhosted.org> STINNER Victor added the comment: Well done. I got 75 emails from buildbots :-D ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:49:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:49:19 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583927359.2.0.179803899277.issue39930@roundup.psfhosted.org> STINNER Victor added the comment: AMD64 Windows10 3.8 build failed with "(...)\pyproject.props(221,5): error : vcruntime14*.dll not found (...)": https://buildbot.python.org/all/#builders/159/builds/190 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:50:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:50:21 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583927421.6.0.545232961571.issue39930@roundup.psfhosted.org> STINNER Victor added the comment: Same error on AMD64 Windows10 3.x: https://buildbot.python.org/all/#builders/129/builds/513 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:52:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:52:10 +0000 Subject: [issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot Message-ID: <1583927530.29.0.751848754039.issue39932@roundup.psfhosted.org> New submission from STINNER Victor : aarch64 RHEL8 Refleaks 3.7: https://buildbot.python.org/all/#/builders/620/builds/20 test_multiprocessing_fork leaked [0, 2, 0] file descriptors, sum=2 0:40:22 load avg: 0.93 Re-running failed tests in verbose mode 0:40:22 load avg: 0.93 Re-running test_multiprocessing_fork in verbose mode test_multiprocessing_fork leaked [2, 0, 0] file descriptors, sum=2 ---------- components: Tests messages: 363909 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:56:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:56:43 +0000 Subject: [issue39933] test_gdb fails on AMD64 FreeBSD Shared 3.x: ptrace: Operation not permitted Message-ID: <1583927803.55.0.643222253401.issue39933@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/152/builds/384 Example: ====================================================================== FAIL: test_pycfunction (test.test_gdb.PyBtTests) [_testcapi.MethClass().meth_fastcall_keywords] Verify that "py-bt" displays invocations of PyCFunction instances ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_gdb.py", line 896, in test_pycfunction self.assertIn(f' _______________________________________ From report at bugs.python.org Wed Mar 11 07:57:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:57:58 +0000 Subject: [issue39933] test_gdb fails on AMD64 FreeBSD Shared 3.x: ptrace: Operation not permitted In-Reply-To: <1583927803.55.0.643222253401.issue39933@roundup.psfhosted.org> Message-ID: <1583927878.68.0.973606309264.issue39933@roundup.psfhosted.org> Change by STINNER Victor : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 07:57:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 11:57:55 +0000 Subject: [issue39933] test_gdb fails on AMD64 FreeBSD Shared 3.x: ptrace: Operation not permitted In-Reply-To: <1583927803.55.0.643222253401.issue39933@roundup.psfhosted.org> Message-ID: <1583927875.08.0.00853216523927.issue39933@roundup.psfhosted.org> STINNER Victor added the comment: Same error on 3.7 and 3.8. AMD64 FreeBSD Shared 3.7: https://buildbot.python.org/all/#/builders/218/builds/91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 08:15:27 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 12:15:27 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583928927.88.0.296612598399.issue39824@roundup.psfhosted.org> Petr Viktorin added the comment: If you use a module subclass that needs some additional C-level infrastructure, it would be more appropriate to override tp_clear/tp_free directly. IMO limiting m_clear/m_free to work just with the module state won't hurt. But it is an API change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:11:16 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:11:16 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583932276.0.0.0263837521851.issue39930@roundup.psfhosted.org> Steve Dower added the comment: New changeset eede148296bf3b4578b92ed6a07f2733a0f1c341 by Steve Dower in branch '3.7': bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918) https://github.com/python/cpython/commit/eede148296bf3b4578b92ed6a07f2733a0f1c341 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:24:52 2020 From: report at bugs.python.org (myzhang1029) Date: Wed, 11 Mar 2020 13:24:52 +0000 Subject: [issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10 Message-ID: <1583933092.46.0.675431384436.issue39934@roundup.psfhosted.org> New submission from myzhang1029 : I apologize for describing this issue badly, but I'll try anyway. The code to demonstrate the issue is attached, so it might be better to read that instead. I noticed that when more than 10 exceptions are raised sequentially (i.e. one from another or one during the handling of another), the interpreter crashes saying "Fatal Python error: XXX block stack overflow". This happens in python 3.7, 3.8 and development(git 39c3493) versions, but not in python2.7. Using ipython also fixes this issue. I know this case is rare, but the maximum number of recursions is more than 2000, and the maximum number of statically nested blocks sepcified in frameobject.c is 20, so I'm pretty sure this isn't intended behavior. ---------- components: Interpreter Core files: exception_nest.py messages: 363914 nosy: myzhang1029 priority: normal severity: normal status: open title: Fatal Python error "XXX block stack overflow" when exception stacks >10 type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file48969/exception_nest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:27:50 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 13:27:50 +0000 Subject: [issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace In-Reply-To: <1582736188.76.0.993881693157.issue39761@roundup.psfhosted.org> Message-ID: <1583933270.25.0.955850993596.issue39761@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 3c97e1e457033bbb8bbe0b7198bd13fc794a12b0 by Petr Viktorin in branch 'master': bpo-39761: Fix dtrace build with empty $DFLAGS (GH-18766) https://github.com/python/cpython/commit/3c97e1e457033bbb8bbe0b7198bd13fc794a12b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:27:50 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 13:27:50 +0000 Subject: [issue38960] DTrace FreeBSD build fix In-Reply-To: <1575439788.6.0.75374191254.issue38960@roundup.psfhosted.org> Message-ID: <1583933270.33.0.230508231603.issue38960@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 3c97e1e457033bbb8bbe0b7198bd13fc794a12b0 by Petr Viktorin in branch 'master': bpo-39761: Fix dtrace build with empty $DFLAGS (GH-18766) https://github.com/python/cpython/commit/3c97e1e457033bbb8bbe0b7198bd13fc794a12b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:33:14 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:33:14 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583933594.98.0.796593572927.issue39930@roundup.psfhosted.org> Steve Dower added the comment: Ah, both of those buildbots are running Build Tools. Apparently there's a different layout for those. Note that the devguide provides instructions that can't be followed with the Build Tools - you need VS Community (at least): https://devguide.python.org/setup/#windows Hopefully by tonight I'll have proper work access so I can figure out why Build Tools don't install everything. It may just be that a configuration option was missed, and so the buildbot owners will have to modify their install. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:36:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 13:36:13 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583933773.7.0.672445115813.issue39930@roundup.psfhosted.org> STINNER Victor added the comment: Other examples of failures. AMD64 Windows8.1 Non-Debug 3.x: https://buildbot.python.org/all/#/builders/9/builds/473 D:\buildarea\3.x.ware-win81-release.nondebug\build\PCbuild\pyproject.props(220,5): error : vcruntime14*.dll not found under C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\ [D:\buildarea\3.x.ware-win81-release.nondebug\build\PCbuild\pythoncore.vcxproj] AMD64 Windows10 3.7: https://buildbot.python.org/all/#/builders/65/builds/114 D:\buildarea\3.7.bolen-windows10\build\PCbuild\pyproject.props(214,5): error : vcruntime14*.dll not found under C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\ [D:\buildarea\3.7.bolen-windows10\build\PCbuild\pythoncore.vcxproj] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:37:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 13:37:40 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583933860.67.0.286455425832.issue39930@roundup.psfhosted.org> STINNER Victor added the comment: It seems like many buildbots are broken. Maybe the "buildbot" label should be tried on PRs changing the Windows build system. x86 Windows7 3.7: https://buildbot.python.org/all/#/builders/53/builds/109 D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\PCbuild\pyproject.props(214,5): error : vcruntime14*.dll not found under D:\Program Files\Microsoft Visual Studio\2017\BuildTools\VC\ [D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\PCbuild\pythoncore.vcxproj] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:45:42 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:45:42 +0000 Subject: [issue39330] Way to build without IDLE In-Reply-To: <1579012886.09.0.695559726455.issue39330@roundup.psfhosted.org> Message-ID: <1583934342.58.0.200717157071.issue39330@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: +steve.dower nosy_count: 4.0 -> 5.0 pull_requests: +18272 pull_request: https://github.com/python/cpython/pull/18921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:46:51 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:46:51 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583934411.2.0.867359519988.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18273 pull_request: https://github.com/python/cpython/pull/18921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:48:07 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:48:07 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583934487.2.0.709409994192.issue39930@roundup.psfhosted.org> Steve Dower added the comment: Added a PR to make the failure silent, up until we're building a release package. That way it'll only bother me, and I can make sure that I have the right VS install. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:52:08 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:52:08 +0000 Subject: [issue39330] Way to build without IDLE In-Reply-To: <1579012886.09.0.695559726455.issue39330@roundup.psfhosted.org> Message-ID: <1583934728.53.0.66077055149.issue39330@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -18272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 09:52:16 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 13:52:16 +0000 Subject: [issue39330] Way to build without IDLE In-Reply-To: <1579012886.09.0.695559726455.issue39330@roundup.psfhosted.org> Message-ID: <1583934736.64.0.943952720918.issue39330@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:12:35 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 14:12:35 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583935955.67.0.424924344678.issue39930@roundup.psfhosted.org> Steve Dower added the comment: New changeset fde44ae6d08d3df79554155b1cf079e73a8fabdd by Steve Dower in branch 'master': bpo-39930: Convert error to warning for more silent failure (GH-18921) https://github.com/python/cpython/commit/fde44ae6d08d3df79554155b1cf079e73a8fabdd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:12:52 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 14:12:52 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583935972.07.0.214560241124.issue39930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18274 pull_request: https://github.com/python/cpython/pull/18922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:13:10 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 14:13:10 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583935990.92.0.453638450251.issue39930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18275 pull_request: https://github.com/python/cpython/pull/18923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:30:32 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 14:30:32 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583937032.49.0.866792789084.issue39930@roundup.psfhosted.org> miss-islington added the comment: New changeset 3136f6f287a56afe87c0fd3e70c15c6e53ae0814 by Miss Islington (bot) in branch '3.7': bpo-39930: Convert error to warning for more silent failure (GH-18921) https://github.com/python/cpython/commit/3136f6f287a56afe87c0fd3e70c15c6e53ae0814 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:31:11 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 14:31:11 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583937071.25.0.757848005688.issue39930@roundup.psfhosted.org> miss-islington added the comment: New changeset 17571c54e03822685656dc7d118a5ddcf8cb58af by Miss Islington (bot) in branch '3.8': bpo-39930: Convert error to warning for more silent failure (GH-18921) https://github.com/python/cpython/commit/17571c54e03822685656dc7d118a5ddcf8cb58af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:37:57 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 14:37:57 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583937477.13.0.739054123678.issue39915@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +18276 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:41:49 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 14:41:49 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583937709.13.0.269433347234.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: > our unittest assuming that b'\xf0' should be true when interpreted as a bool is wrong. > just get rid of that value from the loop in the test? That could be the proper thing to do, but it does make it easy to invoke C undefined behavior from Python code. AFAIK, it would be the only such place in the struct module. So, I'd like to assume and assert/test that sizeof(_Bool) is 1 and the false bit-pattern is (char)0, and with that, just use `PyBool_FromLong((_Bool)*p != 0)`. > maybe we should be raising an error if the bytes are not a valid platform _Bool pattern? That's quite hard to test for. Also, on all current supported platforms, the patterns for bool and char 0 and 1 are the same. I don't see this being different elsewhere, but if there ever is a such a platform, let the test catch the broken assumption. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:42:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 14:42:10 +0000 Subject: [issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot In-Reply-To: <1583927530.29.0.751848754039.issue39932@roundup.psfhosted.org> Message-ID: <1583937729.99.0.55605885749.issue39932@roundup.psfhosted.org> STINNER Victor added the comment: Another example on PPC64LE RHEL8 Refleaks 3.7: https://buildbot.python.org/all/#/builders/431/builds/29 Warning -- Dangling processes: {} Warning -- Dangling processes: {} test_multiprocessing_spawn leaked [0, 2, 0] file descriptors, sum=2 Re-running test_multiprocessing_forkserver in verbose mode test_multiprocessing_forkserver leaked [2, 0, 0] file descriptors, sum=2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:48:37 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Mar 2020 14:48:37 +0000 Subject: [issue2506] Add mechanism to disable optimizations In-Reply-To: <1206797921.05.0.258043023613.issue2506@psf.upfronthosting.co.za> Message-ID: <1583938117.99.0.119505249412.issue2506@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will pick this up from Victor's last patch ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:51:40 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 14:51:40 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583938300.47.0.677688526829.issue39689@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +18277 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 10:59:05 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Wed, 11 Mar 2020 14:59:05 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1583938745.66.0.818660282688.issue39797@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- keywords: +patch pull_requests: +18278 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:05:15 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 15:05:15 +0000 Subject: [issue39689] test_struct failure on s390x Fedora Clang buildbot In-Reply-To: <1583937709.13.0.269433347234.issue39689@roundup.psfhosted.org> Message-ID: <02d8ab2a-a594-48c9-abd3-bfeb24f146a9@www.fastmail.com> Benjamin Peterson added the comment: On Wed, Mar 11, 2020, at 07:41, Petr Viktorin wrote: > > > maybe we should be raising an error if the bytes are not a valid platform _Bool pattern? > > That's quite hard to test for. How so? We just make the same assumption you're making that true = b'\x01' and false = NUL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:06:18 2020 From: report at bugs.python.org (Chris Withers) Date: Wed, 11 Mar 2020 15:06:18 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583939178.53.0.630707227769.issue39915@roundup.psfhosted.org> Chris Withers added the comment: New changeset e553f204bf0e39b1d701a364bc71b286acb9433f by Karthikeyan Singaravelan in branch 'master': bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18924) https://github.com/python/cpython/commit/e553f204bf0e39b1d701a364bc71b286acb9433f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:06:31 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 15:06:31 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1583939191.08.0.802498586724.issue39915@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +18279 pull_request: https://github.com/python/cpython/pull/18927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:11:38 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 15:11:38 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1583939498.34.0.043938372673.issue37207@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 4.0 -> 5.0 pull_requests: +18280 pull_request: https://github.com/python/cpython/pull/18928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:13:00 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 11 Mar 2020 15:13:00 +0000 Subject: [issue39926] unicodedata for Unicode 13.0.0 In-Reply-To: <1583880722.38.0.0788382119247.issue39926@roundup.psfhosted.org> Message-ID: <1583939580.72.0.0681065328064.issue39926@roundup.psfhosted.org> Benjamin Peterson added the comment: If it makes you feel better, I got them, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:25:06 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Mar 2020 15:25:06 +0000 Subject: [issue39931] Global variables are not accessible from child processes (multiprocessing.Pool) In-Reply-To: <1583918452.53.0.6597480705.issue39931@roundup.psfhosted.org> Message-ID: <1583940306.58.0.677105696153.issue39931@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:52:09 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 15:52:09 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583941929.43.0.813677121929.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: The memoryview module does the same thing as struct, and its tests expect the same behavior as with struct. So, whatever we do in struct should be also done in memoryview. ---------- title: test_struct failure on s390x Fedora Clang buildbot -> struct and memoryview tests rely on undefined behavior (as revealed by clang 9) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 11:59:12 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 15:59:12 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583942352.14.0.188116020469.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: > > > maybe we should be raising an error if the bytes are not a valid platform _Bool pattern? > > > > That's quite hard to test for. > > How so? We just make the same assumption you're making that true = b'\x01' and false = NUL. Right, with that assumption, it's not that hard. And it becomes a test-only assumption, which is great! But, I'm still not convinced this would be a good fix. The current struct documentation is consistent with *casting* char to _Bool, rather than doing the memcpy and reinterpreting as _Bool. The memcpy makes sense for larget types, but not so much for _Bool. (Certainly, the docs' assertion that "the conversion between C and Python values should be obvious given their types" is not true here...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:08:09 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Wed, 11 Mar 2020 16:08:09 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1583942889.19.0.887022610322.issue39797@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- pull_requests: +18281 pull_request: https://github.com/python/cpython/pull/18929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:24:06 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Wed, 11 Mar 2020 16:24:06 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1583943846.52.0.917774678519.issue39797@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- pull_requests: +18282 pull_request: https://github.com/python/cpython/pull/18930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:25:58 2020 From: report at bugs.python.org (Nazime Koussaila Lakehal) Date: Wed, 11 Mar 2020 16:25:58 +0000 Subject: [issue39935] argparse: help parameter not documented in add_subparsers().add_parser Message-ID: <1583943958.07.0.538829278301.issue39935@roundup.psfhosted.org> New submission from Nazime Koussaila Lakehal : The parameter help in the method add_parser of _SubParsersAction (that we obtain with ArgumentParser.add_subparsers()) Is not documented. In the documentation we can find: The add_subparsers() method is normally called with no arguments and returns a special action object. This object has a single method, add_parser(), which takes a command name and any ArgumentParser constructor arguments, and returns an ArgumentParser object that can be modified as usual. I found the parameter by accident and then I checked in the source code, it's unfortunate because the help parameter give really nice output when having sub commands. the parameter 'aliases' is also not documented. ---------- assignee: docs at python components: Documentation messages: 363932 nosy: Nazime Koussaila Lakehal, docs at python priority: normal severity: normal status: open title: argparse: help parameter not documented in add_subparsers().add_parser type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:27:33 2020 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 11 Mar 2020 16:27:33 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583944053.91.0.806008335284.issue36144@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +18283 pull_request: https://github.com/python/cpython/pull/18931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:29:04 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 16:29:04 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583944144.48.0.859375520849.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: Oh! I just reead the docs more carefully; they say: For the '?' format character, the return value is either True or False. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be True when unpacking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:32:19 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 16:32:19 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583944339.01.0.537728818969.issue39652@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +berker.peksag, ghaering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:34:22 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Wed, 11 Mar 2020 16:34:22 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1583944462.01.0.958216776532.issue39797@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- pull_requests: +18284 pull_request: https://github.com/python/cpython/pull/18932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:40:12 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Wed, 11 Mar 2020 16:40:12 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1583944812.09.0.176187137846.issue39797@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- pull_requests: +18285 pull_request: https://github.com/python/cpython/pull/18933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:40:12 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 11 Mar 2020 16:40:12 +0000 Subject: [issue38076] Make struct module PEP-384 compatible In-Reply-To: <1568046908.42.0.641730550956.issue38076@roundup.psfhosted.org> Message-ID: <1583944812.82.0.318315432616.issue38076@roundup.psfhosted.org> Change by Petr Viktorin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:41:32 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 16:41:32 +0000 Subject: [issue39935] argparse: help parameter not documented in add_subparsers().add_parser In-Reply-To: <1583943958.07.0.538829278301.issue39935@roundup.psfhosted.org> Message-ID: <1583944892.08.0.455523250144.issue39935@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +paul.j3, rhettinger versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:42:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 16:42:07 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583944927.44.0.337613544509.issue39916@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 704e2065f8b8021a4a6999470fb6ed3453f7679e by Serhiy Storchaka in branch 'master': bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880) https://github.com/python/cpython/commit/704e2065f8b8021a4a6999470fb6ed3453f7679e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:42:24 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 16:42:24 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583944944.61.0.38229045421.issue39916@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +18286 pull_request: https://github.com/python/cpython/pull/18934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:42:31 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 16:42:31 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583944951.91.0.104795480951.issue39916@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18287 pull_request: https://github.com/python/cpython/pull/18935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:46:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:46:10 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1583945170.03.0.683087704877.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a158168a787e82c4b7b18f6833153188e93627a5 by Hai Shi in branch 'master': bpo-1635741: Port _locale extension module to multiphase initialization (PEP 489) (GH-18358) https://github.com/python/cpython/commit/a158168a787e82c4b7b18f6833153188e93627a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:49:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:49:15 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1583945355.45.0.958405254269.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 41fbf865a35d4fb64f047f98dc24690cb0c170fd by Hai Shi in branch 'master': bpo-1635741: Port audioop extension module to multiphase initialization (PEP 489) (GH-18608) https://github.com/python/cpython/commit/41fbf865a35d4fb64f047f98dc24690cb0c170fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:50:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:50:59 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1583945459.02.0.607222807496.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset aa0c0808efbfdee813d2829e49030c667da44e72 by Hai Shi in branch 'master': bpo-1635741: Fix potential refleaks in binascii module (GH-18613) https://github.com/python/cpython/commit/aa0c0808efbfdee813d2829e49030c667da44e72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:51:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:51:39 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583945499.03.0.494091694319.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: > Proposed PR checking if the module state is NULL: > > * PR 18358: _locale module > * PR 18608: audioop module > * PR 18613: binascii Petr suggested to not hold these PRs with this controversial issue. I agree, so I merged these 3 PRs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:52:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:52:45 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1583945565.16.0.682466160116.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: Stefan Behnel: as the 3rd author of the PEP 489, what's your call on this issue? ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:53:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:53:30 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1583945610.39.0.0959575233304.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Hai Shi for your 3 latest PRs, I merged them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 12:56:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 16:56:21 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1583945781.02.0.0349244447259.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 196f1eb6adcfc6a7239330ef508b8bf9dff9940f by Hai Shi in branch 'master': bpo-1635741: Fix refleaks of time module error handling (GH-18486) https://github.com/python/cpython/commit/196f1eb6adcfc6a7239330ef508b8bf9dff9940f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:00:16 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 17:00:16 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583946016.51.0.883291080602.issue39916@roundup.psfhosted.org> miss-islington added the comment: New changeset b1b1d5ff11108620f5bc97976bb889f5cbb24373 by Miss Islington (bot) in branch '3.7': bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880) https://github.com/python/cpython/commit/b1b1d5ff11108620f5bc97976bb889f5cbb24373 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:02:34 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 17:02:34 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583946154.96.0.69254322464.issue39763@roundup.psfhosted.org> Michael Felt added the comment: This was already confirmed by both bots... The last bot build that worked (and for both AIX bots) is: dffe4c07095e0c693e094d3c140e85a68bd8128e The first build that failed (for both) is: 1ec63b62035e73111e204a0e03b83503e1c58f2e See (pass) https://buildbot.python.org/all/#/builders/119/builds/383 and https://buildbot.python.org/all/#/builders/227/builds/369; fail https://buildbot.python.org/all/#/builders/119/builds/384 and https://buildbot.python.org/all/#/builders/227/builds/370 I'll checkout dffe4c07095e0c693e094d3c140e85a68bd8128e to verify it still works successfully. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:07:11 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 17:07:11 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583946431.65.0.835238995221.issue39916@roundup.psfhosted.org> miss-islington added the comment: New changeset c22879914b03ff2da768e557b5c00e9c8c62c695 by Miss Islington (bot) in branch '3.8': bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880) https://github.com/python/cpython/commit/c22879914b03ff2da768e557b5c00e9c8c62c695 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:07:50 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 17:07:50 +0000 Subject: [issue39916] More reliable use of scandir in Path.glob() In-Reply-To: <1583772873.51.0.392726685418.issue39916@roundup.psfhosted.org> Message-ID: <1583946470.38.0.622626542273.issue39916@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 Mar 11 13:32:38 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 17:32:38 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583947958.19.0.852114400282.issue39763@roundup.psfhosted.org> Michael Felt added the comment: After a checkout the build finishes (successfully) with: Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm _lzma _sqlite3 _tkinter _uuid readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time running build_scripts creating build/scripts-3.9 copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/pydoc3 -> build/scripts-3.9 copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/idle3 -> build/scripts-3.9 copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/2to3 -> build/scripts-3.9 changing mode of build/scripts-3.9/pydoc3 from 644 to 755 changing mode of build/scripts-3.9/idle3 from 644 to 755 changing mode of build/scripts-3.9/2to3 from 644 to 755 renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9 renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9 renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9 /opt/bin/install -c -m 644 ../git/python3-3.9/Tools/gdb/libpython.py python-gdb.py xlc_r -c -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I../git/python3-3.9/Include/internal -IObjects -IInclude -IPython -I. -I../git/python3-3.9/Include -I/opt/include -I/op t/include -DPy_BUILD_CORE -o Programs/_testembed.o ../git/python3-3.9/Programs/_testembed.c ../git/python3-3.9/Modules/makexp_aix Modules/python.exp . libpython3.9.a; xlc_r /opt/lib/libintl.a -L/opt/lib -liconv -lexpat /opt/lib/libintl.a -L/opt/lib -liconv -lexpat -Wl,-bE:Modules/python.exp -lld -o Programs/_testembed Programs/_testembed.o libpython3.9.a -lintl -ldl -lm -lm sed -e "s, at EXENAME@,/opt/bin/python3.9," < ../git/python3-3.9/Misc/python-config.in >python-config.py LC_ALL=C sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh >python-config root at x065:[/data/prj/python/python3-3.9]./python Python 3.9.0a4+ (tags/v3.9.0a4-59-gdffe4c0709-dirty:dffe4c0709, Mar 11 2020, 17:09:06) [C] on aix Type "help", "copyright", "credits" or "license" for more information. >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:42:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 17:42:14 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX Message-ID: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> New submission from STINNER Victor : The commit 1ec63b62035e73111e204a0e03b83503e1c58f2e of bpo-39763 broke the Python compilation on AIX: https://bugs.python.org/issue39763#msg363749 -- The last successful build was before the commit 1ec63b62035e73111e204a0e03b83503e1c58f2e: https://buildbot.python.org/all/#/builders/119/builds/383 _socket compilation: (...) -o build/lib.aix-7100-9898-32-3.9-pydebug/_socket.so pythoninfo: sys.path: [ '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/target/lib/python39.zip', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/build/lib.aix-7100-9898-32-3.9-pydebug', '/home/buildbot/.local/lib/python3.9/site-packages'] Both steps use "build/lib.aix-7100-9898-32-3.9-pydebug/" directory. -- Recent failure: https://buildbot.python.org/all/#/builders/119/builds/451 _socket compilation: (...) -o build/lib.aix-7104-1806-32-3.9-pydebug/_socket.so pythoninfo: sys.path: [ '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/target/lib/python39.zip', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib', '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/build/lib.aix-7100-9898-32-3.9-pydebug', '/home/buildbot/.local/lib/python3.9/site-packages'] So the compilation uses "build/lib.aix-7104-1806-32-3.9-pydebug/" directory, whereas pythoninfo uses "build/lib.aix-7100-9898-32-3.9-pydebug/" directory. It can explain why setup.py fails to import _socket later: it was built in a different directory. -- I see that _aix_support._aix_bosmp64() has two code paths depending on the subprocess module can be imported: # subprocess is not necessarily available early in the build process # if not available, the config_vars are also definitely not available # supply substitutes to bootstrap the build try: import subprocess _have_subprocess = True _tmp_bd = get_config_var("AIX_BUILDDATE") _bgt = get_config_var("BUILD_GNU_TYPE") except ImportError: # pragma: no cover _have_subprocess = False _tmp_bd = None _bgt = "powerpc-ibm-aix6.1.7.0" def _aix_bosmp64(): # type: () -> Tuple[str, int] """ Return a Tuple[str, int] e.g., ['7.1.4.34', 1806] The fileset bos.mp64 is the AIX kernel. It's VRMF and builddate reflect the current ABI levels of the runtime environment. """ if _have_subprocess: # We expect all AIX systems to have lslpp installed in this location out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.mp64"]) out = out.decode("utf-8").strip().split(":") # type: ignore # Use str() and int() to help mypy see types return str(out[2]), int(out[-1]) else: from os import uname osname, host, release, version, machine = uname() return "{}.{}.0.0".format(version, release), _MISSING_BD -- _aix_support._aix_bosmp64() is called by _aix_support.aix_platform() which is called by get_host_platform() of distutils.util. Currently, setup.py does: * Inject _bootsubprocess into sys.modules['subprocess'] so "import subprocess" works * Build all C extensions * Remove sys.modules['subprocess'], so the next "import subprocess" may or may not load Lib/subprocess.py which uses the newly built C extensions like _posixsubprocess and select * Attempt to load C extensions: if an import fails, rename the file: it happens for _asyncio on AIX, that's the bug ---------- components: Build messages: 363946 nosy: vstinner priority: normal severity: normal status: open title: Python fails to build _asyncio on module on AIX versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:42:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 17:42:34 +0000 Subject: [issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX) In-Reply-To: <1582744715.59.0.836949225961.issue39763@roundup.psfhosted.org> Message-ID: <1583948554.8.0.62771839632.issue39763@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-39936 "Python fails to build _asyncio on module on AIX" to debug the AIX build failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:42:50 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 11 Mar 2020 17:42:50 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1583948570.68.0.755562496886.issue37207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 5.0 -> 6.0 pull_requests: +18288 pull_request: https://github.com/python/cpython/pull/18936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:50:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 17:50:17 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583949017.47.0.112345787602.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: AIX_BUILDDATE variable is written in pyconfig.h by configure: > https://buildbot.python.org/all/#/builders/119/builds/383 configure: "checking for the system builddate... 1806" > https://buildbot.python.org/all/#/builders/119/builds/451 configure: "checking for the system builddate... 1806" So AIX_BUILDDATE seems to be set in both case. But on build 451, the "build/lib.aix-7100-9898-32-3.9-pydebug" directory name contains 9898: this number comes from _aix_support._MISSING_BD. It's used when _have_subprocess is false or when get_config_var("AIX_BUILDDATE") cannot be converted into an integer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:51:20 2020 From: report at bugs.python.org (Rahul Kumaresan) Date: Wed, 11 Mar 2020 17:51:20 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1583949080.83.0.839029378748.issue36543@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- nosy: +rahul-kumi nosy_count: 3.0 -> 4.0 pull_requests: +18289 pull_request: https://github.com/python/cpython/pull/18937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:51:38 2020 From: report at bugs.python.org (Rahul Kumaresan) Date: Wed, 11 Mar 2020 17:51:38 +0000 Subject: [issue39937] Suggest the usage of Element.iter() instead of iter() in whatsnew Message-ID: <1583949098.86.0.806272470528.issue39937@roundup.psfhosted.org> New submission from Rahul Kumaresan : In the whatsnew section, under the point which mentions the deprecation of getchildren() and getiterator() through bpo-36543, it is suggested to use iter() instead. Ideally there should be a suggestion to use Element.iter() instead. ---------- assignee: docs at python components: Documentation messages: 363949 nosy: docs at python, rahul-kumi, xtreak priority: normal pull_requests: 18290 severity: normal status: open title: Suggest the usage of Element.iter() instead of iter() in whatsnew versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:55:40 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 17:55:40 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583949340.32.0.836651619011.issue39936@roundup.psfhosted.org> Michael Felt added the comment: While looking through the history of bot builds - I consistently see 420 tests being done on one bot - but test_socket does not always show up in the list. I'll look at this as I can, but "free-time" is limited. Delay is not a lack of interest. ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 13:56:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 17:56:57 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583949417.87.0.142554270263.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: Michael.Felt: Can you please try to build the master branch of Python with the attached setup-aix.patch applied? Something like: git checkout master git apply setup-aix.patch ./configure CFLAGS="-O0" make 2>&1|tee make.log Then attach make.log. ---------- keywords: +patch Added file: https://bugs.python.org/file48970/setup-aix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:00:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 18:00:32 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583949632.83.0.475360814828.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: Another approach to patch _aix_support.py, replace: try: import subprocess _have_subprocess = True _tmp_bd = _bgt = get_config_var("BUILD_GNU_TYPE") except ImportError: # pragma: no cover _have_subprocess = False _tmp_bd = None _bgt = "powerpc-ibm-aix6.1.7.0" with: try: import subprocess _have_subprocess = True _tmp_bd = get_config_var("AIX_BUILDDATE") _bgt = get_config_var("BUILD_GNU_TYPE") except ImportError: # pragma: no cover import _bootsubprocess as subprocess _have_subprocess = True _tmp_bd = None _bgt = "powerpc-ibm-aix6.1.7.0" Use _bootsubprocess when subprocess is not available. If this approach works, _have_subprocess=False code path can be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:04:08 2020 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 11 Mar 2020 18:04:08 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1583949848.91.0.781274219727.issue36144@roundup.psfhosted.org> Brandt Bucher added the comment: Yes, I can add a section explaining that after the PEP was accepted, we decided to add the operators to several non-dict mappings as well. I'm also going to add some explanation as to why Mapping/MutableMapping didn't grow them, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:41:28 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 11 Mar 2020 18:41:28 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583952088.73.0.893337640842.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: Concerning memoryview, I've looked at this very briefly: memoryview does not pack values directly, it casts first, which is legal: #define PACK_SINGLE(ptr, src, type) \ do { \ type x; \ x = (type)src; \ memcpy(ptr, (char *)&x, sizeof x); \ } while (0) This macro has exposed compiler bugs before. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:43:11 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 11 Mar 2020 18:43:11 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583952191.51.0.618041963737.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: So which memoryview test (unless it is using the struct module) relies on UB? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:53:44 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 11 Mar 2020 18:53:44 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583952824.68.0.232094368062.issue35712@roundup.psfhosted.org> Ethan Furman added the comment: I know I'm late to the party, but if bool(NotImplemented) returned `NotImplemented` wouldn't that solve the problem? def __ge__(self, other): return not self.__lt__(other) then if __lt__ returns then __gt__ returns NotImplemented NotImplemented True False False True Correct code (which checks for NotImplemented) would still work, and buggy code (which just returns the bool() of NotImplemented), would then be correct. ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:54:14 2020 From: report at bugs.python.org (Eric Govatos) Date: Wed, 11 Mar 2020 18:54:14 +0000 Subject: [issue39938] RotatingFileHandler does not support any other mode than 'a'. Message-ID: <1583952854.31.0.172490606353.issue39938@roundup.psfhosted.org> New submission from Eric Govatos : The RotatingFileHandler class located within lib/logging/handlers.py does not accept any other 'mode' value than its default value of 'a' - even when the parameter is supplied, such as 'ab', to append bytes, this is disregarded and the mode is set back to 'a' if the maxBytes variable is greater than 0. While the reasoning behind this does make sense as the rotating file handler should only be appending data to files, this means that supplying a mode to append bytes is not supported. You can currently get around this by supplying the mode after constructing the handler. Proposed solution would be to remove lines 146 and 147 from the class entirely and let the user decide on the file mode themselves. ---------- components: Library (Lib) messages: 363957 nosy: elgovatos priority: normal severity: normal status: open title: RotatingFileHandler does not support any other mode than 'a'. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:56:07 2020 From: report at bugs.python.org (Eric Govatos) Date: Wed, 11 Mar 2020 18:56:07 +0000 Subject: [issue39938] RotatingFileHandler does not support any mode other than 'a'. In-Reply-To: <1583952854.31.0.172490606353.issue39938@roundup.psfhosted.org> Message-ID: <1583952967.13.0.464070430709.issue39938@roundup.psfhosted.org> Change by Eric Govatos : ---------- title: RotatingFileHandler does not support any other mode than 'a'. -> RotatingFileHandler does not support any mode other than 'a'. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 14:57:28 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 18:57:28 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583953048.87.0.60756739755.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18291 pull_request: https://github.com/python/cpython/pull/18938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:07:06 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 11 Mar 2020 19:07:06 +0000 Subject: [issue39938] RotatingFileHandler does not support any mode other than 'a'. In-Reply-To: <1583952854.31.0.172490606353.issue39938@roundup.psfhosted.org> Message-ID: <1583953626.12.0.149804650401.issue39938@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:07:12 2020 From: report at bugs.python.org (Rahul Kumaresan) Date: Wed, 11 Mar 2020 19:07:12 +0000 Subject: [issue39935] argparse: help parameter not documented in add_subparsers().add_parser In-Reply-To: <1583943958.07.0.538829278301.issue39935@roundup.psfhosted.org> Message-ID: <1583953632.79.0.553856355601.issue39935@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- nosy: +rahul-kumi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:08:43 2020 From: report at bugs.python.org (Rahul Kumaresan) Date: Wed, 11 Mar 2020 19:08:43 +0000 Subject: [issue20039] Missing documentation for argparse.ArgumentTypeError In-Reply-To: <1387622425.21.0.562750433804.issue20039@psf.upfronthosting.co.za> Message-ID: <1583953723.37.0.365844641758.issue20039@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- nosy: +rahul-kumi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:11:38 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 11 Mar 2020 19:11:38 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes Message-ID: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> New submission from Dennis Sweeney : Following discussion here ( https://mail.python.org/archives/list/python-ideas at python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/ ), there is a proposal to add new methods str.cutprefix and str.cutsuffix to alleviate the common misuse of str.lstrip and str.rstrip. I think sticking with the most basic possible behavior def cutprefix(self: str, prefix: str) -> str: if self.startswith(prefix): return self[len(prefix):] # return a copy to work for bytearrays return self[:] def cutsuffix(self: str, suffix: str) -> str: if self.startswith(suffix): # handles the "[:-0]" issue return self[:len(self)-len(suffix)] return self[:] would be best (refusing to guess in the face of ambiguous multiple arguments). Someone can do, e.g. >>> 'foo.tar.gz'.cutsuffix('.gz').cutsuffix('.tar') 'foo' to cut off multiple suffixes. More complicated behavior for multiple arguments could be added later, but it would be easy to make a mistake in prematurely generalizing right now. In bikeshedding method names, I think that avoiding the word "strip" would be nice so users can have a consistent feeling that "'strip' means character sets; 'cut' means substrings". ---------- components: Interpreter Core messages: 363958 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add str methods to remove prefixes or suffixes type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:15:51 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 11 Mar 2020 19:15:51 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1583954151.83.0.547724879144.issue39939@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +18292 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:16:23 2020 From: report at bugs.python.org (Berker Peksag) Date: Wed, 11 Mar 2020 19:16:23 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583954183.45.0.597398738276.issue39652@roundup.psfhosted.org> Berker Peksag added the comment: https://github.com/ghaering/pysqlite/commit/f3d452f2daeb432b8ad89fa4f087164bfd6ddc12 should probably give more context than that huge svnmerge commit :) (Removed older Python versions since even if decide to change the behavior from 2006, it may break third-party programs that are relying on it.) ---------- versions: -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:34:39 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 11 Mar 2020 19:34:39 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1583955279.09.0.549182640789.issue39939@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:42:17 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 11 Mar 2020 19:42:17 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583955737.02.0.170249387998.issue39936@roundup.psfhosted.org> Batuhan Taskaya added the comment: I tried your patch on AIX 7.2, looks like you need to shift sys import to the top Traceback (most recent call last): File "/home/isidentical/cpython/./setup.py", line 16, in sys.modules['subprocess'] = _bootsubprocess NameError: name 'sys' is not defined make: The error code from the last command is 1. Stop. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:50:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 19:50:30 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583956230.81.0.519706569341.issue35712@roundup.psfhosted.org> Serhiy Storchaka added the comment: No. First, it is impossible. nb_bool and PyObject_IsTrue() can return only three value: 1 for true, 0 for false, and -1 for error. It is not possible to represent NotImplemented without breaking all extensions. Currently if not a: b() else: c() is equivalent to if a: c() else: b() If a is NotImplemented, what branch be executed in every case? Second, it would not help. Because real-world examples are not always so trivial as "return not self.__lt__(other)". It may be a part of more complex expression, e.g.: return super().__eq__(other) and self.attr == other.attr So it may help in some examples, but make bugs in other examples even more mystical. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:59:37 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 19:59:37 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583956777.1.0.0949601186736.issue39520@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18293 pull_request: https://github.com/python/cpython/pull/18940 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 15:59:43 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 19:59:43 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583956783.48.0.0789545945279.issue39520@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18294 pull_request: https://github.com/python/cpython/pull/18941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:16:42 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 20:16:42 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583957802.91.0.51344473041.issue39520@roundup.psfhosted.org> miss-islington added the comment: New changeset d0837d2af2c23c3a4b6274f76ca6422a427cc438 by Miss Islington (bot) in branch '3.7': bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304) https://github.com/python/cpython/commit/d0837d2af2c23c3a4b6274f76ca6422a427cc438 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:18:04 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 20:18:04 +0000 Subject: [issue39520] AST Unparser can't unparse ext slices correctly In-Reply-To: <1580591407.68.0.673076668701.issue39520@roundup.psfhosted.org> Message-ID: <1583957884.5.0.0190525474133.issue39520@roundup.psfhosted.org> miss-islington added the comment: New changeset cd07b4da659cb5e86fe7c856aca866b9db466fce by Miss Islington (bot) in branch '3.8': bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304) https://github.com/python/cpython/commit/cd07b4da659cb5e86fe7c856aca866b9db466fce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:24:42 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 20:24:42 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583958282.36.0.95437038922.issue39652@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was originally introduced in https://github.com/ghaering/pysqlite/commit/780a76dcd8f4142b6ecbd423f52e0ccf067fc277. I think that original column names should be returned when PARSE_COLNAMES is not set. Working on a PR. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:29:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 20:29:05 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583958545.72.0.655002352203.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: Yeah, sys must be imported first. Did you try to fix the patch? Does it work? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:29:42 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 11 Mar 2020 20:29:42 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583958582.71.0.447947188827.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: Okay, in memoryview the cast tests can trigger UB checks. memoryview assumes that bool is packed correctly, so just casting does not work. Casting anything to bool is of course a bit silly anyway. diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py index 6178ffde7a..86cf4c309f 100644 --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -2758,6 +2758,8 @@ class TestBufferProtocol(unittest.TestCase): tsize = struct.calcsize(tfmt) n = prod(_tshape) * tsize obj = 'memoryview' if is_byte_format(tfmt) else 'bytefmt' + if "?" in tfmt: + continue for fmt, items, _ in iter_format(n, obj): size = struct.calcsize(fmt) shape = [n] if n > 0 else [] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:36:01 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 20:36:01 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583958961.07.0.603048595789.issue39936@roundup.psfhosted.org> Michael Felt added the comment: I'll take a look at what you are suggesting. The starting point (before the rm command) is the make command that I run again. What I notice - read am thinking - is that _socket.so is being created by the "setup.py build" - so, if you can help me make that bit more verbose, I'll work on that too. +++ Script command is started on Wed Mar 11 15:29:44 CDT 2020. $ $ $ $ rm ./build/lib.aix-7200-1543-32-3.9/_socket.so ./build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o $ $ $ make V=1 CC='gcc -pthread' LDSHARED='Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build running build running build_ext ldd: /lib/libreadline.a: File is an archive. building '_asyncio' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I. -I/home/aixtools/python/cpython-master/Include -I/home/aixtools/python/cpython-master -c /home/aixtools/python/cpython-master/Modules/_asynciomodule.c -o build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/_asynciomodule.o Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/_asynciomodule.o -o build/lib.aix-7200-1543-32-3.9/_asyncio.so building '_socket' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I. -I/home/aixtools/python/cpython-master/Include -I/home/aixtools/python/cpython-master -c /home/aixtools/python/cpython-master/Modules/socketmodule.c -o build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o -o build/lib.aix-7200-1543-32-3.9/_socket.so *** WARNING: renaming "_asyncio" since importing it failed: No module named '_socket' The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Following modules built successfully but were removed because they could not be imported: _asyncio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:43:35 2020 From: report at bugs.python.org (Raul Gallegos) Date: Wed, 11 Mar 2020 20:43:35 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583959415.03.0.153665295241.issue39652@roundup.psfhosted.org> Raul Gallegos added the comment: hi @serhiy.storchaka is this something that you think could be done by a new contributor? I'd really love to take care of this, I can improve on the PR I was preparing https://github.com/python/cpython/pull/18533 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 16:49:03 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 11 Mar 2020 20:49:03 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583959743.33.0.0233307253173.issue35712@roundup.psfhosted.org> Ethan Furman added the comment: Serhiy: ------ > First, it is impossible. nb_bool and PyObject_IsTrue() can return > only three value: 1 for true, 0 for false, and -1 for error. Huh. How is -1 interpreted? Does it become a TypeError? > It is not possible to represent NotImplemented without breaking all > extensions. > > Currently > > if not a: > b() > else: > c() > > is equivalent to > > if a: > c() > else: > b() > > If a is NotImplemented, what branch be executed in every case? Side-stepping to other __dunder__ methods for a moment: if, for example, both __add__ and __radd__ return NotImplemented then the interpreter will convert that into a TypeError. So my thinking is that when the interpreter gets the `NotImplemented` returned by either `if a` or by `if not a` that it would be converted to a `TypeError`, meaning none of the branches would be executed as an exception would be raised instead. > Second, it would not help. Because real-world examples are not always so > trivial as "return not self.__lt__(other)". It may be a part of more > complex expression, e.g.: > > return super().__eq__(other) and self.attr == other.attr I don't see the problem -- breaking it down: return super().__eq__(other) and self.attr == other.attr becomes return NotImplemented and ... and the `and` machinery sees it has a `NotImplemented` and raises a `TypeError`. The same would be true if the `__eq__` operation returned `NotImplemented`. So to make that work, `and` and `or` would have to check if one of the operands is `NotImplemented`. Are there others that would need to have that check? The reason I would prefer this solution is that if it could behave as I described above, the `TypeError` would point at the user's line of code as being the problem, and not inside the __dunder__: class NoAdd: # def __add__(self, other): return NotImplemented # def __radd__(self, other): # fake a NotImplemented TypeError from bool(NotImplemented) raise TypeError("cannot boolean NotImplemented") # what we should see, since the error is in the users' code --> NoAdd() + 7 Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for +: 'NoAdd' and 'int' # what we will see -- a leaky implementation detail --> 7 + NoAdd() Traceback (most recent call last): File "", line 1, in File "", line 6, in __radd__ TypeError: cannot boolean NotImplemented ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:03:28 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 21:03:28 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583960608.92.0.403442660636.issue39936@roundup.psfhosted.org> Michael Felt added the comment: So, with the patch - the process stops at: aixtools at x064:[/home/aixtools/python-3.9]make CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp ' OPT='-DNDEBUG -O' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build Traceback (most recent call last): File "/home/aixtools/python-3.9/Lib/subprocess.py", line 72, in import msvcrt ModuleNotFoundError: No module named 'msvcrt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/aixtools/python-3.9/./setup.py", line 4, in import subprocess File "/home/aixtools/python-3.9/Lib/subprocess.py", line 77, in import _posixsubprocess ModuleNotFoundError: No module named '_posixsubprocess' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/aixtools/python-3.9/./setup.py", line 16, in sys.modules['subprocess'] = _bootsubprocess NameError: name 'sys' is not defined make: 1254-004 The error code from the last command is 1. Stop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:11:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 21:11:47 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583961107.44.0.0397219587942.issue39652@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18295 pull_request: https://github.com/python/cpython/pull/18942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:15:13 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 21:15:13 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583961313.78.0.815720630889.issue39936@roundup.psfhosted.org> Michael Felt added the comment: So, this is what I have on screen. Will add the log in a moment. [1] + Done make 2>&1|tee make.log & aixtools at x064:[/home/aixtools/python-3.9]find . | grep socket ./Doc/howto/sockets.rst ./Doc/library/socket.rst ./Doc/library/socketserver.rst ./Lib/__pycache__/socket.cpython-39.opt-1.pyc ./Lib/__pycache__/socket.cpython-39.opt-2.pyc ./Lib/__pycache__/socket.cpython-39.opt-4.pyc ./Lib/__pycache__/socket.cpython-39.pyc ./Lib/__pycache__/socketserver.cpython-39.pyc ./Lib/socket.py ./Lib/socketserver.py ./Lib/test/__pycache__/mock_socket.cpython-39.pyc ./Lib/test/__pycache__/test_socket.cpython-39.pyc ./Lib/test/__pycache__/test_socketserver.cpython-39.pyc ./Lib/test/mock_socket.py ./Lib/test/test_socket.py ./Lib/test/test_socketserver.py ./Modules/socketmodule.c ./Modules/socketmodule.h ./PCbuild/_socket.vcxproj ./PCbuild/_socket.vcxproj.filters ./build/lib.aix-7104-1806-32-3.9/_socket.so ./build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o aixtools at x064:[/home/aixtools/python-3.9]rm ./build/lib.aix-7104-1806-32-3.9/_socket.so ./build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o aixtools at x064:[/home/aixtools/python-3.9]make V=1 CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp ' OPT='-DNDEBUG -O' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers building '_asyncio' extension xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. -I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c /home/aixtools/python-3.9/Modules/_asynciomodule.c -o build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o -o build/lib.aix-7104-1806-32-3.9/_asyncio.so building '_socket' extension xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. -I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c /home/aixtools/python-3.9/Modules/socketmodule.c -o build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o 1500-030: (I) INFORMATION: PyInit__socket: Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192. Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o -o build/lib.aix-7104-1806-32-3.9/_socket.so *** WARNING: renaming "_asyncio" since importing it failed: No module named '_socket' Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm _lzma _sqlite3 _tkinter readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Following modules built successfully but were removed because they could not be imported: _asyncio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:17:03 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 21:17:03 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583961423.76.0.147622504949.issue39936@roundup.psfhosted.org> Change by Michael Felt : Added file: https://bugs.python.org/file48971/make.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:30:43 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 21:30:43 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583962243.19.0.000874134283373.issue39936@roundup.psfhosted.org> Michael Felt added the comment: OK. I removed the _aix_support.py from the formula. After make see the new (rather) old build paths for "socket" aixtools at x064:[/home/aixtools/python-3.9]find . | grep socket ./Doc/howto/sockets.rst ./Doc/library/socket.rst ./Doc/library/socketserver.rst ./Lib/__pycache__/socket.cpython-39.opt-1.pyc ./Lib/__pycache__/socket.cpython-39.opt-2.pyc ./Lib/__pycache__/socket.cpython-39.opt-4.pyc ./Lib/__pycache__/socket.cpython-39.pyc ./Lib/__pycache__/socketserver.cpython-39.pyc ./Lib/socket.py ./Lib/socketserver.py ./Lib/test/__pycache__/mock_socket.cpython-39.pyc ./Lib/test/__pycache__/test_socket.cpython-39.pyc ./Lib/test/__pycache__/test_socketserver.cpython-39.pyc ./Lib/test/mock_socket.py ./Lib/test/test_socket.py ./Lib/test/test_socketserver.py ./Modules/socketmodule.c ./Modules/socketmodule.h ./PCbuild/_socket.vcxproj ./PCbuild/_socket.vcxproj.filters ./build/lib.aix-7.1-3.9/_socket.so ./build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o I remove these two files again and run make: aixtools at x064:[/home/aixtools/python-3.9]make CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp ' OPT='-DNDEBUG -O' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers building '_asyncio' extension xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. -I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c /home/aixtools/python-3.9/Modules/_asynciomodule.c -o build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o -o build/lib.aix-7.1-3.9/_asyncio.so building '_socket' extension xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. -I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c /home/aixtools/python-3.9/Modules/socketmodule.c -o build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o 1500-030: (I) INFORMATION: PyInit__socket: Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192. Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o -o build/lib.aix-7.1-3.9/_socket.so *** WARNING: renaming "_asyncio" since importing it failed: No module named '_socket' Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm _lzma _sqlite3 _tkinter readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Following modules built successfully but were removed because they could not be imported: _asyncio The diff! diff --git a/Lib/_aix_support.py b/Lib/_aix_support.py index 2c5cd3297d..c7f4491633 100644 --- a/Lib/_aix_support.py +++ b/Lib/_aix_support.py @@ -12,7 +12,8 @@ try: _tmp_bd = get_config_var("AIX_BUILDDATE") _bgt = get_config_var("BUILD_GNU_TYPE") except ImportError: # pragma: no cover - _have_subprocess = False + import _bootsubprocess as subprocess + _have_subprocess = True _tmp_bd = None _bgt = "powerpc-ibm-aix6.1.7.0" diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 4b002ecef1..513af52ecd 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -79,8 +79,9 @@ def get_host_platform(): machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": - from _aix_support import aix_platform - return aix_platform() + return "%s-%s.%s" % (osname, version, release) + # from _aix_support import aix_platform + # return aix_platform() elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+', re.ASCII) diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 4003726dc9..b116e96007 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -666,8 +666,9 @@ def get_platform(): machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": - from _aix_support import aix_platform - return aix_platform() + return "%s-%s.%s" % (osname, version, release) + # from _aix_support import aix_platform + # return aix_platform() elif osname[:6] == "cygwin": osname = "cygwin" import re IMHO - this problem has nothing to do with _aix_support.py - That issue was fixed earlier by the new _bootsubprocess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:41:19 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 21:41:19 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1583962879.52.0.702341932837.issue35712@roundup.psfhosted.org> Serhiy Storchaka added the comment: > How is -1 interpreted? Does it become a TypeError? It is interpreted as error. It requires an exception be set. If you return -1 without setting an exception you will usually get a SystemError or crash. Oh, and this may happen during executing other code, so you will search a bug in wrong place. You cannot change this without breaking the C and Python API in hard way. > So my thinking is that when the interpreter gets the `NotImplemented` returned by either `if a` or by `if not a` that it would be converted to a `TypeError` > and the `and` machinery sees it has a `NotImplemented` and raises a `TypeError`. So you literally want NotImplemented raising a TypeError in boolean context except the "not" operator, and redefine `not a` from False if a else True to NotImplemented if a is NotImplemented else False if a else True You can do this, but this is a different issue, and I doubt that it will solve many problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:44:12 2020 From: report at bugs.python.org (Marco Sulla) Date: Wed, 11 Mar 2020 21:44:12 +0000 Subject: [issue39940] Micro-optimizations to PySequence_Tuple() Message-ID: <1583963052.53.0.534992223538.issue39940@roundup.psfhosted.org> New submission from Marco Sulla : This is a little PR with some micro-optimizations to the PySequence_Tuple() function. Mainly, it simply add a support variable new_n_tmp_1 instead of reassigning newn multiple times. ---------- components: Interpreter Core messages: 363974 nosy: Marco Sulla priority: normal pull_requests: 18296 severity: normal status: open title: Micro-optimizations to PySequence_Tuple() type: performance versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 17:47:09 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 21:47:09 +0000 Subject: [issue39940] Micro-optimizations to PySequence_Tuple() In-Reply-To: <1583963052.53.0.534992223538.issue39940@roundup.psfhosted.org> Message-ID: <1583963229.44.0.677698190823.issue39940@roundup.psfhosted.org> Serhiy Storchaka added the comment: Do you have any benchmarks? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 18:02:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Mar 2020 22:02:11 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1583964131.45.0.880661925646.issue39652@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry Raul, but I already have a PR written. It includes minor refactoring, better error handling in the nearby code, improved tests, fixed documentation and comments which incorrectly described the current behavior. It took time to determine what parts should be fixed, and unless you have found all this in your PR it would take much more time to explain to you what details should be checked than check and fix them myself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 18:35:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 22:35:13 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583966113.95.0.269979652018.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: Michael: this issue is about bootstraping Python. If you want to test a patch or test something else, you must restart from a clean copy of the source code. Either use "make distclean", "git clean -fdx", or recreate the source directory (git clone, decompress an archive, etc.). Then restart from scratch: ./configure && make. > NameError: name 'sys' is not defined Right, that's a stupid bug in my patch. You must import sys before. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 18:42:18 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 11 Mar 2020 22:42:18 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1583966538.28.0.334324859652.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: I checked that NumPy also packs correctly: >>> import numpy as np >>> x = np.array([0,1,2,3], dtype=np.bool) >>> x.tobytes() b'\x00\x01\x01\x01' So I vote for not handling incorrectly packed values and removing "and any non-zero value will be True when unpacking" from the docs, which does not seem to make any sense for _Bool. memoryview also does not guard against the theoretical possibility of incorrectly packed values being trap representations. Values need to be packed correctly, or you get UB. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 18:52:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 22:52:40 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583967160.96.0.345641760396.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: Try to replace Lib/_aix_support.py with attached _aix_support.py: in short, it uses _bootsubprocess if subprocess is not available. ---------- Added file: https://bugs.python.org/file48972/_aix_support.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:10:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:10:56 +0000 Subject: [issue39941] multiprocessing: Process.join() should emit a warning if the process is killed by a signal Message-ID: <1583968256.43.0.607036154625.issue39941@roundup.psfhosted.org> New submission from STINNER Victor : While debugging bpo-39877, I was surprising that Python crash was only noticed on FreeBSD by a side effect. On FreeBSD, coredump files are created in the current directory. But Python regrtest fails if a test creates a file and doesn't remove it. I found that multiprocessing.Process.join() deletes the subprocess.Popen object as soon as the process completes, but it doesn't log any warning if the process is killed by a signal. The caller has no way to be notified. I propose to enhance Process to log a warning if such case happens. ---------- components: Library (Lib) messages: 363980 nosy: vstinner priority: normal severity: normal status: open title: multiprocessing: Process.join() should emit a warning if the process is killed by a signal versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:11:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:11:29 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583968289.22.0.287884856684.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-39941 "multiprocessing: Process.join() should emit a warning if the process is killed by a signal" which may help to detect the issue earlier on any platform, not only on FreeBSD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:12:00 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Mar 2020 23:12:00 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583968320.4.0.17096045711.issue39930@roundup.psfhosted.org> Steve Dower added the comment: Okay, I think I've got an approach that works even on the apparently misconfigured installs on the buildbots (and some user machines, if this is the same underlying issue as issue38597). I wasn't able to reproduce it though, so I have no idea why they don't have the right redist version property. Hopefully using the last-found directory under Redist continues to make sense into the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:14:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:14:10 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1583968450.71.0.0803305468222.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: The initial issue is now fixed. I close the issue. take_gil() only checks if the thread must exit once the GIL is acquired. Maybe it would be able to exit earlier, but I took the safe approach. If we must exit, drop the GIL and then exit. That's basically Python 3.8 behavior. If someone wants to optimize/enhance take_gil() for daemon thread, I suggest to open a new issue. Note: Supporting daemon threads require tricky code in take_gil(). I would prefer to deprecate daemon threads and prepare their removal. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:17:44 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Mar 2020 23:17:44 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1583968664.05.0.0221226616076.issue39927@roundup.psfhosted.org> Terry J. Reedy added the comment: idlemain.py should be documented within idlelib* (I will do that, README.txt and maybe macosx.py). Currently, the chdir is only part of idle.app, not idle on Mac, because it does not happen when starting IDLE in Terminal. This is confusing. As near as I can tell, it is not needed in idlemain.py. If so, it should be moved (revised) into idlelib startup code so it always runs on Mac. How about something like: try: os.chdir(os.path.expanduser('~/Documents')) except OSError: # I presume os.chdir(os.path.expanduser('~')) # Can this fail? * The only mention of 'IDLE.app' in idlelib is in the news item for #27310, where you mention 'idlemain.py', sans path. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:24:40 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 23:24:40 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583969080.64.0.546197305977.issue39930@roundup.psfhosted.org> miss-islington added the comment: New changeset 894adc18b4fb7246b762276a50a332c0e4f0e0f0 by Steve Dower in branch 'master': bpo-39930: Fix MSBuild detection for Build Tools (GH-18938) https://github.com/python/cpython/commit/894adc18b4fb7246b762276a50a332c0e4f0e0f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:24:48 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 23:24:48 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1583969088.14.0.273499077249.issue39930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18297 pull_request: https://github.com/python/cpython/pull/18943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:29:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:29:16 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1583969356.04.0.4315811863.issue39884@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch nosy: +vstinner nosy_count: 1.0 -> 2.0 pull_requests: +18298 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:39:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:39:07 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583969947.81.0.351353412039.issue39847@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 64838ce7172c7a92183b39b22504b433a33a884d by bobince in branch 'master': bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780) https://github.com/python/cpython/commit/64838ce7172c7a92183b39b22504b433a33a884d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:39:52 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 23:39:52 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583969992.45.0.742100525827.issue39847@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +18299 pull_request: https://github.com/python/cpython/pull/18945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:43:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Mar 2020 23:43:57 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1583970237.37.0.400988606811.issue39853@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:50:20 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 11 Mar 2020 23:50:20 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1583970620.45.0.889610190939.issue39936@roundup.psfhosted.org> Michael Felt added the comment: Actually, I had already done that: diff --git a/Lib/_aix_support.py b/Lib/_aix_support.py index 2c5cd3297d..c7f4491633 100644 --- a/Lib/_aix_support.py +++ b/Lib/_aix_support.py @@ -12,7 +12,8 @@ try: _tmp_bd = get_config_var("AIX_BUILDDATE") _bgt = get_config_var("BUILD_GNU_TYPE") except ImportError: # pragma: no cover - _have_subprocess = False + import _bootsubprocess as subprocess + _have_subprocess = True _tmp_bd = None _bgt = "powerpc-ibm-aix6.1.7.0" And after that test, I tried with no calls to _aix_support.py diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 4b002ecef1..513af52ecd 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -79,8 +79,9 @@ def get_host_platform(): machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": - from _aix_support import aix_platform - return aix_platform() + return "%s-%s.%s" % (osname, version, release) + # from _aix_support import aix_platform + # return aix_platform() elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+', re.ASCII) diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 4003726dc9..b116e96007 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -666,8 +666,9 @@ def get_platform(): machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": - from _aix_support import aix_platform - return aix_platform() + return "%s-%s.%s" % (osname, version, release) + # from _aix_support import aix_platform + # return aix_platform() elif osname[:6] == "cygwin": osname = "cygwin" import re ???????? So, even when _aix_support.py is not involved at all, _socket.so is being ignored - even though it was built. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:51:24 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Mar 2020 23:51:24 +0000 Subject: [issue38080] 2to3 urllib fixer: missing fix for urllib.getproxies In-Reply-To: <1568096046.76.0.575371443955.issue38080@roundup.psfhosted.org> Message-ID: <1583970684.63.0.0460034609238.issue38080@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 276a84a0a6c694ce227bf36ec2e2e6ec6686170f by Jos? Roberto Meza Cabrera in branch 'master': bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167) https://github.com/python/cpython/commit/276a84a0a6c694ce227bf36ec2e2e6ec6686170f ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 19:57:21 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Mar 2020 23:57:21 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1583971041.04.0.0939506951599.issue39847@roundup.psfhosted.org> miss-islington added the comment: New changeset 60b1b5ac56fe6099a3d358dc9d6cd6ec72fce2d8 by Miss Islington (bot) in branch '3.8': bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780) https://github.com/python/cpython/commit/60b1b5ac56fe6099a3d358dc9d6cd6ec72fce2d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 20:00:20 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Mar 2020 00:00:20 +0000 Subject: [issue38080] 2to3 urllib fixer: missing fix for urllib.getproxies In-Reply-To: <1568096046.76.0.575371443955.issue38080@roundup.psfhosted.org> Message-ID: <1583971220.2.0.998377754933.issue38080@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 20:11:51 2020 From: report at bugs.python.org (jack1142) Date: Thu, 12 Mar 2020 00:11:51 +0000 Subject: [issue39942] Making instance of `TypeVar` fails because of missing `__name__` Message-ID: <1583971911.89.0.874740392795.issue39942@roundup.psfhosted.org> New submission from jack1142 : Example code: ``` code = """ import typing T = typing.TypeVar("T") """ exec(code, {}) ``` Traceback: ``` Traceback (most recent call last): File "", line 1, in File "", line 3, in File "C:\Python38\lib\typing.py", line 603, in __init__ def_mod = sys._getframe(1).f_globals['__name__'] # for pickling KeyError: '__name__' ``` If this problem with `__name__` is not something that needs to be fixed, then I also noticed that the same line in typing.py will also raise when platform doesn't have `sys._getframe()` ---------- components: Library (Lib) messages: 363990 nosy: jack1142 priority: normal severity: normal status: open title: Making instance of `TypeVar` fails because of missing `__name__` type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 20:15:51 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Mar 2020 00:15:51 +0000 Subject: [issue39940] Micro-optimizations to PySequence_Tuple() In-Reply-To: <1583963052.53.0.534992223538.issue39940@roundup.psfhosted.org> Message-ID: <1583972151.41.0.83405815462.issue39940@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 21:14:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 01:14:09 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1583975649.38.0.933898815002.issue39939@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 21:34:02 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 12 Mar 2020 01:34:02 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1583976842.82.0.87985863095.issue39939@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:14:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 12 Mar 2020 03:14:27 +0000 Subject: [issue39885] IDLE right click should clear any selection In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583982867.93.0.00721264449262.issue39885@roundup.psfhosted.org> Terry J. Reedy added the comment: Restore not clearing the selection when click within it. See Exception in 1 above. Users need to continue to see what will be copied or cut (which also happens with paste). The breakpoint toggle and goto file/line options on the context menu need the line number of the click. If the cursor is not moved, another alternative is needed. ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:15:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 12 Mar 2020 03:15:16 +0000 Subject: [issue39885] IDLE right click outside of any selection should clear it In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583982916.45.0.841058867062.issue39885@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: IDLE right click should clear any selection -> IDLE right click outside of any selection should clear it _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:15:55 2020 From: report at bugs.python.org (Kyle Stanley) Date: Thu, 12 Mar 2020 03:15:55 +0000 Subject: [issue37224] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1583982955.29.0.0635952028339.issue37224@roundup.psfhosted.org> Kyle Stanley added the comment: I have a few spare cycles to take another stab at this issue. I can say with some certainty that the failure in test__xxsubinterpreters.DestroyTests does not occur on the latest commit to master (3.9): ``` $ ./python -m test test__xxsubinterpreters --match DestroyTests -j200 -F -v OK 0:09:28 load avg: 80.87 [2188] test__xxsubinterpreters passed test_all (test.test__xxsubinterpreters.DestroyTests) ... ok test_already_destroyed (test.test__xxsubinterpreters.DestroyTests) ... ok test_bad_id (test.test__xxsubinterpreters.DestroyTests) ... ok test_does_not_exist (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_current (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_other_thread (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_sibling (test.test__xxsubinterpreters.DestroyTests) ... ok test_main (test.test__xxsubinterpreters.DestroyTests) ... ok test_one (test.test__xxsubinterpreters.DestroyTests) ... ok test_still_running (test.test__xxsubinterpreters.DestroyTests) ... ok == Tests result: INTERRUPTED == Test suite interrupted by signal SIGINT. 2188 tests OK. ``` So at this point it seems to be a matter of looking through the diff between 3.8 vs 3.9 for any relevant code paths, and attempting to determine what change resolved the failure for 3.9. It might also be useful to determine if it occurred when the tests were first added in 3.8 or if some other commit introduced a subtle regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:23:07 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 12 Mar 2020 03:23:07 +0000 Subject: [issue39943] Meta: Clean up various issues Message-ID: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> New submission from Andy Lester : This is a meta-ticket for a number of small PRs that clean up some internals. Issues will include: * Removing unnecessary casts * consting pointers that can be made const * Removing unused function arguments * etc ---------- components: Interpreter Core messages: 363993 nosy: petdance priority: normal severity: normal status: open title: Meta: Clean up various issues _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:31:27 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 12 Mar 2020 03:31:27 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1583983887.11.0.981227076524.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- title: Meta: Clean up various issues -> Meta: Clean up various issues in C internals _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:44:59 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 12 Mar 2020 03:44:59 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583984699.87.0.0475989944194.issue39922@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18300 pull_request: https://github.com/python/cpython/pull/18949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:47:49 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 12 Mar 2020 03:47:49 +0000 Subject: [issue39922] Remove unused args in Python/compile.c In-Reply-To: <1583810264.23.0.039012420408.issue39922@roundup.psfhosted.org> Message-ID: <1583984869.69.0.519213770531.issue39922@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: -18300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:50:06 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 12 Mar 2020 03:50:06 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1583985006.52.0.961973029811.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- keywords: +patch pull_requests: +18301 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 11 23:52:05 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 12 Mar 2020 03:52:05 +0000 Subject: [issue39885] IDLE right click outside of any selection should clear it In-Reply-To: <1583557689.84.0.838761374918.issue39885@roundup.psfhosted.org> Message-ID: <1583985125.01.0.919003812568.issue39885@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +18302 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 01:09:59 2020 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 12 Mar 2020 05:09:59 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583989799.81.0.884230542776.issue38643@roundup.psfhosted.org> Zackery Spytz added the comment: Okay, Serhiy. I think your patch is a better choice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 01:30:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 05:30:10 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1583991010.08.0.953093618549.issue39943@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 01:56:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 05:56:57 +0000 Subject: [issue38373] List overallocation strategy In-Reply-To: <1570229023.08.0.986734049649.issue38373@roundup.psfhosted.org> Message-ID: <1583992617.67.0.740693785234.issue38373@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18303 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 02:32:03 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 06:32:03 +0000 Subject: [issue39944] UserString.join should return UserString Message-ID: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> New submission from Dennis Sweeney : It seems that `.join` methods typically return the type of the separator on which they are called: >>> bytearray(b" ").join([b"a", b"b"]) bytearray(b'a b') >>> b" ".join([bytearray(b"a"), bytearray(b"b")]) b'a b' This is broken in UserString.join: >>> from collections import UserString as US >>> x = US(" ").join(["a", "b"]) >>> type(x) Furthermore, this method cannot even accept UserStrings from the iterable: >>> US(" ").join([US("a"), US("b")]) Traceback (most recent call last): ... TypeError: sequence item 0: expected str instance, UserString found. I can submit a PR to fix this. ---------- components: Library (Lib) messages: 363995 nosy: Dennis Sweeney priority: normal severity: normal status: open title: UserString.join should return UserString type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 02:34:10 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 12 Mar 2020 06:34:10 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583994850.77.0.111222151718.issue39944@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 02:42:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 06:42:57 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583995377.59.0.557174718168.issue39944@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a duplicate of issue16397. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> UserString doesn't combine nicely with strings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 02:46:20 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 06:46:20 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583995580.79.0.294551630211.issue39944@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +18304 pull_request: https://github.com/python/cpython/pull/18953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 02:52:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 06:52:01 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583995921.04.0.386691953229.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18305 pull_request: https://github.com/python/cpython/pull/18954 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:01:17 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 07:01:17 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583996477.31.0.664304790808.issue39944@roundup.psfhosted.org> Dennis Sweeney added the comment: This is not a duplicate: issue16397 concerned " ".join([US("a"), US("b")]) While this is concerned about the return value and acceptable parameters for UserString.join(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:03:47 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 07:03:47 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583996627.04.0.0779724947149.issue39944@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: duplicate -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:07:49 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 07:07:49 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583996869.22.0.33109384336.issue39944@roundup.psfhosted.org> Serhiy Storchaka added the comment: You are right. Sorry. ---------- stage: resolved -> patch review superseder: UserString doesn't combine nicely with strings -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:31:15 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 07:31:15 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583998275.62.0.418394406135.issue38643@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ab9c72912178cfdb4d0637be036d78913b769154 by Serhiy Storchaka in branch '3.8': [3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18954) https://github.com/python/cpython/commit/ab9c72912178cfdb4d0637be036d78913b769154 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:37:08 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 07:37:08 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1583998628.15.0.571587422364.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18306 pull_request: https://github.com/python/cpython/pull/18955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:38:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 07:38:15 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1583998695.36.0.280170082543.issue39884@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3 by Victor Stinner in branch 'master': bpo-39884: Add method name in "bad call flags" error (GH-18944) https://github.com/python/cpython/commit/c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:39:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 07:39:24 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1583998764.92.0.984041855646.issue39884@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18307 pull_request: https://github.com/python/cpython/pull/18956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:47:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 07:47:00 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1583999220.04.0.754173328797.issue39884@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18308 pull_request: https://github.com/python/cpython/pull/18957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 03:52:38 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 12 Mar 2020 07:52:38 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1583999558.29.0.327112798475.issue39944@roundup.psfhosted.org> Raymond Hettinger added the comment: This API is very old and doesn't seem to have a caused any issues in practice. Changing the API now is more likely to break existing code than to help anyone in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 04:04:48 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 08:04:48 +0000 Subject: [issue39944] UserString.join should return UserString In-Reply-To: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> Message-ID: <1584000288.56.0.410522484212.issue39944@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 04:15:23 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 08:15:23 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1584000923.8.0.258059600095.issue38643@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6f4e7fcfca6923d0422b20fc8702240bd4e56ebd by Serhiy Storchaka in branch '3.7': [3.7] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18955) https://github.com/python/cpython/commit/6f4e7fcfca6923d0422b20fc8702240bd4e56ebd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 04:18:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Mar 2020 08:18:44 +0000 Subject: [issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base In-Reply-To: <1572445236.44.0.527192204316.issue38643@roundup.psfhosted.org> Message-ID: <1584001124.69.0.230219255894.issue38643@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 04:54:01 2020 From: report at bugs.python.org (Arkadiusz Miskiewicz Arkadiusz Miskiewicz) Date: Thu, 12 Mar 2020 08:54:01 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584003241.26.0.322546068852.issue38744@roundup.psfhosted.org> Arkadiusz Miskiewicz Arkadiusz Miskiewicz added the comment: That test program hangs even on Linux (kernel 4.9.184, glibc 2.30): $ python3 a.py Process ForkPoolWorker-13: Process ForkPoolWorker-12: Process ForkPoolWorker-16: Process ForkPoolWorker-15: Process ForkPoolWorker-11: Process ForkPoolWorker-6: Process ForkPoolWorker-7: Process ForkPoolWorker-14: Process ForkPoolWorker-5: Process ForkPoolWorker-2: Process ForkPoolWorker-10: Process ForkPoolWorker-3: Process ForkPoolWorker-8: Process ForkPoolWorker-1: Process ForkPoolWorker-4: Exception ignored in: Traceback (most recent call last): File "/usr/lib64/python3.8/multiprocessing/util.py", line 201, in __call__ res = self._callback(*self._args, **self._kwargs) File "/usr/lib64/python3.8/multiprocessing/pool.py", line 689, in _terminate_pool Process ForkPoolWorker-9: cls._help_stuff_finish(inqueue, task_handler, len(pool)) File "/usr/lib64/python3.8/multiprocessing/pool.py", line 674, in _help_stuff_finish inqueue._rlock.acquire() KeyboardInterrupt: $ python3 --version Python 3.8.2 ---------- nosy: +arekm title: python 3.8 hang in multiprocessing.Pool() locking on FreeBSD -> python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 04:54:06 2020 From: report at bugs.python.org (Tomas Hak) Date: Thu, 12 Mar 2020 08:54:06 +0000 Subject: [issue39945] Wrong example result in docs Message-ID: <1584003246.97.0.382809912153.issue39945@roundup.psfhosted.org> New submission from Tomas Hak : Step to reproduce: Open page: https://docs.python.org/3/library/sched.html Location: Documentation : sched ? Event scheduler Description: In the text is definition of priority: "Events scheduled for the same time will be executed in the order of their priority. A lower number represents a higher priority." I assume it is correct, but example shows different behavior. There are scheduled two events with priority two and one. In print on the end of example, they are in wrong order : Code: s.enter(5, 2, print_time, argument=('positional',)) s.enter(5, 1, print_time, kwargs={'a': 'keyword'}) Current Result: >From print_time 930343695.274 positional >From print_time 930343695.275 keyword Expected result: >From print_time 930343695.274 keyword >From print_time 930343695.275 positional Conclusion : I tested the example code and it gave me expected result in order "keyword","positional" ---------- assignee: docs at python components: Documentation messages: 364004 nosy: docs at python, hook priority: normal severity: normal status: open title: Wrong example result in docs versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 05:20:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 12 Mar 2020 09:20:26 +0000 Subject: [issue39945] Wrong example result in docs In-Reply-To: <1584003246.97.0.382809912153.issue39945@roundup.psfhosted.org> Message-ID: <1584004826.56.0.13632671297.issue39945@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be a duplicate of issue28297 and issue34677. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 05:29:43 2020 From: report at bugs.python.org (Eric Wieser) Date: Thu, 12 Mar 2020 09:29:43 +0000 Subject: [issue34305] inspect.getsourcefile and inspect.getcomments do not work with decorated functions In-Reply-To: <1533108053.89.0.56676864532.issue34305@psf.upfronthosting.co.za> Message-ID: <1584005383.44.0.353121461506.issue34305@roundup.psfhosted.org> Eric Wieser added the comment: Nothing holding it up from my end, just waiting on someone to review it. Perhaps this ping will help with that. ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 05:32:44 2020 From: report at bugs.python.org (Tomas Hak) Date: Thu, 12 Mar 2020 09:32:44 +0000 Subject: [issue39945] Wrong example result in docs In-Reply-To: <1584003246.97.0.382809912153.issue39945@roundup.psfhosted.org> Message-ID: <1584005564.57.0.146895632543.issue39945@roundup.psfhosted.org> Tomas Hak added the comment: I agree, it is duplicate. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 06:30:20 2020 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 12 Mar 2020 10:30:20 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584009020.7.0.178345089769.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: > So I vote for not handling incorrectly packed values and removing "and any non-zero value will be True when unpacking" from the docs, which does not seem to make any sense for _Bool. I disagree. I don't think struct module's job is to be faithful to _Bool semantics. Up to this point, "?" worked for bytes with "only 0 is false" semantics, in a reliable and documented way. I don't see a reason to let that continue. You're right about trap representations, but IMO floats are much more tied to hardware (and serious users of float are aware of the pitfalls), while _Bool semantics are governed by the whims of the compiler. Also, the "@" prefix is specifically documented to select native Byte order, Size, and Alignment; not how the bit-pattern is interpreted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 06:48:52 2020 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Mar 2020 10:48:52 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584010132.17.0.271520064855.issue38500@roundup.psfhosted.org> Mark Shannon added the comment: I'm not suggesting immediate removal of PEP 532. I am requesting that you don't add a new function to the C API that will prevent implementation of many meaningful optimizations to CPython. PEP 532 does not add any API functions. I understand that you want to fix the regression. Why not do so by reverting the change that caused it? Adding a new API function is not fixing a regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 07:04:48 2020 From: report at bugs.python.org (Eryk Sun) Date: Thu, 12 Mar 2020 11:04:48 +0000 Subject: [issue39920] os.lstat() does not work with Window Dos devices In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1584011088.45.0.746539536584.issue39920@roundup.psfhosted.org> Eryk Sun added the comment: > This is an os.lstat() limitation, nothing to do with pathlib. In 3.8+, stat() and lstat() work with a broader rang of device paths, at least for st_mode checks. For example: >>> s = os.stat('//./PhysicalDrive0') >>> stat.S_ISBLK(s.st_mode) True The problem is pathlib. It handles device paths improperly, such as normalizing '//./PhysicalDrive0' to add a trailing backslash. For example: >>> p = Path('//./PhysicalDrive0') >>> os.fspath(p) '\\\\.\\PhysicalDrive0\\' Issue 33898 covers the issue in more detail and has a pending PR. IMO, the PR needs work (e.g. correct handling of repeated slashes in UNC and device paths, IIRC). It doesn't have many people clamoring for a fix and stepping up to help. I'll try to get back to it soon -- when I'm up to it. --- **Discussion of the observed error** "\\.\PhysicalDrive" is an object symlink to a native Device object [1] that represents a physical disk device. Typically the native path is something like "\Device\Harddisk\DR". This is aliased as "\Device\Harddisk\Partition0", i.e. the 0th partition is the entire disk. A fixed disk will be partitioned into one or more volume devices such as "\Device\HarddiskVolume". Note that native volume device paths are transient, depending on PNP device removal and insertion. To work around this, the Mountpoint Manager maps the native path to a persistent "Volume{GUID}" name, and usually also a persistent DOS drive name such as "X:". Disk and volume devices have a Volume Parameter Block (VPB) [2], which allows a filesystem device to mount them. The filesystem device manages the device namespace and acts as a proxy when accessing the device. In contrast, other device types have no VPB and thus directly manage their own namespace. (A device may implement full or partial support for filesystem functionality, without being mounted, such as "\\.\PIPE", i.e. "\Device\NamedPipe".) The VPB of a disk device is flagged VPB_RAW_MOUNT, which restricts it to the RAW filesystem. (A volume device that isn't formatted or doesn't have a recognizable filesystem will also use RAW.) The RAW filesystem device supports no namespace. Any remaining path, including a root path, fails with STATUS_INVALID_PARAMETER (0xC000_000D), i.e. Windows ERROR_INVALID_PARAMETER (87). In order to observe this error condition in action, the disk device has to first be mounted by RAW. This is possible with a Direct Access Storage Device (DASD) open, for which there is no remaining path and which requests more than just reading device metadata (attributes, security), such as requesting data access. The OP sees a different error because the disk isn't already mounted. This short circuits to the default result of STATUS_UNSUCCESSFUL (0xC000_0001), i.e. Windows ERROR_GEN_FAILURE (31). Here's an example to clarify the behavior. In this first case, the VPB isn't mounted yet by RAW, and mounting fails since the device path includes a remaining path (i.e. a single trailing "/"): >>> try: os.stat('//./PhysicalDrive0/') ... except OSError as e: print(e) ... [WinError 31] A device attached to the system is not functioning If one first mounts the disk with RAW by way of a DASD open, then subsequently one sees the expected invalid parameter error for a non-DASD open: >>> f = open('//./PhysicalDrive0', 'rb') >>> try: os.stat('//./PhysicalDrive0/') ... except OSError as e: print(e) ... [WinError 87] The parameter is incorrect: '//./PhysicalDrive0/' [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_device_object [2]: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_vpb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 07:29:28 2020 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 12 Mar 2020 11:29:28 +0000 Subject: [issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace In-Reply-To: <1582736188.76.0.993881693157.issue39761@roundup.psfhosted.org> Message-ID: <1584012568.48.0.0417286199248.issue39761@roundup.psfhosted.org> Change by Petr Viktorin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 07:45:19 2020 From: report at bugs.python.org (Christian Heimes) Date: Thu, 12 Mar 2020 11:45:19 +0000 Subject: [issue38893] broken container/selinux integration In-Reply-To: <1574408245.03.0.269959513005.issue38893@roundup.psfhosted.org> Message-ID: <1584013519.4.0.0410198649586.issue38893@roundup.psfhosted.org> Christian Heimes added the comment: No, CPython's stdlib doesn't use libselinux. I talked to an engineer from Red Hat's SELinux team today. SELinux returns EACCES for policy violations like in this case. The _copyxattr() helper function ignores EPERM but not EACCES. You are seeing a PermissionError exception because Python maps both EPERM and EACCES to PermissionError. As first fix the _copyxattr() helper could ignore all permission errors for "security.*" namespace and just continue. This will get rid of the error but may still cause lots of AVC audit events. A better but backwards incompatible approach is to handle the xattr namespaces differently. Linux defines four xattr namespaces: security, system, trusted, and user. The security namespace is used by security policies like Smack or SELinux. IMHO _copyxattr() should only copy user xattrs by default. The security namespace should only be copied when the caller opts-in. The cp tool has separate preserve settings for context (SELinux security context) and xattr (other extended attributes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:37:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:37:25 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1584016645.82.0.774368346892.issue39884@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6a12676b1910d52c85561bdf4f1e20aa13fc8f46 by Victor Stinner in branch '3.7': bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18957) https://github.com/python/cpython/commit/6a12676b1910d52c85561bdf4f1e20aa13fc8f46 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:37:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:37:25 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1584016645.62.0.720546792677.issue39884@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 03ac090c5f8d5b281e56c5f5431c1754fd4efe5c by Victor Stinner in branch '3.8': bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956) https://github.com/python/cpython/commit/03ac090c5f8d5b281e56c5f5431c1754fd4efe5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:37:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:37:25 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1584016645.62.0.720546792677.issue39884@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 03ac090c5f8d5b281e56c5f5431c1754fd4efe5c by Victor Stinner in branch '3.8': bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956) https://github.com/python/cpython/commit/03ac090c5f8d5b281e56c5f5431c1754fd4efe5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:38:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:38:29 +0000 Subject: [issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug In-Reply-To: <1583554294.0.0.456473744337.issue39884@roundup.psfhosted.org> Message-ID: <1584016709.06.0.087555882242.issue39884@roundup.psfhosted.org> STINNER Victor added the comment: > While the issues definitely need to be resolved in the C extensions, where to start is not completely clear. I had to put `printfs` in PyCFunction_NewEx and PyDescr_NewMethod to track down the issues, e.g., (...) I agree, I had the same issue :-) I fixed the issue in 3.7, 3.8 and master branches. In 3.7, the modified functions are different and the error message was different but similar. Thanks for your bug report ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:38:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:38:56 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1584016736.77.0.104176624427.issue33012@roundup.psfhosted.org> STINNER Victor added the comment: FYI I modified SystemError("bad call flags") error message to include the method name in bpo-39884. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:48:09 2020 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 12 Mar 2020 12:48:09 +0000 Subject: [issue39938] RotatingFileHandler does not support any mode other than 'a'. In-Reply-To: <1583952854.31.0.172490606353.issue39938@roundup.psfhosted.org> Message-ID: <1584017289.41.0.323737565645.issue39938@roundup.psfhosted.org> Vinay Sajip added the comment: > supplying a mode to append bytes is not supported That is correct, log files supported by standard library handlers are text files using some supported encoding. If you need to store arbitrary bytes directly in a log file, feel free to write your own handlers to do it. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:50:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 12:50:44 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584017444.51.0.230242064678.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: > Why not do so by reverting the change that caused it? Making PyInterpreterState structure private was motivated by the subinterpreters work but also by the work on cleaning the C API. Over time, PyInterpreterState became more and more complex because many other structures have been moved there. For example, the GIL, GC state, warnings state, parser state, etc. I would really avoid exposing the GIL state in the C API since it uses the "pycore_atomic.h" header which caused a *lot* of compiler errors in the past. Most errors were on including the header file, even if the C extension didn't use any atomic variable. I'm really happy that we managed to move atomic variables into the internal C API: we got less error coming from that. I'm strongly opposed to move PyInterpreterState structure back into the Include/cpython/ C API. That would be a big mistake for various reasons. Even in CPython, pycore_pystate.h is causing a lot of troubles since PyInterpreterState became very complex. Example in posixmodule.c: --- #include "Python.h" #ifdef MS_WINDOWS /* include early to avoid conflict with pycore_condvar.h: #define WIN32_LEAN_AND_MEAN #include FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */ # include #endif #include "pycore_ceval.h" /* _PyEval_ReInitThreads() */ #include "pycore_import.h" /* _PyImport_ReInitLock() */ #include "pycore_pystate.h" /* _PyRuntime */ --- pycore_condvar.h is used by the GIL state. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:53:17 2020 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 12 Mar 2020 12:53:17 +0000 Subject: [issue39577] venv --prompt argument is ignored In-Reply-To: <1581066525.57.0.495811141664.issue39577@roundup.psfhosted.org> Message-ID: <1584017597.72.0.916219331889.issue39577@roundup.psfhosted.org> Vinay Sajip added the comment: > My question at this stage is, where is this "Prompt" variable set? If you mean the VIRTUAL_ENV variable, it's set in one of the activation scripts for the venv. In any case, this doesn't look it it's a problem with venv code, more to do with your local environment. So I'll close this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 08:54:24 2020 From: report at bugs.python.org (Vidar Fauske) Date: Thu, 12 Mar 2020 12:54:24 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1584017664.06.0.573322219274.issue26660@roundup.psfhosted.org> Vidar Fauske added the comment: Seems as if this was resolved by the linked PR in 3.8, or am I missing something? ---------- nosy: +vidartf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 09:02:17 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 12 Mar 2020 13:02:17 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584018137.09.0.814569540738.issue39939@roundup.psfhosted.org> Steven D'Aprano added the comment: To be clear, are you only making a copy of the unchanged object if it is a mutable bytearray, not str or bytes? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:02:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 14:02:30 +0000 Subject: [issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t In-Reply-To: <1578581025.66.0.18478821427.issue39277@roundup.psfhosted.org> Message-ID: <1584021750.76.0.0788579708619.issue39277@roundup.psfhosted.org> STINNER Victor added the comment: Oh, clang on FreeBSD spotted a similar bug in float.__trunc__()! static PyObject * float___trunc___impl(PyObject *self) /*[clinic end generated code: output=dd3e289dd4c6b538 input=591b9ba0d650fdff]*/ { double x = PyFloat_AsDouble(self); double wholepart; /* integral portion of x, rounded toward 0 */ (void)modf(x, &wholepart); /* Try to get out cheap if this fits in a Python int. The attempt * to cast to long must be protected, as C doesn't define what * happens if the double is too big to fit in a long. Some rare * systems raise an exception then (RISCOS was mentioned as one, * and someone using a non-default option on Sun also bumped into * that). Note that checking for >= and <= LONG_{MIN,MAX} would * still be vulnerable: if a long has more bits of precision than * a double, casting MIN/MAX to double may yield an approximation, * and if that's rounded up, then, e.g., wholepart=LONG_MAX+1 would * yield true from the C expression wholepart<=LONG_MAX, despite * that wholepart is actually greater than LONG_MAX. */ if (LONG_MIN < wholepart && wholepart < LONG_MAX) { /* <=== HERE */ const long aslong = (long)wholepart; return PyLong_FromLong(aslong); } return PyLong_FromDouble(wholepart); } Objects/floatobject.c:881:45: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion] if (LONG_MIN < wholepart && wholepart < LONG_MAX) { ~ ^~~~~~~~ /usr/include/sys/limits.h:64:18: note: expanded from macro 'LONG_MAX' #define LONG_MAX __LONG_MAX /* max for a long */ ^~~~~~~~~~ /usr/include/x86/_limits.h:64:20: note: expanded from macro '__LONG_MAX' #define __LONG_MAX 0x7fffffffffffffff /* max for a long */ ^~~~~~~~~~~~~~~~~~ 1 warning generated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:08:14 2020 From: report at bugs.python.org (And Clover) Date: Thu, 12 Mar 2020 14:08:14 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1584022094.79.0.144559998575.issue39847@roundup.psfhosted.org> Change by And Clover : ---------- pull_requests: +18309 pull_request: https://github.com/python/cpython/pull/18959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:28:38 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Mar 2020 14:28:38 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1584023318.85.0.749571753411.issue39847@roundup.psfhosted.org> miss-islington added the comment: New changeset feaf0c37891dfe8f0f3e643c3711af3af23bf805 by bobince in branch '3.7': [3.7] bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780) (GH-18959) https://github.com/python/cpython/commit/feaf0c37891dfe8f0f3e643c3711af3af23bf805 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:29:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 14:29:14 +0000 Subject: [issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount() In-Reply-To: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> Message-ID: <1584023354.82.0.290429850324.issue39847@roundup.psfhosted.org> STINNER Victor added the comment: Thanks, it's now fixed in 3.7, 3.8 and master branches. Python 3.5 and 3.6 don't get bugfixes anymore: https://devguide.python.org/#status-of-python-branches ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:32:43 2020 From: report at bugs.python.org (Roundup Robot) Date: Thu, 12 Mar 2020 14:32:43 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1584023563.56.0.272605552093.issue1294959@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 24.0 -> 25.0 pull_requests: +18310 pull_request: https://github.com/python/cpython/pull/18960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 10:38:26 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Mar 2020 14:38:26 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1584023906.86.0.561872469269.issue1294959@roundup.psfhosted.org> miss-islington added the comment: New changeset 3c29675d8736cb1860f342d872ae41e342c6d383 by Ra?l Cumplido in branch 'master': bpo-1294959: Fix typo for new attribute platlibdir. (GH-18960) https://github.com/python/cpython/commit/3c29675d8736cb1860f342d872ae41e342c6d383 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 11:10:04 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 15:10:04 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584025804.82.0.519439657943.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: The docs for native mode (we now always assume C99): "The '?' conversion code corresponds to the _Bool type defined by C99." The memoryview tests that fail are essentially auto-generated and not prescriptive. They just happened to work without UBSan: >>> x = array.array("B", [0,1,2,3]) >>> m = memoryview(x) >>> m.format 'B' >>> c = m.cast("?") # Wrong! >>> c.tolist() [False, True, True, True] I don't see the point in working around UB for the purposes of displaying the wrong cast. If you do subsequent array operations with the variable "c", UB will happen there. In theory you can do the same with a cast from unsigned to signed integers. Signed integers are allowed to be trap representations, though I don't know an actual platform where this is the case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 12:20:51 2020 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 12 Mar 2020 16:20:51 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584030051.71.0.644232587496.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: > The docs for native mode (we now always assume C99): > > "The '?' conversion code corresponds to the _Bool type defined by C99." But, nowhere is it suggested that conversion is "do memcpy and then interpret the bit pattern". That is pretty weird way to convert values in C; it seems to me that it's only a hack to avoid unaligned access. IMO, casting is a more natural way to convert values. And casting to _Bool coerces the value to 0 or 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 12:32:19 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 16:32:19 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584030739.35.0.262165546043.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: The memcpy() is NOT a hack and performs exactly the same operation as casting the pointer and then dereferencing, only in a manner that avoids unaligned accesses. On platforms like x86 the memcpy() is optimized to a simple assignment. Casting the pointer and then dereferencing would also be subject to the UB warnings. You are the one who wanted to *introduce* a hack by dereferencing as char and then cast to _Bool. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 12:37:24 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Mar 2020 16:37:24 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584031044.93.0.316773368506.issue39939@roundup.psfhosted.org> Dennis Sweeney added the comment: Yes: >>> x = "A"*10**6 >>> x.cutprefix("B") is x True >>> x.cutprefix("") is x True >>> y = b"A"*10**6 >>> y.cutprefix(b"B") is y True >>> y.cutprefix(b"") is y True >>> z = bytearray(b"A")*10**6 >>> z.cutprefix(b"B") is z False >>> z.cutprefix(b"") is z False I'm not sure whether this should be part of the spec or an implementation detail. The (str/bytes).replace method docs don't clarify this, but they have the same behavior: >>> x = "A"*10**6 >>> x.replace("B", "C") is x True >>> x.replace("", "") is x True >>> y = b"A"*10**6 >>> y.replace(b"B", b"C") is y True >>> y.replace(b"", b"") is y True >>> z = bytearray(b"A")*10**6 >>> z.replace(b"B", b"C") is z False >>> z.replace(b"", b"") is z False ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 12:47:57 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Mar 2020 16:47:57 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1584031677.22.0.374043665015.issue39930@roundup.psfhosted.org> miss-islington added the comment: New changeset 35ae5d916c6c2e9f211666a3a97965be3d2977ae by Miss Islington (bot) in branch '3.8': bpo-39930: Fix MSBuild detection for Build Tools (GH-18938) https://github.com/python/cpython/commit/35ae5d916c6c2e9f211666a3a97965be3d2977ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 12:51:37 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 12 Mar 2020 16:51:37 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1584031897.71.0.807872597741.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18311 pull_request: https://github.com/python/cpython/pull/18962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:05:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:05:45 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584032745.05.0.917722062603.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: For me, the *short term* goal is to find a way to limit the number of broken C extension module while we modify the C API to make it more opaque. We cannot reach all goals at once (opaque C API, subinterpreter, more optimizations, etc). We have to move step by step. For me it's ok to deprecate or even remove PyInterpreterState_SetEvalFrameFunc() later, once we will have a good reason for that. I'm also ok with having an alternative Python implementation which doesn't support PyInterpreterState_SetEvalFrameFunc(). Users would be able to make a choice: faster Python without PyInterpreterState_SetEvalFrameFunc(), or regular "slow" Python with PyInterpreterState_SetEvalFrameFunc(). That's part of my larger https://pythoncapi.readthedocs.io/ goal: the ability to use different Python "runtimes". >From what I understood, to be able to provide multiple Python runtimes, we have first to "fix" the C API. The HPy project is another approach to this problem. Making the C API opaque makes CPython closer to this goal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:40:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:40:48 +0000 Subject: [issue39946] Is it time to remove _PyThreadState_GetFrame() hook? Message-ID: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> New submission from STINNER Victor : Python has an internal function to get the frame of the PyThreadState: /* hook for PyEval_GetFrame(), requested for Psyco */ #define _PyThreadState_GetFrame _PyRuntime.gilstate.getframe It is used by the public function PyEval_GetFrame() for example. The indirection was added in 2002 by: commit 019a78e76d3542d4d56a08015e6980f8c8aeaba1 Author: Michael W. Hudson Date: Fri Nov 8 12:53:11 2002 +0000 Assorted patches from Armin Rigo: [ 617309 ] getframe hook (Psyco #1) [ 617311 ] Tiny profiling info (Psyco #2) [ 617312 ] debugger-controlled jumps (Psyco #3) These are forward ports from 2.2.2. ... but psyco is outdated for a very long time (superseded by PyPy which is no longer based on CPython). Is it time to drop _PyThreadState_GetFrame() (which became _PyRuntime.gilstate.getframe in the meanwhile)? Or if we keep it, we should use it rather accessing directly PyThreadState.frame (read or write). See also PEP 523 "Adding a frame evaluation API to CPython" and a recent discussion on this PEP: bpo-38500. ---------- components: Interpreter Core messages: 364031 nosy: vstinner priority: normal severity: normal status: open title: Is it time to remove _PyThreadState_GetFrame() hook? versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:41:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:41:05 +0000 Subject: [issue39946] Is it time to remove _PyThreadState_GetFrame() hook? In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584034865.62.0.812194907672.issue39946@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +Mark.Shannon, brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:41:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:41:23 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584034883.74.0.594322487224.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: Somehow related, I just created bpo-39946: "Is it time to remove _PyThreadState_GetFrame() hook?". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:43:47 2020 From: report at bugs.python.org (Jonathan Castro) Date: Thu, 12 Mar 2020 17:43:47 +0000 Subject: [issue31727] FTP_TLS errors when use certain subcommands In-Reply-To: <1507482521.5.0.213398074469.issue31727@psf.upfronthosting.co.za> Message-ID: <1584035027.31.0.421956237531.issue31727@roundup.psfhosted.org> Jonathan Castro added the comment: I had the same problem but when i was trying to upload the files using FTPS with explicit TLS 1.2 over an AWS Lambda function. Each time that i was trying upload a file, there was an lambda timeout on the storbinary called, and the function ended whit error on each execution. Finally the only solution that i founded, to solve this issue, was: 1- It using a threading to do the storebinary process. 2- Put an sleep depending do File size. 3- After the sleep function, it using ftplib.dir. ---------- nosy: +unixjon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:46:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:46:54 +0000 Subject: [issue39947] Move PyThreadState structure to the internal C API Message-ID: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> New submission from STINNER Victor : Python 3.8 moved PyInterpreterState to the internal C API (commit be3b295838547bba267eb08434b418ef0df87ee0 of bpo-35886)... which caused bpo-38500 issue. In Python 3.9, I provided Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as regular functions for the limited API: commit f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613 of bpo-38644. Previously, there were defined as macros, but these macros didn?t compile with the limited C API which cannot access PyThreadState.recursion_depth field (the structure is opaque in the limited C API). That's an enhancement for the limited C API, but PyThreadState is still exposed to the "cpython" C API (Include/cpython/). We should prepare the C API to make the PyThreadState structure opaque. It cannot be done at once, there are different consumers of the PyThreadState structure. In CPython code base, I found: * Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macros access tstate->trash_delete_nesting field. Maybe we can hide these implementation details into new private function calls. * faulthandler.c: faulthandler_py_enable() reads tstate->interp. We should maybe provide a getter function. * _tracemalloc.c: traceback_get_frames() reads tstate->frame. We should maybe provide a getter function. * Private _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() access tstate->recursion_depth. One solution is to move these functions to the internal C API. faulthandler and _tracemalloc are low-level debugging C extensions. Maybe it's ok for them to use the internal C API. But they are examples of C extensions accessing directly the PyThreadState structure. See also bpo-39946 "Is it time to remove _PyThreadState_GetFrame() hook?" about PyThreadState.frame. ---------- components: C API messages: 364034 nosy: vstinner priority: normal severity: normal status: open title: Move PyThreadState structure to the internal C API versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:47:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:47:27 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584035247.71.0.8214640417.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +Mark.Shannon, eric.snow title: Move PyThreadState structure to the internal C API -> Make the PyThreadState structure opaque (move it to the internal C API) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:48:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:48:59 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584035339.74.0.858509202174.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: Mark Shannon: `PyThreadState` is an internal opaque data structure, which means we are free to change it. I guess that you mean PyInterpreterState which was moved to the internal C API in Python 3.8. It was part of public C API in Python 3.7. See commit be3b295838547bba267eb08434b418ef0df87ee0 of bpo-35886. By the way, I just created bpo-39947: "Make the PyThreadState structure opaque (move it to the internal C API)". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 13:52:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 17:52:25 +0000 Subject: [issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584035545.16.0.983782453051.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: Mark: > PEP 523 is quite vague, but the rationale indicates that exposing `eval_frame` is for "a method-level JIT". PEP 523 did not suggest adding an API. I disagree, the PEP is quite explicit: "Third-party code may then set their own frame evaluation function instead to control the execution of Python code." That's the whole point of the PEP: let third-party code set eval_frame to use the feature. The PEP was written in 2016, when the PyInterpreterState structure was part of the public C API. But PyInterpreterState was moved to the internal C API, after the PEP was approved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:16:22 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 18:16:22 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584036982.07.0.784793414185.issue39689@roundup.psfhosted.org> Change by Stefan Krah : ---------- pull_requests: +18312 pull_request: https://github.com/python/cpython/pull/18964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:27:28 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 12 Mar 2020 18:27:28 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584037648.4.0.376304772941.issue39936@roundup.psfhosted.org> Michael Felt added the comment: re: Michael: this issue is about bootstraping Python. If you want to test a patch or test something else, you must restart from a clean copy of the source code. Either use "make distclean", "git clean -fdx", or recreate the source directory (git clone, decompress an archive, etc.). Then restart from scratch: ./configure && make. Understood: between these two timestamps: Date: 2020-03-11 18:55 and Date: 2020-03-11 21:36 - I was doing just that on 4 different VM's: AIX 5.3, 6.1, 7.1 and 7.2 - just in case there may be anything specific re: AIX versions (the bots run on AIX 7.1 and 7.2). I also switched away from any NFS based builds because test behaves differently when the build area is an NFS area compared to jfs2. FYI: I have decided to focus on AIX 7.1 and AIX 7.2 - and am only using gcc (I was also testing runs with both xlc and gcc before I started posting). Further, I like your suggestion to try: subprocess except _bootsubprocess and shall make a PR to that end. Much more clear about what is going on. What I am going to do bewtween now and my next post is again - clean slate - update master to latest version - on two servers. On one server I'll apply your suggestion to _aix_platform.py; on the other I'll patch Lib/distutils/util.py and Lib/sysconfig.py to not even call _aix_platform.py. Ideally, there will be a difference that leads to an understanding of the root cause. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:35:47 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 18:35:47 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584038147.17.0.570793844088.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 1ae9cde4b2323235b5f9ff4bc76e4175a2257172 by Stefan Krah in branch 'master': bpo-39689: Do not test undefined casts to _Bool (GH-18964) https://github.com/python/cpython/commit/1ae9cde4b2323235b5f9ff4bc76e4175a2257172 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:36:17 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Mar 2020 18:36:17 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584038177.22.0.777896100201.issue39689@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18314 pull_request: https://github.com/python/cpython/pull/18966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:36:09 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Mar 2020 18:36:09 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584038169.52.0.656976504417.issue39689@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +18313 pull_request: https://github.com/python/cpython/pull/18965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:39:37 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 12 Mar 2020 18:39:37 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1584038377.66.0.553889894411.issue39924@roundup.psfhosted.org> Manjusaka added the comment: I don't think rename 'link_to' to 'link' directly is a good idea. Because there are many third-party libs have used this name. Unless we can keep two names in this version, and remind people the 'link_to' function will be deprecated totally in a future version. But is there any way to make a function as deprecated? About 'os.readlink', we can hide this function in the platform that doesn't support readlink() just like `epoll' in mac or etc. ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:42:08 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 12 Mar 2020 18:42:08 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1584038528.16.0.366846564088.issue39924@roundup.psfhosted.org> Manjusaka added the comment: But when will os.readlink() be unavailable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:42:49 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 12 Mar 2020 18:42:49 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1584038569.01.0.380781155858.issue39924@roundup.psfhosted.org> Manjusaka added the comment: Fine, I get your means ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:55:40 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 18:55:40 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584039340.72.0.536409910442.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 636eecbbbbc16229432ec8e26e6da287c52f3ca3 by Miss Islington (bot) in branch '3.7': bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18965) https://github.com/python/cpython/commit/636eecbbbbc16229432ec8e26e6da287c52f3ca3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 14:56:22 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 18:56:22 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584039382.05.0.526739725755.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: New changeset f8ce3e2dae277baa2ef92e8a3e935953dc6c3f39 by Miss Islington (bot) in branch '3.8': bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18966) https://github.com/python/cpython/commit/f8ce3e2dae277baa2ef92e8a3e935953dc6c3f39 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 15:11:20 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 19:11:20 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584040280.85.0.763181833636.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: memoryview only supports the native format, so I've disabled the (wrong) test that casts arrays with arbitrary values to _Bool. So memoryview is done. IMO the problem in _struct is that it swaps the x->unpack function for the native one, which does not seem right for _Bool: /* Scan through the native table, find a matching entry in the endian table and swap in the native implementations whenever possible (64-bit platforms may not have "standard" sizes) */ If one disables that swap, the tests pass here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 15:14:27 2020 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 12 Mar 2020 19:14:27 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584040467.61.0.481603025919.issue36144@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +18315 pull_request: https://github.com/python/cpython/pull/18967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 15:19:07 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 12 Mar 2020 19:19:07 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584040747.46.0.181028229988.issue39562@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18316 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 15:55:27 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 12 Mar 2020 19:55:27 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584042927.76.0.785268757642.issue39936@roundup.psfhosted.org> Michael Felt added the comment: The good news! Your patch, better rewrite, of _aix_platform.py is working! Many thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 16:11:39 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 12 Mar 2020 20:11:39 +0000 Subject: [issue24119] Carry comments with the AST In-Reply-To: <1430666470.75.0.339272692521.issue24119@psf.upfronthosting.co.za> Message-ID: <1584043899.33.0.715382895734.issue24119@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 16:30:26 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 12 Mar 2020 20:30:26 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584045026.06.0.634582331825.issue39689@roundup.psfhosted.org> Change by Stefan Krah : ---------- pull_requests: +18317 pull_request: https://github.com/python/cpython/pull/18969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 16:41:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 20:41:25 +0000 Subject: [issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584045685.97.0.598930100654.issue38500@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression) -> PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 16:42:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 20:42:18 +0000 Subject: [issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584045738.6.0.0756462185868.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: I took Mark's concerns in account and I updated my PR to only add *private* functions to the C API, not *public* functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 16:51:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 20:51:03 +0000 Subject: [issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584046263.38.0.633513835175.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: Mark: Would you mind to open a separated issue for your following idea? > I propose a new method on code objects `withCallAtLine(callable: Callable[], line:int)` which returns a new code object with calls to the given callable at the given line. > A breakpoint can then be inserted at line L in function f with `f.__code__ = f.__code__.withCallAtLine(sys.breakpoint, L)`. I prefer to restrict this issue to the PEP 523. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:03:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 21:03:26 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584047006.09.0.17456471852.issue39936@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18318 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:12:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 21:12:07 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584047527.29.0.668876736234.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: I converted attached _aix_support.py into PR 18970 (with minor changes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:16:20 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 12 Mar 2020 21:16:20 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1584047780.23.0.500279833035.issue39927@roundup.psfhosted.org> Ronald Oussoren added the comment: Note that IDLE.app sets the current working directory to ~/Documents to have a sane working directory (and hence sane behavior in file dialogs), by default app bundles on macOS are launched with the root directory as the current working directory. For "python3 -m idlelib" it is not really necessary to change the working directory, and changing it might confuse users that also use IDLE on other platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:24:09 2020 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 12 Mar 2020 21:24:09 +0000 Subject: =?utf-8?q?=5Bissue39862=5D_Why_are_the_union_relationships_not_implemente?= =?utf-8?b?ZCBieSBkZWZhdWx0IGZvciDiiaQgYW5kIOKJpT8=?= In-Reply-To: <1583404181.09.0.848601767593.issue39862@roundup.psfhosted.org> Message-ID: <1584048249.95.0.295824873039.issue39862@roundup.psfhosted.org> G?ry added the comment: Note that other relationships are always valid _and already implemented by default in the interpreter (through the `NotImplemented` return value protocol)_: = is the [converse](https://en.wikipedia.org/wiki/Binary_relation#Converse) of itself, ? is the converse of itself, < and > are each other?s converse, ? and ? as each other?s converse. ("converse" is loosely called "reflected" in the Python documentation.) Which also makes me think that the last sentence of this documentation paragraph is incorrect: > By default, `__ne__()` delegates to `__eq__()` and inverts the result > unless it is `NotImplemented`. There are no other implied > relationships among the comparison operators, for example, the truth > of `(x are each other?s converse, and ? and ? are each other?s converse. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:44:12 2020 From: report at bugs.python.org (dgelessus) Date: Thu, 12 Mar 2020 21:44:12 +0000 Subject: [issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5 Message-ID: <1584049452.89.0.509835184184.issue39948@roundup.psfhosted.org> New submission from dgelessus : In particular, the implementation of posix._fcopyfile uses (available since OS X 10.5), and the implementation of threading.get_native_id uses pthread_threadid_np (available since OS X 10.6). This breaks builds for OS X 10.5 and older. I'm aware that the oldest officially supported OS X version is 10.6, but according to a python-dev post (https://mail.python.org/pipermail/python-dev/2018-May/153725.html), earlier versions are "supported on a best-effort basis". Would patches for these old versions still be accepted? I have the patch for this issue almost completely worked out, and it's not very complicated or intrusive - it mainly just adds standard autoconf checks for the functions/headers in question. ---------- components: macOS messages: 364051 nosy: dgelessus, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5 versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 17:49:27 2020 From: report at bugs.python.org (Seth Troisi) Date: Thu, 12 Mar 2020 21:49:27 +0000 Subject: [issue39949] truncating match in regular expression match objects repr Message-ID: <1584049767.16.0.188415292253.issue39949@roundup.psfhosted.org> New submission from Seth Troisi : Following on https://bugs.python.org/issue17087 Today I was mystified by why a regex wasn't working. >>> import re >>> re.match(r'.{10}', 'A'*49+'B') <_sre.SRE_Match object; span=(0, 10), match='AAAAAAAAAA'> >>> re.match(r'.{49}', 'A'*49+'B') <_sre.SRE_Match object; span=(0, 49), match='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA> >>> re.match(r'.{50}', 'A'*49+'B') <_sre.SRE_Match object; span=(0, 50), match='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA> I became confused on why the B wasn't matching in the third example; It is matching just in the interactive debugger it doesn't fit on the line and doesn't show My suggestion would be to truncate match (in the repr) and append '...' when it's right quote wouldn't show with short matches (or exactly enough space) there would be no change >>> re.match(r'.{48}', string.ascii_letters) <_sre.SRE_Match object; span=(0, 48), match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'> when not all of match can be displayed >>> re.match(r'.{49}', string.ascii_letters) <_sre.SRE_Match object; span=(0, 49), match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW> <_sre.SRE_Match object; span=(0, 49), match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS'...> I'm happy to help out by writing tests or impl if folks thing this is a good idea. I couldn't think of other examples (urllib maybe?) in Python of how this is handled but I could potentially look for some if that would help ---------- components: Library (Lib) messages: 364052 nosy: Seth.Troisi, serhiy.storchaka priority: normal severity: normal status: open title: truncating match in regular expression match objects repr type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 18:10:27 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Mar 2020 22:10:27 +0000 Subject: [issue39949] truncating match in regular expression match objects repr In-Reply-To: <1584049767.16.0.188415292253.issue39949@roundup.psfhosted.org> Message-ID: <1584051027.74.0.485115891191.issue39949@roundup.psfhosted.org> Eric V. Smith added the comment: I think the missing closing quote is supposed to be your visual clue that it's truncated. Although I'll grant you that it's pretty subtle. ---------- nosy: +eric.smith versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 18:15:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 22:15:41 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584051341.49.0.00164678455266.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c846ef004d79ee8e9645d3e5e8b3b0cb97b5013f by Victor Stinner in branch 'master': bpo-39936: _aix_support uses _bootsubprocess (GH-18970) https://github.com/python/cpython/commit/c846ef004d79ee8e9645d3e5e8b3b0cb97b5013f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 18:18:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 22:18:42 +0000 Subject: [issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584051522.85.0.0112923873986.issue38500@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0b72b23fb0c130279f65f3bcd23521acf4a98c88 by Victor Stinner in branch 'master': bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340) https://github.com/python/cpython/commit/0b72b23fb0c130279f65f3bcd23521acf4a98c88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 19:05:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 23:05:18 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584054318.67.0.0516909830185.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18319 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 19:17:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Mar 2020 23:17:53 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584055073.38.0.71925140636.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18320 pull_request: https://github.com/python/cpython/pull/18972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 19:34:40 2020 From: report at bugs.python.org (Barney Gale) Date: Thu, 12 Mar 2020 23:34:40 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1584056080.11.0.803365095393.issue39924@roundup.psfhosted.org> Barney Gale added the comment: Good points! Do you know of an example of a community library that uses `_Accessor.link`? Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 19:40:32 2020 From: report at bugs.python.org (Barney Gale) Date: Thu, 12 Mar 2020 23:40:32 +0000 Subject: [issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage In-Reply-To: <1578678614.26.0.0980677925629.issue39291@roundup.psfhosted.org> Message-ID: <1584056432.77.0.016707667731.issue39291@roundup.psfhosted.org> Barney Gale added the comment: Per discussion on the mailing list, I'd like to request that this bug be re-opened. https://mail.python.org/archives/list/python-dev at python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/ ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 19:44:58 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 12 Mar 2020 23:44:58 +0000 Subject: [issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage In-Reply-To: <1584056432.77.0.016707667731.issue39291@roundup.psfhosted.org> Message-ID: Joannah Nanjekye added the comment: Am hesitant on re-opening this. I think it sounds more meaningful to open a new issue for the new suggestion that requires deprecating this current behavior and introducing the new intended functionality. Best, Joannah On Thu, Mar 12, 2020 at 8:40 PM Barney Gale wrote: > > Barney Gale added the comment: > > Per discussion on the mailing list, I'd like to request that this bug be > re-opened. > > > https://mail.python.org/archives/list/python-dev at python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/ > > ---------- > nosy: +barneygale > > _______________________________________ > Python tracker > > _______________________________________ > -- Best, Joannah Nanjekye *"You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program." Alan J. Perlis* ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 20:37:26 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Mar 2020 00:37:26 +0000 Subject: [issue28775] Option to set startup directory in IDLE In-Reply-To: <1479837252.01.0.0581172301847.issue28775@psf.upfronthosting.co.za> Message-ID: <1584059846.04.0.271383369427.issue28775@roundup.psfhosted.org> Terry J. Reedy added the comment: The rule for whether to switch to the configured directory might be if sys.stdout is None: chdir... On windows, this is true when starting in the console with pyw(pythonw) -m idlelib But there is no need to include the (Windows-only) 'w'. It is meant to be used in the Windows icon shortcut. The option to start in the configured directory even from the console might be seen as a plus. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 20:50:05 2020 From: report at bugs.python.org (Barney Gale) Date: Fri, 13 Mar 2020 00:50:05 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() Message-ID: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> New submission from Barney Gale : Per bpo-39291, the argument order for `pathlib.Path.link_to()` is inconsistent with `symlink_to()` and its own documentation. This ticket covers adding a new `hardlink_to()` method with the correct argument order, and deprecating `link_to()`. Discussion on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/ ---------- components: Library (Lib) messages: 364060 nosy: barneygale priority: normal severity: normal status: open title: Add pathlib.Path.hardlink_to() type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 20:50:57 2020 From: report at bugs.python.org (Barney Gale) Date: Fri, 13 Mar 2020 00:50:57 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1584060657.04.0.161250673988.issue39950@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +18321 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 21:04:47 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Mar 2020 01:04:47 +0000 Subject: [issue24119] Carry comments with the AST In-Reply-To: <1430666470.75.0.339272692521.issue24119@psf.upfronthosting.co.za> Message-ID: <1584061487.08.0.127674488898.issue24119@roundup.psfhosted.org> Guido van Rossum added the comment: I propose to close this issue, since (as of Python 3.8) we now have ast.parse(source, type_comments=True). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 21:05:33 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Mar 2020 01:05:33 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1584061533.5.0.587420071983.issue33337@roundup.psfhosted.org> Guido van Rossum added the comment: If people are looking for a concrete CST that works now, maybe LibCST will work? https://github.com/Instagram/LibCST ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 21:30:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Mar 2020 01:30:06 +0000 Subject: [issue22121] Start IDLE from icon in a better place. In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1584063006.88.0.854789650721.issue22121@roundup.psfhosted.org> Terry J. Reedy added the comment: #39927 is about changing the Mac-specific chdir hidden away in Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py, line 8 A generic solution should supercede that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 21:54:39 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Fri, 13 Mar 2020 01:54:39 +0000 Subject: [issue39933] test_gdb fails on AMD64 FreeBSD Shared 3.x: ptrace: Operation not permitted In-Reply-To: <1583927803.55.0.643222253401.issue39933@roundup.psfhosted.org> Message-ID: <1584064479.61.0.756311518028.issue39933@roundup.psfhosted.org> Kubilay Kocak added the comment: Testing with security.bsd.unprivileged_proc_debug=1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 22:15:50 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 13 Mar 2020 02:15:50 +0000 Subject: [issue35712] Make NotImplemented unusable in boolean context In-Reply-To: <1547157306.18.0.725390794489.issue35712@roundup.psfhosted.org> Message-ID: <1584065750.84.0.527632718484.issue35712@roundup.psfhosted.org> Ethan Furman added the comment: Hmm. Okay, I'm happy with just raising a TypeError in NotImplemented.__bool__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 22:16:09 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 13 Mar 2020 02:16:09 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1584065769.92.0.639071486001.issue39927@roundup.psfhosted.org> Ned Deily added the comment: As Ronald notes, the chdir to the user?s Documents folder is *only* needed when launching via IDLE.app (for example by double-clicking an IDLE.app icon in the macOS Finder) because the user has no control over the launched app?s working directory in that case and the default is inappropriate. Whereas, when launching IDLE from a command line (for example, with ?python -m idlelib?), IDLE inherits the working directory of the UNIX shell process which the user has complete control over. This is how users experience IDLE today on all UNIXy platforms. Thus, the chdir location is correct and current code and behavior should not be changed except to catch a chdir failure. The only question is what to do when an exception is caught. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 22:29:53 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 13 Mar 2020 02:29:53 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1584066593.32.0.882833301336.issue31122@roundup.psfhosted.org> Dima Tisnek added the comment: If someone can review https://github.com/python/cpython/pull/18772 then pretty-please review ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:08:21 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Mar 2020 03:08:21 +0000 Subject: [issue22121] Start IDLE from icon in a better place. In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1584068901.48.0.374517887761.issue22121@roundup.psfhosted.org> Terry J. Reedy added the comment: Recap and proposal When editing a named file, Open and Save start in the directory of that file. Running a file sets the initial working directory of the execution process, which affects imports in the code. We are here discussing the working directory for the IDLE process. This affects a. the working directory for interactive code entered without having first run from the editor; b. the start directory for Open and Save in both Shell and any untitled editor windows. When IDLE is started with command line 'python -m idlelib', its working directory is that of the console. We agree that IDLE should not change this. In this case, sys.stdout is not None. (The exception is when one starts with pythonw, which which is normally useless in the console.) When IDLE is started Windows Explorer by right clicking a file and selecting 'Edit with IDLE' its working directory is the same as the file. I propose that IDLE should not change the directory in this case either. In this case, there is at least one filename in sys.args, which IDLE parses anyway. I initially considered this issue to be about changing the installed Start menu shortcut. But it was suggested that IDLE code might be better. Adding a configuration option would require this. Such code would also not be limited to Windows. I am currently thinking of something like if sys.stdout is None and no file in sys.argv: start_dir = idleConf(...) #28775, default None?. if start_dir is None: start_dir = try: chdir(expanduser('~')) except OSError as e: This might be somehow coordinated with .idlerc location search. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:10:26 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Mar 2020 03:10:26 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1584069026.13.0.945530969794.issue39927@roundup.psfhosted.org> Terry J. Reedy added the comment: Right. I rechecked and Terminal starts in /Users/ and a user can easily switch to Documents or anything else. Dialogs open in the same directory. IDLE should stay wherever when started from terminal. That was agreed on #22121 (Checking 'sys.stdout is None' should work.) Will my suggested change work in idlemain.py? Is there any issue with importing tkinter.messagebox there? If the solution for #22121 is an all-systems patch (see msg364068), as I now expect, the chdir in idlemain could be deleted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:13:10 2020 From: report at bugs.python.org (Eryk Sun) Date: Fri, 13 Mar 2020 03:13:10 +0000 Subject: [issue39920] os.stat() and os.lstat() fail with Windows device paths In-Reply-To: <1583802295.48.0.863493828127.issue39920@roundup.psfhosted.org> Message-ID: <1584069190.28.0.698888955518.issue39920@roundup.psfhosted.org> Eryk Sun added the comment: The particular error reported here is due to pathlib, which is a duplicate of issue 33898. That said, since the OP is using 3.7, I've left this issue open in case someone wants to backport the win32_xstat_impl changes that enable stat() (and in particular setting st_mode) for Windows 'character' (e.g. //./NUL and //./CONIN$) and 'block' devices (e.g. //./C: and //./PhysicalDrive0). I don't recall why Steve Dower decided against backporting this update. ---------- components: +Library (Lib) title: os.lstat() does not work with Window Dos devices -> os.stat() and os.lstat() fail with Windows device paths versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:34:47 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 13 Mar 2020 03:34:47 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1584070487.12.0.408189686846.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18322 pull_request: https://github.com/python/cpython/pull/18973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:40:01 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 13 Mar 2020 03:40:01 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections Message-ID: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> New submission from Dima Tisnek : When a connection wrapped in ssl is closed, sometimes the ssl library reports an error, which I believe should be ignored. The error code is `291` and the name of the error is either SSL_R_KRB5_S_INIT (KRB5_S_INIT) or SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY depending on openssl header file. It's only one code, somehow `ssl.h` (depending on version?) has different symbolic name for the error. TBH, I consider `KRB5_S_INIT` a misnomer, there's no Kerberos here. The explanation for openssl reporting this error is here: https://github.com/openssl/openssl/blob/6d53ad6b5cf726d92860e973d7bc8c1930762086/ssl/record/rec_layer_s3.c#L1657-L1668 > The peer is continuing to send application data, but we have > already sent close_notify. If this was expected we should have > been called via SSL_read() and this would have been handled > above. This situation is easily achieved, because of network delays. Just because we sent "close notify", doesn't mean the other end has received it, and even if it did, there could still be return data in flight. Reproducer is here: https://gist.github.com/dimaqq/087c66dd7b4a85a669a00221dc3792ea ---------- components: Extension Modules, Library (Lib) messages: 364071 nosy: Dima.Tisnek priority: normal severity: normal status: open title: Ignore specific errors when closing ssl connections versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:46:39 2020 From: report at bugs.python.org (Lin Gao) Date: Fri, 13 Mar 2020 03:46:39 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build Message-ID: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> New submission from Lin Gao : We (the MSVC ++ team) is trying to use VS2019 to replace VS2017 to automatically build Python3(branch 3.6)on Windows. First build failed with error MSB8036: The Windows SDK version 10.0.10586.0 was not found. So we modified the build command line to 'build -e -r -v "/p:PlatformToolset=v142" "/p:WindowsTargetPlatformVersion=10.0.18362.0"' , error MSB8036 has disappeared, but triggers another error 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(173,1): fatal error C1189: #error: "No Target Architecture"'. After investigation, this error is reported whenever the F:\gitP\python\cpython\Modules\_io\_iomodule.c file is compiled. And this error will disappear when we add #include to the _iomodule.c file.But when I rebuilt again, I encountered many errors. Does Python3 currently support VS2019 automated builds? If support Could you please help to take a look? Thank you so much! Here is repro steps: 1. git clone -b "3.6" -c core.autocrlf=true https://github.com/python/cpython.git F:\gitP\python\cpython 2. Open a VS 2019 16.4.5 x86 command prompt and browse to F:\gitP\python\cpython 3. checkout the revision to f1f9c0c. 4. Add #include to the _iomodule.c. 5. cd F:\gitP\python\cpython\PCBuild 6. devenv /upgrade pcbuild.sln 7. build -e -r -v "/p:PlatformToolset=v142" "/p:WindowsTargetPlatformVersion=10.0.18362.0" Error: 19>LINK : fatal error LNK1181: cannot open input file 'Microsoft.VisualStudio.Setup.Configuration.Native.lib' 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20779): error C2059: syntax error: 'constant' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20791): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20792): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20793): error C2143: syntax error: missing '{' before '*' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20801): error C2061: syntax error: identifier 'IMAGE_POLICY_ENTRY' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20802): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(20803): error C2143: syntax error: missing '{' before '*' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1032): error C2059: syntax error: 'constant' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1034): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1151): error C2059: syntax error: 'constant' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1153): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1032): error C2059: syntax error: 'constant' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1034): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1151): error C2059: syntax error: 'constant' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(1153): error C2059: syntax error: '}' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.EXE"' : return code '0x2' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] 40>NMAKE : fatal error U1077: 'xcopy' : return code '0x4' [F:\gitP\python\cpython\PCbuild\tk.vcxproj] Stop. 40>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "setlocal [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: if not exist "F:\gitP\python\cpython\externals\tcltk\bin\tk86t.dll" goto build [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: if not exist "F:\gitP\python\cpython\externals\tcltk\include\tk.h" goto build [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: if not exist "F:\gitP\python\cpython\externals\tcltk\lib\tk86t.lib" goto build [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: if not exist "F:\gitP\python\cpython\externals\tcltk\lib\tk8.6" goto build [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: goto :eof [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: :build [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\ [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: cd /D "F:\gitP\python\cpython\externals\tk-8.6.6.0\win" [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: nmake /nologo -f makefile.vc RC=rc MACHINE=IX86 OPTS=msvcrt BUILDDIRTOP="Release" TCLDIR="F:\gitP\python\cpython\externals\tcl-core-8.6.6.0" INSTALLDIR="F:\gitP\python\cpython\externals\tcltk" all [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: nmake /nologo -f makefile.vc RC=rc MACHINE=IX86 OPTS=msvcrt BUILDDIRTOP="Release" TCLDIR="F:\gitP\python\cpython\externals\tcl-core-8.6.6.0" INSTALLDIR="F:\gitP\python\cpython\externals\tcltk" install-binaries install-libraries [F:\gitP\python\cpython\PCbuild\tk.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: " exited with code 2. [F:\gitP\python\cpython\PCbuild\tk.vcxproj] ---------- components: Build files: build.log messages: 364072 nosy: Lin priority: normal severity: normal status: open title: Using VS2019 to automatically build Python3 and it failed to build type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file48973/build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:50:31 2020 From: report at bugs.python.org (Lin Gao) Date: Fri, 13 Mar 2020 03:50:31 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1584071431.81.0.803314441962.issue39952@roundup.psfhosted.org> Change by Lin Gao : ---------- nosy: -Lin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 12 23:52:10 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 13 Mar 2020 03:52:10 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1584071530.42.0.818273621989.issue39951@roundup.psfhosted.org> Dima Tisnek added the comment: Reproducer: """ Reproducer for BPO-39951 We send some data over ssl and close the connection. The server responds after our openssl considers the connection closed-ish and raises an error. """ import asyncio import ssl host = "nghttp2.org" port = 443 ssl_context = ssl.create_default_context() ssl_context.options |= ssl.OP_NO_TLSv1 ssl_context.options |= ssl.OP_NO_TLSv1_1 ssl_context.set_alpn_protocols(["h2"]) # Captured from an HTTP/2 client DATA = b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n\x00\x00*\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x10\x00\x00\x02\x00\x00\x00\x00\x00\x04\x00\x00\xff\xff\x00\x05\x00\x00@\x00\x00\x08\x00\x00\x00\x00\x00\x03\x00\x10\x00\x00\x00\x06\x00\x00\xff\xff\x00\x00\x04\x08\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x04\x01\x00\x00\x00\x00' async def test(): r, w = await asyncio.open_connection(host, port, ssl=ssl_context) info = w.get_extra_info("ssl_object") assert info, "HTTP/2 server is required" proto = info.selected_alpn_protocol() assert proto == "h2", "Failed to negotiate HTTP/2" w.write(DATA) w.close() await w.wait_closed() asyncio.run(test()) Test on macOS, using cpython builds from python.org: ? > python3.7 repro-bpo-39951.py Traceback (most recent call last): File "repro-bpo-39951.py", line 34, in asyncio.run(test()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete return future.result() File "repro-bpo-39951.py", line 31, in test await w.wait_closed() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/streams.py", line 323, in wait_closed await self._protocol._closed File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 530, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata self._sslobj.unwrap() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 778, in unwrap return self._sslobj.shutdown() ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2629) ? > python3.8 repro-bpo-39951.py Traceback (most recent call last): File "repro-bpo-39951.py", line 34, in asyncio.run(test()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "repro-bpo-39951.py", line 31, in test await w.wait_closed() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/streams.py", line 359, in wait_closed await self._protocol._get_close_waiter(self) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py", line 529, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py", line 207, in feed_ssldata self._sslobj.unwrap() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 948, in unwrap return self._sslobj.shutdown() ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2730) ? > python3.9 repro-bpo-39951.py Traceback (most recent call last): File "/.../repro-bpo-39951.py", line 34, in asyncio.run(test()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/.../repro-bpo-39951.py", line 31, in test await w.wait_closed() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/streams.py", line 359, in wait_closed await self._protocol._get_close_waiter(self) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 529, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 207, in feed_ssldata self._sslobj.unwrap() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 948, in unwrap return self._sslobj.shutdown() ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2730) Test on Linux (python:3.8.1-alpine3.11): / # python repro.py Traceback (most recent call last): File "repro.py", line 33, in asyncio.run(test()) File "/usr/local/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete return future.result() File "repro.py", line 30, in test await w.wait_closed() File "/usr/local/lib/python3.8/asyncio/streams.py", line 359, in wait_closed await self._protocol._get_close_waiter(self) File "/usr/local/lib/python3.8/asyncio/sslproto.py", line 529, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/local/lib/python3.8/asyncio/sslproto.py", line 207, in feed_ssldata self._sslobj.unwrap() File "/usr/local/lib/python3.8/ssl.py", line 948, in unwrap return self._sslobj.shutdown() ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2730) ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 00:07:50 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 13 Mar 2020 04:07:50 +0000 Subject: [issue39953] Let's update ssl error codes Message-ID: <1584072470.83.0.437860249809.issue39953@roundup.psfhosted.org> New submission from Dima Tisnek : Let's consider ssl error `291` (https://bugs.python.org/issue39951): It was introduced into openssl 2 years ago: https://github.com/openssl/openssl/commit/358ffa05cd3a088822c7d06256bc87516d918798 The documentation states: SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY:291:\ application data after close notify The `ssl.h` header file contains: # define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291 The master branch of openssl contains this definition too: https://github.com/openssl/openssl/blob/master/include/openssl/sslerr.h # define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291 But what does Python say? ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2629) What's KRB5? It supposedly stands for Kerberos5, and it too is seemingly present in openssl header file: /usr/local/Cellar/openssl/1.0.2s/include/openssl/ssl.h 2951:# define SSL_R_KRB5_S_INIT 291 Moreover, cpython source code contains a fallback, should this value not be defined: https://github.com/python/cpython/blob/master/Modules/_ssl_data.h #ifdef SSL_R_KRB5_S_INIT {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT}, #else {"KRB5_S_INIT", ERR_LIB_SSL, 291}, #endif Thus, today, Python reports an error with wrong *label* but correct *text*: [SSL: KRB5_S_INIT] application data after close notify The label and text don't match each other, because... well... I guess that's why we should fix it :) ---------- components: Extension Modules messages: 364074 nosy: Dima.Tisnek priority: normal severity: normal status: open title: Let's update ssl error codes versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 03:45:42 2020 From: report at bugs.python.org (Michael Felt) Date: Fri, 13 Mar 2020 07:45:42 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584085542.09.0.148165958763.issue39936@roundup.psfhosted.org> Michael Felt added the comment: Fantastic! Many thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 03:47:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 07:47:30 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584085650.55.0.998604790474.issue39936@roundup.psfhosted.org> STINNER Victor added the comment: POWER6 AIX 3.x and PPC64 AIX 3.x buildbots are back to green. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 03:47:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 07:47:36 +0000 Subject: [issue39936] Python fails to build _asyncio on module on AIX In-Reply-To: <1583948534.42.0.125038756594.issue39936@roundup.psfhosted.org> Message-ID: <1584085656.68.0.979402070509.issue39936@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 04:08:47 2020 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 13 Mar 2020 08:08:47 +0000 Subject: =?utf-8?q?=5Bissue39862=5D_Why_are_the_union_relationships_not_implemente?= =?utf-8?b?ZCBieSBkZWZhdWx0IGZvciDiiaQgYW5kIOKJpT8=?= In-Reply-To: <1583404181.09.0.848601767593.issue39862@roundup.psfhosted.org> Message-ID: <1584086927.7.0.949918844598.issue39862@roundup.psfhosted.org> G?ry added the comment: More precisely: The following relationships are always valid and therefore implemented by default in Python (_except for the union relationships, which seems arbitrary and is the reason of this Python issue_): - 2 [complementary](https://en.wikipedia.org/wiki/Binary_relation#Complement) relationships: "= and ? are each other?s complement"; - 6 [converse](https://en.wikipedia.org/wiki/Binary_relation#Converse) relationships*: "= is the converse of itself", "? is the converse of itself", "< and > are each other?s converse", and "? and ? are each other?s converse"; - 2 [union](https://en.wikipedia.org/wiki/Binary_relation#Union) relationships: "? is the union < and ="?and "? is the union of > and ?". The following relationships are only valid for [total orders](https://en.wikipedia.org/wiki/Binary_relation#Properties) and therefore not implemented by default in Python (but users can conveniently implement them when they are valid with the [`functools.total_ordering`](https://docs.python.org/3/library/functools.html#functools.total_ordering) class decorator provided by the Python standard library): - 4 [complementary](https://en.wikipedia.org/wiki/Binary_relation#Complement) relationships: "< and ? are each other?s complement" and "> and ? are each other?s complement". ---- \* Converse relationships are implemented in Python through the [`NotImplemented` protocol](https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 05:02:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Mar 2020 09:02:52 +0000 Subject: [issue39953] Let's update ssl error codes In-Reply-To: <1584072470.83.0.437860249809.issue39953@roundup.psfhosted.org> Message-ID: <1584090172.48.0.386845524712.issue39953@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +alex, christian.heimes, dstufft, janssen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 05:20:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 09:20:03 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584091203.51.0.26229438917.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 224481a8c988fca12f488544edd2f01c0af2a91d by Victor Stinner in branch 'master': bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972) https://github.com/python/cpython/commit/224481a8c988fca12f488544edd2f01c0af2a91d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 05:32:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 09:32:03 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584091923.6.0.44263076084.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18323 pull_request: https://github.com/python/cpython/pull/18974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 07:00:22 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Mar 2020 11:00:22 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1584097222.58.0.161070102887.issue39930@roundup.psfhosted.org> Steve Dower added the comment: New changeset c05e491a69df3fe0a8be91eeddd330792ada6755 by Steve Dower in branch '3.7': bpo-39930: Fix MSBuild detection for Build Tools (GH-18938) https://github.com/python/cpython/commit/c05e491a69df3fe0a8be91eeddd330792ada6755 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 07:39:43 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 11:39:43 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584099583.59.0.235763938704.issue39947@roundup.psfhosted.org> Fabio Zadrozny added the comment: As a note, externally I have to use it in pydevd to set the tracing for different threads -- i.e.: https://bugs.python.org/issue35370 Will that still be possible? ---------- nosy: +fabioz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 07:42:17 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 11:42:17 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584099737.38.0.370383012106.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: As a note, the workaround is now in https://github.com/fabioz/PyDev.Debugger/blob/pydev_debugger_1_9_0/pydevd_attach_to_process/common/py_settrace_37.hpp#L150 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 07:43:19 2020 From: report at bugs.python.org (Emmanuel Arias) Date: Fri, 13 Mar 2020 11:43:19 +0000 Subject: [issue39953] Let's update ssl error codes In-Reply-To: <1584072470.83.0.437860249809.issue39953@roundup.psfhosted.org> Message-ID: <1584099799.23.0.255103117719.issue39953@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:05:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:05:56 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584101156.45.0.477498692039.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: Can't you use PyEval_SetTrace()? https://docs.python.org/dev/c-api/init.html#c.PyEval_SetTrace ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:06:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:06:52 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584101212.48.0.309320710966.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: > As a note, externally I have to use it in pydevd to set the tracing for different threads -- i.e.: https://bugs.python.org/issue35370 Will that still be possible? My intent is not to prevent third-party C extension modules to modify PyThreadState, but to make the structure opaque. I mean that we should add getter and setter function for the most commonly used PyThreadState fields. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:07:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:07:54 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584101274.72.0.180654124763.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd by Victor Stinner in branch 'master': bpo-39947: Move get_recursion_depth() to _testinternalcapi (GH-18974) https://github.com/python/cpython/commit/3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:14:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:14:26 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584101666.48.0.899582639737.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: > Note: currently there is a way to achieve that by pausing all the threads then selectively switching to a thread to make it current and setting the tracing function using the C-API (see: https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_attach_to_process/dll/attach.cpp#L1224), but I believe this is very hacky and not portable to other Python implementations. I'm not sure that I understand your need. Do you need a variant of PyEval_SetTrace() which accepts a tstate argument? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:19:44 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 12:19:44 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584101984.81.0.939402077977.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: I'd like to, but it only sets the tracing to the currently running thread (the request is for setting the tracing for other threads). Just for info, the problem I'm solving is that the debugger is multi-threaded, but the user can start the code without any tracing in place, and then, when it gets to an attach to process or a programmatic attach to the debugger, the debugger needs to set the tracing to threads that are already running (and any new thread created afterward) and Python doesn't really have any structure for that in place (so, I'm using the C-API as a workaround to do what PyEval_SetTrace does but targeting any thread). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:20:25 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 12:20:25 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584102025.79.0.74817591078.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: >> Note: currently there is a way to achieve that by pausing all the threads then selectively switching to a thread to make it current and setting the tracing function using the C-API (see: https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_attach_to_process/dll/attach.cpp#L1224), but I believe this is very hacky and not portable to other Python implementations. > I'm not sure that I understand your need. Do you need a variant of PyEval_SetTrace() which accepts a tstate argument? Yes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:21:16 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 12:21:16 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584102076.05.0.164523683061.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: Maybe better would be the thread id so that the tstate structure is not needed there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:24:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:24:25 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x Message-ID: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> New submission from STINNER Victor : It started to at build 385 or 386. AMD64 FreeBSD Shared 3.x: https://buildbot.python.org/all/#/builders/152/builds/391 ====================================================================== FAIL: test_specific_shell (test.test_subprocess.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_subprocess.py", line 2180, in test_specific_shell self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii')) AssertionError: b'' != b'/usr/local/bin/bash' ---------- components: Tests messages: 364089 nosy: vstinner priority: normal severity: normal status: open title: test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:24:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:24:34 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584102274.75.0.675880573405.issue39954@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 08:38:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 12:38:40 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584103120.89.0.351288954462.issue39954@roundup.psfhosted.org> STINNER Victor added the comment: It looks like an installation issue: % /usr/local/bin/bash -c "" ld-elf.so.1: Shared object "libncurses.so.8" not found, required by "bash" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:22:58 2020 From: report at bugs.python.org (Ying Zhang) Date: Fri, 13 Mar 2020 13:22:58 +0000 Subject: [issue39955] argparse print_help breaks when help is blank space Message-ID: <1584105778.75.0.565516989827.issue39955@roundup.psfhosted.org> New submission from Ying Zhang : Code is attached. Comments in line. from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter parser1 = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) parser1.add_argument('--foo', default='default_value_for_foo', required=False) # this will not print the default value for foo. I think this is not the most natural choice, given that the user has asked for ArgumentDefaultsHelpFormatter, but acceptable since the user didn't define help here. parser1.add_argument('--bar', help='', default='default_value_for_bar', required=False) # this will not print the default value for bar. Again, acceptable but I feel not the most natural. parser1.add_argument('--baz', help=' ', default='default_value_for_baz', required=False) # this will print the default value for baz. parser1.print_help() parser2 = ArgumentParser() parser2.add_argument('--baz', help=' ', default='default_value_for_baz', required=False) # this will break, which surprises me. parser2.print_help() ---------------- Result: python argparse_help_demo.py usage: argparse_help_demo.py [-h] [--foo FOO] [--bar BAR] [--baz BAZ] optional arguments: -h, --help show this help message and exit --foo FOO --bar BAR --baz BAZ (default: default_value_for_baz) Traceback (most recent call last): File "argparse_help_demo.py", line 21, in parser2.print_help() File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 2474, in print_help self._print_message(self.format_help(), file) File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 2458, in format_help return formatter.format_help() File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 284, in format_help help = self._root_section.format_help() File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 215, in format_help item_help = join([func(*args) for func, args in self.items]) File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 215, in item_help = join([func(*args) for func, args in self.items]) File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 215, in format_help item_help = join([func(*args) for func, args in self.items]) File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 215, in item_help = join([func(*args) for func, args in self.items]) File "/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 527, in _format_action parts.append('%*s%s\n' % (indent_first, '', help_lines[0])) IndexError: list index out of range ---------- components: Library (Lib) messages: 364091 nosy: Ying Zhang priority: normal severity: normal status: open title: argparse print_help breaks when help is blank space type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:39:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:39:48 +0000 Subject: [issue35370] Provide API to set the tracing function to be used for running threads. In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584106788.83.0.0358611730451.issue35370@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18324 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:40:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:40:33 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584106833.6.0.0495452295328.issue35370@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Provide API to set the tracing function to be used for running threads. -> Add _PyEval_SetTrace(tstate, func, arg) function versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:42:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:42:38 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584106958.15.0.920988859676.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: Attached PR 18975 adds _PyEval_SetTrace(tstate, func, arg) function. It requires that the caller holds the GIL. The function calls PySys_Audit() in the context of the current thread state (not in "tstate"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:46:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:46:30 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584107190.2.0.458907147199.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: > Maybe better would be the thread id so that the tstate structure is not needed there. PyInterpreterState.tstate_head allows to iterate on all thread states, but I'm not aware of an API to get a PyThreadState from its identifier (tstate->id). -- See also bpo-1021318: "PyThreadState_Next not thread safe". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:46:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:46:53 +0000 Subject: [issue1021318] PyThreadState_Next not thread safe Message-ID: <1584107213.98.0.697575048412.issue1021318@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-35370: "Add _PyEval_SetTrace(tstate, func, arg) function". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:57:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 13:57:15 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584107835.64.0.297825435551.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9ee88cde1abf7f274cc55a0571b1c2cdb1263743 by Dong-hee Na in branch 'master': bpo-37207: Use PEP 590 vectorcall to speed up tuple() (GH-18936) https://github.com/python/cpython/commit/9ee88cde1abf7f274cc55a0571b1c2cdb1263743 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 09:58:38 2020 From: report at bugs.python.org (Jimmy Lai) Date: Fri, 13 Mar 2020 13:58:38 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1584107918.7.0.0715102741739.issue33337@roundup.psfhosted.org> Jimmy Lai added the comment: Just found Guido mentioned LibCST. Here is a quick overview: 1. LibCST is an open source Python concrete syntax tree parser. It provides a CST looks like and feel like AST. 2. It's built by Instagram for linter and refactoring tools (exact use cases what ?ukasz mentioned). We have a linter framework built on top of LibCST which allows a lint rule automatically fixes the issue (autofixer) for developers. We're working on open source it to help developers write better code easily. CC Tim We also found a couple other linter related open source tools use LibCST. 3. It's based on parso (which based on pgen2) and currently supports Python 3.5 to 3.8. Tim is working on adding the support back to 3.0 now and potentially 2.7 later. 4. It provides various patterns for traversing and modifying CST easily, including the AST visitor/transformer pattern, matchers pattern, various helpers for find/replace nodes in a tree and high level transform helpers (e.g. added needed import, remove unused import). 5. It also provides metadata for tree node from static analysis, e.g. line/column position, qualified name, scope analysis, inferred type annotation (through Pyre). Those are useful information for building advanced linter or refactoring tool. There are more features available in LibCST. We continue to develop it to make automated refactoring even easier. We welcome your feedback and PRs! ---------- nosy: +jimmylai _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 10:04:44 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 14:04:44 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584108284.4.0.636280091105.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: I'm iterating on all threads and getting its thread id to find out the thread state (in my use case) and then doing what you just did there... So, while this solution does work for me, if the idea is making tstate opaque, then having (an optional) thread id in settrace (which iterates to find the proper thread if given) could solve it without having to rely on any CPython internals on my side (although it should probably return a bool to say if it did work then). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:35:35 2020 From: report at bugs.python.org (paul j3) Date: Fri, 13 Mar 2020 15:35:35 +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: <1584113735.78.0.42228079651.issue39955@roundup.psfhosted.org> Change by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:38:16 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 13 Mar 2020 15:38:16 +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: <1584113896.39.0.570170364845.issue39955@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:39:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:39:16 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584113956.25.0.498900123718.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 309d7cc5df4e2bf3086c49eb2b1b56b929554500 by Victor Stinner in branch 'master': bpo-35370: Add _PyEval_SetTrace() function (GH-18975) https://github.com/python/cpython/commit/309d7cc5df4e2bf3086c49eb2b1b56b929554500 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:40:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:40:40 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584114040.31.0.511126306162.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: PyEval_SetTrace() and PyEval_SetProfile() function have no return value but can raise an exception. I'm not comfortable about these functions. Maybe one option would be to call PyErr_WriteUnraisable() on PySys_Audit() error. It might be better than "leaking" an exception which is unexpected to PyEval_SetTrace() and PyEval_SetProfile() callers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:40:35 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 13 Mar 2020 15:40:35 +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: <1584114035.65.0.436599207369.issue39955@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems to be a duplicate of issue24444 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:44:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:44:45 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584114285.61.0.00181139834785.issue35370@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18325 pull_request: https://github.com/python/cpython/pull/18977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:48:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:48:38 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584114518.95.0.177614905944.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: > PyEval_SetTrace() and PyEval_SetProfile() function have no return value but can raise an exception. I'm not comfortable about these functions. Maybe one option would be to call PyErr_WriteUnraisable() on PySys_Audit() error. It might be better than "leaking" an exception which is unexpected to PyEval_SetTrace() and PyEval_SetProfile() callers. I wrote PR 18977 to implement this idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:50:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:50:27 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584114627.25.0.49124699242.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: Fabio: I added _PyEval_SetProfile() and _PyEval_SetTrace() which take a tstate parameter. These functions have a constraint: the caller must hold the GIL. Is it an acceptable constraint for you? That's not something new, it's already the code in Python 3.8, it's just that it wasn't documented. In Python 3.7, it was less important: Python 3.8 added a call to PySys_Audit() which can execute arbitrary Python code. Anyway, touching Python internals without holding the GIL is risky: see bpo-1021318 for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:51:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 15:51:55 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584114715.83.0.00296641630993.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 38965ec5411da60d312b59be281f3510d58e0cf1 by Victor Stinner in branch 'master': bpo-39947: Hide implementation detail of trashcan macros (GH-18971) https://github.com/python/cpython/commit/38965ec5411da60d312b59be281f3510d58e0cf1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 11:55:47 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Mar 2020 15:55:47 +0000 Subject: [issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll In-Reply-To: <1583918374.95.0.227432259029.issue39930@roundup.psfhosted.org> Message-ID: <1584114947.5.0.723792045516.issue39930@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:01:21 2020 From: report at bugs.python.org (Tal Einat) Date: Fri, 13 Mar 2020 16:01:21 +0000 Subject: [issue39330] Way to build without IDLE In-Reply-To: <1579012886.09.0.695559726455.issue39330@roundup.psfhosted.org> Message-ID: <1584115281.8.0.501243130948.issue39330@roundup.psfhosted.org> Change by Tal Einat : ---------- nosy: -taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:02:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 16:02:45 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1584115365.79.0.441275601592.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: Miro Hron?ok ran rpmdiff to compare the Fedora with the old downstream patches and with the new upstream commit 8510f430781118d9b603c3a2f06945d6ebc5fe42: compare the Python package with and without setup.py changes. https://src.fedoraproject.org/rpms/python39/pull-request/31#comment-39392 In short, there is no difference. Moreover, Miro Hron?ok, Matej Cepl and me don't know the rationale of these setup.py changes. I propose to drop them and wait until someone complains. If someone complains, we would know the rationale and so have a good reason to have these setup.py changes. For readline: Fedora libreadline is already linked to libtinfo and so setup.py doesn't go up to `self.compiler.find_library_file(self.lib_dirs + ['/usr/lib/termcap'], 'termcap')` code path. This code is deadcode on Fedora. For /usr/local/lib vs /usr/local/lib64: I'm not sure why /usr/local/lib is used in the first place. Fedora installs libraries in /usr, not in /usr/local. Maybe it's there for users who install dependencies without Fedora: by installed them manually in /usr/local. Again, since it's unclear how /usr/local is supposed to be used, I prefer to leave it unchanged. I closed the PR 18917. Morevoer, if it becomes an issue in Fedora, we can start with a downstream patch again, to see how it goes, before going directly upstream. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:04:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 16:04:36 +0000 Subject: [issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1584115476.45.0.54292706687.issue1294959@roundup.psfhosted.org> STINNER Victor added the comment: I close this very old issue (15 years old!). Thank you *very much* to everybody who was involved in helping to get it fixed! If I forgot someone, comment this issue or open a new one. There is one last minor issue, but there is already a dedicated issue: bpo-24871 "freeze.py doesn't work on x86_64 Linux out of the box". ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:04:47 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Mar 2020 16:04:47 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584115487.13.1.21894091287e-06.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset d648ef10c5c7659ed3c9f34d5c751dc55e2c6007 by Charles Burkland in branch 'master': bpo-36144: Update os.environ and os.environb for PEP 584 (#18911) https://github.com/python/cpython/commit/d648ef10c5c7659ed3c9f34d5c751dc55e2c6007 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:06:08 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Mar 2020 16:06:08 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584115568.26.0.388081759972.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 6d674a1bf456945eb758e85c11484a9f1494f2b4 by Brandt Bucher in branch 'master': bpo-36144: OrderedDict Union (PEP 584) (#18967) https://github.com/python/cpython/commit/6d674a1bf456945eb758e85c11484a9f1494f2b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:08:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 16:08:24 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584115704.73.0.139190165773.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: I tested to build numpy with an opaque PyThreadState. First issue, Plex gets the current interpreter using PyThreadState.interp: /tmp/pip-install-aq60p8w2/Cython/Cython/Plex/Scanners.c:7447:73: erreur: d?r?f?rencement d'un pointeur du type incomplet ??PyThreadState?? {alias ??struct _ts??} 7447 | PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); We should add a PyThreadState_GetInterpreter(tstate) getter. faulthandler_py_enable() would use it for example. Maybe _PyInterpreterState_Get() can be used, but it's a private function. There are also _PyThreadState_UncheckedGet() and _PyGILState_GetInterpreterStateUnsafe() which are worse: don't check for NULL pointers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:14:04 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Mar 2020 16:14:04 +0000 Subject: [issue39330] Way to build without IDLE In-Reply-To: <1579012886.09.0.695559726455.issue39330@roundup.psfhosted.org> Message-ID: <1584116044.24.0.229294810018.issue39330@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:34:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 16:34:14 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584117254.3.0.21680780163.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18326 pull_request: https://github.com/python/cpython/pull/18978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:36:25 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 13 Mar 2020 16:36:25 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584117385.08.0.554469406635.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: Holding the GIL is a reasonable constraint. As a note, the original request was for a Python-level tracing function (so that in the future other Python implementations also provide that function) -- does this need a PEP? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:42:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 16:42:16 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584117736.95.0.0677796213229.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18327 pull_request: https://github.com/python/cpython/pull/18979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:47:12 2020 From: report at bugs.python.org (Zachary Ware) Date: Fri, 13 Mar 2020 16:47:12 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1584118032.26.0.328015065015.issue39952@roundup.psfhosted.org> Zachary Ware added the comment: (FTR, removing yourself from the "nosy list" means you won't get any responses to your issue, so I've added you back :)) This appears to be a problem with building Tcl/Tk. If you don't need the tkinter module, you can try adding the `--no-tkinter` flag to your `build.bat` invocation. We have an open issue to upgrade Tcl/Tk to 8.6.10 (which is more likely to support VS2019) in Python 3.9, but that is not going to be backported to 3.6, which is now in security-fix-only mode. ---------- components: +Windows nosy: +Lin, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 12:56:57 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 13 Mar 2020 16:56:57 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584118617.58.0.969767899816.issue37207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18328 pull_request: https://github.com/python/cpython/pull/18980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 13:04:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 17:04:00 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584119040.66.0.62859775785.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 by Victor Stinner in branch 'master': bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978) https://github.com/python/cpython/commit/ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 13:08:02 2020 From: report at bugs.python.org (zd nex) Date: Fri, 13 Mar 2020 17:08:02 +0000 Subject: [issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval Message-ID: <1584119282.92.0.936171127004.issue39956@roundup.psfhosted.org> New submission from zd nex : So currently if python code contains 1_1 it is handled as number 11. When user uses int("1_1") it also creates 11 and when ast.literal_eval is used it is also created instead of string. How can user get SyntaxError input on int or literal_eval with obviously wrong input (some keyboards have . next to _) like int(input()) in REPL? In python2.7 this was checked, but now even string is handled as number. Is there some reason? I understand reasoning behind PEP515, that int(1_1) can create 11, but why int("1_1") creates it also? Previously users used literal_eval for safe check of values, but now user can put 1_1 and it is transferred as number. Is there some plan to be able control behavior of these functions? I was now with some students, which used python2.7 and they find it also confusing. Most funny thing is that when they do same thing in JavaScript parseInt("1_1") they get 1, in old python this was error and now we give them 11. I would suggest that it would be possible to strictly check strings, as it was in old Python2.7. This way user would be able to use _ in code to arrange numbers, but it would also allow checks on wrong inputs of users which were meant something else, for example if you use it in try/except in console. ---------- messages: 364112 nosy: zd nex priority: normal severity: normal status: open title: Numeric Literals vs string "1_1" on input int() or float() or literal_eval type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 13:12:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 17:12:33 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584119553.15.0.641621589641.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18329 pull_request: https://github.com/python/cpython/pull/18981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 13:15:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 17:15:37 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584119737.17.0.0833816726837.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset be79373a78c0d75fc715ab64253c9b757987a848 by Victor Stinner in branch 'master': bpo-39947: Add PyInterpreterState_Get() function (GH-18979) https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 13:31:04 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 17:31:04 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1584120664.43.0.733522038798.issue26227@roundup.psfhosted.org> STINNER Victor added the comment: sock_decode_hostname() of socketmodule.c currently uses PyUnicode_DecodeFSDefault() on Windows. PyUnicode_DecodeFSDefault() uses UTF-8 by default (PEP 529). I understand that the ANSI code page should be used instead of UTF-8. Would it work to use PyUnicode_DecodeLocale(name, "surrogatepass")? It's implemented with mbstowcs(), but I don't recall which encoding it uses on Windows. Or can we use PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass")? -- I understand that setting PYTHONLEGACYWINDOWSFSENCODING environment variable to 1 should work around the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 14:17:26 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 13 Mar 2020 18:17:26 +0000 Subject: [issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval In-Reply-To: <1584119282.92.0.936171127004.issue39956@roundup.psfhosted.org> Message-ID: <1584123446.71.0.413418061681.issue39956@roundup.psfhosted.org> Raymond Hettinger added the comment: I prefer what we have now. The language is consistent across script input, int(), and literal_eval(). In my courses, I haven't encountered any issues with Python allowing "1_1". The actual problem my learners encounter is the need to strip commas from input. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 14:28:19 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Mar 2020 18:28:19 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1584124099.9.0.71305788791.issue26227@roundup.psfhosted.org> Steve Dower added the comment: I think PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass") captures the intention better, and is less likely to break in the future (apart from all the ways it's currently broken :) ) You should be right about the workaround too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 14:29:31 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Mar 2020 18:29:31 +0000 Subject: [issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval In-Reply-To: <1584119282.92.0.936171127004.issue39956@roundup.psfhosted.org> Message-ID: <1584124171.61.0.886117642667.issue39956@roundup.psfhosted.org> Serhiy Storchaka added the comment: You can validate the input before using it. if '_' in s: raise ValueError or if not re.fullmatch('[0-9]+', s): raise ValueError Do you want to accept "????" or " 12 "? If not then validate the input before using int(). Also, do not use ast.literal_eval() with untrusted input without validation. It is not a "safe eval" and may even crash the interpreter. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:24:43 2020 From: report at bugs.python.org (Jens Reidel) Date: Fri, 13 Mar 2020 19:24:43 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy Message-ID: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> New submission from Jens Reidel : Hi guys, compiling CPython from the master branch will result in a git history with the commit https://github.com/python/cpython/commit/211055176157545ce98e6c02b09d624719e6dd30 included and in Lib/inspect.py, however the return type is still like before and behaviour has not changed. Python 3.9.0a4+ (heads/master:be79373a78, Mar 11 2020, 16:36:27) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> inspect.signature(lambda x, y: None).parameters == inspect.signature(lambda y, x: None).parameters True >>> I have been able to confirm this on all builds I've done. To get it to do expected behaviour and return False on above code, I need to patch back the commit that changed OrderedDict to dict (https://raw.githubusercontent.com/Gelbpunkt/python-image/master/inspect.patch is the file I am using to patch). I have compiled against the codebase of https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848 and believe this is some issue with the Lib/inspect.py code internally if the patch file can fix it. ---------- components: Library (Lib) messages: 364118 nosy: gelbpunkt priority: normal severity: normal status: open title: bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:26:36 2020 From: report at bugs.python.org (Jens Reidel) Date: Fri, 13 Mar 2020 19:26:36 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584127596.5.0.636265619288.issue39957@roundup.psfhosted.org> Change by Jens Reidel : ---------- title: bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy -> bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:27:29 2020 From: report at bugs.python.org (Jens Reidel) Date: Fri, 13 Mar 2020 19:27:29 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584127649.34.0.992766909919.issue39957@roundup.psfhosted.org> Jens Reidel added the comment: Just to show the types are inequal: Without patch file: >>> inspect.signature(lambda x: None).parameters mappingproxy({'x': }) With patch file: >>> inspect.signature(lambda x: None).parameters mappingproxy(OrderedDict([('x', )])) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:27:43 2020 From: report at bugs.python.org (Atle Solbakken) Date: Fri, 13 Mar 2020 19:27:43 +0000 Subject: [issue39958] Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime) Message-ID: <1584127663.81.0.927144728358.issue39958@roundup.psfhosted.org> New submission from Atle Solbakken : In _PyInterpreterState_DeleteExceptMain() aqcuires lock with HEAD_LOCK(runtime). With the lock still held and if a interpreter state is to be cleared, _PyInterpreterState_Clear() is called. HEAD_LOCK(runtime) is then called again (from within Clear()), causing deadlock. Backtrace is from 3.8.2-1. Looks like this is also present in Python-3.8.2rc2 and Python-3.9.0a4. #0 futex_abstimed_wait_cancelable (private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x555555619cc0) at ../sysdeps/unix/sysv/linux/futex-internal.h:208 #1 do_futex_wait (sem=sem at entry=0x555555619cc0, abstime=0x0, clockid=0) at sem_waitcommon.c:112 #2 0x00007ffff7f08488 in __new_sem_wait_slow (sem=sem at entry=0x555555619cc0, abstime=0x0, clockid=0) at sem_waitcommon.c:184 #3 0x00007ffff7f08501 in __new_sem_wait (sem=sem at entry=0x555555619cc0) at sem_wait.c:42 #4 0x00007ffff6ee6cf3 in PyThread_acquire_lock_timed (lock=0x555555619cc0, microseconds=, intr_flag=0) at ../Python/thread_pthread.h:471 #5 0x00007ffff6ef6789 in _PyInterpreterState_Clear (interp=0x555555630310, runtime=, runtime=) at ../Python/pystate.c:261 #6 0x00007ffff6ef8018 in _PyInterpreterState_DeleteExceptMain (runtime=0x7ffff7297a80 <_PyRuntime>) at ../Python/pystate.c:380 #7 0x00007ffff6e49912 in PyOS_AfterFork_Child () at ../Modules/posixmodule.c:472 #8 0x00007ffff7f9681c in __fork_main_tstate_callback (arg=) at python3.c:626 #9 0x00007ffff7f989d1 in rrr_py_with_global_tstate_do (callback=0x7ffff7f96800 <__fork_main_tstate_callback>, arg=0x0) at python3.c:1222 #10 0x00007ffff7f8b563 in rrr_socket_with_lock_do (callback=callback at entry=0x7ffff7f98a00 <__fork_callback>, arg=arg at entry=0x0) at rrr_socket.c:169 #11 0x00007ffff7f96d07 in __rrr_py_fork_intermediate (function=function at entry=0x7ffff632a700, fork_data=fork_data at entry=0x555555639e40, child_method=child_method at entry=0x7ffff7f965f0 <__rrr_py_start_persistent_thread_rw_child>) at python3.c:653 #12 0x00007ffff7f97075 in __rrr_py_start_persistent_rw_thread_intermediate (function=function at entry=0x7ffff632a700, fork=fork at entry=0x555555639e40) at python3.c:749 #13 0x00007ffff7f972bd in __rrr_py_start_thread (result_fork=0x5555555d2dd8, rrr_objects=0x5555555d2de8, module_name=0x5555556a70e0 "testing", function_name=0x5555555fb6d0 "process", start_method=0x7ffff7f97040 <__rrr_py_start_persistent_rw_thread_intermediate>) at python3.c:855 #14 0x00007ffff65dc3a0 in ?? () #15 0x0000000000000000 in ?? () ---------- components: C API messages: 364120 nosy: Atle Solbakken priority: normal severity: normal status: open title: Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime) type: crash versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:35:52 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 13 Mar 2020 19:35:52 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584128152.29.0.94816244489.issue39957@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 15:43:03 2020 From: report at bugs.python.org (Diogo Flores) Date: Fri, 13 Mar 2020 19:43:03 +0000 Subject: [issue39959] (Possible) bug on multiprocessing.shared_memory Message-ID: <1584128583.89.0.486447704556.issue39959@roundup.psfhosted.org> New submission from Diogo Flores : Hello, I came across with what seems like a bug (or at least a disagreement with the current documentation). Discussion: I expected that after creating a numpy-array (on terminal 1), which is backed by shared memory, I would be able to use it in other terminals until I would call `shm.unlink()` (on terminal 1), at which point, the memory block would be released and no longer accessible. What happened is that after accessing the numpy-array from terminal 2, I called 'close()' on the local 'existing_shm' instance and exited the interpreter, which displayed the `warning` seen below. After, I tried to access the same shared memory block from terminal 3, and a FileNotFoundError was raised. (The same error was also raised when I tried to call 'shm.unlink()' on terminal 1, after calling 'close()' on terminal 2.) It seems that calling `close()` on an instance, destroys further access to the shared memory block from any point, while what I expected was to be able to access the array (i.e. on terminal 2), modify it, "close" my access to it, and after be able to access the modified array on i.e. terminal 3. If the error is on my side I apologize for raising this issue and I would appreciate for clarification on what I am doing wrong. Thank you. Diogo Please check below for the commands issued: ## Terminal 1 >>> from multiprocessing import shared_memory >>> import numpy as np >>> >>> a = np.array([x for x in range(10)]) >>> shm = shared_memory.SharedMemory(create=True, size=a.nbytes) >>> b = np.ndarray(a.shape, dtype=a.dtype, buffer=shm.buf) >>> b[:] = a[:] >>> >>> shm.name 'psm_592ec635' ## Terminal 2 >>> from multiprocessing import shared_memory >>> import numpy as np >>> >>> existing_shm = shared_memory.SharedMemory('psm_592ec635') >>> c = np.ndarray((10,), dtype=np.int64, buffer=existing_shm.buf) >>> >>> c array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> >>> del c >>> existing_shm.close() >>> >>> exit() ~: /usr/lib/python3.8/multiprocessing/resource_tracker.py:203: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' ## Finally, on terminal 3 >>> from multiprocessing import shared_memory >>> import numpy as np >>> >>> existing_shm = shared_memory.SharedMemory('psm_592ec635') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/multiprocessing/shared_memory.py", line 100, in __init__ self._fd = _posixshmem.shm_open( FileNotFoundError: [Errno 2] No such file or directory: '/psm_592ec635' ---------- components: Library (Lib) messages: 364121 nosy: dxflores priority: normal severity: normal status: open title: (Possible) bug on multiprocessing.shared_memory versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 18:01:17 2020 From: report at bugs.python.org (Atle Solbakken) Date: Fri, 13 Mar 2020 22:01:17 +0000 Subject: [issue39958] Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime) In-Reply-To: <1584127663.81.0.927144728358.issue39958@roundup.psfhosted.org> Message-ID: <1584136877.73.0.623181421525.issue39958@roundup.psfhosted.org> Atle Solbakken added the comment: By "manually" clearing/deleting any interpreter states from non-main thread states prior to running (PyOS_AfterForkChild()), the deadlock does not occur. // With tstate_orig being a PyThreadState which is not main: PyInterpreterState *istate = tstate_orig->interp; PyInterpreterState_Clear(istate); PyInterpreterState_Delete(istate); // Then run PyOS_AfterFork_Child(); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 18:31:04 2020 From: report at bugs.python.org (Matthias Braun) Date: Fri, 13 Mar 2020 22:31:04 +0000 Subject: [issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?) Message-ID: <1584138664.49.0.0727456636956.issue39960@roundup.psfhosted.org> New submission from Matthias Braun : This is about an extension type created via `PyType_FromSpec` that overrides `tp_setattro` (minimal example attached). In this case cpython does not let me grab and use the `__setattr__` function "manually". Example: ``` >>> import demo >>> mytype_setattr = demo.MyType.__setattr__ >>> i = demo.MyType() >>> mytype_setattr(i, "foo", "bar") Traceback (most recent call last): File "", line 1, in TypeError: can't apply this __setattr__ to object object ``` I suspect this is related to the loop at the beginning of typeobject.c / hackcheck() that skips over types with Py_TPFLAGS_HEAPOBJECT. (Though removing the loop breaks things like the enum module). ---------- components: C API files: demomodule.zip messages: 364123 nosy: Matthias Braun priority: normal severity: normal status: open title: Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?) versions: Python 3.7 Added file: https://bugs.python.org/file48974/demomodule.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 18:32:19 2020 From: report at bugs.python.org (szb512) Date: Fri, 13 Mar 2020 22:32:19 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584138739.41.0.849456386885.issue39107@roundup.psfhosted.org> Change by szb512 : ---------- keywords: +patch nosy: +sdcards nosy_count: 9.0 -> 10.0 pull_requests: +18330 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 18:38:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Mar 2020 22:38:11 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584139091.79.0.626230639817.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 by Victor Stinner in branch 'master': bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981) https://github.com/python/cpython/commit/8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:09:18 2020 From: report at bugs.python.org (Clem Wang) Date: Fri, 13 Mar 2020 23:09:18 +0000 Subject: [issue39961] warning: this use of "defined" may not be portable (Mac OS) Message-ID: <1584140958.39.0.802157581006.issue39961@roundup.psfhosted.org> New submission from Clem Wang : pyenv install 3.8.2 results in: BUILD FAILED (OS X 10.15.3 using python-build 20180424) Inspect or clean up the working tree at /var/folders/jy/10md97xn3mz_x_b42l1r2r8c0000gp/T/python-build.20200313154805.37448 Results logged to /var/folders/jy/10md97xn3mz_x_b42l1r2r8c0000gp/T/python-build.20200313154805.37448.log Last 10 log lines: 331 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:331:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] 540 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] cc1: some warnings being treated as errors make: *** [Objects/floatobject.o] Error 1 make: *** Waiting for unfinished jobs.... The real problem is on line 199 of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h /* */ #define _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT \ defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1)) I'm not sure if this is a problem for Apple to fix or whether the Python build needs to be more tolerant of warnings. ---------- components: macOS messages: 364125 nosy: clem.wang, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: warning: this use of "defined" may not be portable (Mac OS) type: compile error versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:11:32 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 13 Mar 2020 23:11:32 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different In-Reply-To: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> Message-ID: <1584141092.27.0.0540878471035.issue39891@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +18331 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:39:01 2020 From: report at bugs.python.org (Cezary Wagner) Date: Fri, 13 Mar 2020 23:39:01 +0000 Subject: [issue39962] Wrong tell function results. Message-ID: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> New submission from Cezary Wagner : I wrote code which scan very large file PGN (chess games database). But I found that tell() function is buggy see results. Here is some code: with open('../s01_parser_eval/data/out-6976.txt') as pgn: is_game_parsed = parser.parse_game(visitor=visitor) # if processing_statistics.games % 100 == 0: print(processing_statistics.games, processing_statistics.positions, processing_statistics.moves, '%.2f' % processing_statistics.get_games_to_moves(), '%.2f' % processing_statistics.get_positions_to_moves(), '%.2f' % speed if speed else speed, pgn.tell()) print(pgn.tell()) This code can be simplified to this: with open('../s01_parser_eval/data/out-6976.txt') as pgn: while True: pgn.readline() print(pgn.tell()) 1 1 0 0.00 0.00 318.64 1008917597 1008917597 2 47 46 23.00 1.02 343.64 1008917599 1008917599 3 47 46 15.33 1.02 291.08 1008920549 1008920549 4 107 107 26.75 1.00 292.03 1008920551 1008920551 5 107 107 21.40 1.00 185.41 18446744074718477807 <- ??? 18446744074718477807 6 234 235 39.17 1.00 157.63 1008926192 1008926192 7 234 235 33.57 1.00 167.75 1008928371 1008928371 8 276 278 34.75 0.99 180.48 1008928373 1008928373 9 276 278 30.89 0.99 185.30 1008931145 1008931145 10 334 336 33.60 0.99 192.58 1008931147 1008931147 11 334 336 30.55 0.99 164.90 1008937220 1008937220 12 468 472 39.33 0.99 149.00 1008937222 1008937222 13 468 472 36.31 0.99 157.58 1008938833 1008938833 14 495 502 35.86 0.99 165.96 1008938835 1008938835 15 495 502 33.47 0.99 167.89 1008941875 1008941875 16 556 567 35.44 0.98 172.10 1008941877 1008941877 17 556 567 33.35 0.98 177.84 1008943769 1008943769 18 591 604 33.56 0.98 184.09 1008943771 1008943771 19 591 604 31.79 0.98 185.38 1008946692 1008946692 20 653 666 33.30 0.98 188.68 1008946694 1008946694 21 653 666 31.71 0.98 192.90 18446744074718500485 <- ??? 18446744074718500485 ---------- messages: 364126 nosy: Cezary.Wagner priority: normal severity: normal status: open title: Wrong tell function results. type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:44:08 2020 From: report at bugs.python.org (Cezary Wagner) Date: Fri, 13 Mar 2020 23:44:08 +0000 Subject: [issue39962] Wrong tell function results. In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584143048.77.0.690196854266.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: Some good snippet for testing very short. with open('../s01_parser_eval/data/out-6976.txt') as pgn: pgn.seek(1008915299) while True: pgn.readline() print(pgn.tell()) 1008915327 1008915366 1008915387 1008915409 1008915425 1008915449 1008915471 1008915490 1008915509 1008915534 1008915559 1008915572 1008915631 1008915654 1008915678 1008915680 1008917597 1008917599 1008917631 1008917670 1008917696 1008917718 1008917734 1008917758 1008917780 1008917799 1008917818 1008917843 1008917868 1008917881 1008917942 1008917965 1008917989 1008917991 1008920549 1008920551 1008920583 1008920622 1008920643 1008920663 1008920679 1008920703 1008920725 1008920744 1008920763 1008920788 1008920813 1008920826 1008920877 1008920900 1008920924 1008920926 18446744074718477807 <- ??? 1008926192 1008926220 1008926259 1008926276 1008926304 1008926320 1008926344 1008926366 1008926385 1008926404 1008926428 1008926452 1008926465 1008926521 1008926544 1008926568 1008926570 1008928371 1008928373 1008928401 1008928440 1008928460 1008928491 1008928507 1008928531 1008928553 1008928572 1008928591 1008928615 1008928640 1008928653 1008928690 1008928713 1008928737 1008928739 1008931145 1008931147 1008931175 1008931214 1008931233 1008931253 1008931269 1008931293 1008931315 1008931334 1008931353 1008931377 1008931401 1008931414 1008931463 1008931486 1008931516 1008931518 1008937220 1008937222 1008937254 1008937293 1008937315 1008937340 1008937356 1008937380 1008937402 1008937421 1008937440 1008937465 1008937490 1008937503 1008937536 1008937559 18446744074718489200 <- ??? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:49:42 2020 From: report at bugs.python.org (Cezary Wagner) Date: Fri, 13 Mar 2020 23:49:42 +0000 Subject: [issue39962] Wrong tell function results (Windows 10/Python 64 3.8.2) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584143382.05.0.684031441841.issue39962@roundup.psfhosted.org> Change by Cezary Wagner : ---------- title: Wrong tell function results. -> Wrong tell function results (Windows 10/Python 64 3.8.2) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:58:47 2020 From: report at bugs.python.org (Cezary Wagner) Date: Fri, 13 Mar 2020 23:58:47 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy2.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584143927.63.0.310875200968.issue39962@roundup.psfhosted.org> Change by Cezary Wagner : ---------- title: Wrong tell function results (Windows 10/Python 64 3.8.2) -> Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy2.6/Python2.7) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 19:59:47 2020 From: report at bugs.python.org (Cezary Wagner) Date: Fri, 13 Mar 2020 23:59:47 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584143987.13.0.696639836918.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: I do some test and bu exist in 3.8/3.7 but not in no bug in PyPy3.6/Python2.7. ---------- title: Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy2.6/Python2.7) -> Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:00:44 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 00:00:44 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584144044.37.0.0552375290691.issue39962@roundup.psfhosted.org> Change by Cezary Wagner : ---------- components: +IO, Interpreter Core, Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:02:31 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 14 Mar 2020 00:02:31 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584144151.13.0.000712723572792.issue39962@roundup.psfhosted.org> Eric V. Smith added the comment: tell() is opaque when opening a text file: you can't interpret the output, its only use is for input to seek(). >From the docs https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects: "f.tell() returns an integer giving the file object?s current position in the file represented as number of bytes from the beginning of the file when in binary mode and an opaque number when in text mode." Does the value returned from tell() not work in seek()? That would be the only bug here. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:13:24 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 00:13:24 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584144804.51.0.226815671907.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: Let's test it now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:19:25 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 14 Mar 2020 00:19:25 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584145165.83.0.990584579942.issue39962@roundup.psfhosted.org> Tim Peters added the comment: This is very well known on Windows, and the behavior is inherited from the Windows C libraries. If you need a byte count instead, then - as the docs already say - you need to open the file in binary mode instead. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:32:32 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 00:32:32 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584145952.09.0.723925021354.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: Really really strange but it works :) "an opaque number when in text mode." -> so it is Windows C libraries. I use it in production code too so my heart speed up when I see number but it works as you said. It looks complicated/slow if I have to open file in binary mode. I can do it but it is ugly workaround to get position? It looks some decide that speed is better than functionality so binary files is only option to get for example estimate progress in some speedometer. I think that should some function to convert this .tell() for text files into real .tell(). with open('../s01_parser_eval/data/out-6976.txt') as pgn: pgn.seek(1008915299) t = None while True: if t: pgn.seek(t) pgn.readline() pt = t t = pgn.tell() if pt: if pt > t: print('Strange %s!', t) pgn.seek(t) print(pgn.tell()) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 20:34:10 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 00:34:10 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584146050.8.0.275298984424.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: Thank you for very good explanation. It was hard to understand. I am programming a lot (++10 years) in many language but I still learning new things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 21:02:34 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 14 Mar 2020 01:02:34 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584147754.84.0.0585319591472.issue39962@roundup.psfhosted.org> Tim Peters added the comment: Sorry, but there is no documented relationship between byte offsets and tell() results for text-mode files in Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/ftell-ftelli64?view=vs-2019 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 21:33:39 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 01:33:39 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584149619.08.0.316817549363.issue39957@roundup.psfhosted.org> Inada Naoki added the comment: Would you create a pull request? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 22:13:13 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Sat, 14 Mar 2020 02:13:13 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584151993.35.0.382684188296.issue39954@roundup.psfhosted.org> Kubilay Kocak added the comment: Updated FreeBSD CURRENT base, which removed libncurses. The bash port installation needed to be rebuilt. @Victor Can tests be skipped on the basis of required dependencies failing to load/run? ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 22:17:10 2020 From: report at bugs.python.org (Eryk Sun) Date: Sat, 14 Mar 2020 02:17:10 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584152230.56.0.867237055995.issue39962@roundup.psfhosted.org> Eryk Sun added the comment: > Sorry, but there is no documented relationship between byte > offsets and tell() results for text-mode files in Windows: The I/O stack in Python 3 does not use C FILE streams, and this issue is not related to Windows. TextIOWrapper.tell returns a "cookie" based on the decoder state: https://github.com/python/cpython/blob/3.8/Modules/_io/textio.c#L2589 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 22:22:40 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 14 Mar 2020 02:22:40 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584152560.0.0.00525234162989.issue39962@roundup.psfhosted.org> Tim Peters added the comment: Good to know, Eryk - thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 23:25:33 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Mar 2020 03:25:33 +0000 Subject: [issue39883] Use BSD0 license for code in docs In-Reply-To: <1583553057.27.0.724137569708.issue39883@roundup.psfhosted.org> Message-ID: <1584156333.48.0.779278415691.issue39883@roundup.psfhosted.org> Terry J. Reedy added the comment: What is the complication? The Python license is already rather permissive. Anyway, there is a name at mail.python.org address for trademark issues, listed on the site, and it might be appropriate for license legal questions also. Or this might be a question for discuss.python.org. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 23:36:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Mar 2020 03:36:06 +0000 Subject: [issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5 In-Reply-To: <1584049452.89.0.509835184184.issue39948@roundup.psfhosted.org> Message-ID: <1584156966.49.0.0232229788357.issue39948@roundup.psfhosted.org> Terry J. Reedy added the comment: For current releases, which only provide 64-bit binaries, 10.9 is the lated supported version. See https://www.python.org/downloads/release/python-377/ for example. I believe this should be closed. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 23:43:26 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 03:43:26 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584157406.03.0.253540991157.issue39087@roundup.psfhosted.org> Inada Naoki added the comment: New changeset c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b by Inada Naoki in branch 'master': bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659) https://github.com/python/cpython/commit/c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 13 23:45:35 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 03:45:35 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584157535.24.0.250312085145.issue39087@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +18332 pull_request: https://github.com/python/cpython/pull/18984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 00:24:17 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 04:24:17 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584159857.5.0.970990757709.issue39087@roundup.psfhosted.org> Inada Naoki added the comment: I'm sorry about merging PR 18327, but I can not find enough usage example of the _PyUnicode_GetUTF8Buffer. PyUnicode_AsUTF8AndSize is optimized, and utf8_cache is not so bad in most case. So _PyUnicode_GetUTF8Buffer seems not worth enough. I will revert PR 18327. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 00:27:50 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 04:27:50 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584160070.35.0.515693852231.issue39087@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +18333 pull_request: https://github.com/python/cpython/pull/18985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 01:35:00 2020 From: report at bugs.python.org (Mario de OOurtzborun) Date: Sat, 14 Mar 2020 05:35:00 +0000 Subject: [issue39963] Subclassing slice objects Message-ID: <1584164100.31.0.19477580242.issue39963@roundup.psfhosted.org> New submission from Mario de OOurtzborun : Is there any reason why slice objects aren't subclassable? I want a mutable slice object, but there is no way to create one that will work with lists or tuples. And __index__ method requires to return int. I want to prepare a git merge request about this issue if there is no specific reason to forbid them becoming a base class. ---------- messages: 364143 nosy: mariode1 priority: normal severity: normal status: open title: Subclassing slice objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 01:43:48 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 14 Mar 2020 05:43:48 +0000 Subject: [issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different In-Reply-To: <1583623675.84.0.678348320324.issue39891@roundup.psfhosted.org> Message-ID: <1584164628.22.0.0458237307423.issue39891@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 01:45:17 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 14 Mar 2020 05:45:17 +0000 Subject: [issue39959] (Possible) bug on multiprocessing.shared_memory In-Reply-To: <1584128583.89.0.486447704556.issue39959@roundup.psfhosted.org> Message-ID: <1584164717.09.0.520376043955.issue39959@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 01:50:29 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 14 Mar 2020 05:50:29 +0000 Subject: [issue39937] Suggest the usage of Element.iter() instead of iter() in whatsnew In-Reply-To: <1583949098.86.0.806272470528.issue39937@roundup.psfhosted.org> Message-ID: <1584165029.92.0.458492790152.issue39937@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 7a5cbc72988aee668816be9d1ef44c0cb4081ff6 by Rahul Kumaresan in branch 'master': bpo-39937: Improve suggestions for removal of getchildren and getiterator in changelog (GH-18937) https://github.com/python/cpython/commit/7a5cbc72988aee668816be9d1ef44c0cb4081ff6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 01:51:53 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 14 Mar 2020 05:51:53 +0000 Subject: [issue39937] Suggest the usage of Element.iter() instead of iter() in whatsnew In-Reply-To: <1583949098.86.0.806272470528.issue39937@roundup.psfhosted.org> Message-ID: <1584165113.26.0.0210664019021.issue39937@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 02:10:09 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Mar 2020 06:10:09 +0000 Subject: [issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5 In-Reply-To: <1584049452.89.0.509835184184.issue39948@roundup.psfhosted.org> Message-ID: <1584166209.34.0.472250064132.issue39948@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. Feel free to submit a PR or patch. I can?t guarantee we will accept it if it?s too intrusive. (The request here is to fix building from source for these older systems not to provide binary releases.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 02:59:31 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 06:59:31 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584169171.78.0.208997364453.issue39087@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 3a8c56295d6272ad2177d2de8af4c3f824f3ef92 by Inada Naoki in branch 'master': Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer()" (GH-18985) https://github.com/python/cpython/commit/3a8c56295d6272ad2177d2de8af4c3f824f3ef92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 02:59:47 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 14 Mar 2020 06:59:47 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584169187.62.0.71893120313.issue39087@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 03:04:38 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 14 Mar 2020 07:04:38 +0000 Subject: [issue39963] Subclassing slice objects In-Reply-To: <1584164100.31.0.19477580242.issue39963@roundup.psfhosted.org> Message-ID: <1584169478.46.0.26081741338.issue39963@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 03:13:01 2020 From: report at bugs.python.org (Chris Withers) Date: Sat, 14 Mar 2020 07:13:01 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1584169981.09.0.443378835349.issue39915@roundup.psfhosted.org> Chris Withers added the comment: New changeset f6bdac1bf718eab0cc5b6554f363f21252d245ce by Miss Islington (bot) in branch '3.8': bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18927) https://github.com/python/cpython/commit/f6bdac1bf718eab0cc5b6554f363f21252d245ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 03:17:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 14 Mar 2020 07:17:26 +0000 Subject: [issue39915] await_args_list in AsyncMock always refers to the last awaited call object In-Reply-To: <1583771348.56.0.120635292587.issue39915@roundup.psfhosted.org> Message-ID: <1584170246.33.0.487581016415.issue39915@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks Mads Sejersen for the report. Closing this as fixed as it's merged to 3.9 and 3.8. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 04:26:35 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 14 Mar 2020 08:26:35 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584174395.79.0.208824545104.issue37207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18334 pull_request: https://github.com/python/cpython/pull/18986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 05:52:23 2020 From: report at bugs.python.org (Jens Reidel) Date: Sat, 14 Mar 2020 09:52:23 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584179543.16.0.796361756372.issue39957@roundup.psfhosted.org> Change by Jens Reidel : ---------- keywords: +patch pull_requests: +18335 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 06:41:48 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 10:41:48 +0000 Subject: [issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval In-Reply-To: <1584119282.92.0.936171127004.issue39956@roundup.psfhosted.org> Message-ID: <1584182508.44.0.199875780989.issue39956@roundup.psfhosted.org> Mark Dickinson added the comment: [Raymond] > I prefer what we have now. The language is consistent [...] Agreed. I don't see value in having two different sets of rules, one for numeric literals and one for explicit str-to-int conversions. And if we *were* to adopt a different set of rules for str-to-int conversions, what would those rules be? There are a lot of fairly arbitrary choices to make (whitespace before/after/between sign and digits, digit sets, leading zeros, characters permitted as signs, permissible digit separators). The decision would be easier if there were a widespread standard that could help us choose a particular ruleset, but I'm not aware of any such standard. Much cleaner and simpler to have the rules for str-to-int match those for numeric literal parsing. (And similarly for floats.) [zd nex] > I would suggest that it would be possible to strictly check strings [...] As Serhiy pointed out, it already is possible, in a variety of ways. If you're arguing for something like `int("+123", strict=True)`, you'd need to say exactly what "strict=True" should mean, make a case that your particular choice is sufficiently standard and useful to others to make it worth adding to core Python, consider how it would interact with the "base" argument, and a whole lot more. If you want to take that forward, I think that's something you'd need to bring up on the python-ideas mailing list for further discussion. I'll close here. ---------- nosy: +mark.dickinson resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 06:45:40 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 10:45:40 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584182740.39.0.871472151372.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 5208b4b37953a406db0ed6a9db545c2948dde989 by Zackery Spytz in branch 'master': bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) https://github.com/python/cpython/commit/5208b4b37953a406db0ed6a9db545c2948dde989 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:00:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 11:00:07 +0000 Subject: [issue39087] [C API] No efficient C API to get UTF-8 string from unicode object. In-Reply-To: <1576671015.48.0.740860223179.issue39087@roundup.psfhosted.org> Message-ID: <1584183607.23.0.369383379045.issue39087@roundup.psfhosted.org> Serhiy Storchaka added the comment: I though there are at least 3-4 use cases in the core and stdlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:05:47 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 11:05:47 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584183947.83.0.576156719127.issue39871@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +18336 pull_request: https://github.com/python/cpython/pull/18989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:30:41 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 11:30:41 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584185441.95.0.65540653044.issue39871@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +18337 pull_request: https://github.com/python/cpython/pull/18990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:38:55 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 11:38:55 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584185935.98.0.812481502749.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset e634a8ac1f8a2904a2241b83fc5e4c9f40d5c7ca by Mark Dickinson in branch '3.8': [3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18989) https://github.com/python/cpython/commit/e634a8ac1f8a2904a2241b83fc5e4c9f40d5c7ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:46:38 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 11:46:38 +0000 Subject: [issue39615] cpython/abstract.h not compatible with C90 In-Reply-To: <1581508507.12.0.731337298421.issue39615@roundup.psfhosted.org> Message-ID: <1584186398.36.0.725772750235.issue39615@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think we should distinguish minimal supported C standard for compiling CPython itself and for compiling extensions. We can use all C99 features supported by main compilers in the code of CPython, but C99 is not even compatible with C++, and it may be not compatible with extensions written in other languages (D, Rust, Go, etc), so I think we should use more restricted version in headers. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:51:56 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 11:51:56 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584186716.83.0.814787385619.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 4dcfe5f2e4bad8e03990de75d8d4ec20e8aa23b3 by Mark Dickinson in branch '3.7': [3.7] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18990) https://github.com/python/cpython/commit/4dcfe5f2e4bad8e03990de75d8d4ec20e8aa23b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 07:53:04 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 14 Mar 2020 11:53:04 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1584186784.11.0.992147125858.issue39871@roundup.psfhosted.org> Mark Dickinson added the comment: Zackery: Thanks for the fix! Now merged and backported to 3.8 and 3.7. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 08:03:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 12:03:16 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584187396.85.0.531396841944.issue24916@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is the problem with the current code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 08:48:10 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 12:48:10 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584190090.96.0.108214467484.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: > The I/O stack in Python 3 does not use C FILE streams, and this issue is not related to Windows. TextIOWrapper.tell returns a "cookie" based on the decoder state: That can big problem when I use serialization if f.tell() is "cookie". When I serialize it and run program again f.seek() will not works. I will test it but I think that can be big problem since this behavior is very unclear and non standard (comparing to C++/C#/Java ...). Maybe it should some method to get right position not "opaque position". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 08:59:34 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 12:59:34 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584190774.4.0.97071853955.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: I tested is and it is not "state cookie" but it is "absolute position" and it is "stateless". > The I/O stack in Python 3 does not use C FILE streams, and this issue is not related to Windows. TextIOWrapper.tell returns a "cookie" based on the decoder state: I will study: https://github.com/python/cpython/blob/3.8/Modules/_io/textio.c#L2589 - Thank you for reference. See this test code (wrong seek is good - decoder has not state before - first line of program). You can swap this two fragments and it still works. print('seek 18446744073709554618') with open('../s01_parser_eval/data/out-6976.txt') as pgn: pgn.seek(18446744073709554618) while pgn.tell() != 3003: pgn.readline() print(pgn.tell()) print() print('seek 0') with open('../s01_parser_eval/data/out-6976.txt') as pgn: pgn.seek(0) while pgn.tell() != 18446744073709554618: pgn.readline() print(pgn.tell()) pgn.readline() print('next', pgn.tell()) print('seek 18446744073709554618') with open('../s01_parser_eval/data/out-6976.txt') as pgn: pgn.seek(18446744073709554618) while pgn.tell() != 3003: pgn.readline() print(pgn.tell())) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:00:35 2020 From: report at bugs.python.org (Cezary Wagner) Date: Sat, 14 Mar 2020 13:00:35 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584190835.91.0.583193989544.issue39962@roundup.psfhosted.org> Cezary Wagner added the comment: C:\root\Python\Python38\python.exe "C:/Users/Cezary Wagner/PycharmProjects/chess-lichess-eval-parse/sandbox/s03_create_tree/s03_python_bug.py" seek 18446744073709554618 3003 seek 0 75 114 145 165 181 205 227 246 265 290 315 328 365 387 411 413 18446744073709554618 next 3003 seek 18446744073709554618 3003 Process finished with exit code 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:27:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 13:27:41 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584192461.75.0.556309901902.issue38938@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a large change. And making heaqq.merge a class looks unrelated to the declared goal. I afraid it may add significant overhead. Since this is an optimization, could you please provide any benchmarks which we can use to check the performance boost? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:41:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 13:41:01 +0000 Subject: [issue39585] Delete a pending item in _warning.c In-Reply-To: <1581172060.12.0.48939566603.issue39585@roundup.psfhosted.org> Message-ID: <1584193261.53.0.0701655915273.issue39585@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 57c781048915e45d15eaa348c51ec01b12cc170a by Hai Shi in branch 'master': bpo-39585: Delete a pending comment in _warning.c (GH-18414) https://github.com/python/cpython/commit/57c781048915e45d15eaa348c51ec01b12cc170a ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:42:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 13:42:16 +0000 Subject: [issue39585] Delete a pending item in _warning.c In-Reply-To: <1581172060.12.0.48939566603.issue39585@roundup.psfhosted.org> Message-ID: <1584193336.08.0.191784852425.issue39585@roundup.psfhosted.org> Serhiy Storchaka added the comment: The C code is equivalent to the Python code. No special handling is needed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:48:52 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 14 Mar 2020 13:48:52 +0000 Subject: [issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7) In-Reply-To: <1584142741.89.0.229638402821.issue39962@roundup.psfhosted.org> Message-ID: <1584193732.34.0.661542481019.issue39962@roundup.psfhosted.org> Eric V. Smith added the comment: > That can big problem when I use serialization if f.tell() is "cookie". I'm sorry, but that's the way it is with text files. You'll need to find some other way to accomplish what you're trying to achieve. Since this isn't a bug, I'm closing this issue. You might want to try stackoverflow or python-list if you'd like some additional help. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:48:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 13:48:59 +0000 Subject: [issue39582] ossaudiodev update helpers signature Message-ID: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> New submission from Serhiy Storchaka : New changeset b81f40f0adae3b1d1e57f9a89940ba827b9ede70 by David CARLIER in branch 'master': bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412) https://github.com/python/cpython/commit/b81f40f0adae3b1d1e57f9a89940ba827b9ede70 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:49:12 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 13:49:12 +0000 Subject: [issue39582] ossaudiodev update helpers signature In-Reply-To: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> Message-ID: <1584193752.1.0.489713607611.issue39582@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18338 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 09:49:18 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 13:49:18 +0000 Subject: [issue39582] ossaudiodev update helpers signature In-Reply-To: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> Message-ID: <1584193758.6.0.502518855668.issue39582@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18339 pull_request: https://github.com/python/cpython/pull/18992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:05:06 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:05:06 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584194706.93.0.657121965546.issue39509@roundup.psfhosted.org> Serhiy Storchaka added the comment: RFC 8297 RFC 8470 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:05:48 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:05:48 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584194748.06.0.234822705467.issue39509@roundup.psfhosted.org> Serhiy Storchaka added the comment: RFC8297 RFC8470 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:07:15 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:07:15 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584194835.71.0.442368986099.issue39509@roundup.psfhosted.org> Serhiy Storchaka added the comment: RFC 8297: https://tools.ietf.org/html/rfc8297 RFC 8470: https://tools.ietf.org/html/rfc8470 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:07:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:07:44 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584194864.89.0.843496285149.issue39509@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg364165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:07:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:07:41 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584194861.41.0.099946587871.issue39509@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg364166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:12:04 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:12:04 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584195124.5.0.0838143618278.issue39509@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset da52be47690da0d9f78d0dce9ee5c3e4dbef49e1 by Dong-hee Na in branch 'master': bpo-39509: Update HTTP status code to follow IANA (GH-18294) https://github.com/python/cpython/commit/da52be47690da0d9f78d0dce9ee5c3e4dbef49e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:12:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:12:57 +0000 Subject: [issue39509] Update HTTP status code to follow IANA In-Reply-To: <1580482249.3.0.655297807601.issue39509@roundup.psfhosted.org> Message-ID: <1584195177.48.0.0360501512478.issue39509@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 Mar 14 10:24:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:24:10 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584195850.45.0.805683538739.issue39677@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6672c16b1d7f83789bf3a2016bd19edfd3568e71 by Taine Zhao in branch 'master': bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550) https://github.com/python/cpython/commit/6672c16b1d7f83789bf3a2016bd19edfd3568e71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:24:18 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:24:18 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584195858.1.0.546090935402.issue39677@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18340 pull_request: https://github.com/python/cpython/pull/18993 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:24:24 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:24:24 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584195864.33.0.977510906598.issue39677@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18341 pull_request: https://github.com/python/cpython/pull/18994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:33:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 14 Mar 2020 14:33:52 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584196432.12.0.142673820903.issue39954@roundup.psfhosted.org> STINNER Victor added the comment: > @Victor Can tests be skipped on the basis of required dependencies failing to load/run? No idea how to detect such issue. For me, such installation issue is uncommon and it's easier to fix your system rather than trying to skip the test. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:43:50 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:43:50 +0000 Subject: [issue39582] ossaudiodev update helpers signature In-Reply-To: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> Message-ID: <1584197030.71.0.566320210083.issue39582@roundup.psfhosted.org> miss-islington added the comment: New changeset 148786a2cd56f71a87bdcf4dd4e5c4ca00f3630e by Miss Islington (bot) in branch '3.7': bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412) https://github.com/python/cpython/commit/148786a2cd56f71a87bdcf4dd4e5c4ca00f3630e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:43:56 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:43:56 +0000 Subject: [issue39582] ossaudiodev update helpers signature In-Reply-To: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> Message-ID: <1584197036.55.0.28699587021.issue39582@roundup.psfhosted.org> miss-islington added the comment: New changeset 9644702936a5758b99bd951446a5b0ef05ec022a by Miss Islington (bot) in branch '3.8': bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412) https://github.com/python/cpython/commit/9644702936a5758b99bd951446a5b0ef05ec022a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:45:14 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:45:14 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584197114.47.0.876713948123.issue39677@roundup.psfhosted.org> miss-islington added the comment: New changeset 725cbce25084a67ad7ff48b75cca3e240ef57606 by Miss Islington (bot) in branch '3.7': bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550) https://github.com/python/cpython/commit/725cbce25084a67ad7ff48b75cca3e240ef57606 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:45:27 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 14:45:27 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584197127.17.0.0473897484609.issue39677@roundup.psfhosted.org> miss-islington added the comment: New changeset a927e91186727b5184d774d1d99c70b9ff5497f5 by Miss Islington (bot) in branch '3.8': bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550) https://github.com/python/cpython/commit/a927e91186727b5184d774d1d99c70b9ff5497f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:45:25 2020 From: report at bugs.python.org (hai shi) Date: Sat, 14 Mar 2020 14:45:25 +0000 Subject: [issue39585] Delete a pending item in _warning.c In-Reply-To: <1581172060.12.0.48939566603.issue39585@roundup.psfhosted.org> Message-ID: <1584197125.71.0.396564044003.issue39585@roundup.psfhosted.org> hai shi added the comment: Thanks, serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:54:12 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sat, 14 Mar 2020 14:54:12 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584197652.9.0.519240472438.issue38576@roundup.psfhosted.org> Change by Ashwin Ramaswami : ---------- keywords: +patch nosy: +epicfaace nosy_count: 10.0 -> 11.0 pull_requests: +18342 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:55:45 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:55:45 +0000 Subject: [issue39677] 3.6+ documentation for MAKE_FUNCTION In-Reply-To: <1582032052.37.0.86110712101.issue39677@roundup.psfhosted.org> Message-ID: <1584197745.59.0.930811727527.issue39677@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry for the delay with review and thank you for your contribution. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:57:40 2020 From: report at bugs.python.org (Thomas Krennwallner) Date: Sat, 14 Mar 2020 14:57:40 +0000 Subject: [issue38891] ShareableList read and write access is O(N), should be O(1) In-Reply-To: <1574389874.92.0.425732905902.issue38891@roundup.psfhosted.org> Message-ID: <1584197860.8.0.407255138046.issue38891@roundup.psfhosted.org> Change by Thomas Krennwallner : ---------- keywords: +patch nosy: +tkren nosy_count: 3.0 -> 4.0 pull_requests: +18343 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:58:19 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 14:58:19 +0000 Subject: [issue39582] ossaudiodev update helpers signature In-Reply-To: <1584193739.68.0.870734384701.issue39582@roundup.psfhosted.org> Message-ID: <1584197899.53.0.850169696038.issue39582@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am not sure that it fixes a real bug, I did not check it on different platforms, but just for the case I backported it to 3.7 and 3.8. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 10:59:40 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sat, 14 Mar 2020 14:59:40 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584197980.23.0.0221821002834.issue38744@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: Bisecting led to this commit and reverting it on 3.8 branch makes the hang go away. 7c994549dcffd0d9d3bb37475e6374f356e7240e is the first bad commit commit 7c994549dcffd0d9d3bb37475e6374f356e7240e Author: Pablo Galindo Date: Sat Mar 16 22:34:24 2019 +0000 bpo-35493: Use Process.sentinel instead of sleeping for polling worker status in multiprocessing.Pool (#11488) * bpo-35493: Use Process.sentinel instead of sleeping for polling worker status in multiprocessing.Pool * Use self-pipe pattern to avoid polling for changes * Refactor some variable names and add comments * Restore timeout and poll * Use reader object only on wait() * Recompute worker sentinels every time * Remove timeout and use change notifier * Refactor some methods to be overloaded by the ThreadPool, document the cache class and fix typos Lib/multiprocessing/pool.py | 88 +++++++++++++++++++--- .../2019-01-09-23-43-08.bpo-35493.kEcRGE.rst | 3 + 2 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2019-01-09-23-43-08.bpo-35493.kEcRGE.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:01:39 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sat, 14 Mar 2020 15:01:39 +0000 Subject: [issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit In-Reply-To: <1544786874.12.0.788709270274.issue35493@psf.upfronthosting.co.za> Message-ID: <1584198099.73.0.010281853918.issue35493@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: And also https://bugs.python.org/issue38744 on Linux and FreeBSD ---------- nosy: +arekm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:02:55 2020 From: report at bugs.python.org (hai shi) Date: Sat, 14 Mar 2020 15:02:55 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584198175.54.0.0448183732491.issue39337@roundup.psfhosted.org> hai shi added the comment: > How about calling `encodings.normalize_encoding() in codecs.normalizestring()` to keep same behavior?(I create PR18845) I have try this idea, but it make the testcase of test_io.py failed because some object will call `codecs.Lookup()` in `__del__()`.-->extension module will be cleaned before calling `__del__().` > I would prefer that codecs.lookup() and encodings.normalize_encoding() behave the same. Either always ignore or always copy. I try to add a `_Py_normalize_unicode_encoding()` in unicodeobject.c to support non-ASCII encoding names' normalization(PR18987), but this PR caused many testcases failed. For example: In master: python3.9 -c "print('a\xac\u1234\u20ac\u8000\U0010ffff'.encode('iso-8859-15', 'namereplace'))" result: b'a\xac\\N{ETHIOPIC SYLLABLE SEE}\xa4\\N{CJK UNIFIED IDEOGRAPH-8000}\\U0010ffff' after PR18987: ./python -c "print('a\xac\u1234\u20ac\u8000\U0010ffff'.encode('iso-8859-15', 'namereplace'))" result: b'a\xac\\N{ETHIOPIC SYLLABLE SEE}\\N{EURO SIGN}\\N{CJK UNIFIED IDEOGRAPH-8000}\\U0010ffff' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:03:52 2020 From: report at bugs.python.org (hai shi) Date: Sat, 14 Mar 2020 15:03:52 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584198232.57.0.82829184255.issue39337@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18344 pull_request: https://github.com/python/cpython/pull/18987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:06:35 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sat, 14 Mar 2020 15:06:35 +0000 Subject: [issue33136] Harden ssl module against CVE-2018-8970 In-Reply-To: <1521969562.74.0.467229070634.issue33136@psf.upfronthosting.co.za> Message-ID: <1584198395.86.0.861777984.issue33136@roundup.psfhosted.org> Ashwin Ramaswami added the comment: Can this be closed now? ---------- nosy: +epicfaace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:18:58 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sat, 14 Mar 2020 15:18:58 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584199138.17.0.739110053704.issue38744@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: bpo-35493 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:36:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 14 Mar 2020 15:36:32 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584200192.66.0.946909602147.issue38744@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Check out https://bugs.python.org/issue39360 foe more context on this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:41:12 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 14 Mar 2020 15:41:12 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584200472.01.0.707209051367.issue38744@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, notice that writing Pool().map(sleep, [0.01] * 10) is out of contact as the Pool object can be collected immediately and there is no proper termination and cleanup. The correct way is to use the context manager: with Pool() as pool: pool.map(sleep, [0.01] * 10) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:42:22 2020 From: report at bugs.python.org (Malcolm Smith) Date: Sat, 14 Mar 2020 15:42:22 +0000 Subject: [issue33689] Blank lines in .pth file cause a duplicate sys.path entry In-Reply-To: <1527634994.48.0.682650639539.issue33689@psf.upfronthosting.co.za> Message-ID: <1584200542.36.0.360612984701.issue33689@roundup.psfhosted.org> Malcolm Smith added the comment: It's definitely a bug and not a documentation lapse. There's no reason why blank lines should have that effect, and no indication in the code that this was intentional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 11:51:46 2020 From: report at bugs.python.org (Ryan Tu) Date: Sat, 14 Mar 2020 15:51:46 +0000 Subject: [issue8704] cgitb sends a bogus HTTP header if the app crashes before finishing headers In-Reply-To: <1273759972.28.0.178671810955.issue8704@psf.upfronthosting.co.za> Message-ID: <1584201106.23.0.367692562127.issue8704@roundup.psfhosted.org> Ryan Tu added the comment: #Maybe not a good solution I do not know the should we delete the code in cgitb.py or adjust the configration of apache httpd. My solution is deleting some code as follows: ``` return ''' --> --> --> ''' ``` Then it works very well, and it has good view.Anyone know what is the situation in ngix? ---------- nosy: +Ryan Tu versions: +Python 3.8 -Python 2.7, Python 3.2, Python 3.3, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 12:03:23 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sat, 14 Mar 2020 16:03:23 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584201803.34.0.987585267364.issue39360@roundup.psfhosted.org> Change by Arkadiusz Mi?kiewicz : ---------- nosy: +arekm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 13:31:51 2020 From: report at bugs.python.org (Manjusaka) Date: Sat, 14 Mar 2020 17:31:51 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1584207111.21.0.871208056046.issue39924@roundup.psfhosted.org> Change by Manjusaka : ---------- keywords: +patch pull_requests: +18345 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 13:47:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Mar 2020 17:47:20 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1584208040.9.0.19895307369.issue39927@roundup.psfhosted.org> Terry J. Reedy added the comment: The solution given by Ned above also solved https://stackoverflow.com/questions/60648250/cannot-open-idle-on-mac. So dd's situation was not unique. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:23:43 2020 From: report at bugs.python.org (Rahul Kumaresan) Date: Sat, 14 Mar 2020 18:23:43 +0000 Subject: [issue39705] Tutorial, 5.6 Looping Techniques, sorted() example In-Reply-To: <1582277071.44.0.766763125418.issue39705@roundup.psfhosted.org> Message-ID: <1584210223.61.0.474699818859.issue39705@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- keywords: +patch pull_requests: +18346 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:26:06 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 18:26:06 +0000 Subject: [issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs In-Reply-To: <1579799539.42.0.511265830635.issue39435@roundup.psfhosted.org> Message-ID: <1584210366.15.0.875568387058.issue39435@roundup.psfhosted.org> Serhiy Storchaka added the comment: In pickle.py the name of the first parameter is "s" (it was "str" in 2.7), not "data". And in the module docstring it is "string". So we have two options: 1. Make the first parameter positional-only. This is not breaking change because the documentation and two implementations had four different names, so there was no official way to pass it by keyword. 2. Make it positional-and-keyword parameter officially. All implementations, documentation and docstrings should be synchronized. What is more preferable? Do we need to pass the first argument to pickle.loads() by keyword? After resolving this issue we may want to revise other modules which have the loads() function. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:26:43 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 18:26:43 +0000 Subject: [issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs In-Reply-To: <1579799539.42.0.511265830635.issue39435@roundup.psfhosted.org> Message-ID: <1584210403.01.0.166268145535.issue39435@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- type: -> enhancement versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:56:15 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 14 Mar 2020 18:56:15 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584212175.07.0.578713334014.issue38576@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 9165addc22d05e776a54319a8531ebd0b2fe01ef by Ashwin Ramaswami in branch 'master': bpo-38576: Disallow control characters in hostnames in http.client (GH-18995) https://github.com/python/cpython/commit/9165addc22d05e776a54319a8531ebd0b2fe01ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:56:21 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 18:56:21 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584212181.45.0.000453716284707.issue38576@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +18348 pull_request: https://github.com/python/cpython/pull/19000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:56:28 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 18:56:28 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584212188.83.0.381121932832.issue38576@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18349 pull_request: https://github.com/python/cpython/pull/19001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 14:56:36 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 18:56:36 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584212196.14.0.320315137828.issue38576@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18350 pull_request: https://github.com/python/cpython/pull/19002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:02:04 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 14 Mar 2020 19:02:04 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584212524.33.0.4119123545.issue38576@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks for the PR Ashwin! ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:13:02 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 19:13:02 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584213182.11.0.0443131277017.issue38576@roundup.psfhosted.org> miss-islington added the comment: New changeset 34f85af3229f86c004a954c3f261ceea1f5e9f95 by Miss Islington (bot) in branch '3.7': bpo-38576: Disallow control characters in hostnames in http.client (GH-18995) https://github.com/python/cpython/commit/34f85af3229f86c004a954c3f261ceea1f5e9f95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:13:36 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 19:13:36 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584213216.73.0.105878645596.issue38576@roundup.psfhosted.org> miss-islington added the comment: New changeset ff69c9d12c1b06af58e5eae5db4630cedd94740e by Miss Islington (bot) in branch '3.8': bpo-38576: Disallow control characters in hostnames in http.client (GH-18995) https://github.com/python/cpython/commit/ff69c9d12c1b06af58e5eae5db4630cedd94740e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:15:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 19:15:40 +0000 Subject: [issue39334] python specific index directives in our doc has been deprecated 10 years ago In-Reply-To: <1579035270.07.0.838861663002.issue39334@roundup.psfhosted.org> Message-ID: <1584213339.99.0.102177106466.issue39334@roundup.psfhosted.org> Serhiy Storchaka added the comment: Maybe just add the implementation of Python specific index directives in our extensions Doc/tools/extensions? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:21:31 2020 From: report at bugs.python.org (jack1142) Date: Sat, 14 Mar 2020 19:21:31 +0000 Subject: [issue39232] asyncio crashes when tearing down the proactor event loop In-Reply-To: <1578335360.75.0.333919607495.issue39232@roundup.psfhosted.org> Message-ID: <1584213691.47.0.793977731548.issue39232@roundup.psfhosted.org> Change by jack1142 : ---------- nosy: +jack1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 15:31:31 2020 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 14 Mar 2020 19:31:31 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584214291.24.0.563561189015.issue36144@roundup.psfhosted.org> Brandt Bucher added the comment: Three other MutableMappings we might want to update: - shelve.Shelf - weakref.WeakKeyDictionary - weakref.WeakValueDictionary Shelf is up in the air, since it doesn't look like it defines a copy() equivalent... I also have no experience with it. Since it's a MutableMapping subclass, (not a dict subclass), we could in theory hold off on updating this until someone asks for it, without backward compatibility issues. I think the other two should be updated, though. I can coordinate PRs for them this week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 16:05:43 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 14 Mar 2020 20:05:43 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584216343.08.0.106644915514.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: I definitely think we should leave Shelf alone, it's a toy class from a different era. It makes sense to update the weak dicts; hopefully the | and |= operators can be implemented in terms of other, more primitive operations, so we will have assurance that these classes' essential behavior is preserved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 17:13:01 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sat, 14 Mar 2020 21:13:01 +0000 Subject: [issue39887] Duplicate C object description of vectorcallfunc In-Reply-To: <1583570940.02.0.236043511606.issue39887@roundup.psfhosted.org> Message-ID: <1584220381.55.0.450995338926.issue39887@roundup.psfhosted.org> Ashwin Ramaswami added the comment: I can no longer reproduce this issue. Has it been fixed? $ make html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -W . build/html Running Sphinx v2.2.0 making output directory... done building [mo]: targets for 0 po files that are out of date building [html]: targets for 486 source files that are out of date updating environment: [new config] 486 added, 0 changed, 0 removed /home/epicfaace/cpython/Doc/venv/lib/python3.6/site-packages/sphinx/util/nodes.py:151: FutureWarning: The iterable returned by Node.traverse() will become an iterator instead of a list in Docutils > 0.16. for classifier in reversed(node.parent.traverse(nodes.classifier)): reading sources... [100%] whatsnew/index looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] whatsnew/index generating indices... genindex py-modindexdone writing additional pages... download index search opensearchdone copying images... [100%] using/win_installer.png copying downloadable files... [100%] includes/tzinfo_examples.py copying static files... ... done copying extra files... done dumping search index in English (code: en)... done dumping object inventory... done build succeeded. The HTML pages are in build/html. Build finished. The HTML pages are in build/html. ---------- nosy: +epicfaace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 17:24:32 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 14 Mar 2020 21:24:32 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584221072.34.0.341604093681.issue38938@roundup.psfhosted.org> Dennis Sweeney added the comment: First, as I posted at https://github.com/python/cpython/pull/17729#issuecomment-571864662, there is a theoretical advantage of fewer comparisons in all cases, and the new algorithm would be especially dominant when one iterable keeps winning. (I'm given to understand that "lists very often do have exploitable partial order in real life" ;-) > making heaqq.merge a class looks unrelated to the declared goal. Is there a better way to implement a C accelerator for a Python function that returns a generator? I figured it would be better to have the pure-python implementation match the C implementation. As for the timing, I'm running Windows and pyperf gives a "WARNING: unable to increase process priority", and a "WARNING: no operation available for your platform" when I run "pyperf system tune", but I'm still able to get the following results: .\python.bat -m pyperf timeit -s "from random import random; from heapq import merge; from collections import deque; iters = [sorted(random() for j in range(10_000)) for i in range(20)]" "deque(merge(*iters), maxlen=0)" Master: Mean +- std dev: 88.0 ms +- 10.3 ms This PR: Mean +- std dev: 28.2 ms +- 1.0 ms The above I'll call "merging 20 of size 10_000." For "merging 2 of size 100_000", I get: Master: Mean +- std dev: 34.4 ms +- 3.2 ms This PR: Mean +- std dev: 10.6 ms +- 0.7 ms Merging 10_000 of size 100: Master: Mean +- std dev: 1.56 sec +- 0.11 sec This PR: Mean +- std dev: 628 ms +- 22 ms ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 17:51:18 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 21:51:18 +0000 Subject: [issue39887] Duplicate C object description of vectorcallfunc In-Reply-To: <1583570940.02.0.236043511606.issue39887@roundup.psfhosted.org> Message-ID: <1584222678.86.0.17329416978.issue39887@roundup.psfhosted.org> Serhiy Storchaka added the comment: I cannot reproduce it anymore after cleaning and building from zero. Perhaps it was a build artefact, vectorcallfunc was defined in Doc/c-api/typeobj.rst before 9a13a388f202268dd7b771638adbec132449b98b. Thank you for checking it Ashwin. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 17:57:54 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sat, 14 Mar 2020 21:57:54 +0000 Subject: [issue34591] smtplib mixes RFC821 and RFC822 addresses In-Reply-To: <1536180104.03.0.56676864532.issue34591@psf.upfronthosting.co.za> Message-ID: <1584223074.41.0.9831518086.issue34591@roundup.psfhosted.org> Ashwin Ramaswami added the comment: What do you mean by "it then proceeds to use it as an RFC821 address"? ---------- nosy: +epicfaace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:02:46 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Mar 2020 22:02:46 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584223366.01.0.962945103334.issue38938@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, I did not notice that there is a C implementation in PR 18427. Changes in the Python implementations are so larger that I though this is the goal of the PR. Often the most clear and efficient way to implement an iterator in Python is to write a generator function. In C you need to write a class with the __next__ method, but Python has better way. I have tested your first example with the Python implementation and got 93.9 msec on master vs 314 msec with PR 18427 applied. It is expected that the C implementation is faster than the Python implementation, but was there a need to make the Python implementation 3 times slower? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:13:30 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Mar 2020 22:13:30 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1584224010.41.0.102871474586.issue39869@roundup.psfhosted.org> miss-islington added the comment: New changeset 4abe77c725b1d0a2187b7160924258c9810b824c by Miss Islington (bot) in branch '3.8': bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) https://github.com/python/cpython/commit/4abe77c725b1d0a2187b7160924258c9810b824c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:17:14 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Mar 2020 22:17:14 +0000 Subject: [issue39869] Improve Instance Objects tutorial documentation In-Reply-To: <1583452369.51.0.496952610919.issue39869@roundup.psfhosted.org> Message-ID: <1584224234.28.0.0163601974774.issue39869@roundup.psfhosted.org> Ned Deily added the comment: New changeset 6b6756f1283a87091c6186e70b544d4789e12c51 by Miss Islington (bot) in branch '3.6': bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) (GH-18898) https://github.com/python/cpython/commit/6b6756f1283a87091c6186e70b544d4789e12c51 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:28:29 2020 From: report at bugs.python.org (Lahfa Samy) Date: Sat, 14 Mar 2020 22:28:29 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584224909.5.0.724826123676.issue39879@roundup.psfhosted.org> Lahfa Samy added the comment: Hi, I would like to take this issue as my first contribution to Python, I'm currently subscribed to the python-core-mentorship list. I do not know exactly how to submit a patch for an issue. Kind regards. ---------- nosy: +AkechiShiro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:31:23 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 14 Mar 2020 22:31:23 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584225083.29.0.224697457022.issue38938@roundup.psfhosted.org> Dennis Sweeney added the comment: The existing Python implementation is benefiting from the C accelerators for heapify and heapreplace. When forcing pure python using test.support, I get these results: .\python.bat -m pyperf timeit -s "from random import random; from collections import deque; from test import support; merge = support.import_fresh_module('heapq', blocked=['_heapq']).merge; iters = [sorted(random() for j in range(1_000)) for i in range(20)]" "deque(merge(*iters), maxlen=0)" Master: Mean +- std dev: 73.1 ms +- 8.4 ms PR: Mean +- std dev: 63.7 ms +- 7.8 ms I think I remember getting similarly slightly-better results out of PyPy, but I will double-check. So while the existing "mixed-c-and-Python" implementation would be deleted, the "true pure-Python" implementation would get faster and the pure-c implementation would be created much faster. Is that an acceptable trade-off? Regarding using a generator for the Python implementation, is it okay if type(heapq.merge) gives for the Python implementation but for the c implementation? How much seemingly-irrelevant variation like this is acceptable between the APIs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:32:08 2020 From: report at bugs.python.org (Mariatta) Date: Sat, 14 Mar 2020 22:32:08 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584225128.67.0.00798897227248.issue39879@roundup.psfhosted.org> Mariatta added the comment: Patch are submitted as pull request on our GitHub repo. Here's a write-up on how to do it https://devguide.python.org/pullrequest/#step-by-step-guide ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 18:35:55 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Mar 2020 22:35:55 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584225355.97.0.209469125989.issue38576@roundup.psfhosted.org> Ned Deily added the comment: New changeset 83fc70159b24f5b11a5ef87c9b05c2cf4c7faeba by Miss Islington (bot) in branch '3.6': bpo-38576: Disallow control characters in hostnames in http.client (GH-18995) (GH-19002) https://github.com/python/cpython/commit/83fc70159b24f5b11a5ef87c9b05c2cf4c7faeba ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 20:59:13 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 15 Mar 2020 00:59:13 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584233953.01.0.141694440803.issue38576@roundup.psfhosted.org> Gregory P. Smith added the comment: If anyone cares about 2.7, the *final* release is coming up in a few weeks. They'll need to figure out what it looks like there and get a 2.7 PR reviewed by the release manager. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 21:13:27 2020 From: report at bugs.python.org (Lahfa Samy) Date: Sun, 15 Mar 2020 01:13:27 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584234807.53.0.125387654588.issue39879@roundup.psfhosted.org> Change by Lahfa Samy : ---------- keywords: +patch pull_requests: +18351 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 21:28:02 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 01:28:02 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1584235682.65.0.209705249187.issue39073@roundup.psfhosted.org> Change by Ashwin Ramaswami : ---------- keywords: +patch nosy: +epicfaace nosy_count: 3.0 -> 4.0 pull_requests: +18352 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:00:34 2020 From: report at bugs.python.org (dgelessus) Date: Sun, 15 Mar 2020 02:00:34 +0000 Subject: [issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5 In-Reply-To: <1584049452.89.0.509835184184.issue39948@roundup.psfhosted.org> Message-ID: <1584237634.53.0.138575368491.issue39948@roundup.psfhosted.org> Change by dgelessus : ---------- keywords: +patch pull_requests: +18353 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:11:01 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 02:11:01 +0000 Subject: [issue39728] Instantiating enum with invalid value results in ValueError twice In-Reply-To: <1582448824.79.0.766917894274.issue39728@roundup.psfhosted.org> Message-ID: <1584238261.06.0.591025300189.issue39728@roundup.psfhosted.org> Ashwin Ramaswami added the comment: I can't reproduce this on the latest python (3.9) from master. Can you? ---------- nosy: +epicfaace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:11:48 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 02:11:48 +0000 Subject: [issue39728] Instantiating enum with invalid value results in ValueError twice In-Reply-To: <1582448824.79.0.766917894274.issue39728@roundup.psfhosted.org> Message-ID: <1584238308.38.0.997502959247.issue39728@roundup.psfhosted.org> Ashwin Ramaswami added the comment: Never mind, I was able to reproduce it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:15:13 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 02:15:13 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584238513.64.0.613694722076.issue38744@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am mentoring @BTaskaya and I asked to take a look a this. After some debugging, we found that the problem is the following: When the pull is not used via the context manager or terminate() is called, there is a system in multiprocessing.util that handles finalization of all pools via an atexit handler (the Finalize) class. This class registers the _terminate_pool handler in the registry of finalizers of the module, and that registry is called on interpreter exit via _exit_function. The problem is that the "happy" path with the context manager or manual call to finalize() does some extra steps that _terminate_pool does not: def terminate(self): util.debug('terminating pool') self._state = TERMINATE self._worker_handler._state = TERMINATE self._change_notifier.put(None) self._terminate() In this code self._terminate() calls _terminate_pool. The step that is not executed when the atexit() handler calls _terminate_pool is pinging the _change_notifier queue to unblock the maintenance threads. The fix is moving the "self._change_notifier.put(None)" to the _terminate_pool function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:15:35 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 02:15:35 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584238535.26.0.165315090808.issue38744@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: BTaskaya will create a PR to fix this soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 22:47:50 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 15 Mar 2020 02:47:50 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584240470.01.0.376924815862.issue39360@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch nosy: +BTaskaya nosy_count: 4.0 -> 5.0 pull_requests: +18354 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:19:20 2020 From: report at bugs.python.org (Richard King) Date: Sun, 15 Mar 2020 03:19:20 +0000 Subject: [issue39964] adding a string to a list works differently with x+='' compared to x=x+'' Message-ID: <1584242360.88.0.483321661554.issue39964@roundup.psfhosted.org> New submission from Richard King : x = ['a'] x += ' ' results in ['a',' '] x = x + ' ' results in an exception: Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate list (not "str") to list It behaves the same in 2.7.15 and 3.7.2. ---------- components: Windows messages: 364213 nosy: paul.moore, rickbking, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: adding a string to a list works differently with x+='' compared to x=x+'' type: behavior versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:25:46 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 15 Mar 2020 03:25:46 +0000 Subject: [issue39964] adding a string to a list works differently with x+='' compared to x=x+'' In-Reply-To: <1584242360.88.0.483321661554.issue39964@roundup.psfhosted.org> Message-ID: <1584242746.64.0.322942666462.issue39964@roundup.psfhosted.org> Steven D'Aprano added the comment: That's not a bug. The in-place addition `+=` for lists is equivalent to the extend method. See the documentation: https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types and the tutorial: https://docs.python.org/3/tutorial/datastructures.html ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:28:36 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:28:36 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584242916.43.0.330850927569.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Check out also https://bugs.python.org/issue38744 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:50:53 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:50:53 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set Message-ID: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : If PyCF_ALLOW_TOP_LEVEL_AWAIT is set this code is valid: def f(): await foo And this should raise a "SyntaxError: 'await' outside async function". The reason is that the PyCF_ALLOW_TOP_LEVEL_AWAIT is global in the compiler and affects everything without checking if the current code being compiled is actually in the TOP level or not. ---------- components: asyncio messages: 364216 nosy: asvetlov, pablogsal, yselivanov priority: normal severity: normal status: open title: await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:52:58 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:52:58 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584244378.44.0.881326329478.issue39562@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 5.0 -> 6.0 pull_requests: +18355 pull_request: https://github.com/python/cpython/pull/19010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:58:24 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 15 Mar 2020 03:58:24 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584244704.49.0.51870219049.issue39965@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:58:26 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:58:26 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584244706.57.0.997069751267.issue39562@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -18355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:59:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:59:05 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584244745.27.0.787812495912.issue39562@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +18357 pull_request: https://github.com/python/cpython/pull/19010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 14 23:59:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 03:59:05 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584244745.2.0.420682051237.issue39965@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +18356 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 00:29:39 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 04:29:39 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584246579.05.0.849161103435.issue39965@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 90235810ec28ca954bbf4b61a5ae5df7a00db409 by Pablo Galindo in branch 'master': bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010) https://github.com/python/cpython/commit/90235810ec28ca954bbf4b61a5ae5df7a00db409 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 00:29:49 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 04:29:49 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584246589.93.0.652474376804.issue39965@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18358 pull_request: https://github.com/python/cpython/pull/19011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 00:30:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 04:30:29 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584246629.96.0.320502346475.issue39965@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 00:46:30 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 04:46:30 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584247590.04.0.193458746782.issue39965@roundup.psfhosted.org> miss-islington added the comment: New changeset f7e32fcbd65490c921e1836c2399827d14d0eb7b by Miss Islington (bot) in branch '3.8': bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010) https://github.com/python/cpython/commit/f7e32fcbd65490c921e1836c2399827d14d0eb7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 00:52:13 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Sun, 15 Mar 2020 04:52:13 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584247933.9.0.343920882218.issue39954@roundup.psfhosted.org> Kubilay Kocak added the comment: Not suggesting it's the *best* way, but for example, isn't there a way to handle return codes from shell executions such as: https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 01:43:27 2020 From: report at bugs.python.org (Daurnimator) Date: Sun, 15 Mar 2020 05:43:27 +0000 Subject: [issue34591] smtplib mixes RFC821 and RFC822 addresses In-Reply-To: <1584223074.41.0.9831518086.issue34591@roundup.psfhosted.org> Message-ID: Daurnimator added the comment: On Sun, 15 Mar 2020 at 08:58, Ashwin Ramaswami wrote: > What do you mean by "it then proceeds to use it as an RFC821 address"? It writes it into an SMTP command as if it was an RFC821 address. This is a problem because not all RFC822 addresses are valid RFC821 addresses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 02:00:32 2020 From: report at bugs.python.org (Yury Selivanov) Date: Sun, 15 Mar 2020 06:00:32 +0000 Subject: [issue39965] await is valid in non async functions if PyCF_ALLOW_TOP_LEVEL_AWAIT is set In-Reply-To: <1584244253.08.0.00539812271843.issue39965@roundup.psfhosted.org> Message-ID: <1584252032.86.0.175338392581.issue39965@roundup.psfhosted.org> Yury Selivanov added the comment: Good catch & PR ;) Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 02:39:44 2020 From: report at bugs.python.org (Avram) Date: Sun, 15 Mar 2020 06:39:44 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception Message-ID: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> New submission from Avram : This bug was introduced with Issue25597 Here's some code that demonstrates the error: import sys from unittest.mock import patch with patch.object(sys, 'stdout', wraps=sys.stdout) as mockstdout: bool(sys.stdout) This works fine in 3.8 and earlier, but fails in 3.9 It seems the goal was to be able to access dunder methods for wrapped objects. Before this change __bool__ wasn't actually being checked, but was forced to True, which works for basic existence tests. The new code method._mock_wraps = getattr(mock._mock_wraps, name) has no fallthrough in case the attribute isn't there such as the case with __bool__ on sys.stdout. ---------- components: Library (Lib) messages: 364222 nosy: Darragh Bailey, anthonypjshaw, aviso, cjw296, lisroach, mariocj89, michael.foord, pconnell, r.david.murray, rbcollins, xtreak priority: normal severity: normal status: open title: mock 3.9 bug: Wrapped objects without __bool__ raise exception type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 03:38:55 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 07:38:55 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584257935.34.0.142888845872.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18359 pull_request: https://github.com/python/cpython/pull/19012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 04:57:43 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 15 Mar 2020 08:57:43 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1584262663.74.0.759450270062.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the report. There should be a check to ensure that the attribute is present to handle the attribute error while attaching the wrapped object's value. Something like below could be done so that we check for wrapped value or fallback to the old behaviour. This needs a test too where the report can be added as a unittest. The news entry can also ensure that the wrapped value will be used when present or falls back to the default value. Marking it as a 3.9 regression. diff --git Lib/unittest/mock.py Lib/unittest/mock.py index 20daf724c1..86e832cc51 100644 --- Lib/unittest/mock.py +++ Lib/unittest/mock.py @@ -2036,7 +2036,7 @@ _side_effect_methods = { def _set_return_value(mock, method, name): # If _mock_wraps is present then attach it so that wrapped object # is used for return value is used when called. - if mock._mock_wraps is not None: + if mock._mock_wraps is not None and hasattr(mock._mock_wraps, name): method._mock_wraps = getattr(mock._mock_wraps, name) return ---------- keywords: +3.9regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 05:27:24 2020 From: report at bugs.python.org (daniel hahler) Date: Sun, 15 Mar 2020 09:27:24 +0000 Subject: [issue39967] bdb calls linecache.checkcache, resulting in source being different from code Message-ID: <1584264444.94.0.414903908366.issue39967@roundup.psfhosted.org> New submission from daniel hahler : `Bdb.reset` calls `linecache.checkcache`, which will clear the cache for any updated source files. This however might result in displayed source code being different from the actual code, in case you are editing the file being currently debugged. I think it is better to keep the initially cached version (which might still get invalidated/checked via inspect itself), but that is another issue. The code is very old already, merged in b6775db241: commit b6775db241 Author: Guido van Rossum Date: Mon Aug 1 11:34:53 1994 +0000 Merge alpha100 branch back to main trunk I will try a PR that removes it to see if it causes any test failures. Code ref: https://github.com/python/cpython/blob/598d29c51c7b5a77f71eed0f615eb0b3865a4085/Lib/bdb.py#L56-L57 ---------- components: Library (Lib) messages: 364224 nosy: blueyed priority: normal severity: normal status: open title: bdb calls linecache.checkcache, resulting in source being different from code versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 05:28:41 2020 From: report at bugs.python.org (daniel hahler) Date: Sun, 15 Mar 2020 09:28:41 +0000 Subject: [issue39967] bdb calls linecache.checkcache, resulting in source being different from code In-Reply-To: <1584264444.94.0.414903908366.issue39967@roundup.psfhosted.org> Message-ID: <1584264521.24.0.397926525352.issue39967@roundup.psfhosted.org> Change by daniel hahler : ---------- keywords: +patch pull_requests: +18360 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 05:40:36 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sun, 15 Mar 2020 09:40:36 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584265236.67.0.562355190721.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: I've applied pull request patch (which looks a bit weird to me, removes something then adds the same thing back etc https://patch-diff.githubusercontent.com/raw/python/cpython/pull/19009.patch). Essentially the change is: diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index b223d6aa72..8bd9608b0e 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -682,7 +682,15 @@ class Pool(object): # this is guaranteed to only be called once util.debug('finalizing pool') - worker_handler._state = TERMINATE + # Explicitly do the cleanup here if it didn't come from terminate() + # (required for if the queue will block, if it is already closed) + if worker_handler._state != TERMINATE: + # Notify that the worker_handler state has been changed so the + # _handle_workers loop can be unblocked (and exited) in order to + # send the finalization sentinel all the workers. + worker_handler._state = TERMINATE + change_notifier.put(None) + task_handler._state = TERMINATE util.debug('helping task handler/workers to finish') Unfortunately test case from first message in this bug report still hangs for me with this applied. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 06:07:17 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sun, 15 Mar 2020 10:07:17 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584266837.25.0.00843946081682.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: (note, testing on 3.8 branch + pull request patch) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 06:21:08 2020 From: report at bugs.python.org (swgmma) Date: Sun, 15 Mar 2020 10:21:08 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1584267668.73.0.597323143434.issue30082@roundup.psfhosted.org> swgmma added the comment: > Try running that script with pythonw.exe instead. That did the trick. Confirmed that the changes are working as intended. Running the test script posted earlier and adding the new `force_hide` kwarg to the subprocess call: With `force_hide=False`, a command prompt window pops up. With `force_hide=True`, no command prompt window pops up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 06:28:14 2020 From: report at bugs.python.org (swgmma) Date: Sun, 15 Mar 2020 10:28:14 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1584268094.57.0.121793204264.issue30082@roundup.psfhosted.org> Change by swgmma : ---------- keywords: +patch pull_requests: +18361 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 06:29:01 2020 From: report at bugs.python.org (swgmma) Date: Sun, 15 Mar 2020 10:29:01 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1584268141.61.0.441549491538.issue30082@roundup.psfhosted.org> Change by swgmma : ---------- pull_requests: +18362 pull_request: https://github.com/python/cpython/pull/18719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 07:03:01 2020 From: report at bugs.python.org (swgmma) Date: Sun, 15 Mar 2020 11:03:01 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1584270180.95.0.116122364651.issue30082@roundup.psfhosted.org> Change by swgmma : ---------- pull_requests: -18362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 07:53:21 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 15 Mar 2020 11:53:21 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584273201.73.0.33644544006.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 13.0 -> 14.0 pull_requests: +18363 pull_request: https://github.com/python/cpython/pull/19015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 08:01:24 2020 From: report at bugs.python.org (Lahfa Samy) Date: Sun, 15 Mar 2020 12:01:24 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584273684.14.0.776788493961.issue39879@roundup.psfhosted.org> Lahfa Samy added the comment: Following the guide, I've send a patch with the fix, I'm waiting for a review. Once the patch will be reviewed and accepted. My patch will need to be backported from 3.9 to 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 08:24:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Mar 2020 12:24:32 +0000 Subject: [issue39507] http library missing HTTP status code 418 "I'm a teapot" In-Reply-To: <1580477561.46.0.283786859287.issue39507@roundup.psfhosted.org> Message-ID: <1584275072.33.0.370731003114.issue39507@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 61ac612e78e4f2625977406fb6f366e0a644673a by Ross in branch 'master': bpo-39507: Add HTTP status 418 "I'm a Teapot" (GH-18291) https://github.com/python/cpython/commit/61ac612e78e4f2625977406fb6f366e0a644673a ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 08:25:14 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Mar 2020 12:25:14 +0000 Subject: [issue39507] http library missing HTTP status code 418 "I'm a teapot" In-Reply-To: <1580477561.46.0.283786859287.issue39507@roundup.psfhosted.org> Message-ID: <1584275114.57.0.900558972588.issue39507@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 08:51:13 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 15 Mar 2020 12:51:13 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1584276673.72.0.886800904532.issue38870@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +18365 pull_request: https://github.com/python/cpython/pull/19016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:42:06 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 13:42:06 +0000 Subject: [issue39968] move extension modules' macros of `get_xx_state()` to inline function. Message-ID: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> New submission from hai shi : as victor and petr said in PR18613?inline function is more better than macros, so I plan move all extension modules' macros of `get_xx_state()` to inline function. Note: some inline get_xx_state() can not be used directly in `tp_traverse`?`tp_free` and `tp_clear`(issue39824). ---------- components: Extension Modules messages: 364231 nosy: petr.viktorin, shihai1991, vstinner priority: normal severity: normal status: open title: move extension modules' macros of `get_xx_state()` to inline function. type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:45:05 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 13:45:05 +0000 Subject: [issue39968] move extension modules' macros of `get_xx_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584279905.11.0.880298443407.issue39968@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +18366 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:50:41 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 13:50:41 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584280241.14.0.507055033212.issue10572@roundup.psfhosted.org> Ido Michael added the comment: Before I put more time into that, here's the strategy here: 1. Module by module migration. 2. By this order tkinter/test distutils/tests ctypes/tests lib2to3/tests unittest/test * sqlite3/test - excluded because needs more work. Please let me know if there is a different order or more exclusions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:51:58 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 13:51:58 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584280318.57.0.279873499192.issue10572@roundup.psfhosted.org> Ido Michael added the comment: + Distutils is last priority ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:52:42 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 13:52:42 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584280362.63.0.45455882809.issue39968@roundup.psfhosted.org> Change by hai shi : ---------- title: move extension modules' macros of `get_module_state()` to inline function. -> port extension modules' macros of `get_module_state()` to inline function. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 09:52:28 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 13:52:28 +0000 Subject: [issue39968] move extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584280348.84.0.828829962598.issue39968@roundup.psfhosted.org> Change by hai shi : ---------- title: move extension modules' macros of `get_xx_state()` to inline function. -> move extension modules' macros of `get_module_state()` to inline function. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:02:30 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 14:02:30 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584280950.09.0.382972569802.issue1635741@roundup.psfhosted.org> hai shi added the comment: hundreds of encoding names can not be released in Py_Finalize(). for example: ``` 0x7ff482f589e0 [1] 'iso_8859_1_1987' 0x7ff482f58970 [1] 'iso_8859_1' ``` --> ``` 0x7ff482f589e0 [2] 'iso_8859_1_1987' 0x7ff482f58970 [2] 'iso_8859_1' ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:12:53 2020 From: report at bugs.python.org (hai shi) Date: Sun, 15 Mar 2020 14:12:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584281573.43.0.171511024621.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18367 pull_request: https://github.com/python/cpython/pull/19018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:27:55 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 15 Mar 2020 14:27:55 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584282475.64.0.574799370125.issue37207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18368 pull_request: https://github.com/python/cpython/pull/19019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:49:37 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 14:49:37 +0000 Subject: [issue33689] Blank lines in .pth file cause a duplicate sys.path entry In-Reply-To: <1527634994.48.0.682650639539.issue33689@psf.upfronthosting.co.za> Message-ID: <1584283777.06.0.631294124204.issue33689@roundup.psfhosted.org> Ido Michael added the comment: I can take this and have a PR ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:53:42 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 14:53:42 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584284022.17.0.564064428728.issue39107@roundup.psfhosted.org> Ido Michael added the comment: I can take this for Mac V 10.14.6 if there was a decision? ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:54:33 2020 From: report at bugs.python.org (Sebastian G Pedersen) Date: Sun, 15 Mar 2020 14:54:33 +0000 Subject: [issue39380] ftplib uses latin-1 as default encoding In-Reply-To: <1579776260.84.0.333075912412.issue39380@roundup.psfhosted.org> Message-ID: <1584284073.44.0.849583717414.issue39380@roundup.psfhosted.org> Sebastian G Pedersen added the comment: Thanks again for the engagement. I am also in favor of adding the encoding to the constructor. However, following Giampaolo's comment, that utf-8 is standard and has been for a long time (and the RFC dating back to year 1999), I am also in favor of changing the default encoding in the same PR. As mentioned in the previous comments, most users use ASCII and will not be affected by this anyway - which is probably also why this issue hasn't been raised before. Please let me know your thoughts on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:56:25 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 14:56:25 +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: <1584284185.84.0.781208839079.issue39955@roundup.psfhosted.org> Ido Michael added the comment: Looks like both the original and this are still issues. Can I take this? ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:56:22 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 15 Mar 2020 14:56:22 +0000 Subject: [issue39969] Remove Param expression context from AST Message-ID: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> New submission from Batuhan Taskaya : Param is an expression context that is no longer in use, we can simply remove it. This node predates the arguments node, and if I am not misguessing used inside of function signatures. ---------- components: Library (Lib) messages: 364238 nosy: BTaskaya priority: normal severity: normal status: open title: Remove Param expression context from AST versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 10:59:03 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 15 Mar 2020 14:59:03 +0000 Subject: [issue39969] Remove Param expression context from AST In-Reply-To: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> Message-ID: <1584284343.21.0.609719650101.issue39969@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18369 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 11:01:14 2020 From: report at bugs.python.org (Yi Luan) Date: Sun, 15 Mar 2020 15:01:14 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines Message-ID: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> New submission from Yi Luan : Hello, Apologies if this was a duplicate issue. I guess the most concise way of saying this is that when doing: >>> datetime.datetime.utcnow().timestamp() on a machine whose local time isn't the UTC time, the above code will not return the correct timestamp. Because datetime.datetime.timestamp() and datetime.datetime.fromtimestamp() will intrinsically convert the timestamp based on the local time of the running machine, when fed with data that are already converted to UTC, these functions will double convert them hence will return incorrect result. For example: On a machine that is in CST time: >>> dt = datetime.datetime.utcnow() >>> dt datetime.datetime(2020, 3, 15, 14, 33, 10, 213664) >>> datetime.datetime.fromtimestamp(dt.timestamp(), datetime.timezone.utc) datetime.datetime(2020, 3, 15, 6, 33, 10, 213664) Meanwhile, on a machine that is in UTC time: >>> dt = datetime.datetime.utcnow() >>> dt datetime.datetime(2020, 3, 15, 14, 41, 2, 203275) >>> datetime.datetime.fromtimestamp(dt.timestamp(), datetime.timezone.utc) datetime.datetime(2020, 3, 15, 14, 41, 2, 203275) I understand that one should probably use datetime.datetime.fromtimestamp() to construct time, but the output of the above code is inconsistent on machines that are set to different timezones. The above code explicitly asked to get the UTC time now and get the timestamp, then convert from a UTC timestamp to a datetime object. The result should be the same on the first machine but it didn't. >From my point of view, timestamp() functions should not shift any datetime objects since it returns an object that is naive about the tzinfo anyway. Timestamp data generated by Python should be correct and code should do what the programmer asked the code to do. In the above example, datetime.datetime.utcnow().timestamp() should return the timestamp of now in UTC time but in fact on a machine in CST time it would return the timestamp 8 hours before the UTC timestamp of now. The intrinsic behavior of timestamp() functions will cause ambiguity in code, therefore I suggest that timestamp() functions, unless used on tz aware objects, should not shift any date time based on the running machine's local time. ---------- components: Library (Lib) messages: 364240 nosy: Yi Luan priority: normal severity: normal status: open title: Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 11:08:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 15 Mar 2020 15:08:26 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584284906.4.0.513621440466.issue39970@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 11:45:32 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 15:45:32 +0000 Subject: [issue39725] unrelated `from None` exceptions lose prior exception information In-Reply-To: <1582405503.93.0.737085396902.issue39725@roundup.psfhosted.org> Message-ID: <1584287132.55.0.917708313994.issue39725@roundup.psfhosted.org> Ido Michael added the comment: Can I take this change into a PR? Or is it still in the process? ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 11:50:33 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 15 Mar 2020 15:50:33 +0000 Subject: [issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError In-Reply-To: <1574201186.66.0.441437608856.issue38856@roundup.psfhosted.org> Message-ID: <1584287433.35.0.805160488566.issue38856@roundup.psfhosted.org> Ido Michael added the comment: Is this open for a PR? ---------- nosy: +Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:04:37 2020 From: report at bugs.python.org (Paul Ganssle) Date: Sun, 15 Mar 2020 16:04:37 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584288277.45.0.929178109129.issue39970@roundup.psfhosted.org> Paul Ganssle added the comment: This is the intended behavior of these functions, and there is actually now a warning on both the utcnow and utcfromtimestamp functionsto reflect this: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow I would say that the correct answer here is to stop using utcnow and utcfromtimestamp (except possibly in very limited circumstance), I have written about it here: https://blog.ganssle.io/articles/2019/11/utcnow.html The preferred way to do this is `datetime.now(tzinfo=datetime.timezone.utc)` or `datetime.fromtimestamp(ts, tzinfo=datetime.timezone.utc)`. The main thing to internalize is that the result of `.timestamp()` always has a time zone, because it is an epoch time, meaning that it is the number of seconds in UTC since 1970-01-01T00:00:00Z. In Python 2, any operations on naive datetimes that required them to represent absolute times were an error, but in Python 3 that was changed and they were treated as local times. Perhaps leaving that behavior as is and having a dedicated "local time" object would have been a good idea, but there are actually some serious problems with doing it that way because it's difficult to define "local time" in such a way that it may not change over the course of an interpreter lifetime, which would cause major issues for an aware datetime (guaranteed not to change over the course of the interpreter lifetime). Treating naive times as local for operations that require localization (without changing their equality and comparison semantics, which is what would cause the problems) is a neat solution to that. Sorry this causes confusion, perhaps in the future we can look into removing the `.utcnow()` and `.utcfromtimestamp()` functions, or renaming them to something else. I'm going to set the status of this as wontfix because this is an intended behavior, but feel free to continue to use the ticket for discussion. Thank you for taking the time to file an issue! ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:07:09 2020 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 15 Mar 2020 16:07:09 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584288429.34.0.269046901792.issue39970@roundup.psfhosted.org> Alexander Belopolsky added the comment: I am sure this has been reported before ? I will try to find the relevant issue. This behavior is correct and documented. The only improvement that we can consider is to make it more explicit that utcnow is deprecated and the correct way to obtain the UTC timestamp is datetime.now(timezone.utc).timestamp() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:09:08 2020 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 15 Mar 2020 16:09:08 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584288548.82.0.30922845744.issue39970@roundup.psfhosted.org> Alexander Belopolsky added the comment: This is a duplicate of issue 33293. ---------- superseder: -> Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:10:19 2020 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 15 Mar 2020 16:10:19 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584288619.93.0.781545835884.issue39970@roundup.psfhosted.org> Change by Alexander Belopolsky : ---------- resolution: wont fix -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:39:23 2020 From: report at bugs.python.org (Diogo Flores) Date: Sun, 15 Mar 2020 16:39:23 +0000 Subject: [issue39971] Error on documentation - Quick fix. Message-ID: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> New submission from Diogo Flores : Hello, A code example from the 'functional programming how-to' raises an error. The simplest fix would be to remove the Ellipsis object from the 'line_list'. Thank you, Diogo Please check below for the commands issued: # https://docs.python.org/3/howto/functional.html#generator-expressions-and-list-comprehensions >>> line_list = [' line 1\n', 'line 2 \n', ...] >>> >>> # Generator expression -- returns iterator >>> stripped_iter = (line.strip() for line in line_list) >>> >>> # List comprehension -- returns list >>> stripped_list = [line.strip() for line in line_list] Traceback (most recent call last): File "", line 1, in File "", line 1, in AttributeError: 'ellipsis' object has no attribute 'strip' ---------- assignee: docs at python components: Documentation messages: 364247 nosy: docs at python, dxflores priority: normal severity: normal status: open title: Error on documentation - Quick fix. versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 12:39:14 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 15 Mar 2020 16:39:14 +0000 Subject: [issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash In-Reply-To: <1583311221.81.0.793172357388.issue39845@roundup.psfhosted.org> Message-ID: <1584290354.7.0.984890528013.issue39845@roundup.psfhosted.org> Eryk Sun added the comment: PowerShell translates single quotes to double quotes when they're used to delimit a string in the command line, which complies with VC++ command-line parsing and CommandLineToArgvW [1]. But PowerShell 5 has a bug here. It translates 'C:\unu doi\' into "C:\unu doi\". A double quote preceded by a backslash is parsed as a literal double quote. It should escape the trailing backslash as two backslashes, i.e. "C:\unu doi\\". PowerShell 6 (pwsh) implements it correctly. [1]: https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments?view=vs-2019 ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 13:39:37 2020 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 15 Mar 2020 17:39:37 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584293977.45.0.786165018292.issue10572@roundup.psfhosted.org> ?ric Araujo added the comment: I would advise against this for two reasons: - git does not track renames, contrart to Mercurial, so every log/diff command needs to analyse files to determine if something was moved rather than deleted + created; the matching can change depending on a command-line param, and git log needs a --follow option. - github does not apply --follow, so history for moved files is not useful: https://github.com/idomic/cpython/commits/bpo-10572-testlibs/Lib/test/tkinter_test/test_tkinter/test_widgets.py (for some reason, annotate works: https://github.com/idomic/cpython/blame/bpo-10572-testlibs/Lib/test/tkinter_test/test_tkinter/test_widgets.py ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:32:21 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:32:21 +0000 Subject: [issue39969] Remove Param expression context from AST In-Reply-To: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> Message-ID: <1584300741.17.0.287667522457.issue39969@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8689209e0338943dba9b7ff5566b8a420374764c by Batuhan Ta?kaya in branch 'master': bpo-39969: Remove ast.Param node class as is no longer used (GH-19020) https://github.com/python/cpython/commit/8689209e0338943dba9b7ff5566b8a420374764c ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:32:35 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:32:35 +0000 Subject: [issue39969] Remove Param expression context from AST In-Reply-To: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> Message-ID: <1584300755.59.0.054408250856.issue39969@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:38:56 2020 From: report at bugs.python.org (Kyle Stanley) Date: Sun, 15 Mar 2020 19:38:56 +0000 Subject: [issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError In-Reply-To: <1574201186.66.0.441437608856.issue38856@roundup.psfhosted.org> Message-ID: <1584301136.18.0.770953503669.issue38856@roundup.psfhosted.org> Kyle Stanley added the comment: > Is this open for a PR? I opened a PR for this issue a bit ago (applies Yury's suggestion of suppressing the exception), just waiting on review from Andrew when he finds the time to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:39:20 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 19:39:20 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584301160.17.0.156411782016.issue1635741@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18370 pull_request: https://github.com/python/cpython/pull/19022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:39:25 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 19:39:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584301165.79.0.834887941859.issue1635741@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18371 pull_request: https://github.com/python/cpython/pull/19021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:44:47 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:44:47 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584301487.04.0.383652757583.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > which looks a bit weird to me Is explained in the message in https://bugs.python.org/msg364211: What happens is that is moving that code so is executed in both code paths: explicit termination and multiprocessing finalization. > Unfortunately test case from first message in this bug report still hangs for me with this applied. Hummm, the test case from this bug is precisely the test case in PR 19009 so it should not hang. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:46:03 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:46:03 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584301563.87.0.795334641502.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ac10e0c93218627d1a639db0b7b41714c5f6a883 by Batuhan Ta?kaya in branch 'master': bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009) https://github.com/python/cpython/commit/ac10e0c93218627d1a639db0b7b41714c5f6a883 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:46:08 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 19:46:08 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584301568.63.0.672784891966.issue39360@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18372 pull_request: https://github.com/python/cpython/pull/19023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:47:55 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:47:55 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584301675.21.0.111025653116.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Hummm, the test case from this bug is precisely the test case in PR 19009 so it should not hang. Oh, actually I am wrong as this is a different issue I had in mind. PR 19009 should fix the case reported in https://bugs.python.org/issue38744 and this equivalent: from multiprocessing import Pool class A: def __init__(self): self.pool = Pool(processes=1) def test(): problem = A() problem.pool.map(float, tuple(range(10))) if __name__ == "__main__": test() Notice that in this code there is no __del__ call. ---------- nosy: -miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:52:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:52:05 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584301925.96.0.454506743663.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I tried and I cannot reproduce the hang with the code provided in the first message here after PR 19009. (Tested on Linux, Windows and MacOS) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:53:24 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 15 Mar 2020 19:53:24 +0000 Subject: [issue39961] warning: this use of "defined" may not be portable (Mac OS) In-Reply-To: <1584140958.39.0.802157581006.issue39961@roundup.psfhosted.org> Message-ID: <1584302004.62.0.530769016965.issue39961@roundup.psfhosted.org> Ronald Oussoren added the comment: What version of macOS are you on? And which compiler do you use? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:54:21 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:54:21 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584302061.1.0.11758628914.issue38744@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:54:16 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:54:16 +0000 Subject: [issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux In-Reply-To: <1573225244.96.0.151354887911.issue38744@roundup.psfhosted.org> Message-ID: <1584302056.87.0.674323201236.issue38744@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closed via PR 19009 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 15:57:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 19:57:00 +0000 Subject: [issue38870] Expose ast.unparse in the ast module In-Reply-To: <1574289269.61.0.90605518345.issue38870@roundup.psfhosted.org> Message-ID: <1584302220.59.0.741769963928.issue38870@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5b66ec166b81c8a77286da2c0d17be3579c3069a by Batuhan Ta?kaya in branch 'master': bpo-38870: Implement support for ast.FunctionType in ast.unparse (GH-19016) https://github.com/python/cpython/commit/5b66ec166b81c8a77286da2c0d17be3579c3069a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 16:46:20 2020 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 15 Mar 2020 20:46:20 +0000 Subject: [issue9685] tuples should remember their hash value In-Reply-To: <1282764797.19.0.867524122951.issue9685@psf.upfronthosting.co.za> Message-ID: <1584305180.37.0.151176456507.issue9685@roundup.psfhosted.org> Anthony Sottile added the comment: hit this today unfortunately -- I'm working with some pretty complex (and nested) `typing.NamedTuple` objects and the lack of caching here results in quite the slowdown (in my macro benchmarks it's the difference between a render pass taking 180ms and 25ms) the class in question is being used as a cache key: https://github.com/asottile/babi/blob/1be4e80eddc1bff0eb8047cc89337fdf006ad148/babi/highlight.py#L217 with the hash cached: ``` ?s event 123744 startup 27833 kEND5 2859 ^X ``` without the hash cached: ``` ?s event 122575 startup 180415 kEND5 3725 ^X ``` (my hash cache of course being slower than it could be in C) ``` @@ -214,10 +214,21 @@ class Region(NamedTuple): scope: Scope +_state_hash_cache = {} + + class State(NamedTuple): entries: Tuple['Entry', ...] while_stack: Tuple[Tuple['WhileRule', int], ...] + def __hash__(self): + k = id(self) + try: + return _state_hash_cache[k] + except KeyError: + ret = _state_hash_cache[k] = super().__hash__() + return ret + @classmethod def root(cls, entry: 'Entry') -> 'State': return cls((entry,), ()) ``` ___ I get that this is a pretty extreme case and it's unlikely to change the resolution of this issue, but figured I'd point it out in case anyone else is hitting similar issues ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 16:48:55 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sun, 15 Mar 2020 20:48:55 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584305335.12.0.750834201618.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: Ok, so two test cases 1) from multiprocessing.pool import ThreadPool class A(object): def __init__(self): self.pool = ThreadPool() def __del__(self): self.pool.close() self.pool.join() a = A() print(a) 2) from multiprocessing import Pool class A: def __init__(self): self.pool = Pool(processes=1) def test(): problem = A() problem.pool.map(float, tuple(range(10))) if __name__ == "__main__": test() On two my test environments with Linux, 5.5.2 and 4.9.208 kernel, glibc 2.31 (userspace is mostly the same on both) test 1) hangs, 2) doesn't hang. Testing done on 3.8 branch + https://patch-diff.githubusercontent.com/raw/python/cpython/pull/19023.patch For test 1) no traceback on ctrl+c and also no trace logged with faulthandler installed, so no idea where it hangt. strace shows [...] [pid 232031] munmap(0x7f1baaffe000, 8392704 [pid 232017] write(5, "\0\0\0\4\200\4N.", 8 [pid 232031] <... munmap resumed>) = 0 [pid 232017] <... write resumed>) = 8 [pid 232031] exit(0) = ? [pid 232017] futex(0x7f1b94000b60, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY [pid 232031] +++ exited with 0 +++ ^C ************************* ctrl + c pressed [pid 232017] <... futex resumed>) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) strace: Process 232017 detached strace: Process 232032 detached strace: Process 232033 detached strace: Process 232034 detached strace: Process 232035 detached ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 16:53:42 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 15 Mar 2020 20:53:42 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584305622.66.0.172421543776.issue38938@roundup.psfhosted.org> Dennis Sweeney added the comment: My suspicion was confirmed about PyPy (My PyPy here is Python 3.6.1 (784b254d6699, Apr 16 2019, 12:10:48) [PyPy 7.1.1-beta0 with MSC v.1910 32 bit] on win32). In what follows, "heapq2.py" had exactly the `class merge` Python implementation from PR 18427. pypy -m pyperf timeit -s "from random import random; from heapq import merge; from collections import deque; iters = [sorted(random() for j in ra nge(10_000)) for i in range(20)]" "deque(merge(*iters), maxlen=0)" Mean +- std dev: 191 ms +- 3 ms pypy -m pyperf timeit -s "from random import random; from heapq2 import merge; from collections import deque; iters = [sorted(random() for j in r ange(10_000)) for i in range(20)]" "deque(merge(*iters), maxlen=0)" Mean +- std dev: 69.3 ms +- 2.2 ms Another test: PyPy merging 2 iterables of size 100_000: heapq: Mean +- std dev: 91.4 ms +- 2.4 ms heapq2: Mean +- std dev: 52.4 ms +- 2.1 ms PyPy merging 10_000 iterables of size 100: heapq: Mean +- std dev: 2.74 sec +- 0.07 sec heapq2: Mean +- std dev: 781 ms +- 19 ms ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 17:26:28 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 21:26:28 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584307588.83.0.561782576835.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Sadly, I am unable to reproduce, so without more clarification or a reliable reproducer, we cannot start debugging the issue. > For test 1) no traceback on ctrl+c and also no trace logged with faulthandler installed, so no idea where it hangt. Can you attach with gdb and tell the C trace and the python trace (check the gdb helpers on the CPython repo for the later). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 17:26:55 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Mar 2020 21:26:55 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584307615.36.0.400668350831.issue39360@roundup.psfhosted.org> miss-islington added the comment: New changeset 7f5302fed4ff0cc8042e639b29a0664a16bc2702 by Miss Islington (bot) in branch '3.8': bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009) https://github.com/python/cpython/commit/7f5302fed4ff0cc8042e639b29a0664a16bc2702 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 17:44:40 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sun, 15 Mar 2020 21:44:40 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584308680.78.0.835487544577.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: http://ixion.pld-linux.org/~arekm/python-gdb1.txt it's a result of thread apply all bt, thread apply all bt full, where pystack command shows nothing. ps. I'm arekm at freenode and can give ssh account for playing with the issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 18:54:21 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 22:54:21 +0000 Subject: [issue37860] Add netlify deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584312861.1.0.682731014489.issue37860@roundup.psfhosted.org> Change by Ashwin Ramaswami : ---------- pull_requests: +18373 pull_request: https://github.com/python/cpython/pull/19025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:00:23 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 23:00:23 +0000 Subject: [issue37860] Add netlify deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584313223.22.0.707124377467.issue37860@roundup.psfhosted.org> Ashwin Ramaswami added the comment: Given Ernest's comment in https://github.com/python/cpython/pull/15288#issuecomment-579476340 about the limitations of Netlify (1000 build minutes per month), it doesn't seem like Netlify will be a viable alternative. Instead, I've added a PR (https://github.com/python/cpython/pull/19025) that takes an alternative approach. It uses GitHub Actions to deploy the docs to the gh-pages branch, then adds a comment to the PR with a link to the deploy preview. The way this works is that the gh-pages branch has subfolders with the SHA of each commit, and each deploy preview is deployed to each subfolder. I've enabled this on my fork of cpython -- here's an example PR on my fork: https://github.com/epicfaace/cpython/pull/7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:06:06 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 23:06:06 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584313566.73.0.134861531771.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > ps. I'm arekm at freenode and can give ssh account for playing with the issue Can you send me an email to pablogsal at gmail.com to set up ssh access? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:06:43 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Sun, 15 Mar 2020 23:06:43 +0000 Subject: [issue37860] Add netlify deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584313603.53.0.106958957633.issue37860@roundup.psfhosted.org> Ashwin Ramaswami added the comment: GitHub Pages has no limit on "build limits" like Netlify does. One limitation of this approach, though, is that GitHub Pages sites are limited to 1 GB in size. Each doc build is 50 MB, meaning that we could host at a maximum 20 builds. If we needed to, we could resolve this by doing one (or multiple) of the following: - check with GitHub to see if they will increase the limit for this case - only build PRs that have been tagged "documentation" - add a workflow to automatically remove deploy previews after a certain amount of time has passed or after a PR has been merged - don't deploy on GitHub Pages, but use something like https://surge.sh/, which apparently doesn't have a hard limit on size of a static site ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:14:40 2020 From: report at bugs.python.org (Clem Wang) Date: Sun, 15 Mar 2020 23:14:40 +0000 Subject: [issue39961] warning: this use of "defined" may not be portable (Mac OS) In-Reply-To: <1584140958.39.0.802157581006.issue39961@roundup.psfhosted.org> Message-ID: <1584314080.11.0.994797124624.issue39961@roundup.psfhosted.org> Clem Wang added the comment: Oops: forgot version numbers.... MacOS Catalina (10.15.13 19D76) 2.6 Ghz 6-Code Intel i7 32 GB RAM Homebrew 2.2.10 Homebrew/homebrew-core (git revision 58c0; last commit 2020-03-13) Homebrew/homebrew-cask (git revision ab52c7; last commit 2020-03-14) Not sure which compiler is being used, but I have these installed: gcc --version gcc (MacPorts gcc9 9.2.0_1) 9.2.0 (3.8-env) C02ZD5VVLVDQ:3.8-env clem.wang$ clang --version clang version 9.0.0 (tags/RELEASE_900/final) Target: x86_64-apple-darwin19.3.0 Thread model: posix InstalledDir: /usr/local/opt/llvm/bin ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:16:38 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 23:16:38 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584314198.34.0.5005056865.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I still cannot reproduce it in your system: [test at ixion-pld cpython]$ hostname ixion-pld [test at ixion-pld cpython]$ uname -a Linux ixion-pld 5.5.2-1 #1 SMP Wed Feb 5 19:26:43 CET 2020 x86_64 Common_KVM_processor PLD Linux [test at ixion-pld cpython]$ cat lel.py from multiprocessing.pool import ThreadPool class A(object): def __init__(self): self.pool = ThreadPool() def __del__(self): self.pool.close() self.pool.join() a = A() print(a) [test at ixion-pld cpython]$ time ./python lel.py <__main__.A object at 0x7f9130becd20> real 0m0.124s user 0m0.105s sys 0m0.021s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:17:57 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Mar 2020 23:17:57 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584314277.59.0.0782278756164.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I tested it on the master branch with commit 5b66ec166b81c8a77286da2c0d17be3579c3069a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:29:19 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Sun, 15 Mar 2020 23:29:19 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584314959.9.0.0901061029537.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: master works fine 3.8 branch hangs so there is some other/related issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:35:31 2020 From: report at bugs.python.org (Kyle Stanley) Date: Sun, 15 Mar 2020 23:35:31 +0000 Subject: [issue37860] Add netlify deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584315331.78.0.923522432024.issue37860@roundup.psfhosted.org> Kyle Stanley added the comment: > only build PRs that have been tagged "documentation" My preference would be to have a "preview-with-netlify" label that could be manually added to use the netlify preview on a case-by-case basis. There are a substantial number of trivial PRs (such as typo fixes and similar minor changes) that are automatically labelled as "documentation" which wouldn't particularly benefit from the netlify preview and would needlessly occupy part of the limit. Personally, I feel that it most largely benefits more significant documentation changes that involve modification of existing markup or the addition of new markup, rather than all documentation PRs. So a manually added label to trigger it makes the most sense to me. This would be very similar to the recently added "test-with-buildbots" label. ---------- nosy: +aeros _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 19:35:40 2020 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Mar 2020 23:35:40 +0000 Subject: [issue39725] unrelated `from None` exceptions hide prior exception information In-Reply-To: <1582405503.93.0.737085396902.issue39725@roundup.psfhosted.org> Message-ID: <1584315340.22.0.868516090351.issue39725@roundup.psfhosted.org> Nick Coghlan added the comment: Tweaked title to be "hide" rather "lose" (all the info is theoretically still there in various places, it's just hidden by the default traceback printing machinery, and hard to extract from the exception tree). Issue #18861 is the original report of this problem. My concern with Serhiy's suggestion is that it would take us from merely hiding information to actually losing it. I'm wondering if we're actually missing a piece of lower level infrastructure: a query API that reports *all* live exceptions in a thread. For example, there might be a "sys.active_exceptions()" API that returned a list of all active exceptions. * []: No exception active * [exc]: Running an except/finally/__exit__ for "exc" * [exc_inner, exc_outer]: Running an except/finally/__exit__ for "exc_inner" inside one for "exc_outer" * etc So in Serhiy's example, at the point where the context is suppressed, that new API would report [ValueError(), TypeError()] (with the relevant caught exception instances). Given that extra low level API, we would gain more options for populating attributes on exceptions. Alternatively, Serhiy's suggested approach might be sufficient, even without that new API, if we added a new __suppressed_context__ attribute to capture the original value of __context__ before it was replaced. ---------- title: unrelated `from None` exceptions lose prior exception information -> unrelated `from None` exceptions hide prior exception information _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 21:00:29 2020 From: report at bugs.python.org (R. David Murray) Date: Mon, 16 Mar 2020 01:00:29 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1584320429.06.0.525777047227.issue39073@roundup.psfhosted.org> R. David Murray added the comment: Thanks for the PR. I've made some review comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 21:40:51 2020 From: report at bugs.python.org (Caleb Hattingh) Date: Mon, 16 Mar 2020 01:40:51 +0000 Subject: [issue39839] Non-working error handler when creating a task with assigning a variable In-Reply-To: <1583259870.1.0.174919125514.issue39839@roundup.psfhosted.org> Message-ID: <1584322851.89.0.660330427926.issue39839@roundup.psfhosted.org> Caleb Hattingh added the comment: Can reproduce also on 3.8. Another version that "works" (raises the exception) is task = loop.create_task(test()) del task Suggests there's something going on with reference counting or garbage collection. In the version that "doesn't work", the task exception only appears in the custom exception handler when the loop is stopped, not before. I've added a log message to show each second that passes, and the loop is stopped after 5 seconds: import asyncio import logging def handle_exception(loop, context): msg = context.get("exception", context["message"]) logging.error("Caught exception: %s", msg) async def test(): await asyncio.sleep(1) raise Exception("Crash.") def second_logger(loop, count) -> int: logging.warning(count) loop.call_later(1, lambda count=count: second_logger(loop, count + 1)) def main(): loop = asyncio.get_event_loop() loop.call_later(1, lambda: second_logger(loop, 0)) loop.call_later(5, loop.stop) loop.set_exception_handler(handle_exception) task = loop.create_task(test()) try: loop.run_forever() finally: loop.close() if __name__ == "__main__": main() OUTPUT: $ py -3.8 -u bpo-issue39839.py WARNING:root:0 WARNING:root:1 WARNING:root:2 WARNING:root:3 WARNING:root:4 ERROR:root:Caught exception: Crash. ---------- nosy: +cjrh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 21:46:10 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 16 Mar 2020 01:46:10 +0000 Subject: [issue39971] Error on documentation - Quick fix. In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1584323170.47.0.447019889152.issue39971@roundup.psfhosted.org> Eric V. Smith added the comment: I don't think that was meant to be a literal example. I think that "..." here means "and other strings". ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 22:11:52 2020 From: report at bugs.python.org (Ashwin Ramaswami) Date: Mon, 16 Mar 2020 02:11:52 +0000 Subject: [issue37860] Add deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584324712.44.0.569959802133.issue37860@roundup.psfhosted.org> Change by Ashwin Ramaswami : ---------- title: Add netlify deploy preview for docs -> Add deploy preview for docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 22:13:32 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 02:13:32 +0000 Subject: [issue34882] f(a=1, *args) should be a SyntaxError In-Reply-To: <1538553672.9.0.545547206417.issue34882@psf.upfronthosting.co.za> Message-ID: <1584324812.88.0.969476081148.issue34882@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 22:34:57 2020 From: report at bugs.python.org (Todd Jennings) Date: Mon, 16 Mar 2020 02:34:57 +0000 Subject: [issue39883] Use BSD0 license for code in docs In-Reply-To: <1583553057.27.0.724137569708.issue39883@roundup.psfhosted.org> Message-ID: <1584326097.23.0.90226650469.issue39883@roundup.psfhosted.org> Todd Jennings added the comment: Hi Terry, Please take a look at the linked PR. This was already discussed on the python-ideas mailing list and Guido agreed this is a good idea. It is currently waiting on a PSF board decision. Guido requested I create a blurb, and that required a corresponding issue number, so I created this issue. But to answer your question, the problem is incorporating code into an existing project. The whole point of examples and recipes is that they be used in other projects. But keeping them under the Python 2.0 license makes this hard, since it requires all the documentation keep that same license. So you can't use, say, an itertools recipe without keeping a separate license for that code, and some way to identify which code falls under that license. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 22:38:12 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 02:38:12 +0000 Subject: [issue37860] Add deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584326292.33.0.97425774695.issue37860@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 22:52:46 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 16 Mar 2020 02:52:46 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584327166.38.0.220772422688.issue39939@roundup.psfhosted.org> Raymond Hettinger added the comment: Guido, do you support this API expansion? ---------- nosy: +gvanrossum, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 23:08:17 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 16 Mar 2020 03:08:17 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584328097.35.0.264712469268.issue39968@roundup.psfhosted.org> Raymond Hettinger added the comment: Tim, do you approve of this kind of wholesale macro-to-inline function conversion? My thought is that in most cases, there is no advantage to conversion and that sometimes there will be minor disadvantage in code generation when the macro is used across files. I like inline functions as well as next person, but that doesn't mean all macros have to be rewritten. Mostly, this seems like unnecessary code churn. ---------- nosy: +rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 23:12:04 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 16 Mar 2020 03:12:04 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584328324.8.0.839593032844.issue38938@roundup.psfhosted.org> Raymond Hettinger added the comment: Serhiy, I've got this one. It will still take a little to get to it, but I've already invested work in it. The code idea is plausible but I want to think it through for both CPython and PyPy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 23:20:23 2020 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 16 Mar 2020 03:20:23 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584328823.55.0.923527088923.issue39824@roundup.psfhosted.org> Nick Coghlan added the comment: Petr's point that any subclass state should be managed in the subclass cleanup functions is a good one, so I withdraw my concern: * custom module subclasses should clean up like any other class instance * the module slots are then only needed if the module state actually gets populated, so we can safely skip them if it never even gets allocated ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 15 23:28:28 2020 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 16 Mar 2020 03:28:28 +0000 Subject: [issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main() In-Reply-To: <1583628832.97.0.582883450111.issue39892@roundup.psfhosted.org> Message-ID: <1584329308.92.0.360245767829.issue39892@roundup.psfhosted.org> Nick Coghlan added the comment: Issue 10535 says they should already be on by default in unittest. I seem to recall checking that was still true when implementing the default warning filter changes in 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 00:04:11 2020 From: report at bugs.python.org (Yi Luan) Date: Mon, 16 Mar 2020 04:04:11 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584331451.62.0.38619184098.issue39970@roundup.psfhosted.org> Yi Luan added the comment: Hi, Thanks for taking time to reply my question. I suppose the title I put was a bit confusing. And the recommended way to generate time in UTC does solve this issue, in Python. However the message I was trying to convey is, the behavior of timestamp() is one action too much from my point of view. Say, for example, if I'm sending data generated on my local machine (in CST time) to someone else, and for easy comparison and precision I used `datetime.datetime.now().timestamp()` as the value of time fields. I would naturally think that the timestamp() function returned the timestamp of my local time. And if the person who received the data, instead of using Python, used Node.js to import those timestamps, and told by me that the timestamps were in CST time. Then he/she will get the wrong time since those timestamps were actually in UTC. As Scott Mayer, the author of Effective C++, once said, "APIs should be easy to use correctly and hard to use incorrectly", timestamp() functions from my point of view did one thing too much, it shouldn't shift any datetime object that it was fed into. And in the documentation of datetime.timestamp(), there is no warning about this behavior, only a note on getting the UTC time. It only says "Return POSIX timestamp corresponding to the datetime instance". From my understanding POSIX timestamp is the time elapsed since epoch, not time elapsed -8 hours on CST timed machines since epoch. By it's nature, timestamps couldn't and shouldn't incorporate any timezone information, when only presented with a naive datetime, program should only convert it to whatever datetime that timestamp represents, rather than thinking that the machine is in some timezone and shifts it by some time and then converts it. Sorry if what I wrote does not make sense, the reason for me to use utcnow() is just to demonstrate, from my point of view utcnow() or utcfromtimestamp() did nothing wrong, but the problem lies with the timestamp() and fromtimestamp() functions' extra behavior. Another example is, say, the current unix epoch is 1584330809, when I fed it into Python on my local machine, I get: >>> datetime.datetime.fromtimestamp(1584330809) datetime.datetime(2020, 3, 16, 11, 53, 29) when I fed it into Node.js, I get: > new Date(1584330809*1000) 2020-03-16T03:53:29.000Z >From my point of view, the Node's behavior is much more natural and intuitive. since we didn't know what timezone 1584330809 is in, the returned datetime should be just how many seconds elapsed since epoch, not my local time of the machine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 00:15:14 2020 From: report at bugs.python.org (Yi Luan) Date: Mon, 16 Mar 2020 04:15:14 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584332114.83.0.910614557049.issue39970@roundup.psfhosted.org> Yi Luan added the comment: Sorry to make changes again but I typed his name wrong = =! It's Scott Meyers. Apologies. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 00:32:55 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 16 Mar 2020 04:32:55 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584333175.34.0.45782214625.issue39939@roundup.psfhosted.org> Guido van Rossum added the comment: I stopped following the discussion at some point, but I think this is worth adding it -- I have seen this done over and over again, and apparently lots of other people have felt the need too. I think these names are fine, and about the best we can do (keeping in line with the "feel" of the rest of the string API). I like the behavior of returning a copy of the string if there's no match (as opposed to failing, which was also brought up). If the original object is immutable this should return the original object, but that should be considered a CPython optimization (IIRC all the string methods are pretty careful about that), but not required by the spec. FWIW the pseudo code has a copy/paste error: In cutsuffix() it should use endswith() rather than startswith(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 00:42:58 2020 From: report at bugs.python.org (Ion SKALAMERA) Date: Mon, 16 Mar 2020 04:42:58 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" Message-ID: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> New submission from Ion SKALAMERA : I tried programming a recursive fractal with Python Turtle on repl.it: https://repl.it/@IonSKALAMERA/simplefractalrecursive and when my code came to calculating the angle degrees(0) returned NoneType which is a serious bug in the math library. I dont know with which Python version it operates ---------- messages: 364285 nosy: Ion SKALAMERA priority: normal severity: normal status: open title: Math library Bug Return None for "degrees(0)" type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 01:12:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 16 Mar 2020 05:12:27 +0000 Subject: [issue39883] Use BSD0 license for code in docs In-Reply-To: <1583553057.27.0.724137569708.issue39883@roundup.psfhosted.org> Message-ID: <1584335547.96.0.254730495346.issue39883@roundup.psfhosted.org> Terry J. Reedy added the comment: OK. I looked at the PR. Normally, issue comes first, with justification and approval status. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 01:21:31 2020 From: report at bugs.python.org (Ion SKALAMERA) Date: Mon, 16 Mar 2020 05:21:31 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" In-Reply-To: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> Message-ID: <1584336091.25.0.669042613071.issue39972@roundup.psfhosted.org> Change by Ion SKALAMERA : ---------- nosy: +mark.dickinson, rhettinger, stutzbach -Ion SKALAMERA _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 01:23:17 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 16 Mar 2020 05:23:17 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect Message-ID: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> New submission from Zackery Spytz : PyObject_GenericSetDict() takes three arguments, but the documentation states that it takes just two. ---------- assignee: docs at python components: Documentation messages: 364287 nosy: ZackerySpytz, docs at python priority: normal severity: normal status: open title: The documentation for PyObject_GenericSetDict() is incorrect versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 01:25:06 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 16 Mar 2020 05:25:06 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584336306.17.0.764708409062.issue39973@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +18374 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 01:37:14 2020 From: report at bugs.python.org (Ion SKALAMERA) Date: Mon, 16 Mar 2020 05:37:14 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" In-Reply-To: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> Message-ID: <1584337034.03.0.876433108633.issue39972@roundup.psfhosted.org> Change by Ion SKALAMERA : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 02:02:01 2020 From: report at bugs.python.org (tzickel) Date: Mon, 16 Mar 2020 06:02:01 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join Message-ID: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> New submission from tzickel : bpo 36051 added optimization to release GIL on certain conditions of bytes joining, but it has missed a critical path. If the number of items joining is less or equal to NB_STATIC_BUFFERS (10) than static_buffers will be used to hold the buffers. https://github.com/python/cpython/blob/5b66ec166b81c8a77286da2c0d17be3579c3069a/Objects/stringlib/join.h#L54 But then the decision to release the GIL or not (drop_gil) does not take this into consideration, and the GIL might be released and then another thread is free to do the same code path, and hijack the static_buffers for it's own usage, causing a race condition. A decision should be made if it's worth for the optimization to not use the static buffers in this case (although it's an early part of the code...) or not drop the GIL anyhow if it's static buffers (a thing which might make this optimization not worth it, since based on length of data to join, and not number of items to join). ---------- messages: 364288 nosy: tzickel priority: normal severity: normal status: open title: A race condition with GIL releasing exists in stringlib_bytes_join versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 02:06:31 2020 From: report at bugs.python.org (tzickel) Date: Mon, 16 Mar 2020 06:06:31 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584338791.86.0.298208294198.issue39974@roundup.psfhosted.org> Change by tzickel : ---------- nosy: +bmerry, inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 02:12:42 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 16 Mar 2020 06:12:42 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" In-Reply-To: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> Message-ID: <1584339162.29.0.749135432621.issue39972@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: math.degrees returns 0.0 and even has a test for this at https://github.com/python/cpython/blob/5b66ec166b81c8a77286da2c0d17be3579c3069a/Lib/test/test_math.py#L476 . I am not sure of the environment under which repl.it runs as sys is not accessible. I guess it's an issue on their side. ./python.exe Python 3.9.0a4+ (heads/master:5b66ec166b, Mar 16 2020, 10:41:43) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import math >>> math.degrees(0) 0.0 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 02:30:03 2020 From: report at bugs.python.org (Bruce Merry) Date: Mon, 16 Mar 2020 06:30:03 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584340203.65.0.624351424275.issue39974@roundup.psfhosted.org> Bruce Merry added the comment: Good catch! I'll take a look this week to see what makes sense for the use case for which I originally proposed this optimisation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 02:38:26 2020 From: report at bugs.python.org (Hamid Nazari) Date: Mon, 16 Mar 2020 06:38:26 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" In-Reply-To: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> Message-ID: <1584340706.33.0.790277975017.issue39972@roundup.psfhosted.org> Hamid Nazari added the comment: You seem to be calling `turtle.degrees()`, not `math.degrees()`. Try this in your Repl.it: (which does not use cpython, rather it uses Skulpt) import math import turtle print(turtle.degrees(0)) print(math.degrees(0)) ---------- nosy: +hamidnazari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 03:03:32 2020 From: report at bugs.python.org (SilentGhost) Date: Mon, 16 Mar 2020 07:03:32 +0000 Subject: [issue39972] Math library Bug Return None for "degrees(0)" In-Reply-To: <1584333778.69.0.393057197826.issue39972@roundup.psfhosted.org> Message-ID: <1584342212.64.0.420765290287.issue39972@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +Ion SKALAMERA resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 03:17:33 2020 From: report at bugs.python.org (tzickel) Date: Mon, 16 Mar 2020 07:17:33 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584343053.87.0.253397953794.issue39974@roundup.psfhosted.org> tzickel added the comment: Also, in line: https://github.com/python/cpython/blob/d07d9f4c43bc85a77021bcc7d77643f8ebb605cf/Objects/stringlib/join.h#L85 perhaps add an if to check if the backing object is really mutable ? (Py_buffer.readonly) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 03:18:39 2020 From: report at bugs.python.org (Noel del rosario) Date: Mon, 16 Mar 2020 07:18:39 +0000 Subject: [issue39975] Group of commands running in Python 3.7.6 Shell, but failing as Script file. Message-ID: <1584343119.59.0.433664804662.issue39975@roundup.psfhosted.org> New submission from Noel del rosario : Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. from future import absolute_import, division, print_function, unicode_literals import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras print(tf.version) 2.1.0 BUT IF I RUN THESE COMMANDS as a PYTHON SCRIPT FILE iy FAILS. ======================== RESTART: D:\PythonCode-1\tmp.py ======================= Traceback (most recent call last): File "D:\PythonCode-1\tmp.py", line 7, in import tensorflow as tf File "C:\Python37\lib\site-packages\tensorflow_init_.py", line 101, in from tensorflow_core import * File "C:\Python37\lib\site-packages\tensorflow_core_init_.py", line 40, in from tensorflow.python.tools import module_util as _module_util ModuleNotFoundError: No module named 'tensorflow.python.tools'; 'tensorflow.python' is not a package Why is it failing as a Script file ? Is there something wrong in my Procedure ? Hope to teceive your reply and Thanks in Advanced. ---------- messages: 364293 nosy: rosarion priority: normal severity: normal status: open title: Group of commands running in Python 3.7.6 Shell, but failing as Script file. versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 03:38:21 2020 From: report at bugs.python.org (tzickel) Date: Mon, 16 Mar 2020 07:38:21 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584344301.62.0.930892851413.issue39974@roundup.psfhosted.org> tzickel added the comment: Also, semi related, (dunno where to discuss it), would a good .join() optimization be to add an optional length parameter, like .join(iterable, length=10), and when running in that code-path, it would skip all the calls to (PySequence_Fast which converts no list to list), and all the pre calculation of length to calculate allocation size, and instead directly start copying from input until length is done, and if the iterable didn't have enough length to fill up, only then throw an exception ? There are places where you know how much information you expect to be .joining (or you want to join just a part of it) ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 03:52:43 2020 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 16 Mar 2020 07:52:43 +0000 Subject: [issue39976] Add "**other_popen_kwargs" to subprocess API signatures in docs Message-ID: <1584345163.73.0.77779853177.issue39976@roundup.psfhosted.org> New submission from Nick Coghlan : Two of my colleagues missed the "The arguments shown above are merely the most common ones, ..." caveat on the subprocess.run documentation, and assumed that Python 3.5 only supported the "cwd" option in the low level Popen API, and not any of the higher level APIs. Something we could potential do is include a "**other_popen_kwargs" placeholder in the affected API signatures (run, call, check_call, check_output) that makes it clear there are more options beyond the explicitly listed ones. ---------- assignee: docs at python components: Documentation messages: 364295 nosy: docs at python, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add "**other_popen_kwargs" to subprocess API signatures in docs type: enhancement versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 04:13:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Mar 2020 08:13:16 +0000 Subject: [issue39638] Keep ASDL signatures for AST nodes In-Reply-To: <1581766346.86.0.0377348739096.issue39638@roundup.psfhosted.org> Message-ID: <1584346396.94.0.981460658833.issue39638@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4ab362cec6dc68c798b3e354f687cf39e207b9a9 by Batuhan Ta?kaya in branch 'master': bpo-39638: Keep ASDL signatures in the AST nodes (GH-18515) https://github.com/python/cpython/commit/4ab362cec6dc68c798b3e354f687cf39e207b9a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 04:20:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Mar 2020 08:20:35 +0000 Subject: [issue38938] Possible performance improvement for heaqq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1584346835.73.0.111920445672.issue38938@roundup.psfhosted.org> Serhiy Storchaka added the comment: Are there any algorithmic optimizations in the Python version or it was just rewritten from a generator function to a class? If yes, how hard to keep the functional design? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 04:21:03 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Mar 2020 08:21:03 +0000 Subject: [issue39638] Keep ASDL signatures for AST nodes In-Reply-To: <1581766346.86.0.0377348739096.issue39638@roundup.psfhosted.org> Message-ID: <1584346863.65.0.588615401082.issue39638@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 Mar 16 04:57:16 2020 From: report at bugs.python.org (Lin Gao) Date: Mon, 16 Mar 2020 08:57:16 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1584349036.16.0.190800557094.issue39952@roundup.psfhosted.org> Lin Gao added the comment: Hi, Thanks for your reply and info! I've tried to use you provided --no-tkinter to re-build python3.6. And now There is only one error left. Have you encountered this problem? build -e -r --no-tkinter -v "/p:PlatformToolset=v142" "/p:WindowsTargetPlatformVersion=10.0.18362.0" Error: LINK : fatal error LNK1181: cannot open input file 'Microsoft.VisualStudio.Setup.Configuration.Native.lib' [F: \gitP\python\cpython\PCbuild\_distutils_findvs.vcxproj] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 04:59:01 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Mon, 16 Mar 2020 08:59:01 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584349141.7.0.511248827279.issue39879@roundup.psfhosted.org> Change by Furkan ?nder : ---------- nosy: +furkanonder nosy_count: 4.0 -> 5.0 pull_requests: +18375 pull_request: https://github.com/python/cpython/pull/19027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 05:38:37 2020 From: report at bugs.python.org (Inada Naoki) Date: Mon, 16 Mar 2020 09:38:37 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584351517.56.0.618567661705.issue39974@roundup.psfhosted.org> Inada Naoki added the comment: static_buffers is not a static variable. It is auto local variable. So I think other thread don't hijack it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 05:40:25 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Mon, 16 Mar 2020 09:40:25 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584351625.85.0.800905983423.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: On master test 1) hangs before commit below and works after commit below. Unfortunately applying that commit to 3.8 branch doesn't help - 3.8 still hangs. Some other fix is also needed I guess commit 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 Author: Victor Stinner Date: Mon Mar 9 23:37:49 2020 +0100 bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848) Clear the frames of daemon threads earlier during the Python shutdown to call objects destructors. So "unclosed file" resource warnings are now emitted for daemon threads in a more reliable way. Cleanup _PyThreadState_DeleteExcept() code: rename "garbage" to "list". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 05:43:11 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Mon, 16 Mar 2020 09:43:11 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584351791.75.0.750833394422.issue39879@roundup.psfhosted.org> Furkan ?nder added the comment: I sent pr. All tests passed successfully. If accepted, this will be my first contribution :) https://github.com/python/cpython/pull/19027 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 05:43:11 2020 From: report at bugs.python.org (Inada Naoki) Date: Mon, 16 Mar 2020 09:43:11 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584343053.87.0.253397953794.issue39974@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: > > > > perhaps add an if to check if the backing object is really mutable ? > (Py_buffer.readonly) > > Py_buffer.readonly doesn't mean immutable. You can create read only buffer from bytearray too. Current logic uses PyBytes_CheckExact. It is safe and enough for most cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 05:50:19 2020 From: report at bugs.python.org (Bruce Merry) Date: Mon, 16 Mar 2020 09:50:19 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584352219.42.0.21085977759.issue39974@roundup.psfhosted.org> Bruce Merry added the comment: > static_buffers is not a static variable. It is auto local variable. > So I think other thread don't hijack it. Oh yes, quite right. I should have looked closer at the code first before commenting. I think this can be closed as not-a-bug, unless +tzickel has example code that gives the wrong output? > perhaps add an if to check if the backing object is really mutable ? (Py_buffer.readonly) It's not just the buffer data being mutable that's an issue, it's the owning object. It's possible for an object to expose a read-only buffer, but also allow the buffer (including its size or address) to be mutated through its own API. > Also, semi related, (dunno where to discuss it), would a good .join() optimization be to add an optional length parameter, like .join(iterable, length=10) You could always open a separate bug for it, but I can't see it catching on given that one needs to modify one's code for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 06:00:56 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 10:00:56 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1584352856.07.0.43116239678.issue36287@roundup.psfhosted.org> Batuhan Taskaya added the comment: @serhiy.storchaka, with these ASDL signatures, I have a patch that would omit default values for both Nones and [] in case they are redundant. But this is a bit different than your approach so I wanted to ask what's your opinion about adding an extra argument called omit_defaults, and only omit defaults it present. I'm adding this because unlike your first patch, these aren't actually defaults when creating the objects (like ast.Module(body=[x]) != ast.Module(body=[x], type_ignores=[])) so doing anything other than looking to that representation would be different than the actual result. What're your opinions about this? (I'm submitting the initial version of the patch before doing a PR) ---------- Added file: https://bugs.python.org/file48975/ast.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 06:26:37 2020 From: report at bugs.python.org (foldr) Date: Mon, 16 Mar 2020 10:26:37 +0000 Subject: [issue39977] Python aborts trying to load libcrypto.dylib Message-ID: <1584354397.7.0.17560175577.issue39977@roundup.psfhosted.org> New submission from foldr : Good morning. I recently updated my system to MacOS Catalina and python crashes if it tries to load libcrypto.dylib. I have attached the crash report generated by MacOS. Steps to reproduce: Calling a binary that loads the library causes the crash: $ luigi [1] 70375 abort luigi $ dex2call [1] 70451 abort dex2call Loading the library from the interpreter triggers the crash too: $ python Python 3.7.6 (default, Dec 30 2019, 19:38:28) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import dex2call [1] 70536 abort python I have tested with https://pypi.org/project/luigi/ and https://pypi.org/project/dex2call/. Invoking python without any script or with (I suppose) a script that does not require libcrypto works fine: $ python Python 3.7.6 (default, Dec 30 2019, 19:38:28) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> $ python ~/scripts/yt2nb.py Traceback (most recent call last): File "/Users/foldr/scripts/yt2nb.py", line 6, in e = xml.etree.ElementTree.parse(sys.argv[1]).getroot() IndexError: list index out of range The content of yt2nb.py is: #!/usr/bin/env python3 import xml.etree.ElementTree import sys e = xml.etree.ElementTree.parse(sys.argv[1]).getroot() for outline in e.iter('outline'): if "type" in outline.attrib and outline.attrib["type"] == "rss": url = outline.attrib['xmlUrl'] name = outline.attrib['title']#.encode("utf-8") print("%s youtube \"~%s\"" % (url, str(name))) I have Python installed from brew and the crash report has all the relevant version numbers. Let me know if you need more information for testing or reproducibility. Thank you. Daniel. ---------- components: macOS files: python-crash.txt messages: 364306 nosy: foldr, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python aborts trying to load libcrypto.dylib type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48976/python-crash.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 06:43:15 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Mon, 16 Mar 2020 10:43:15 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584355395.72.0.69819004176.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: This one is also needed on 3.8 to get it not hang with 1) test case. So 3.8 branch + 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 + 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 is working for me. commit 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 Author: Victor Stinner Date: Sat Feb 1 02:30:25 2020 +0100 bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296) PyThreadState.on_delete is a callback used to notify Python when a thread completes. _thread._set_sentinel() function creates a lock which is released when the thread completes. It sets on_delete callback to the internal release_sentinel() function. This lock is known as Threading._tstate_lock in the threading module. The release_sentinel() function uses the Python C API. The problem is that on_delete is called late in the Python finalization, when the C API is no longer fully working. The PyThreadState_Clear() function now calls the PyThreadState.on_delete callback. Previously, that happened in PyThreadState_Delete(). The release_sentinel() function is now called when the C API is still fully working. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 07:04:15 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 11:04:15 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584356655.82.0.369503990357.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Can you try applying 4f384af067d05b16a554bfd976934fca9f87a1cf and 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 together? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 07:04:57 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 11:04:57 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584356697.41.0.361354940175.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, sorry, I missed your last message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 07:07:24 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 11:07:24 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584356844.26.0.495468687856.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > So 3.8 branch + 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 + 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 is working for me. I can confirm that these commits together fix the problem. Victor, are you OK if we backport both changes to 3.8? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 07:17:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Mar 2020 11:17:19 +0000 Subject: [issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections) In-Reply-To: <1580231817.93.0.47144630055.issue39481@roundup.psfhosted.org> Message-ID: <1584357439.52.0.745117341163.issue39481@roundup.psfhosted.org> ?ukasz Langa added the comment: Submitted a request for consideration by the Steering Council: https://github.com/python/steering-council/issues/21 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 08:20:48 2020 From: report at bugs.python.org (Ido Michael) Date: Mon, 16 Mar 2020 12:20:48 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584361248.52.0.955017862878.issue10572@roundup.psfhosted.org> Ido Michael added the comment: Hey Eric, I'm not sure what you mean, you don't recommend the change in general? Or you just don't recommend Git for this and saying I should use Mercurial instead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:04:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:04:33 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584363873.81.0.921271882373.issue39939@roundup.psfhosted.org> STINNER Victor added the comment: The proposed change will affect many builtin types: bytes, bytearray, str, but also other types like collections.UserString. Would it make sense to summarize what has been said in the python-ideas thread into a PEP? It may good to specify things like: >>> x = "A"*10**6 >>> x.cutprefix("B") is x True The specification can be just "that's an implementation detail" or "CPython implementation specific" :-) I don't expect such PEP to be long nor controversial, but it may help to write it down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:06:36 2020 From: report at bugs.python.org (Ma Lin) Date: Mon, 16 Mar 2020 13:06:36 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584363996.98.0.0645024168685.issue39974@roundup.psfhosted.org> Ma Lin added the comment: I also planned to review this commit at some moment, I feel a bit unsteady about it. If an optimization needs to be fine-tuned, and may introduces some pitfalls for future code maintenance, IMHO it is best to avoid doing this kind of optimization. ---------- nosy: +Ma Lin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:15:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:15:22 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584364522.6.0.0723878352414.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f707d94af68a15afc27c1a9da5835f9456259fea by Hai Shi in branch 'master': bpo-39968: Convert extension modules' macros of get_module_state() to inline functions (GH-19017) https://github.com/python/cpython/commit/f707d94af68a15afc27c1a9da5835f9456259fea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:21:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:21:03 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584364863.54.0.0203350964586.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: There are multiple good reasons to replace macros with static inline functions: * Parameter types and return value are well defined * Less error-prone: avoid completely https://gcc.gnu.org/onlinedocs/gcc-9.3.0/cpp/Macro-Pitfalls.html#Macro-Pitfalls * Variables have a well defined scope, reduce the risk of unexpected side effects I merged the PR 19017: it uses better names for the function and it adds assert(state != NULL). Be careful of bpo-39824: in some cases, the module state *can* be NULL: but I checked, and it's not the case here. Moreover, bpo-39824 may prevent NULL module state (let's see ;-)). Thanks Hai Shi! > minor disadvantage in code generation Micro-benchmarks and machine code analysis was done in previous issues replacing macros with static inline functions, and the outcome is that there is no effect on performance. See for example bpo-35059: performance critical Py_INCREF() and Py_DECREF() functions are now static inline functions. If someone is curious about the the machine code, you should use -O3 with PGO+LTO, which is what should be used on Linux distributions. If static inline functions are not inlined for whatever reason, I suggest to tune the compiler rather than moving back to ugly macros. If you use configure --enable-shared, I now also strongly suggest to use -fno-semantic-interposition: it's now used on Fedora and RHEL to build Python libpython. Note: Support for "static inline" is now explicitly required by the PEP 7 to build Python, since Python 3.6. And it's more and more used in Python header files. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:23:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:23:12 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584364992.77.0.054840777199.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: Note: Hai Shi is working hard on converting modules to multiphase module initialization (PEP 489) which helps to cleanup the Python state at exit, and subinterpreters will likely benefit of that. This issue is related to this work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:35:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:35:45 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584365745.71.0.643743770983.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: I updated PR 18738 to document the incompatible change in What's New In Python 3.9. Sadly, I expect that almost no third-party extension module implement the PEP 489 yet. So I expect that little or no third-party code is impacted in pratice. > the module slots are then only needed if the module state actually gets populated, so we can safely skip them if it never even gets allocated That's also my understanding. > custom module subclasses should clean up like any other class instance That sounds like a reasonable compromise to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:38:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:38:34 +0000 Subject: [issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main() In-Reply-To: <1583628832.97.0.582883450111.issue39892@roundup.psfhosted.org> Message-ID: <1584365914.77.0.304275526281.issue39892@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:39:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:39:05 +0000 Subject: [issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError In-Reply-To: <1574201186.66.0.441437608856.issue38856@roundup.psfhosted.org> Message-ID: <1584365945.2.0.975384549172.issue38856@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:46:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:46:45 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584366405.53.0.581424171432.issue39954@roundup.psfhosted.org> STINNER Victor added the comment: Do you suggest to skip the test if returncode has a specific value? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 09:50:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 13:50:50 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584366650.79.0.861625182366.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I forgot a cool advantage that I discovered late: debuggers and profilers understand inlined code and are able to get the name of the static inline function, whereas it's not possible to do that with macros. If I recall correctly, it works even if the function is inlined. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:00:17 2020 From: report at bugs.python.org (hai shi) Date: Mon, 16 Mar 2020 14:00:17 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584367217.28.0.844633611903.issue39968@roundup.psfhosted.org> hai shi added the comment: Wow, thanks, victor. those msgs is very helpful to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:04:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 14:04:25 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584367464.99.0.266611422451.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c98f87fc330eb40fbcff627dfc50958785a44f35 by Dong-hee Na in branch 'master': bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986) https://github.com/python/cpython/commit/c98f87fc330eb40fbcff627dfc50958785a44f35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:05:08 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 16 Mar 2020 14:05:08 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584367508.5.0.772242983407.issue39970@roundup.psfhosted.org> Paul Ganssle added the comment: @Yi Luan I think you may misunderstand what the `.timestamp()` function does - it returns an epoch time, which is the amount of time (in seconds) elapsed since the Unix epoch: https://en.wikipedia.org/wiki/Unix_time The number is not different depending on your time zone: >>> from datetime import * >>> from dateutil import tz >>> dt = datetime(2019, 1, 1, tzinfo=timezone.utc) >>> print(f"{dt}: {dt.timestamp()}") 2019-01-01 00:00:00+00:00: 1546300800.0 >>> dt = dt.astimezone(tz.gettz("America/New_York")) >>> print(f"{dt}: {dt.timestamp()}") 2018-12-31 19:00:00-05:00: 1546300800.0 >>> dt = dt.astimezone(tz.gettz("Asia/Tokyo")) >>> print(f"{dt}: {dt.timestamp()}") 2019-01-01 09:00:00+09:00: 1546300800.0 Note how the timestamp number is always the same. Alexander's suggestion of using `datetime.now(tz=timezone.utc).timestamp()` is slightly misleading because `datetime.now().timestamp()` and `datetime.now(tz=timezone.utc).timestamp()` will always return the same value. I think he was just using that as shorthand for "replace datetime.utcnow() with datetime.now(tz=timezone.utc) in all cases". When you have a naive datetime (with no tzinfo), the only options are to pick the time zone it represents and convert to UTC or to throw an error and say, "We don't know what time zone this represents, so we cannot do this operation." Python 2 used to throw an exception, but in Python 3 naive datetimes represent local times. If you want "nominal number of seconds since 1970-01-01T00:00:00 *in this time zone*", you want something more like this: def seconds_since(dt, epoch=datetime(1970, 1, 1)): return (dt.replace(tzinfo=None) - epoch).total_seconds() That does not take into account total elapsed time from DST transitions and the like - to do that, you'll want something more like this: def seconds_elapsed_since(dt, epoch=datetime(1970, 1, 1)): if epoch.tzinfo is None and dt.tzinfo is not None: epoch = epoch.replace(tzinfo=dt.tzinfo) return (dt - epoch).total_seconds() I urge you not to do this in any sort of interop protocol, though, because integer timestamps are traditionally interpreted as Unix times, and if you start passing around an integer timestamp that represents "unix time plus or minus a few hours", you are likely to create bugs when someone mistakes it for a unix time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:06:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 14:06:32 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584367592.34.0.363575177898.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 87ec86c425a5cd3ad41b831b54c0ce1a0c363f4b by Dong-hee Na in branch 'master': bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980) https://github.com/python/cpython/commit/87ec86c425a5cd3ad41b831b54c0ce1a0c363f4b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:09:28 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Mar 2020 14:09:28 +0000 Subject: [issue39978] Vectorcall implementation should conform to PEP 590. Message-ID: <1584367768.43.0.96665023225.issue39978@roundup.psfhosted.org> New submission from Mark Shannon : The implementation of `PyObject_Vectorcall` adds unnecessary overhead to PEP 590, which undermines its purpose. The implementation was changed in https://github.com/python/cpython/pull/17052, which I objected to at the time. The change has a negative impact on performance as it add calls to both `PyThreadState_GET()` and `_Py_CheckFunctionResult()`. This is practically an invitation for callers to skip `PyObject_Vectorcall` and access the underlying function pointer directly, making `PyObject_Vectorcall` pointless. https://github.com/python/cpython/pull/17052 should be reverted. ---------- keywords: 3.9regression messages: 364325 nosy: Mark.Shannon, petr.viktorin, vstinner priority: normal severity: normal status: open title: Vectorcall implementation should conform to PEP 590. versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:24:16 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 14:24:16 +0000 Subject: [issue36287] Make ast.dump() not output optional default fields In-Reply-To: <1552556885.52.0.772295389158.issue36287@roundup.psfhosted.org> Message-ID: <1584368656.74.0.831696423486.issue36287@roundup.psfhosted.org> Batuhan Taskaya added the comment: Actually I have a better solution for this (which I hope to share really soon if it works.) I think we can do default value initialization for both Nones (with your patch) and lists, it requires a bit of extra work but I think I can do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:27:01 2020 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 16 Mar 2020 14:27:01 +0000 Subject: [issue39978] Vectorcall implementation should conform to PEP 590. In-Reply-To: <1584367768.43.0.96665023225.issue39978@roundup.psfhosted.org> Message-ID: <1584368821.3.0.701936672902.issue39978@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:52:01 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 16 Mar 2020 14:52:01 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584370321.64.0.558275994995.issue39968@roundup.psfhosted.org> Dong-hee Na added the comment: > cpython/Modules/readline.c:90:20: error: unknown type name 'PyModule' get_readline_state(PyModule *module) Compile is failure after PR 19017 is merged on macOS. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:57:54 2020 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBKZXppb3Jza8O9?=) Date: Mon, 16 Mar 2020 14:57:54 +0000 Subject: [issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError In-Reply-To: <1550845114.74.0.376208054151.issue36078@roundup.psfhosted.org> Message-ID: <1584370674.52.0.443727954892.issue36078@roundup.psfhosted.org> Tom?? Jeziorsk? added the comment: I found what appears to be a very similar issue so instead of creating a new issue I will place it here as a comment. The following code: == import argparse parser = argparse.ArgumentParser() parser.add_argument('letter', choices=['a', 'b', 'c'], default=argparse.SUPPRESS, nargs='?') args = parser.parse_args([]) == results in this error: == usage: pok.py [-h] [{a,b,c}] pok.py: error: argument letter: invalid choice: '==SUPPRESS==' (choose from 'a', 'b', 'c') == ---------- nosy: +jeyekomon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 10:57:55 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 16 Mar 2020 14:57:55 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584370675.4.0.662232053388.issue39968@roundup.psfhosted.org> Dong-hee Na added the comment: See also: https://github.com/python/cpython/runs/509226542#step:4:305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 11:10:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 15:10:28 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584371428.66.0.559371484601.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 356c878fbf2a97aa3ab7951fd7456d219ff0b466 by Dong-hee Na in branch 'master': bpo-1635741: Port _statistics module to multiphase initialization (GH-19015) https://github.com/python/cpython/commit/356c878fbf2a97aa3ab7951fd7456d219ff0b466 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 11:14:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 15:14:03 +0000 Subject: [issue39978] Vectorcall implementation should conform to PEP 590. In-Reply-To: <1584367768.43.0.96665023225.issue39978@roundup.psfhosted.org> Message-ID: <1584371643.29.0.0552122619211.issue39978@roundup.psfhosted.org> STINNER Victor added the comment: > The change has a negative impact on performance How did you notice the slowdown? I ran benchmarks in https://github.com/python/cpython/pull/17052 and I didn't notice any performance overhead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 11:19:06 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 16 Mar 2020 15:19:06 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584371946.34.0.346455992181.issue39968@roundup.psfhosted.org> Dong-hee Na added the comment: I reopen this issue for the above problem ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 11:33:15 2020 From: report at bugs.python.org (hai shi) Date: Mon, 16 Mar 2020 15:33:15 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584372795.13.0.122200406224.issue39968@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18377 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/19028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 11:34:10 2020 From: report at bugs.python.org (hai shi) Date: Mon, 16 Mar 2020 15:34:10 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584372850.31.0.107755647776.issue39968@roundup.psfhosted.org> hai shi added the comment: > See also: https://github.com/python/cpython/runs/509226542#step:4:305 Oh, thanks, Dong-hee Na. I create a PR for this typo error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:17:28 2020 From: report at bugs.python.org (Gle) Date: Mon, 16 Mar 2020 16:17:28 +0000 Subject: [issue39979] Cannot tune scrypt with large enough parameters Message-ID: <1584375448.39.0.689012483556.issue39979@roundup.psfhosted.org> New submission from Gle : I can use scrypt KDF with the cryptography module https://cryptography.io/en/latest/hazmat/primitives/key-derivation-functions/#cryptography.hazmat.primitives.kdf.scrypt.Scrypt with large parameters (n=2**20, r=16, p=1) On the other hand, using scrypt KDF from hashlib with the same parameters yields "Invalid combination of n, r, p, maxmem" (I use maxmem=0). Shouldn't they behave the same ? As they both seem to be wrappers around OpenSSL ? I've also included a set of functioning parameters as hashlib's scrypt works fine on small parameter values. Notice that the output from hashlib's scrypt is different than the output from the cryptography module. Shouldn't they be the same ? (I'm no cryptography expert) I would really like to be able to use scrypt for hardened password hashing using only python standard library's hashlib. Maybe I'm missing something ? Python is great ! Thanks for all the good work ! ---------- components: Library (Lib) files: compare.py messages: 364334 nosy: Gle, christian.heimes, gregory.p.smith priority: normal severity: normal status: open title: Cannot tune scrypt with large enough parameters type: crash versions: Python 3.8 Added file: https://bugs.python.org/file48977/compare.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:20:47 2020 From: report at bugs.python.org (paul j3) Date: Mon, 16 Mar 2020 16:20:47 +0000 Subject: [issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError In-Reply-To: <1550845114.74.0.376208054151.issue36078@roundup.psfhosted.org> Message-ID: <1584375647.36.0.392526598711.issue36078@roundup.psfhosted.org> paul j3 added the comment: You are right, this part of the same issue. _get_value() tests '==SUPPRESS==' both for type and choices. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:31:38 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Mar 2020 16:31:38 +0000 Subject: [issue39977] Python aborts trying to load libcrypto.dylib In-Reply-To: <1584354397.7.0.17560175577.issue39977@roundup.psfhosted.org> Message-ID: <1584376298.55.0.792126873453.issue39977@roundup.psfhosted.org> Ned Deily added the comment: The crash report gives the reason for the crash: Application Specific Information: /usr/lib/libcrypto.dylib abort() called Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI. This means something you are importing is trying to access the deprecated macOS system version of OpenSSL's libcrypto and not a newer, third-party version supplied in this case by Homebrew. Try importing _hashlib directly in the interpreter: >>> import _hashlib If you see the error then, you know that your Python installation has been built and linked incorrectly with the system OpenSSL libraries. If not, then almost certainly a third-party package installed with this Pyrhon instance was built incorrectly and is trying to link to the system libcryto. In either case, you should try re-installing those items using their latest versions. Good luck! ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:41:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 16:41:50 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584376910.67.0.551455813587.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f6a58507820c67e8d0fb07875cd1b1d9f5e510a8 by Victor Stinner in branch 'master': bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) https://github.com/python/cpython/commit/f6a58507820c67e8d0fb07875cd1b1d9f5e510a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:45:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 16:45:31 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584377131.32.0.130512002476.issue35370@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18378 pull_request: https://github.com/python/cpython/pull/19029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 12:51:27 2020 From: report at bugs.python.org (tzickel) Date: Mon, 16 Mar 2020 16:51:27 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584377487.91.0.365320690123.issue39974@roundup.psfhosted.org> tzickel added the comment: My mistake... ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:16:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 17:16:38 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584378998.55.0.888771689812.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5f104d56fa10f88098338b3f1ea74bcbe6924ca9 by Hai Shi in branch 'master': bpo-39968: Fix a typo error in get_readline_state() (GH-19028) https://github.com/python/cpython/commit/5f104d56fa10f88098338b3f1ea74bcbe6924ca9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:17:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 17:17:41 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584379061.74.0.808789591439.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6ff79f65820031b219622faea8425edaec9a43f3 by Dong-hee Na in branch 'master': bpo-37207: Use PEP 590 vectorcall to speed up set() constructor (GH-19019) https://github.com/python/cpython/commit/6ff79f65820031b219622faea8425edaec9a43f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:18:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 17:18:24 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584379104.44.0.757759303658.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 046255c40fc0d9c5a4c528eb5955792fa08df66f by Victor Stinner in branch '3.8': bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) (GH-19029) https://github.com/python/cpython/commit/046255c40fc0d9c5a4c528eb5955792fa08df66f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:19:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 17:19:09 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584379149.92.0.486636998104.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: > As a note, the original request was for a Python-level tracing function (so that in the future other Python implementations also provide that function) -- does this need a PEP? What do you mean by a Python-level tracing function? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:21:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 17:21:13 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584379273.39.0.650059615986.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: > Compile is failure after PR 19017 is merged on macOS. Oh, macOS job was marked as success on PR 19017 :-( https://github.com/python/cpython/runs/509226542 But I confirm that I can read there: """ Failed to build these modules: _tkinter readline """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:42:54 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Mon, 16 Mar 2020 17:42:54 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584380574.24.0.397223974928.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: >> As a note, the original request was for a Python-level tracing function (so that in the future other Python implementations also provide that function) -- does this need a PEP? > What do you mean by a Python-level tracing function? I mean that it's a function to be called from Python (not only from C) -- which hopefully could be adopted by other Python implementations in the long run. I.e.: something as adding a thread_id to sys.settrace -- sys.settrace(trace_func, thread_id=None). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:46:54 2020 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 16 Mar 2020 17:46:54 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584380814.46.0.845655160244.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: I would certainly like to see this, it would eliminate my last few hand rolled temporary directory contexts Mauro would you be interested in re-posting this patch as a PR to github? (or allowing someone else to carry your patch forward?) ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:48:16 2020 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 16 Mar 2020 17:48:16 +0000 Subject: [issue37695] Incorrect error message for `unget_wch(bytes_object)` In-Reply-To: <1564283698.6.0.693266446979.issue37695@roundup.psfhosted.org> Message-ID: <1584380896.73.0.518256373698.issue37695@roundup.psfhosted.org> Change by Anthony Sottile : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:49:37 2020 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 16 Mar 2020 17:49:37 +0000 Subject: [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops In-Reply-To: <1553894696.91.0.352723977034.issue36478@roundup.psfhosted.org> Message-ID: <1584380977.63.0.358336487618.issue36478@roundup.psfhosted.org> Change by Anthony Sottile : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:50:10 2020 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 16 Mar 2020 17:50:10 +0000 Subject: [issue35312] lib2to3.pgen2.parse.ParseError is not roundtrip pickleable In-Reply-To: <1543205038.25.0.788709270274.issue35312@psf.upfronthosting.co.za> Message-ID: <1584381010.62.0.807694736295.issue35312@roundup.psfhosted.org> Change by Anthony Sottile : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:50:37 2020 From: report at bugs.python.org (Diogo Flores) Date: Mon, 16 Mar 2020 17:50:37 +0000 Subject: [issue39971] Error on documentation - Quick fix. In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1584381037.04.0.775606606358.issue39971@roundup.psfhosted.org> Diogo Flores added the comment: Agreed, Eric. Nevertheless, I think that this example might raise unnecessary confusion to someone new to Python, and hence the reason why I decided to open the issue. Anyhow, I trust your judgement and please feel free to leave things as is and close this issue. PS: I really the work you did with dataclasses, and I actually explored the idea further with a small (300 LoC) library that adds runtime type checking for instances of dataclasses - if you are ever curious you can find the code on my GitHub at /dxflores/invis. Thank you, Diogo ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 13:53:35 2020 From: report at bugs.python.org (hai shi) Date: Mon, 16 Mar 2020 17:53:35 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584381215.76.0.197168957787.issue39968@roundup.psfhosted.org> hai shi added the comment: > Oh, macOS job was marked as success on PR 19017 :-( yeah, it's weird. This macOS job should be enhanced? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:09:47 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 18:09:47 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584382187.11.0.014945139454.issue39824@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think Cython makes use of PEP-489 so unless I am missing something all generated extensions use PEP-489 structures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:24:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 18:24:56 +0000 Subject: [issue39968] port extension modules' macros of `get_module_state()` to inline function. In-Reply-To: <1584279726.3.0.17378093364.issue39968@roundup.psfhosted.org> Message-ID: <1584383096.3.0.60594658122.issue39968@roundup.psfhosted.org> STINNER Victor added the comment: > This macOS job should be enhanced? setup.py skips optional dependencies like readline on purpose. readline is built again onx86-64 macOS 3.x buildbot worker and test_readline passed. I close the issue. Thanks for the quick fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:36:14 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 16 Mar 2020 18:36:14 +0000 Subject: [issue37860] Add deploy preview for docs In-Reply-To: <1565817286.53.0.142673590989.issue37860@roundup.psfhosted.org> Message-ID: <1584383774.95.0.376318372754.issue37860@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:36:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 18:36:15 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584383775.97.0.12656938137.issue35370@roundup.psfhosted.org> STINNER Victor added the comment: > I.e.: something as adding a thread_id to sys.settrace -- sys.settrace(trace_func, thread_id=None). What is the use case for this feature? It seems quite complicated to implement the thread_id for sys.settrace(trace_func, thread_id=None). Currently, there is no way for a thread to execute code directly in another thread. In asyncio, it has to through call_soon_threadsafe() which queues the function calls and the function is called "later" and the caller doesn't get the result. https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.loop.call_soon_threadsafe sys.setprofile() and sys.settrace() use the current Python thread state (tstate). The threading.enumerate() function returns threading.Thread instances, but it's not currently possible to get the Python thread state (C structure PyThreadState) from a Python threading.Thread object. At the C level, Python doesn't maintain a list of thread. There is only threading.enumerate() which is implemented in Python. PyDev.Debugger seems to use the C API. Can it continue to use the C API? Note: There is threading.setprofile() and threading.settrace() which set a profile/trace function when *new* threads are spawned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:40:05 2020 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 16 Mar 2020 18:40:05 +0000 Subject: [issue39656] shebanged scripts can escape from `venv` depending on how it was created In-Reply-To: <1581880911.6.0.392245585345.issue39656@roundup.psfhosted.org> Message-ID: <1584384005.86.0.775169696561.issue39656@roundup.psfhosted.org> Change by Anthony Sottile : ---------- keywords: +patch pull_requests: +18379 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19030 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:48:32 2020 From: report at bugs.python.org (Jeff Fischer) Date: Mon, 16 Mar 2020 18:48:32 +0000 Subject: [issue39959] (Possible) bug on multiprocessing.shared_memory In-Reply-To: <1584128583.89.0.486447704556.issue39959@roundup.psfhosted.org> Message-ID: <1584384512.24.0.166705106384.issue39959@roundup.psfhosted.org> Jeff Fischer added the comment: I've run into the same problem. It appears that the SharedMemory class is assuming that all clients of a segment are child processes from a single parent, and that they inherit the same resource_tracker. If you run separate, unrelated processes, you get a separate resource_tracker for each process. Then, when a process does a close() followed by a sys.exit(), the resource tracker detects a leak and unlinks the segment. In my application, segment names are stored on the local filesystem and a specific process is responsible for unlinking the segment when it is shut down. I was able to get this model to work with the current SharedMemory implementation by having processes which are just doing a close() also call resource_tracker.unregister() directly to prevent their local resource trackers from destroying the segment. I imagine the documentation needs some discussion of the assumed process model and either: 1) a statement that you need to inherit the resource tracker from a parent process, 2) a blessed way to call the resource tracker to manually unregister, or 3) a way to disable the resource tracker when creating the SharedMemory object. ---------- nosy: +jfischer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 14:56:13 2020 From: report at bugs.python.org (Krzysztof Rusek) Date: Mon, 16 Mar 2020 18:56:13 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader Message-ID: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> New submission from Krzysztof Rusek : importlib.resources.path() function may return a path to a file with different contents than expected. This may happen when using a custom loader implementation that uses fake filenames (like ''). I'm attaching a reproduction test (resources.py). ---------- components: Library (Lib) files: resources.py messages: 364352 nosy: Krzysztof Rusek priority: normal severity: normal status: open title: importlib.resources.path() may return incorrect path when using custom loader versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file48978/resources.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 15:01:40 2020 From: report at bugs.python.org (Fabio Zadrozny) Date: Mon, 16 Mar 2020 19:01:40 +0000 Subject: [issue35370] Add _PyEval_SetTrace(tstate, func, arg) function In-Reply-To: <1543660837.51.0.788709270274.issue35370@psf.upfronthosting.co.za> Message-ID: <1584385300.76.0.285358494822.issue35370@roundup.psfhosted.org> Fabio Zadrozny added the comment: >> I.e.: something as adding a thread_id to sys.settrace -- sys.settrace(trace_func, thread_id=None). > What is the use case for this feature? The use case is having the user attach the debugger (either programmatically or by doing an attach to process) and be able to debug all threads, not just the current thread. > It seems quite complicated to implement the thread_id for sys.settrace(trace_func, thread_id=None). Humm, isn't it just a matter of passing the proper tstate to _PyEval_SetTrace? It seems reasonably simple to do at C (i.e.: iterate the existing thread states to get the thread id and then pass the proper tsate to _PyEval_SetTrace -- which is roughly what is done in the debugger, although it's a bit more complicated because it supports Python 2.7 up to Python 3.8...). > At the C level, Python doesn't maintain a list of thread. There is only threading.enumerate() which is implemented in Python. The tstate does contain the thread id, so, iterating the available tstates should be enough for that. > PyDev.Debugger seems to use the C API. Can it continue to use the C API? It can for CPython, but it can't for other Python implementations (and ideally I'd like to rely less on the CPython C-API -- because there's too much implementation details on it, things seem to break at each new version). > Note: There is threading.setprofile() and threading.settrace() which set a profile/trace function when *new* threads are spawned Yes, I know about those, but it's not enough if the user attaches the debugger after the process is already running. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 15:02:50 2020 From: report at bugs.python.org (Krzysztof Rusek) Date: Mon, 16 Mar 2020 19:02:50 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584385370.45.0.746191383854.issue39980@roundup.psfhosted.org> Krzysztof Rusek added the comment: Maybe importlib.resources.path() should skip checking file existence when ResourceReader.resource_path() raises FileNotFoundError? Current logic: @contextmanager def path(package: Package, resource: Resource) -> Iterator[Path]: resource = _normalize_path(resource) package = _get_package(package) reader = _get_resource_reader(package) if reader is not None: try: yield Path(reader.resource_path(resource)) return except FileNotFoundError: pass else: _check_location(package) # Fall-through for both the lack of resource_path() *and* if # resource_path() raises FileNotFoundError. package_directory = Path(package.__spec__.origin).parent file_path = package_directory / resource if file_path.exists(): yield file_path else: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 15:17:20 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 19:17:20 +0000 Subject: [issue39981] Default values for AST Nodes Message-ID: <1584386240.94.0.329600152717.issue39981@roundup.psfhosted.org> New submission from Batuhan Taskaya : For omitting some defaults, @serhiy.storchaka already added support to initialize some ast nodes with some default values (optional fields). An example; >>> ast.Constant().kind is None True This isn't exactly a default value, but some kind of class attribute. I think we can push this one step further and initialize all kinds of default values (both optionals and sequences). An example; >>> func = ast.FunctionDef("easy_func", ast.arguments(), body=[ast.Pass()]) >>> func = ast.fix_missing_locations(func) >>> exec(compile(ast.Module(body=[func]), "", "exec")) >>> easy_func() compared to this (other way around, compiler gives errors so does most of the ast based tool, including ast.unparser) >>> func = ast.FunctionDef("easy_func", ast.arguments(posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]), decorator_list=[], body=[ast.Pass()]) >>> func = ast.fix_missing_locations(func) >>> exec(compile(ast.Module(body=[func], type_ignores=[]), "", "exec")) >>> easy_func() ---------- components: Library (Lib) messages: 364355 nosy: BTaskaya, benjamin.peterson, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Default values for AST Nodes type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 15:53:55 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 16 Mar 2020 19:53:55 +0000 Subject: [issue39981] Default values for AST Nodes In-Reply-To: <1584386240.94.0.329600152717.issue39981@roundup.psfhosted.org> Message-ID: <1584388435.57.0.400489332797.issue39981@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18380 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 16:25:59 2020 From: report at bugs.python.org (Roundup Robot) Date: Mon, 16 Mar 2020 20:25:59 +0000 Subject: [issue26067] test_shutil fails when gid name is missing In-Reply-To: <1452373835.73.0.278108988814.issue26067@psf.upfronthosting.co.za> Message-ID: <1584390359.7.0.98259631739.issue26067@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +18381 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 16:44:11 2020 From: report at bugs.python.org (Matthias Braun) Date: Mon, 16 Mar 2020 20:44:11 +0000 Subject: [issue26067] test_shutil fails when gid name is missing In-Reply-To: <1452373835.73.0.278108988814.issue26067@psf.upfronthosting.co.za> Message-ID: <1584391451.5.0.751565029645.issue26067@roundup.psfhosted.org> Matthias Braun added the comment: I have the same issue on my work macbook which has some form of network login configured. The primary group id of my user account there cannot be found in the group database and cannot be resolved to a name. I'm not sure why that is but I am pretty sure there is no obligation that a gid must be resolvable to a name. I submitted a PR to just skip the last part of the test_shutil/chown if the uid/gid cannot be resolved to a name. ---------- nosy: +Matthias Braun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 16:44:30 2020 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 16 Mar 2020 20:44:30 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584391470.89.0.473267740719.issue10572@roundup.psfhosted.org> ?ric Araujo added the comment: Yes, I recommend against this change. Sorry for the time already spent :( (I only named Mercurial because python-dev used it before, so I was comparing the behaviour of the two tools) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 16:58:08 2020 From: report at bugs.python.org (Zachary Ware) Date: Mon, 16 Mar 2020 20:58:08 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584392288.44.0.31686425566.issue10572@roundup.psfhosted.org> Zachary Ware added the comment: I'm personally still in favor of the change. This wouldn't be the first big movement of files in our repo and likely not the last, and I don't think git/GitHub's support (or lack thereof) for file moves is a good enough reason to not organize things better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:04:56 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Mar 2020 21:04:56 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584392696.85.0.954466835425.issue10572@roundup.psfhosted.org> Ned Deily added the comment: > some vendors like to leave out the tests and not having them all under 'test' prevents that from working cleanly Yeah, but presumably all the major distributors have long ago figured out how to do this (it's not *that* hard) and, by moving the tests now, would actually make work for them :) (Granted, that's also not that hard) Losing the history of a bunch of files would be a much more serious concern, IMHO. If the files can't be moved without losing history, I'de be a definite -1 on this change; otherwise, a meh -0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:43:29 2020 From: report at bugs.python.org (Matthias Braun) Date: Mon, 16 Mar 2020 21:43:29 +0000 Subject: [issue36017] test_grp In-Reply-To: <1550438801.86.0.404382548135.issue36017@roundup.psfhosted.org> Message-ID: <1584395009.67.0.184452262653.issue36017@roundup.psfhosted.org> Change by Matthias Braun : ---------- keywords: +patch nosy: +Matthias Braun nosy_count: 1.0 -> 2.0 pull_requests: +18382 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:48:12 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 21:48:12 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584395292.2.0.616657353408.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This looks like a "new feature/improvement". Why was this code backported to a stable version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:47:35 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 21:47:35 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584395255.38.0.175466992577.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This code has introduced a regression in AIX in Python 3.7.7 as the new "test_maxcontext_exact_arith" test hangs indefinitely or just segfaults. ---------- keywords: +3.7regression nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:48:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 21:48:32 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584395312.25.0.187422596686.issue39576@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 17:59:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 21:59:26 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x Message-ID: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 FreeBSD Shared 3.x: https://buildbot.python.org/all/#/builders/152/builds/409 ====================================================================== ERROR: testSendmsg (test.test_socket.SendmsgSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 342, in _setUp self.__setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 2716, in setUp super().setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 2533, in setUp super().setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 646, in setUp conn, addr = self.serv.accept() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() ConnectionAbortedError: [Errno 53] Software caused connection abort (...) ====================================================================== ERROR: testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 342, in _setUp self.__setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 2533, in setUp super().setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 646, in setUp conn, addr = self.serv.accept() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() ConnectionAbortedError: [Errno 53] Software caused connection abort (...) ====================================================================== ERROR: testRecvmsgIntoGenerator (test.test_socket.RecvmsgIntoSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 342, in _setUp self.__setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 2533, in setUp super().setUp() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_socket.py", line 646, in setUp conn, addr = self.serv.accept() File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() ConnectionAbortedError: [Errno 53] Software caused connection abort (...) ---------- components: Tests messages: 364362 nosy: koobs, vstinner priority: normal severity: normal status: open title: FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:08:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 22:08:18 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584396498.16.0.75309544215.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: It worked 10 days ago: https://buildbot.python.org/all/#/builders/152/builds/382 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:13:18 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 22:13:18 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584396798.84.0.450874985221.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: > This looks like a "new feature/improvement". Why was this code backported to a stable version? Thanks for the lecture. This is an esoteric case between bugfix and feature that only occurs with very large context precisions. If Bloomberg isn't happy with _decimal, they can stop using it. I'm not paid by them. Which AIX buildbot fails? There are many green ones. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:21:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 22:21:11 +0000 Subject: [issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver Message-ID: <1584397271.26.0.591205335177.issue39983@roundup.psfhosted.org> New submission from STINNER Victor : Tests run with --fail-env-changed. test_multiprocessing_forkserver failed with "env changed", but no warning was logged to explain why :-( PPC64LE RHEL7 3.8: https://buildbot.python.org/all/#/builders/401/builds/69 ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml -j10 ---------- components: Tests messages: 364365 nosy: vstinner priority: normal severity: normal status: open title: test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:21:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 22:21:54 +0000 Subject: [issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot In-Reply-To: <1583927530.29.0.751848754039.issue39932@roundup.psfhosted.org> Message-ID: <1584397314.44.0.489283385378.issue39932@roundup.psfhosted.org> STINNER Victor added the comment: Bug seen on Pytho 3.7 branch, on Fedora Stable, RHEL7 and RHEL8, on different architectures. aarch64 RHEL7 Refleaks 3.7: https://buildbot.python.org/all/#builders/598/builds/22 PPC64LE RHEL7 Refleaks 3.7: https://buildbot.python.org/all/#builders/414/builds/32 PPC64LE Fedora Stable Refleaks 3.7: https://buildbot.python.org/all/#/builders/388/builds/31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:27:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 16 Mar 2020 22:27:06 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584397626.1.0.954494242579.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: Same issue on AMD64 FreeBSD Shared 3.8: https://buildbot.python.org/all/#builders/18/builds/162 It looks more like a recent FreeBSD upgrade than a Python regression. 3.8 fail, build 162: os.uname: posix.uname_result(sysname='FreeBSD', nodename='130-CURRENT-amd64', release='13.0-CURRENT', version='FreeBSD 13.0-CURRENT #1 r358865: Wed Mar 11 21:35:42 UTC 2020 root at 130-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC', machine='amd64') 3.8 ok, build 153 (12 days ago): os.uname: posix.uname_result(sysname='FreeBSD', nodename='130-CURRENT-amd64', release='13.0-CURRENT', version='FreeBSD 13.0-CURRENT #7 r356645: Sun Jan 12 14:57:12 AEDT 2020 root at 130-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', machine='amd64') The kernel changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 18:36:31 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 22:36:31 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584398191.07.0.798799853003.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: > This code has introduced a regression in AIX in Python 3.7.7 Also this is a rather bold statement since probably no one has ever run _decimal on AIX with MAX_PREC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:05:53 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 23:05:53 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584399953.99.0.470146717711.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Thanks for the lecture. This is an esoteric case between bugfix and feature that only occurs with very large context precisions. Nobody is lecturing anyone. I am just asking why this was backported. > If Bloomberg isn't happy with _decimal, they can stop using it. I'm not paid by them. Stefan, nobody has mentioned Bloomberg in this issue so please, stop. > Also this is a rather bold statement since probably no one has ever run _decimal on AIX with MAX_PREC. Well, I just did and I can confirm that reverting the 3.7 backport fixes the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:31:58 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 23:31:58 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584401518.21.0.638872324201.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: > Well, I just did and I can confirm that reverting the 3.7 backport fixes the problem. If you are fortunate enough to have access to an AIX system, I guess you have to find out why POWER6 AIX 3.8 and PPC64 AIX 3.8 apparently work on https://buildbot.python.org/ but your 3.7 does not. It seems rather strange to me. Are you compiling --with-system-libmpdec? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:38:08 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 23:38:08 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584401888.63.0.10514029268.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: Hi Michael, in case you have built 3.7.7 on AIX, have you observed any problems with test_decimal? ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:43:15 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 23:43:15 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584402195.43.0.838661158538.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > If you are fortunate enough to have access to an AIX system, I guess you have to find out why POWER6 AIX 3.8 and PPC64 AIX 3.8 apparently work on https://buildbot.python.org/ but your 3.7 does not. I am working on trying to debug where the problem comes from, but meanwhile, I wanted to report here that this introduced a difference between Python 3.7.6 and Python 3.7.7 I still did not test Python 3.8 but I suppose that it has the same problem. > Are you compiling --with-system-libmpdec? No, I am compiling with: CFLAGS+= -qmaxmem=-1 OBJECT_MODE=64 CONFIGURE_ARGS=--enable-shared --with-system-ffi --without-computed-gotos ac_cv_rshift_extends_sign=no ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:49:56 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 23:49:56 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584402596.42.0.799597547934.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: These flags worked for xlc when snakebite was still up: ./configure CC=xlc_r AR="ar -X64" CFLAGS="-q64 -qmaxmem=70000" LDFLAGS="-q64" -qmaxmem was always finicky, I remember segfaults too (AIX problem, not libmpdec problem). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:51:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Mar 2020 23:51:29 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584402689.79.0.659721410134.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Btw, this is AIX 7.1.0.0 with xlc in case that is relevant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:57:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 23:57:36 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584403056.03.0.184153031237.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: BTW, if you are compiling with xlc and there"s no xlc buildbot, perhaps a company-that-shall-not-be-named should provide one. I mean, it's not okay to complain about a regression and then mention xlc about 10 mails later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:58:05 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 16 Mar 2020 23:58:05 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584403085.61.0.998190241264.issue39576@roundup.psfhosted.org> Change by Stefan Krah : ---------- assignee: -> skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 19:59:31 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 16 Mar 2020 23:59:31 +0000 Subject: [issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc. In-Reply-To: <1515429303.77.0.467229070634.issue32521@psf.upfronthosting.co.za> Message-ID: <1584403171.77.0.769854680694.issue32521@roundup.psfhosted.org> Charalampos Stratakis added the comment: Closing the issue as python2 is not receiving any more fixes and our downstream workaround is enough for it. Python3 is fine as well. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 20:05:27 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 00:05:27 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584403527.98.0.449038771046.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I mean, it's not okay to complain about a regression and then mention xlc about 10 mails later. How is this related? Or is not ok to report a behaviour change in a stable release even if the platform is "best-effort"? A regression by definition is a behaviour change between two versions. AIX is a "best-effort" platform, not a fully-supported one and I am well aware. I have not asked for a revert in anycase, precisely because of that (that decision should be up the release manager anyway), I am just communicating the regression. And doing so is perfectly "ok", even If I am using xlc (which is the native compiler on AIX). ---------- assignee: skrah -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 20:14:39 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 00:14:39 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584404079.57.0.151887069879.issue39576@roundup.psfhosted.org> Change by Stefan Krah : ---------- assignee: -> skrah keywords: -3.7regression, patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 20:53:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 00:53:21 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval Message-ID: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> New submission from STINNER Victor : The _PyRuntime.ceval structure should be made "per-interpreter". I don't want to make the GIL per-interpreter: that's out of the scope of this issue. So I propose to only move a few fields to make more ceval fields "per interpreter". ---------- components: Interpreter Core messages: 364378 nosy: vstinner priority: normal severity: normal status: open title: Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:01:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 01:01:59 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584406919.29.0.232781903884.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18383 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:04:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 01:04:51 +0000 Subject: [issue31857] Make the behavior of USE_STACKCHECK deterministic In-Reply-To: <1508807362.1.0.213398074469.issue31857@psf.upfronthosting.co.za> Message-ID: <1584407091.78.0.977253272107.issue31857@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18384 pull_request: https://github.com/python/cpython/pull/19034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:06:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 01:06:13 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1584407173.53.0.136829669463.issue38644@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18385 pull_request: https://github.com/python/cpython/pull/19034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:15:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 01:15:32 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584407732.41.0.663674358936.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2037502613471a0a0a0262085cc50adb378ebbad by Hai Shi in branch 'master': bpo-1635741: Port _ctypes_test extension to multiphase initialization (PEP 489) (GH-19012) https://github.com/python/cpython/commit/2037502613471a0a0a0262085cc50adb378ebbad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:23:01 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 17 Mar 2020 01:23:01 +0000 Subject: [issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584102265.92.0.572809355016.issue39954@roundup.psfhosted.org> Message-ID: <1584408181.86.0.643772222584.issue39954@roundup.psfhosted.org> Kubilay Kocak added the comment: The current test runs a try/finally without any exception handling, so even minimal exception handling will cover a large swatch of potential issues. CalledProcessError [1] returned by check_call() or check_output() appears to be handy [1] https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:25:23 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 17 Mar 2020 01:25:23 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584408323.19.0.750980470938.issue39982@roundup.psfhosted.org> Kubilay Kocak added the comment: Saw the following commit which *may* be related: "Log: sendfile() does currently not support SCTP sockets. Therefore, fail the call. " https://svnweb.freebsd.org/changeset/base/358965 I'm updating FreeBSD base on the BB worker to include that commit and will re-run the failing build ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 21:42:20 2020 From: report at bugs.python.org (Maxwell Bernstein) Date: Tue, 17 Mar 2020 01:42:20 +0000 Subject: [issue39985] str.format and string.Formatter subscript behaviors diverge Message-ID: <1584409340.15.0.380295025491.issue39985@roundup.psfhosted.org> New submission from Maxwell Bernstein : As I understand it, str.format and string.Formatter are supposed to behave the same, with string.Formatter being a pluggable variant. While poking at string.Formatter, I noticed that they do not behave the same when formatting a nameless subscript: ``` import string str.format("{[0]}", "hello") # => "h" string.Formatter().format("{[0]}", "hello") # => KeyError("") ``` They seem to work the same in the case where the arg is either indexed by number or by name: ``` import string str.format("{0[0]}", "hello") # => "h" string.Formatter().format("{0[0]}", "hello") # => "h" str.format("{a[0]}", a="hello") # => "h" string.Formatter().format("{a[0]}", a="hello") # => "h" ``` After some digging, I have come up with a couple ideas: * Change _string.formatter_field_name_split to treat an empty string field name as 0, so that string.Formatter.get_value looks up the arg in args, instead of kwargs * Change string.Formatter.get_value to treat empty string key as 0, and look up the arg in args, instead of kwargs I'm happy to submit a PR if people find one of these two solutions palatable or have some solutions of their own. (Note: this may appear in other versions, but I don't have them on my machine to test.) ---------- components: Library (Lib) messages: 364382 nosy: tekknolagi priority: normal severity: normal status: open title: str.format and string.Formatter subscript behaviors diverge type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:19:35 2020 From: report at bugs.python.org (Inada Naoki) Date: Tue, 17 Mar 2020 02:19:35 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584411575.69.0.980247095651.issue39974@roundup.psfhosted.org> Change by Inada Naoki : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:22:20 2020 From: report at bugs.python.org (Matthias Braun) Date: Tue, 17 Mar 2020 02:22:20 +0000 Subject: [issue39986] test_os / test_listdir failed as root-directory changed during test Message-ID: <1584411740.74.0.439695982402.issue39986@roundup.psfhosted.org> New submission from Matthias Braun : The test_listdir test from Lib/test/test_os.py is using os.listdir() twice in the root directory with and without parameters and compares the results. I just had the test fail for me, because an unrelated process happened to create a file in the root directory between the two invocations of os.listdir. In my case it was rsyslog creating '/imjournal.state.tmp', but the problem is a general one. The test failed with: ``` ..test test_os failed -- Traceback (most recent call last): File "/home/matthiasb/dev/fbcpython/Lib/test/test_os.py", line 1914, in test_listdir self.assertEqual(set(os.listdir()), set(os.listdir(os.sep))) AssertionError: Items in the first set but not the second: 'imjournal.state.tmp' ``` ---------- components: Tests messages: 364383 nosy: Matthias Braun priority: normal severity: normal status: open title: test_os / test_listdir failed as root-directory changed during test type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:35:49 2020 From: report at bugs.python.org (Larry Hastings) Date: Tue, 17 Mar 2020 02:35:49 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584412549.18.0.128167076611.issue39511@roundup.psfhosted.org> Larry Hastings added the comment: > We should do that for each singletons: > > * None (Py_None) > * True (Py_True) > * False (Py_False) > * Ellipsis (Py_Ellipsis) Aren't there a couple more lurking in the interpreter? E.g. empty tuple, empty frozenset. > That is exactly why I didn't propose a change to them. > The singletons still are refcounted as usual, > just that their ob_refcnt is ignored. > If they somehow reach 0, they just "resurrect" themselves > and ignore the regular collection behavior. That seems like a very good idea! They don't even need to "resurrect" themselves--we just ensure tp_dealloc is a no-op for those special values. If we do that, different threads and different interpreters can change ob_refcnt willy-nilly, there can be unsafe races between threads, the value could no longer make any sense--but as long as we never free the object, it's all totally fine. (Actually: tp_dealloc shouldn't be a no-op--it should add a million to the reference count for these special objects, to forestall future irrelevant calls to tp_dealloc.) This might have minor deleterious effects, e.g. sys.getrefcount() would return misleading results for such objects. I think that's acceptable. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:39:46 2020 From: report at bugs.python.org (Matthias Braun) Date: Tue, 17 Mar 2020 02:39:46 +0000 Subject: [issue39986] test_os / test_listdir failed as root-directory changed during test In-Reply-To: <1584411740.74.0.439695982402.issue39986@roundup.psfhosted.org> Message-ID: <1584412786.66.0.195811928161.issue39986@roundup.psfhosted.org> Change by Matthias Braun : ---------- keywords: +patch pull_requests: +18386 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:41:24 2020 From: report at bugs.python.org (Matthias Braun) Date: Tue, 17 Mar 2020 02:41:24 +0000 Subject: [issue5944] test_os failure on OS X, probably related to PEP 383 In-Reply-To: <1241546478.3.0.733152091309.issue5944@psf.upfronthosting.co.za> Message-ID: <1584412884.22.0.81336346682.issue5944@roundup.psfhosted.org> Matthias Braun added the comment: I believe my suggested pull request in https://bugs.python.org/issue39986 may solve this issue as a side effect because we no longer list the root directory but a temporary directory with controlled filenames. ---------- nosy: +Matthias Braun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 22:41:17 2020 From: report at bugs.python.org (Matthias Braun) Date: Tue, 17 Mar 2020 02:41:17 +0000 Subject: [issue38454] test_listdir is failing on ubuntu with WSL In-Reply-To: <1570856792.9.0.835565691535.issue38454@roundup.psfhosted.org> Message-ID: <1584412877.45.0.27664564191.issue38454@roundup.psfhosted.org> Matthias Braun added the comment: I believe my suggested pull request in https://bugs.python.org/issue39986 may solve this issue as a side effect because we no longer list the root directory but a temporary directory with controlled filenames. ---------- nosy: +Matthias Braun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 16 23:31:49 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Tue, 17 Mar 2020 03:31:49 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584415909.12.0.0835181582082.issue39984@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- nosy: +phsilva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 00:32:22 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 17 Mar 2020 04:32:22 +0000 Subject: [issue39985] str.format and string.Formatter subscript behaviors diverge In-Reply-To: <1584409340.15.0.380295025491.issue39985@roundup.psfhosted.org> Message-ID: <1584419542.8.0.821738060235.issue39985@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 00:54:08 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Mar 2020 04:54:08 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584420848.78.0.76296481038.issue39107@roundup.psfhosted.org> Ned Deily added the comment: There is nothing more for you to do for this on the Mac side right now, thanks. I?m not sure what the Status of changes for Windows build are. Perhaps that should be a separate issue as the two aren?t really related. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 01:44:37 2020 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 17 Mar 2020 05:44:37 +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: <1584423877.41.0.810721890152.issue39816@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 4.0 -> 5.0 pull_requests: +18387 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 02:54:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 06:54:30 +0000 Subject: [issue39987] Simplify setting line numbers in the compiler Message-ID: <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently the compiler can set the line number to the instruction or keep it unset (zero). Then, when create linenotab it adds entries only for set line numbers. But in rare cases (docstring or the first instruction in the module, definition of a function with default arguments, maybe more) it may add multiple entries for the same lineno even if the bytecode offset is less than 255. Seems the only effect of this is a suboptimal linenotab. The proposed PR simplifies setting the line number in the compiler (it was the primary goal) and also fixes the above minor issue. The simplification is needed for several future changes in the compiler. ---------- components: Interpreter Core messages: 364388 nosy: benjamin.peterson, brett.cannon, pablogsal, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Simplify setting line numbers in the compiler versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 02:55:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 06:55:52 +0000 Subject: [issue39987] Simplify setting line numbers in the compiler In-Reply-To: <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org> Message-ID: <1584428152.95.0.522145548608.issue39987@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 03:29:17 2020 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 17 Mar 2020 07:29:17 +0000 Subject: [issue39656] shebanged scripts can escape from `venv` depending on how it was created In-Reply-To: <1581880911.6.0.392245585345.issue39656@roundup.psfhosted.org> Message-ID: <1584430157.9.0.997403203791.issue39656@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 58ec58a42bece5b2804b178c7a6a7e67328465db by Anthony Sottile in branch 'master': bpo-39656: Ensure `bin/python3.#` is always present in virtual environments on POSIX (GH-19030) https://github.com/python/cpython/commit/58ec58a42bece5b2804b178c7a6a7e67328465db ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 03:29:51 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 07:29:51 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST Message-ID: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> New submission from Serhiy Storchaka : AugLoad and AugStore are never exposed to the user. They are not generated by the parser and the compiler does not accept it. >>> from ast import * >>> tree = Module(body=[AugAssign(target=Name(id='x', ctx=AugStore()), op=Add(), value=Constant(value=1))], type_ignores=[]) >>> compile(fix_missing_locations(tree), 'sample', 'exec') Traceback (most recent call last): File "", line 1, in ValueError: expression must have Store context but has AugStore instead They are only used in temporary nodes created by the compiler. But the support of AugLoad and AugStore is spread across many sites in the compiler, adding special cases which have very little in common with the "normal" cases of Load, Store and Del. The proposed PR removes AugLoad and AugStore. It moves support of the augmented assignment into a separate function and cleans up the rest of the code. This saves around 70 lines of handwritten code and around 60 lines of generated code. The PR depends on issue39987. See also similar issue39969. ---------- components: Interpreter Core messages: 364390 nosy: BTaskaya, benjamin.peterson, brett.cannon, pablogsal, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Remove AugLoad and AugStore expression context from AST type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 03:38:45 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 07:38:45 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584430725.04.0.522905204202.issue39988@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18389 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:06:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 08:06:12 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line Message-ID: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently ast.dump() in multiline mode (see issue37995) appends closing parenthesis to the end of the line: >>> import ast >>> node = ast.parse('spam(eggs, "and cheese")') >>> print(ast.dump(node, indent=3)) Module( body=[ Expr( value=Call( func=Name(id='spam', ctx=Load()), args=[ Name(id='eggs', ctx=Load()), Constant(value='and cheese')], keywords=[]))], type_ignores=[]) It uses vertical space more efficiently (which is especially important on Windows console). But I got a feedback about output closing parenthesis on separate lines (msg363783): Module( body=[ Expr( value=Call( func=Name(id='spam', ctx=Load()), args=[ Name(id='eggs', ctx=Load()), Constant(value='and cheese') ], keywords=[] ) ) ], type_ignores=[] ) It looks more "balanced", but less vertical space efficient. It adds almost 300 lines to 57 examples in Doc/library/ast.rst. And after omitting optional list arguments like keywords=[] and type_ignores=[] (see issue39981) the stairs of parenthesis will look even longer. The proposed PR changes the output of ast.dump() by moving closing parenthesis on separate lines. I am still not sure what output is better. ---------- components: Library (Lib) messages: 364391 nosy: benjamin.peterson, pablogsal, rhettinger, serhiy.storchaka, terry.reedy priority: normal severity: normal status: open title: Output closing parenthesis in ast.dump() on separate line type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:08:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 08:08:56 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584432536.39.0.502271181331.issue39989@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18390 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:19:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 08:19:35 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584433175.74.0.350950423188.issue39973@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a45b695b9fcfbbb0a087222abc5c8d691a7d2770 by Zackery Spytz in branch 'master': bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026) https://github.com/python/cpython/commit/a45b695b9fcfbbb0a087222abc5c8d691a7d2770 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:20:02 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Mar 2020 08:20:02 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584433202.46.0.383699946013.issue39973@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18391 pull_request: https://github.com/python/cpython/pull/19040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:20:10 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Mar 2020 08:20:10 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584433210.74.0.460066664494.issue39973@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18392 pull_request: https://github.com/python/cpython/pull/19041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:25:37 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Mar 2020 08:25:37 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584433537.74.0.515688096048.issue39973@roundup.psfhosted.org> miss-islington added the comment: New changeset da1fe768e582387212201ab8737a1a5f26110664 by Miss Islington (bot) in branch '3.8': bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026) https://github.com/python/cpython/commit/da1fe768e582387212201ab8737a1a5f26110664 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:25:54 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Mar 2020 08:25:54 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584433554.21.0.73178991734.issue39973@roundup.psfhosted.org> miss-islington added the comment: New changeset 4e3a7f9205112e7da1032aa802edf84379b134fc by Miss Islington (bot) in branch '3.7': bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026) https://github.com/python/cpython/commit/4e3a7f9205112e7da1032aa802edf84379b134fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:32:05 2020 From: report at bugs.python.org (Berry Schoenmakers) Date: Tue, 17 Mar 2020 08:32:05 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584433925.42.0.632343029239.issue38237@roundup.psfhosted.org> Berry Schoenmakers added the comment: There seems to be a slight mixup with the built-in pow() function in Python 3.8.2. Currently, under https://docs.python.org/3/library/functions.html#pow it says: Changed in version 3.9: Allow keyword arguments. Formerly, only positional arguments were supported. I think this should be into "Changed in version 3.8 ... ", as pow(3,4, mod=5) actually works in Python 3.8.2. The "What?s New In Python 3.8" also needs to be changed accordingly. In https://docs.python.org/3/whatsnew/3.8.html#positional-only-parameters it says: One use case for this notation is that it allows pure Python functions to fully emulate behaviors of existing C coded functions. For example, the built-in pow() function does not accept keyword arguments: def pow(x, y, z=None, /): "Emulate the built in pow() function" r = x ** y return r if z is None else r%z This example can simply be dropped now. ---------- nosy: +lschoe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 04:59:16 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Mar 2020 08:59:16 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584435556.62.0.555821037693.issue38237@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +18393 pull_request: https://github.com/python/cpython/pull/19042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:02:17 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 09:02:17 +0000 Subject: [issue39973] The documentation for PyObject_GenericSetDict() is incorrect In-Reply-To: <1584336197.86.0.863686228864.issue39973@roundup.psfhosted.org> Message-ID: <1584435737.6.0.911387559421.issue39973@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:03:41 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Mar 2020 09:03:41 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584435821.15.0.639864783636.issue38237@roundup.psfhosted.org> Mark Dickinson added the comment: > This example can simply be dropped now. It could be, but it would be better to replace it with a different example that works. Any suggestions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:09:56 2020 From: report at bugs.python.org (Ammar Askar) Date: Tue, 17 Mar 2020 09:09:56 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584436196.93.0.438904362886.issue38237@roundup.psfhosted.org> Ammar Askar added the comment: In my original PR I changed it to divmod: https://github.com/python/cpython/pull/16302/files#diff-986275b975a33c44c0aba973362516fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:12:56 2020 From: report at bugs.python.org (Yi Luan) Date: Tue, 17 Mar 2020 09:12:56 +0000 Subject: [issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines In-Reply-To: <1584284474.21.0.996854093569.issue39970@roundup.psfhosted.org> Message-ID: <1584436376.66.0.258555747774.issue39970@roundup.psfhosted.org> Yi Luan added the comment: Hi Paul, Yes, I totally agree with you, and I should follow your advice and not to pass timestamps as representations of arbitrary datetime for interop usage. However in my particular case, I'm not the person who can make such type of decisions. Perhaps I'm very picky here but I think it would be more natural for `timestamp()` types of functions to return the arbitrary timestamp value(or vise versa) regardless of which timezone I'm in.....When interop and international operations were involved, Python's behavior might just add another level of conversion into the process and create more unnecessary confusion. I know I should always be aware of the timezone my machine is in and adding a tzinfo in the code for cross timezone operations in Python. But a simple code like: >>> datetime.datetime(2019, 1, 1, 0, 0, 0).timestamp() would generate different result on different machines across different timezone is, from my point of view, a confusing behavior, because, I can only be sure that I am the cautious one and putting tzinfo in, however, if there were multiple person in different timezone that didn't put tzinfo in and using different programming tools, the potential results of programs would be quite confusing (timestamp generated by python fed into other programming tools, or vise versa), but I understand that it is not a sound practice in the first place. Also, from my point of view, when not presented with tzinfo, the machine should not guess what timezone the programmer want this datetime.datetime(2019, 1, 1, 0, 0, 0) to be in, not to think that because my machine is in such such timezone so the timestamp() generated from datetime.datetime(2019, 1, 1, 0, 0, 0) would be 2019/1/1 00:00:00 minus or plus some hours. As you've mentioned: When you have a naive datetime (with no tzinfo), the only options are to pick the time zone it represents and convert to UTC or to throw an error and say, "We don't know what time zone this represents, so we cannot do this operation." Python 2 used to throw an exception, but in Python 3 naive datetimes represent local times. I think the appropriate option is to not pick any time zone at all, just viewing it as an "UTC"(return nominal value of timestamp()) other than "convert"-ing it to UTC(shifting by N hours based on the running machine's timezone), since we don't have any knowledge on which timezone this datetime object represents, we can't know if we have converted it truly to UTC or not, and to me, why bother shifting it by some hours and timestamp() it anyway, that's just another layer of calculation that could go wrong. Anyways, the above is just my personal opinion, obviously there is definitely nothing wrong with viewing an arbitrary datetime as a local time. Since you've mentioned that this behavior is intended, I'd assume and understand that this behavior is a result of balancing a lot of other choices. But from my point of view, as a clueless user, it might give me some confusion as to what the actual timestamp() I'm generating, or what the actual datetime I've imported when presented with an arbitrary timestamp. And generating timestamp on naive datetime objects regardless of what timezone the machine is in seems to be a more straight forward and clear thing to do. Again thanks very much for baring with me with this discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:21:34 2020 From: report at bugs.python.org (=?utf-8?q?Nguy=E1=BB=85n_Gia_Phong?=) Date: Tue, 17 Mar 2020 09:21:34 +0000 Subject: [issue39990] help output should make use of typing.get_type_hints Message-ID: <1584436894.78.0.585396462695.issue39990@roundup.psfhosted.org> New submission from Nguy?n Gia Phong : With PEP 563, it is legal to annotate a function as follows def foo(bar: 'int') -> 'bool': pass Currently, help(foo) would print the exact signature in foo.__annotations__ and it's not really pretty. My proposal is to use the type hints from typing.get_type_hints to make documentations more readable from the user's perspective. I might not be aware of all use cases and disadvantages of this proposal however. ---------- assignee: docs at python components: Documentation messages: 364399 nosy: McSinyx, docs at python priority: normal severity: normal status: open title: help output should make use of typing.get_type_hints _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:27:49 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 09:27:49 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584437269.9.0.230643474767.issue38237@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is hard to find a builtin which could be easy and clearly implemented in Python (it means no use of dunder methods). Maybe sorted()? def sorted(iterable, /, *, key=None, reverse=False): """Emulate the built in sorted() function""" result = list(iterable) result.sort(key=key, reverse=reverse) return result Although I think that this use case is less important. The primary goal of the feature is mentioned at the end of the section -- easy way to implement functions which accept arbitrary keyword arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:31:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 09:31:40 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584437500.2.0.432141182643.issue38237@roundup.psfhosted.org> Serhiy Storchaka added the comment: divmod() should be implemented via __divmod__ and __rdivmod__. And they should be looked up on the type, not instance. There is no easy way to express it in Python accurately. This would make the example too complex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:42:57 2020 From: report at bugs.python.org (Ammar Askar) Date: Tue, 17 Mar 2020 09:42:57 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584438177.81.0.701105686023.issue38237@roundup.psfhosted.org> Ammar Askar added the comment: I don't think that matters. The example is supposed to just serve as an illustration, it doesn't need to encode the dunder dispatch semantics. The already existing example doesn't check for a __pow__. I'd picture it just as: return x//y, x%y ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:44:33 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 17 Mar 2020 09:44:33 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584438273.87.0.612542151578.issue39982@roundup.psfhosted.org> Kubilay Kocak added the comment: Update to BB complete. Rebuilding: https://buildbot.python.org/all/#/builders/18/builds/162 and https://buildbot.python.org/all/#/builders/152/builds/409 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 05:45:23 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 09:45:23 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584438323.44.0.109298814129.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: A focused issue report would include at least the following: 1) Acknowledge that gcc builds work on the AIX buildbots (a fact that has been entirely ignored so far). 2) State the exact regression: msg364373 (which was also ignored, are you using xlc or xlc_r?) says that there have always been problems with xlc unless configured in a very specific manner. Then obviously we need the exact Python code that worked in 3.7.6 but not in 3.7.7. In short, given the flakiness of the xlc toolchain I'm not even sure if anything can be classified as a regression. Most xlc users I've talked to have switched to gcc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:18:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 10:18:36 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584440316.32.0.369216648386.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: It is also instructive how Granlund views xlc: https://gmplib.org/list-archives/gmp-bugs/2010-November/002119.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:26:08 2020 From: report at bugs.python.org (=?utf-8?q?Nguy=E1=BB=85n_Gia_Phong?=) Date: Tue, 17 Mar 2020 10:26:08 +0000 Subject: [issue39990] help output should make use of typing.get_type_hints In-Reply-To: <1584436894.78.0.585396462695.issue39990@roundup.psfhosted.org> Message-ID: <1584440768.95.0.365274460286.issue39990@roundup.psfhosted.org> Change by Nguy?n Gia Phong : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:43:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 10:43:57 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584441837.73.0.783061357819.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: > https://buildbot.python.org/all/#/builders/152/builds/409 That's AMD64 FreeBSD Shared 3.x: there are still tons of SCTP failures. "Log: sendfile() does currently not support SCTP sockets. Therefore, fail the call." I don't understand why the test passed previously... was it simply skipped? Test on FreeBSD 12.1: --- vstinner at freebsd$ uname -a FreeBSD freebsd 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64 vstinner at freebsd$ ./python -m test test_socket -v -m '*SCTP*' == CPython 3.9.0a4+ (heads/master:a45b695b9f, Mar 17 2020, 10:42:05) [Clang 8.0.1 (tags/RELEASE_801/final 366581)] == FreeBSD-12.1-RELEASE-p2-amd64-64bit-ELF little-endian == cwd: /usr/home/vstinner/python/master/build/test_python_1636 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.23 Run tests sequentially 0:00:00 load avg: 0.23 [1/1] test_socket testSendmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgAfterClose (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgAncillaryGenerator (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgArray (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgBadArgs (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgBadCmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgBadMultiCmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgDataGenerator (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgDontWait (test.test_socket.SendmsgSCTPStreamTest) ... skipped 'MSG_DONTWAIT not known to work on this platform when sending' testSendmsgExcessCmsgReject (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgExplicitNoneAddr (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgGather (test.test_socket.SendmsgSCTPStreamTest) ... ok testSendmsgTimeout (test.test_socket.SendmsgSCTPStreamTest) ... ok testRecvmsg (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgBadArgs (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgEOF (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgExplicitDefaults (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgFromSendmsg (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgLongAncillaryBuf (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgOverflow (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgPeek (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgShortAncillaryBuf (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgShorter (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgTimeout (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsgTrunc (test.test_socket.RecvmsgSCTPStreamTest) ... ok testRecvmsg (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgAfterClose (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgEOF (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgExplicitDefaults (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgFromSendmsg (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgIntoArray (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgIntoBadArgs (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgIntoGenerator (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgIntoScatter (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgLongAncillaryBuf (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgOverflow (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgPeek (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgShortAncillaryBuf (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgShorter (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgTimeout (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok testRecvmsgTrunc (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok ---------------------------------------------------------------------- Ran 42 tests in 0.327s OK (skipped=1) == Tests result: SUCCESS == 1 test OK. Total duration: 746 ms Tests result: SUCCESS --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:45:58 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 17 Mar 2020 10:45:58 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584441958.24.0.988743682412.issue39107@roundup.psfhosted.org> Steve Dower added the comment: Yeah, this is on me now. Hopefully we can just pull in the new sources and they'll be fine, but historically it's taken a couple of days/weeks to get the issues ironed out. Unfortunately, I'm still on a flaky internet connection (but only for GitHub.com for some reason), so I can't clone the repos I need. But someone else should be able to submit PRs that I can merge: * clone https://github.com/python/cpython-source-deps/ * disable autocrlf * checkout tcl, delete all files (except README.md) and extract tcl-8.6.10 * git add --all; git tag tcl-core-8.6.10.0; push and send PR * checkout tk, delete all files (except README.md) and extract tk-8.6.10 * git add --all; git tag tk-8.6.10.0; push and send PR Once those are merged: * checkout cpython repo and update version number in PCbuild/tcltk.props and PCbuild/get_externals.bat * test build with PCbuild/prepare_tcltk.bat, then build with PCbuild/build.bat * push, send PR Before that is merged, I'll branch in cpython-bin-deps so that PRs keep building with the older version, then I can trigger the real build. I'll likely need somebody to download the built files and check them into the cpython-bin-deps repo, but I'll give it a go myself first in case my connection is up to it. Any volunteers? ---------- assignee: ned.deily -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:54:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 10:54:17 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584442457.27.0.905459659458.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: It seems like there is a race condition in some tests. Running the same test twice on the idle buildbot worker fails randomly: 130-CURRENT-amd64% ./python -m test test_socket -v -m test.test_socket.RecvmsgSCTPStreamTest.testRecvmsgAfterClose == CPython 3.9.0a4+ (heads/master:6ff79f6582, Mar 16 2020, 22:07:47) [Clang 10.0.0 (git at github.com:llvm/llvm-project.git llvmorg-10.0.0-rc3-1-gc290c == FreeBSD-13.0-CURRENT-amd64-64bit-ELF little-endian == cwd: /usr/home/haypo/python/master/build/test_python_31444 == CPU count: 2 == encodings: locale=UTF-8, FS=utf-8 (...) testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ok (...) 130-CURRENT-amd64% ./python -m test test_socket -v -m test.test_socket.RecvmsgSCTPStreamTest.testRecvmsgAfterClose (...) testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ERROR ====================================================================== ERROR: testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 342, in _setUp self.__setUp() File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 2533, in setUp super().setUp() File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 646, in setUp conn, addr = self.serv.accept() File "/usr/home/haypo/python/master/Lib/socket.py", line 293, in accept fd, addr = self._accept() ConnectionAbortedError: [Errno 53] Software caused connection abort (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 06:56:07 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 17 Mar 2020 10:56:07 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1584442567.11.0.892343291066.issue39952@roundup.psfhosted.org> Steve Dower added the comment: Hi Lin, please look me up on Teams and we can chat about this. I haven't heard about this effort and I'd love to know what you're working on. --- The last error is because the VS Setup team has never updated their package to include v142 libs (https://www.nuget.org/packages/Microsoft.VisualStudio.Setup.Configuration.Native/) If you're prepared to make modifications, then it's probably easiest to backport the change we made in Python 3.7 to shell out to vswhere.exe instead of directly enumerating installs. See Lib/distutils/_msvccompiler.py (it's probably safe to take the entire file and just remove the _distutils_findvs.vcxproj project). Or if you know that the .lib format is compatible, you could update the AdditionalLibraryDirectories value in _distutils_findvs.vcxproj to not use $(PlatformToolset) and just specify v141. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:17:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 11:17:32 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584443852.68.0.62154874673.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Acknowledge that gcc builds work on the AIX buildbots (a fact that has been entirely ignored so far). I do acknowledge that. I am not saying that I am sure there is a bug in the code. For what I know at this point it may be something with xlc, with the OS itself, with the libc version or something misconfigured on the machine. The only thing I know is that before I could run the test suite without any problem on 3.7.6 and now I cannot in 3.7.7, and because 3.7 a maintenance branch I though this is a possible regression, so I reported it. > are you using xlc or xlc_r? I am using xlc_r. I am saying xlc because that is the name of the compiler. The _r suffix activates thread-safe compilation (which I am doing). Apologies for the confusion. > State the exact regression The **exact** regression is that I could run the test suite without any crash or freeze on this AIX system with 3.7.6 and I cannot in 3.7.7. At the very least this is due to the fact that there is a new test that crashes/hangs. Why this happens I still have no idea as I am currently investigating. Debugging on AIX is not a pleasant task. > n short, given the flakiness of the xlc toolchain I'm not even sure if anything can be classified as a regression. Most xlc users I've talked to have switched to gcc. I notified the behaviour different here so we can discuss about this as a team. If we decide that this is xlc's fault or is not worth to investigate or that because AIX is not really fully supported we do not want to spend resources I can totally understand it. I thought this was important enough because this change was in 3.7, which is supposed to be stable across minor releases (the same applies for 3.8 if the problem also appears there). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:20:00 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Mar 2020 11:20:00 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584444000.56.0.677502210459.issue39989@roundup.psfhosted.org> Mark Dickinson added the comment: This feels like something that's very much down to personal preference. I also prefer the closing "]" and ")" characters on their own lines, but I'd be happy with an argument to ast.dump giving me that option. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:27:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 11:27:33 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address Message-ID: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> New submission from STINNER Victor : My FreeBSD VM has a NIC with the IPv6 address fe80::5054:ff:fe9: local-link IPv6 address. It's used by uuid._netstat_getnode() as a MAC address, but it seems like this IPv6 address doesn't respect RFC 4122 and so should be skipped. _find_mac_under_heading() should reject IPv6 address: only use MAC address. vstinner at freebsd$ uname -a FreeBSD freebsd 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64 ====================================================================== FAIL: test_netstat_getnode (test.test_uuid.TestInternalsWithExtModule) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 767, in test_netstat_getnode self.check_node(node, 'netstat') File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 736, in check_node self.assertTrue(0 < node < (1 << 48), AssertionError: False is not true : fe805054fffe9 is not an RFC 4122 node ID ====================================================================== FAIL: test_netstat_getnode (test.test_uuid.TestInternalsWithoutExtModule) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 767, in test_netstat_getnode self.check_node(node, 'netstat') File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 736, in check_node self.assertTrue(0 < node < (1 << 48), AssertionError: False is not true : fe805054fffe9 is not an RFC 4122 node ID It's using a qemu VM run by virt-manager. fe805054fffe9 seems to be the MAC address of my vtnet network interface: vstinner at freebsd$ netstat -ian Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll vtnet 1500 52:54:00:9d:0e:67 10017 0 0 8174 0 0 vtnet - fe80::%vtnet0 fe80::5054:ff:fe9 0 - - 4 - - vtnet - 192.168.122.0 192.168.122.45 8844 - - 8171 - - lo0 16384 lo0 260148 0 0 260148 0 0 lo0 - ::1/128 ::1 193 - - 193 - - ff01::1%lo0 ff02::2:2eb7:74fa ff02::2:ff2e:b774 ff02::1%lo0 ff02::1:ff00:1%lo lo0 - fe80::%lo0/64 fe80::1%lo0 0 - - 0 - - ff01::1%lo0 ff02::2:2eb7:74fa ff02::2:ff2e:b774 ff02::1%lo0 ff02::1:ff00:1%lo lo0 - 127.0.0.0/8 127.0.0.1 259955 - - 259955 - - 224.0.0.1 ---------- components: Tests messages: 364412 nosy: barry, vstinner priority: normal severity: normal status: open title: test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:33:57 2020 From: report at bugs.python.org (Thomas Kluyver) Date: Tue, 17 Mar 2020 11:33:57 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584444837.36.0.790135752039.issue24916@roundup.psfhosted.org> Thomas Kluyver added the comment: Serhiy, I think you fixed the part that was actually likely to cause problems a few years ago in issue #25985 & commit 885bdc4946890f4bb80557fab80c3874b2cc4d39 . Using sys.version[:3] to get a short version like 3.8 was what I wanted to fix. People are presumably still trying to change the other bits because there's still a FIXME comment. If we're happy with the current code, I think we can remove that comment and close the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:50:58 2020 From: report at bugs.python.org (Berry Schoenmakers) Date: Tue, 17 Mar 2020 11:50:58 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584445858.1.0.747477280855.issue38237@roundup.psfhosted.org> Berry Schoenmakers added the comment: Maybe a use case in this direction: int(x, base=10). Because, if you type int(x='3', base=12) you get TypeError: 'x' is an invalid keyword argument for int() and x needs to be a positional-only to program this yourself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 07:58:38 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 11:58:38 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584446318.71.0.066337416618.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: "The **exact** regression is that I could run the test suite without any crash or freeze on this AIX system with 3.7.6 and I cannot in 3.7.7. At the very least this is due to the fact that there is a new test that crashes/hangs." In other words, contrary to your earlier dismissal, you did NOT run _decimal on AIX with MAX_PREC but just ran the 3.7.6 tests that do not include any tests with MAX_PREC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:07:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 12:07:05 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584446825.39.0.695839640996.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > In other words, contrary to your earlier dismissal, you did NOT run _decimal on AIX with MAX_PREC but just ran the 3.7.6 tests that do not include any tests with MAX_PREC. I did, and it raises MemoryError: ? uname -a AIX 1 7 powerpc 00CCAD974C00 AIX ? python3.7 --version Python 3.7.6 ? python3.7 Lib/test/test_decimal.py ... ====================================================================== ERROR: test_maxcontext_exact_arith (__main__.CWhitebox) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_decimal.py", line 5506, in test_maxcontext_exact_arith self.assertEqual(Decimal(4).sqrt(), 2) MemoryError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:09:46 2020 From: report at bugs.python.org (Vladimir) Date: Tue, 17 Mar 2020 12:09:46 +0000 Subject: [issue39992] Windows line endings of pyc file detected on Ubuntu Message-ID: <1584446986.58.0.898200280545.issue39992@roundup.psfhosted.org> New submission from Vladimir : I have problem to run pyc file on one machine with Ubuntu Server 18.04.4 LTS. This is my source code of the file: #!/root/PycharmProjects/Project/venv/bin/python3.7 print("Hi") When I compile it in python console with commands: import py_compile py_compile.compile('test2.py') I get test2.cpython-37.pyc file. Then I add execution access by chmod +x test2.cpython-37.pyc If I run ./test2.cpython-37.pyc on first machine (Ubuntu Server 18.04.4 LTS) I get simple "Hi". But if I run similarly compiled file on other machine with the same OS - Ubuntu Server 18.04.4 LTS, I get: ./test2.cpython-37.pyc: line 1: $'B\r\r': command not found ./test2.cpython-37.pyc: line 2: syntax error near unexpected token `)' ./test2.cpython-37.pyc: line 2: `z?p^=?@s ed?dS)ZHiN)?print?rrtest2.py?' It looks like it is reading Windows line endings. But why? It is created, compiled and run on Ubuntu machine. How can I solve this issue, and run this pyc file with the right result on second machine? ---------- messages: 364417 nosy: vladinko0 priority: normal severity: normal status: open title: Windows line endings of pyc file detected on Ubuntu versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:12:27 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 12:12:27 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584447147.87.0.411053507428.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Just to be clear: I am saying that the *exact* regression is manifested with the new test because that is the behavioural difference that I experienced and how I found this problem. > but just ran the 3.7.6 tests that do not include any tests with MAX_PREC. Independently on other considerations, If the test suite fails in 3.7.7 and succeeds in 3.7.6 that is a regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:26:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 12:26:59 +0000 Subject: [issue39992] Windows line endings of pyc file detected on Ubuntu In-Reply-To: <1584446986.58.0.898200280545.issue39992@roundup.psfhosted.org> Message-ID: <1584448019.9.0.989684744706.issue39992@roundup.psfhosted.org> Serhiy Storchaka added the comment: pyc files are not executable files. If you can run it on your machine it means that you have installed some loader hook which allow you to run files which are not machine executable files and not shell scripts. It seems it is not installed on your other machine. This hook is not a part of Python. You have to find what additional software is installed on your first machine and install the necessary parts on your other machine. ---------- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:29:24 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 12:29:24 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584448164.75.0.266753837187.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: Sorry, I'm reacting like Granlund now and close. These discussions lead nowhere. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:38:13 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 12:38:13 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584448693.44.0.284509707245.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: After some debugging, I discovered that the new test succeeds if I configure and compile CPython without 'OBJECT_MODE=64' set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:47:03 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 12:47:03 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584449223.69.0.507819486634.issue39988@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is possible also to get rid of the ctx argument at all. The context may be determined by the parent nodes. But it is larger and breaking change, so I'll open a separate issue for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:52:49 2020 From: report at bugs.python.org (sanjeev) Date: Tue, 17 Mar 2020 12:52:49 +0000 Subject: [issue31895] How to implement api in python website In-Reply-To: <1509325061.68.0.213398074469.issue31895@psf.upfronthosting.co.za> Message-ID: <1584449569.76.0.231719936886.issue31895@roundup.psfhosted.org> sanjeev added the comment: native support for converting https://www.extam.com/ ---------- nosy: +sanjeev091 title: Native hijri calendar support -> How to implement api in python website type: enhancement -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 08:54:31 2020 From: report at bugs.python.org (sanjeev) Date: Tue, 17 Mar 2020 12:54:31 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584449671.77.0.634948977674.issue39988@roundup.psfhosted.org> sanjeev added the comment: Thank you for this question https://www.extam.com/ ---------- nosy: +sanjeev091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 09:08:22 2020 From: report at bugs.python.org (Michael S) Date: Tue, 17 Mar 2020 13:08:22 +0000 Subject: [issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation. Message-ID: <1584450502.26.0.366268948098.issue39993@roundup.psfhosted.org> New submission from Michael S : I just read https://docs.python.org/3/reference/compound_stmts.html#function-definitions The item parameter_list is defined as: parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] | parameter_list_no_posonly This definition states that the "," "/" after ("," defparameter)* are mandatory. But this is not true in Python 3.8, because you can define a function as def f(a): pass Did I miss something? ---------- assignee: docs at python components: Documentation messages: 364425 nosy: Michael S2, docs at python priority: normal severity: normal status: open title: Language Reference - Function definition parameter_list item definition not equivalent to implementation. type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 09:17:04 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 13:17:04 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584451024.35.0.397285203387.issue39991@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18394 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 09:35:09 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 17 Mar 2020 13:35:09 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584452109.36.0.743491083795.issue39989@roundup.psfhosted.org> Eric V. Smith added the comment: For what it's worth (which might not be much), here is what black produces: Module( body=[ Expr( value=Call( func=Name(id="spam", ctx=Load()), args=[Name(id="eggs", ctx=Load()), Constant(value="and cheese")], keywords=[], ) ) ], type_ignores=[], ) I agree with Mark: it's all probably personal preference, and I'd be okay either way. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 09:38:53 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Mar 2020 13:38:53 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584452333.27.0.574931325706.issue39989@roundup.psfhosted.org> Mark Dickinson added the comment: Ah yes; looking at the `black` output, there's also an opportunity for an exciting discussion about trailing commas here :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 09:58:06 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Mar 2020 13:58:06 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584453486.17.0.548213737171.issue37207@roundup.psfhosted.org> Dong-hee Na added the comment: Victor, frozenset is the last basic builtin collection which is not applied to this improvement yet. frozenset also show similar performance improvement by using vectorcall pyperf compare_to master.json bpo-37207.json Mean +- std dev: [master] 2.26 us +- 0.06 us -> [bpo-37207] 2.06 us +- 0.05 us: 1.09x faster (-9%) > What I mean is that vectorcall should not be used for everything I definitely agree with this opinion. So I ask your opinion before submit the patch. frozenset is not frequently used than the list/set/dict. but frozenset is also the basic builtin collection, IMHO it is okay to apply vectorcall. What do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:10:55 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Mar 2020 14:10:55 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584454255.51.0.514415647375.issue39511@roundup.psfhosted.org> Mark Shannon added the comment: Consider the case where a thread that doesn't hold the GIL attempts to get a reference on `None`. The problem with having a single immortal `None`, is that it will cause data cache thrashing as two different CPUs modify the refcount on the shared `None` object. Each subinterpreter needs its own distinct `None`. `None` could be made immortal, it just can't be shared between sub-interpreters. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:13:55 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Mar 2020 14:13:55 +0000 Subject: [issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation. In-Reply-To: <1584450502.26.0.366268948098.issue39993@roundup.psfhosted.org> Message-ID: <1584454435.67.0.0483409902995.issue39993@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Did I miss something? Yep, what you are missing is that the rule is really: (defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]) | (parameter_list_no_posonly) which means that is either defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] or parameter_list_no_posonly and for the def(a): pass case the corresponding rule is parameter_list_no_posonly (check the rest of the specification). Do you think that adding these explicit parentheses would help with help making this more clear? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:19:09 2020 From: report at bugs.python.org (=?utf-8?q?Nguy=E1=BB=85n_Gia_Phong?=) Date: Tue, 17 Mar 2020 14:19:09 +0000 Subject: [issue39990] help should evaluate forward reference In-Reply-To: <1584436894.78.0.585396462695.issue39990@roundup.psfhosted.org> Message-ID: <1584454749.03.0.583570370251.issue39990@roundup.psfhosted.org> Nguy?n Gia Phong added the comment: I traced it down to inspect.formatannotation(annotation). Before checking for isinstance(annotation, type), IMHO we should do something like import typing if isinstance(annotation, str): annotation = typing.ForwardRef(str)._evaluate(annotation) However, is is not aware of globals and especially locals of help caller, so I guess more sophisticated solution is required. ---------- title: help output should make use of typing.get_type_hints -> help should evaluate forward reference _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:51:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 14:51:49 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584456709.95.0.930733190849.issue39991@roundup.psfhosted.org> STINNER Victor added the comment: New changeset eb886db1e99a15f15a2342aa496197a5f88fa9c8 by Victor Stinner in branch 'master': bpo-39991: uuid._netstat_getnode() ignores IPv6 addresses (GH-19043) https://github.com/python/cpython/commit/eb886db1e99a15f15a2342aa496197a5f88fa9c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:57:09 2020 From: report at bugs.python.org (Michael S) Date: Tue, 17 Mar 2020 14:57:09 +0000 Subject: [issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation. In-Reply-To: <1584450502.26.0.366268948098.issue39993@roundup.psfhosted.org> Message-ID: <1584457029.06.0.148589482147.issue39993@roundup.psfhosted.org> Michael S added the comment: Thanks Pablo, sorry, I was just stupid. > Do you think that adding these explicit parentheses would help with help making this more clear? Maybe. I read the BNF documentation the first time today, but since it's not intended for beginners, I think it's clear enough. How should we continue with this issue? I don't really see any closing button or the like. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 10:59:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 14:59:41 +0000 Subject: [issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation. In-Reply-To: <1584450502.26.0.366268948098.issue39993@roundup.psfhosted.org> Message-ID: <1584457181.96.0.474795216917.issue39993@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:10:36 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Mar 2020 15:10:36 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1584457836.51.0.471853478913.issue36710@roundup.psfhosted.org> Mark Shannon added the comment: Instead of passing `_PyRuntimeState` around everywhere, why not just let it disappear in time. Currently `_PyRuntimeState` manages "global" state, mainly the GIL and some config. Once the GIL has been migrated to the sub-interpreters, the config part can be factored out and `_PyRuntimeState` can just disappear. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:12:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 15:12:39 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584457959.66.0.113191289918.issue39991@roundup.psfhosted.org> STINNER Victor added the comment: It seems like this issue is a regression caused by the following change of bpo-28009: commit 0bcbfa43d55d9558cdcb256d8998366281322080 Author: Michael Felt Date: Thu Sep 26 20:43:15 2019 +0100 bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672) which replaced: if len(word) == 17 and word.count(b':') == 5: with: if len(word) == 17: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:14:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 15:14:13 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1584458053.2.0.932810940986.issue28009@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset 0bcbfa43d55d9558cdcb256d8998366281322080 by Tal Einat (Michael Felt) in branch 'master': > bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672) This change introduced a regression: bpo-39991. I pushed the commit eb886db1e99a15f15a2342aa496197a5f88fa9c8 to fix my case, but I'm not sure that the fix covers all cases. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:17:53 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Mar 2020 15:17:53 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584458273.14.0.378681392654.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: > You are the one who wanted to *introduce* a hack by dereferencing as char and then cast to _Bool. :-) Yes, I did change my mind after reading the documentation. The docs say two contradicting things: 1. The '?' conversion code corresponds to the _Bool type defined by C99 2. ... any non-zero value will be True when unpacking. So it's clear that something has to change. IMO, preserving (2) and relaxing (1) is the more useful choice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:18:25 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Mar 2020 15:18:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584458305.4.0.151367804849.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18395 pull_request: https://github.com/python/cpython/pull/19044 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:20:23 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 17 Mar 2020 15:20:23 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1584458423.58.0.0736900397175.issue36710@roundup.psfhosted.org> Steve Dower added the comment: > Instead of passing `_PyRuntimeState` around everywhere, why not just let it disappear in time. Agreed. It's valuable to pass the thread state, but the runtime state should only be needed to create a new thread state (and arguably not even then). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 11:30:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 15:30:44 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584459044.84.0.402279822834.issue39991@roundup.psfhosted.org> STINNER Victor added the comment: My fix is incomplete: the IPv6 address "123:2:3:4:5:6:7:8" is a valid IPv6 address and uuid.py accepts it as a valid MAC address, whereas it's not a MAC address. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:04:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:04:10 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1584461050.29.0.862094837495.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: > Instead of passing `_PyRuntimeState` around everywhere, why not just let it disappear in time. Passing runtime (_PyRuntimeState) is a temporary move until more and more fields are moved from _PyRuntimeState into PyInterpreterState. I just created bpo-39984 "Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval" yesterday ;-) Once we will manage to move the GIL into PyInterpreterState, we would still have to pass PyInterpreterState or PyThreadState to function which require to access the GIL. Passing explicitly runtime is a first step to prepare to migration to PyInterpreterState or PyThreadState. My intent is to show that many functions rely on "global variables": pass these variables instead. If you are thinking about getting the current Python thread state using a thread local storage, that's a different topic and I'm not aware of an open issue to track this idea. > Currently `_PyRuntimeState` manages "global" state, mainly the GIL and some config. Once the GIL has been migrated to the sub-interpreters, the config part can be factored out and `_PyRuntimeState` can just disappear. I don't think that we will be able to fully remove _PyRuntimeState. It seems like the PEP 554 "Multiple Interpreters in the Stdlib" requires a registry of interpreters and it currently lives in _PyRuntimeState. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:07:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 16:07:34 +0000 Subject: [issue39987] Simplify setting line numbers in the compiler In-Reply-To: <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org> Message-ID: <1584461254.27.0.493639138506.issue39987@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 61cb3d02b83e746e59bb1351a0865e3b8714b2d6 by Serhiy Storchaka in branch 'master': bpo-39987: Simplify setting lineno in the compiler. (GH-19037) https://github.com/python/cpython/commit/61cb3d02b83e746e59bb1351a0865e3b8714b2d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:08:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 16:08:21 +0000 Subject: [issue39987] Simplify setting line numbers in the compiler In-Reply-To: <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org> Message-ID: <1584461301.66.0.793497072456.issue39987@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:19:33 2020 From: report at bugs.python.org (Palak Kumar Jha) Date: Tue, 17 Mar 2020 16:19:33 +0000 Subject: [issue39994] Redundant code in pprint module. Message-ID: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> New submission from Palak Kumar Jha : In the PrettyPrinter._format method, since self._dispatch has dict.__repr__ [key] mapped to self._pprint_dict [value] the elif block is not needed. Its work is already being done by the if block above, which searches self._dispatch to fetch the appropriate value. ---------- messages: 364442 nosy: palakjha priority: normal severity: normal status: open title: Redundant code in pprint module. type: enhancement versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:25:48 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Mar 2020 16:25:48 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584462348.48.0.190260790074.issue39988@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg364424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:26:13 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Mar 2020 16:26:13 +0000 Subject: [issue31895] How to implement api in python website In-Reply-To: <1509325061.68.0.213398074469.issue31895@psf.upfronthosting.co.za> Message-ID: <1584462373.28.0.595435449442.issue31895@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg364423 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:38:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:38:16 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1584463096.41.0.0636141148789.issue39943@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 982307b9cceef36e30ac43b13032d68c3b921adc by Andy Lester in branch 'master': bpo-39943: Remove unused self from find_nfc_index() (GH-18973) https://github.com/python/cpython/commit/982307b9cceef36e30ac43b13032d68c3b921adc ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:39:34 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Mar 2020 16:39:34 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1584463174.31.0.32640456791.issue36710@roundup.psfhosted.org> Mark Shannon added the comment: Even if `_PyRuntime` ends up as just a list of interpreters and doesn't disappear completely, it won't be used anything like as much as it is now. Many of the functions that it getting passed to will no longer need it, so why bother passing it now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:41:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:41:55 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584463315.65.0.00327007158474.issue39991@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18396 pull_request: https://github.com/python/cpython/pull/19045 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:51:52 2020 From: report at bugs.python.org (Dino Viehland) Date: Tue, 17 Mar 2020 16:51:52 +0000 Subject: [issue26067] test_shutil fails when gid name is missing In-Reply-To: <1452373835.73.0.278108988814.issue26067@psf.upfronthosting.co.za> Message-ID: <1584463912.26.0.163491274703.issue26067@roundup.psfhosted.org> Dino Viehland added the comment: New changeset 52268941f37e3e27bd01792b081877ec3bc9ce12 by Matthias Braun in branch 'master': bpo-26067: Do not fail test_shutil / chown when gid/uid cannot be resolved (#19032) https://github.com/python/cpython/commit/52268941f37e3e27bd01792b081877ec3bc9ce12 ---------- nosy: +dino.viehland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:52:42 2020 From: report at bugs.python.org (Palak Kumar Jha) Date: Tue, 17 Mar 2020 16:52:42 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1584463962.3.0.183704302788.issue39994@roundup.psfhosted.org> Change by Palak Kumar Jha : ---------- keywords: +patch pull_requests: +18397 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19046 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:53:08 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 17 Mar 2020 16:53:08 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584463988.89.0.941804123078.issue39980@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +barry, jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:54:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:54:19 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584464059.4.0.177957814513.issue39511@roundup.psfhosted.org> STINNER Victor added the comment: Mark: > The problem with having a single immortal `None`, is that it will cause data cache thrashing as two different CPUs modify the refcount on the shared `None` object. Yeah, I concur with Mark: having one singleton per interpreter should provide better usage of the CPU caches, especially CPU data cache level 1. Mark: > Consider the case where a thread that doesn't hold the GIL attempts to get a reference on `None`. The main drawback of PR 18301 is that accessing "Py_None" means accessing tstate->interp->none. Except that the commonly used _PyThreadState_GET() returns NULL if the thread doesn't hold the GIL. One alternative would be to use PyGILState_GetThisThreadState() but this API doesn't support subinterpreters. Maybe we are moving towards a major backward incompatible changes required to make the subinterpreters implementation more efficient. Maybe CPython should have a backward compatible behavior by default (Py_None can be read without holding the GIL), but running subinterpreters in parallel would change Py_None behavior (cannot be read without holding the GIL). I don't know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:55:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:55:43 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584464143.33.0.199266022942.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: > What do you think? I would prefer to see a PR to give my opinion :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:55:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 16:55:57 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584464157.09.0.326453482462.issue24916@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:57:45 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 17 Mar 2020 16:57:45 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584464265.09.0.932498683804.issue10572@roundup.psfhosted.org> Brett Cannon added the comment: I'm also still in favour of the change. While people may have worked around this that doesn't mean we need to keep forcing them to do so. People worked around our lack of booleans but we chose to still fix that. ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:57:57 2020 From: report at bugs.python.org (hai shi) Date: Tue, 17 Mar 2020 16:57:57 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584464277.76.0.621799044713.issue39337@roundup.psfhosted.org> hai shi added the comment: > Maybe we should just add a private function for test in _testcapi. Oh, there have a problem with this idea: struct _is is defined in internal/pycore_pystate.h. _testcapi must test the public Python C API, not CPython internal C API ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 12:59:02 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 17 Mar 2020 16:59:02 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584464342.64.0.717716635828.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: > So it's clear that something has to change. IMO, preserving (2) and relaxing (1) is the more useful choice. But not in this issue I think. GH-18969 is a minimal change that *removes* UB for the standard sizes. UB for the native type is a direct consequence of using _Bool. Native types should be left as is because that's what array libraries expect. The docs could need a change (in another issue). Also, UB can only happen in a constructed example --- correctly packed arrays don't have any incorrect values. So I think any fear of UB here is not warranted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:01:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:01:54 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with Message-ID: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Ubuntu Shared 3.x: https://buildbot.python.org/all/#/builders/101/builds/532 test_crash (test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) ... Stdout: 15.51s Stderr: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) Dangling thread: Dangling thread: <_MainThread(MainThread, started 140540525950528)> Dangling thread: <_ExecutorManagerThread(Thread-111, stopped daemon 140540401628928)> (...) ====================================================================== ERROR: test_crash (test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) [exit at task unpickle] ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_concurrent_futures.py", line 1119, in test_crash executor.shutdown(wait=True) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py", line 721, in shutdown self._executor_manager_thread_wakeup.wakeup() File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py", line 93, in wakeup self._writer.send_bytes(b"") File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 205, in send_bytes self._send_bytes(m[offset:offset + size]) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 416, in _send_bytes self._send(header + buf) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 373, in _send n = write(self._handle, buf) OSError: [Errno 9] Bad file descriptor Stdout: 15.51s Stderr: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) Dangling thread: Dangling thread: <_MainThread(MainThread, started 140540525950528)> Dangling thread: <_ExecutorManagerThread(Thread-111, stopped daemon 140540401628928)> -- On the same build, test_concurrent_futures timed out after 15 min, while running test_ressources_gced_in_workers(): 0:29:08 load avg: 1.46 Re-running test_concurrent_futures in verbose mode (...) test_map_exception (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok test_map_timeout (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok test_max_workers_negative (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok test_max_workers_too_large (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... skipped 'Windows-only process limit' test_no_stale_references (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok Timeout (0:15:00)! Thread 0x00007f38bf766700 (most recent call first): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 303 in wait File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/queues.py", line 227 in _feed File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 882 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 944 in _bootstrap_inner File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 902 in _bootstrap Thread 0x00007f38bff67700 (most recent call first): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/selectors.py", line 415 in select File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 936 in wait File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py", line 372 in wait_result_broken_or_wakeup File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py", line 319 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 944 in _bootstrap_inner File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 902 in _bootstrap Thread 0x00007f38c7128640 (most recent call first): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 303 in wait File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/_base.py", line 434 in result File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_concurrent_futures.py", line 955 in test_ressources_gced_in_workers File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 616 in _callTestMethod File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 659 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 719 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__ File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/runner.py", line 176 in run File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 2079 in _run_suite File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 2201 in run_unittest File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 153 in _runtest File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 193 in runtest File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 691 in _main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 634 in main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 712 in main File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/__main__.py", line 2 in File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 87 in _run_code File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 194 in _run_module_as_main test_ressources_gced_in_workers (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... Makefile:1171: recipe for target 'buildbottest' failed make: *** [buildbottest] Error 1 command timed out: 1200 seconds without output running [b'make', b'buildbottest', b'TESTOPTS=-j2 --junit-xml test-results.xml ${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', b'TESTTIMEOUT=900'], attempting to kill program finished with exit code 2 elapsedTime=3849.667593 ---------- components: Tests messages: 364451 nosy: vstinner priority: normal severity: normal status: open title: test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:02:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:02:14 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor In-Reply-To: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> Message-ID: <1584464534.47.0.863757970322.issue39995@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with -> test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:03:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:03:30 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584464610.12.0.493736182896.issue39337@roundup.psfhosted.org> STINNER Victor added the comment: > _testcapi must test the public Python C API, not CPython internal C API Use _testinternalcapi in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:04:51 2020 From: report at bugs.python.org (Mauro S. M. Rodrigues) Date: Tue, 17 Mar 2020 17:04:51 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584464691.67.0.478205106367.issue25024@roundup.psfhosted.org> Mauro S. M. Rodrigues added the comment: Hi Anthony, Thanks for asking, yeah I'm interested in push a new version. I'll do it later today and I'll post a link to the pr here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:06:06 2020 From: report at bugs.python.org (Antony Lee) Date: Tue, 17 Mar 2020 17:06:06 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584464766.93.0.0227203056421.issue25024@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:09:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:09:50 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584464990.07.0.257648675165.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5b1ef200d31a74a9b478d0217d73ed0a659a8a06 by Victor Stinner in branch 'master': bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738) https://github.com/python/cpython/commit/5b1ef200d31a74a9b478d0217d73ed0a659a8a06 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:10:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:10:56 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584465056.7.0.0869963042981.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Petr and Nick for the review ;-) Pablo Galindo Salgado: > I think Cython makes use of PEP-489 so unless I am missing something all generated extensions use PEP-489 structures. Alright. I still consider that my change is correct and will no harm anyone ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:16:32 2020 From: report at bugs.python.org (hai shi) Date: Tue, 17 Mar 2020 17:16:32 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584465392.51.0.38533349558.issue39337@roundup.psfhosted.org> hai shi added the comment: > Use _testinternalcapi in this case. oh, forgive me. I don't atttention this extension module before :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:19:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 17 Mar 2020 17:19:06 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584465546.2.0.427608668226.issue39989@roundup.psfhosted.org> Terry J. Reedy added the comment: The current output looks like Python code. The proposed revision looks more like C, and I find the example above less readable with the prominence given to what is close to noise. The difference is part of the reason I left C for Python over 2 decades ago. Please make the alternative an option. The preferred form depends on the person and possibly the AST. (The example in Pablo's message is quite different.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:26:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 17:26:00 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584465960.27.0.27708645445.issue25024@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is your use case Anthony? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:33:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:33:52 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584466432.42.0.57423276069.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18398 pull_request: https://github.com/python/cpython/pull/19047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:36:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:36:51 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584466611.59.0.952579965583.issue39991@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ebf6bb9f5ef032d1646b418ebbb645ea0b217da6 by Victor Stinner in branch 'master': bpo-39991: Enhance uuid parser for MAC address (GH-19045) https://github.com/python/cpython/commit/ebf6bb9f5ef032d1646b418ebbb645ea0b217da6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:37:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:37:36 +0000 Subject: [issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address In-Reply-To: <1584444453.93.0.776725863736.issue39991@roundup.psfhosted.org> Message-ID: <1584466656.33.0.0862462678499.issue39991@roundup.psfhosted.org> STINNER Victor added the comment: Ok, the new stricter parser should now cover all cases. If not, it should be easier to fix it ;-) I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:37:56 2020 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 17 Mar 2020 17:37:56 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584466676.61.0.193310471331.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: one example is here: https://github.com/pre-commit/pre-commit/blob/bb6f1efe63c168d9393d520bd60e16c991a57059/pre_commit/store.py#L137-L139 where I would want cleanup in the exceptional case another (related but different) closed-source use case involves creating a temporary directory that may be deleted and currently has to be guarded by: shutil.rmtree(..., ignore_errors=True) (making `TemporaryDirectory` not useful since it crashes if the directory goes missing) there's additionally the problem of readonly files on windows, and readonly directories elsewhere being undeletable without a custom rmtree but I think that's a different issue entirely -- https://github.com/pre-commit/pre-commit/blob/bb6f1efe63c168d9393d520bd60e16c991a57059/pre_commit/util.py#L250-L267 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:46:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:46:32 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584467192.18.0.685254151686.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 514c469719f149e1722a91a9d0c63bf89dfefb2a by Dong-hee Na in branch 'master': bpo-1635741: Port itertools module to multiphase initialization (GH-19044) https://github.com/python/cpython/commit/514c469719f149e1722a91a9d0c63bf89dfefb2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:46:27 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 17 Mar 2020 17:46:27 +0000 Subject: [issue39717] Fix exception causes in tarfile module In-Reply-To: <1582315232.59.0.621263718222.issue39717@roundup.psfhosted.org> Message-ID: <1584467187.31.0.158696806917.issue39717@roundup.psfhosted.org> Ram Rachum added the comment: Ethan, got a verdict? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:47:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 17:47:52 +0000 Subject: [issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created In-Reply-To: <1459203748.81.0.389724870435.issue26660@psf.upfronthosting.co.za> Message-ID: <1584467272.6.0.194089266557.issue26660@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:50:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:50:48 +0000 Subject: [issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x Message-ID: <1584467448.23.0.447277683737.issue39996@roundup.psfhosted.org> New submission from STINNER Victor : Sadly, faulthandler failed to dump the Python traceback and kill the process. Instead, the main libregrtest process had to kill the child process (process group) :-( https://buildbot.python.org/all/#/builders/152/builds/420 ... 0:56:25 load avg: 0.22 running: test_multiprocessing_fork (35 min 42 sec) 0:56:55 load avg: 0.40 running: test_multiprocessing_fork (36 min 12 sec) 0:57:25 load avg: 0.24 running: test_multiprocessing_fork (36 min 42 sec) 0:57:55 load avg: 0.25 running: test_multiprocessing_fork (37 min 12 sec) Kill process group 0:58:13 load avg: 0.24 [420/420/3] test_multiprocessing_fork timed out (37 min 30 sec) (37 min 30 sec) See also bpo-39995: test_concurrent_futures.test_ressources_gced_in_workers() timed out after 15 minutes on AMD64 Ubuntu Shared 3.x. ---------- components: Tests messages: 364464 nosy: koobs, vstinner priority: normal severity: normal status: open title: test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:51:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:51:37 +0000 Subject: [issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584467448.23.0.447277683737.issue39996@roundup.psfhosted.org> Message-ID: <1584467497.76.0.709629476973.issue39996@roundup.psfhosted.org> STINNER Victor added the comment: In the previous build 419, test_multiprocessing_fork took 4 min 12 sec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:53:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 17 Mar 2020 17:53:31 +0000 Subject: [issue31895] How to implement api in python website In-Reply-To: <1509325061.68.0.213398074469.issue31895@psf.upfronthosting.co.za> Message-ID: <1584467611.04.0.387741097061.issue31895@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- type: performance -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:56:02 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 17:56:02 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584467762.33.0.826062772663.issue25024@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you want the conditional cleanup, then TemporaryDirectory is obviously a wrong tool. mkdtemp looks more appropriate. If you remove directory in process of working with temporary directory, would it help if you create a subdirectory in the temporary directory and work with it (including conditionally removing)? As for the readonly files, was not this problem solved by PR 10320? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 13:56:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 17:56:49 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584467809.34.0.302745048231.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset dab8423d220243efabbbcafafc12d90145539b50 by Victor Stinner in branch 'master': bpo-39984: Add PyInterpreterState.ceval (GH-19047) https://github.com/python/cpython/commit/dab8423d220243efabbbcafafc12d90145539b50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:00:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 17 Mar 2020 18:00:10 +0000 Subject: [issue31895] Native hijri calendar support In-Reply-To: <1509325061.68.0.213398074469.issue31895@psf.upfronthosting.co.za> Message-ID: <1584468010.55.0.182648457854.issue31895@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: How to implement api in python website -> Native hijri calendar support _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:06:54 2020 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 17 Mar 2020 18:06:54 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1584468414.07.0.329901263495.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: oh! that's neat, yeah hadn't been following closely enough it seems, good to hear that the readonly thing is fixed! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:17:23 2020 From: report at bugs.python.org (Larry Hastings) Date: Tue, 17 Mar 2020 18:17:23 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584469043.32.0.622554823246.issue39511@roundup.psfhosted.org> Larry Hastings added the comment: > The problem with having a single immortal `None`, is that it will > cause data cache thrashing as two different CPUs modify the > refcount on the shared `None` object. That's a very reasonable theory. Personally, I find modern CPU architecture bewildering and unpredictable. So I'd prefer it if somebody tests such performance claims, rather than simply asserting them and having that be the final design. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:27:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 18:27:39 +0000 Subject: [issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584467448.23.0.447277683737.issue39996@roundup.psfhosted.org> Message-ID: <1584469659.92.0.139476883657.issue39996@roundup.psfhosted.org> STINNER Victor added the comment: On FreeBSD CURRENT worker, I reproduced the issue: "test_enter (test.test_multiprocessing_fork.WithProcessesTestPool) ..." hangs. Sadly I unblocked a process when I did a mistake in gdb while getting Python tracebacks. Process 90127: 90127 4 S+ 0:00.51 /usr/home/haypo/python/master/python -c from multiprocessing.forkserver import main; main(8, 9, ['__main__', 'test.test_multiprocessing_forkserver'], **{'sys_path': ['/usr/home/haypo/python/master', '/usr/local/lib/python39.zip', (gdb) py-bt Traceback (most recent call first): File "/usr/home/haypo/python/master/Lib/selectors.py", line 558, in select kev_list = self._selector.control(None, max_ev, timeout) File "/usr/home/haypo/python/master/Lib/multiprocessing/forkserver.py", line 986, in main File "", line 1, in Process 90645 cmdline = './python -m test -v test_multiprocessing_fork -F' (gdb) py-bt Traceback (most recent call first): File "/usr/home/haypo/python/master/Lib/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() File "/usr/home/haypo/python/master/Lib/multiprocessing/queues.py", line 355, in get with self._rlock: File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 370, in worker `func` and (a, b) becomes func(a, b). File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 571, in _bootstrap File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 75, in _launch code = process_obj._bootstrap(parent_sentinel=child_r) File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 276, in _Popen return Popen(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 633, in start File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 838, in _repopulate_pool_static self._cache = pool._cache File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 559, in _repopulate_pool outqueue.put(None) File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 375, in Pool File "/usr/home/haypo/python/master/Lib/test/_test_multiprocessing.py", line 2338, in setUpClass cls.pool = cls.Pool(4) (...) Process 90646 : cmdline = './python -m test -v test_multiprocessing_fork -F' (gdb) py-bt Traceback (most recent call first): File "/usr/home/haypo/python/master/Lib/multiprocessing/connection.py", line 384, in _recv chunk = read(handle, remaining) File "/usr/home/haypo/python/master/Lib/multiprocessing/connection.py", line 419, in _recv_bytes buf = self._recv(4) File "/usr/home/haypo/python/master/Lib/multiprocessing/connection.py", line 221, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/home/haypo/python/master/Lib/multiprocessing/queues.py", line 356, in get res = self._reader.recv_bytes() File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 370, in worker `func` and (a, b) becomes func(a, b). File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 571, in _bootstrap File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 75, in _launch code = process_obj._bootstrap(parent_sentinel=child_r) File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 276, in _Popen return Popen(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 633, in start File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 838, in _repopulate_pool_static self._cache = pool._cache File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 559, in _repopulate_pool outqueue.put(None) File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 375, in Pool File "/usr/home/haypo/python/master/Lib/test/_test_multiprocessing.py", line 2338, in setUpClass cls.pool = cls.Pool(4) (...) Process 90648: cmdline = './python -m test -v test_multiprocessing_fork -F' (gdb) py-bt Traceback (most recent call first): File "/usr/home/haypo/python/master/Lib/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() File "/usr/home/haypo/python/master/Lib/multiprocessing/queues.py", line 355, in get with self._rlock: File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 370, in worker `func` and (a, b) becomes func(a, b). File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 571, in _bootstrap File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 75, in _launch code = process_obj._bootstrap(parent_sentinel=child_r) File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 276, in _Popen return Popen(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 633, in start File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 838, in _repopulate_pool_static self._cache = pool._cache File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 559, in _repopulate_pool outqueue.put(None) File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 375, in Pool File "/usr/home/haypo/python/master/Lib/test/_test_multiprocessing.py", line 2338, in setUpClass cls.pool = cls.Pool(4) (...) Process 90654: cmdline = './python -m test -v test_multiprocessing_fork -F' (gdb) py-bt Traceback (most recent call first): File "/usr/home/haypo/python/master/Lib/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() File "/usr/home/haypo/python/master/Lib/multiprocessing/queues.py", line 355, in get with self._rlock: File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 370, in worker `func` and (a, b) becomes func(a, b). File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 571, in _bootstrap File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 75, in _launch code = process_obj._bootstrap(parent_sentinel=child_r) File "/usr/home/haypo/python/master/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 276, in _Popen return Popen(process_obj) File "/usr/home/haypo/python/master/Lib/multiprocessing/process.py", line 633, in start File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 838, in _repopulate_pool_static self._cache = pool._cache File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 559, in _repopulate_pool outqueue.put(None) File "/usr/home/haypo/python/master/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() File "/usr/home/haypo/python/master/Lib/multiprocessing/context.py", line 375, in Pool File "/usr/home/haypo/python/master/Lib/test/_test_multiprocessing.py", line 2664, in test_enter pool = self.Pool(1) (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:35:07 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Mar 2020 18:35:07 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584470107.23.0.696421299059.issue39511@roundup.psfhosted.org> Mark Shannon added the comment: Having two CPUs write to the same cache line is a well known performance problem. There's nothing special about CPython here. The proper name for it seems to be "cache line ping-pong", but a search for "false sharing" might be more informative. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 14:51:04 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 17 Mar 2020 18:51:04 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584471064.28.0.736491108754.issue39689@roundup.psfhosted.org> Ronald Oussoren added the comment: Note that the implementation of np_bool in _struct.c [1] is incorrect because this is supposed to access a boolean of a standard size, but uses _Bool. The size of _Bool is not prescribed, and IIRC sizeof(_Bool) was 4 with the compilers used for macOS/PPC. [1] https://github.com/python/cpython/blob/master/Modules/_struct.c#L703 ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 16:05:09 2020 From: report at bugs.python.org (Ethan Furman) Date: Tue, 17 Mar 2020 20:05:09 +0000 Subject: [issue39717] Fix exception causes in tarfile module In-Reply-To: <1582315232.59.0.621263718222.issue39717@roundup.psfhosted.org> Message-ID: <1584475509.49.0.945757888695.issue39717@roundup.psfhosted.org> Ethan Furman added the comment: Yes. Some of the changes are good, others should be `from None`. The `from None` raises should include the ones where the new exception includes the text of the caught exception. What is needed is text captured from the proposed changes to see if the previous exception was useful, and not easily gotten in other ways -- for example, the bz2 ImportError can be easily regenerated by `import bz2` at the REPL, so `from None` makes sense there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 16:08:08 2020 From: report at bugs.python.org (Yurii) Date: Tue, 17 Mar 2020 20:08:08 +0000 Subject: [issue39997] "is" operator doesn't work on method returned from method descriptor Message-ID: <1584475688.33.0.103660819792.issue39997@roundup.psfhosted.org> New submission from Yurii : I reproduced this in python 3.8 and python 3.6. The last line displays the bug itself, all other lines do the setup and pretty much explain WHY I think that is the bug. class Class: def method(self): ... instance = Class() # expected: ids match assert id(Class.method.__get__(None, Class)) == id(Class.method) # expected: __eq__ returns True assert Class.method.__get__(None, Class) == Class.method # expected: is returns True assert Class.method.__get__(None, Class) is Class.method # expected: ids match assert id(Class.method.__get__(instance, Class)) == id(instance.method) # expected: __eq__ returns True assert Class.method.__get__(instance, Class) == instance.method # UNEXPECTED: is returns False, why?.. assert Class.method.__get__(instance, Class) is not instance.method # why? ---------- messages: 364474 nosy: yandrieiev priority: normal severity: normal status: open title: "is" operator doesn't work on method returned from method descriptor type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 16:12:50 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 17 Mar 2020 20:12:50 +0000 Subject: [issue39717] Fix exception causes in tarfile module In-Reply-To: <1582315232.59.0.621263718222.issue39717@roundup.psfhosted.org> Message-ID: <1584475970.73.0.793873247374.issue39717@roundup.psfhosted.org> Ram Rachum added the comment: I understand. I've closed my PR and I'll let someone else implement this ticket-- I don't want to be the reason that someone didn't get the information they wanted in an error report. Thanks anyway for your time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 16:22:17 2020 From: report at bugs.python.org (Lahfa Samy) Date: Tue, 17 Mar 2020 20:22:17 +0000 Subject: [issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows In-Reply-To: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> Message-ID: <1584476537.28.0.554434227549.issue28859@roundup.psfhosted.org> Lahfa Samy added the comment: Nishant Misra are you still working on this issue, if not could I take it from now on, as my first issue and contribution to Python? ---------- nosy: +AkechiShiro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 16:56:35 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 17 Mar 2020 20:56:35 +0000 Subject: [issue39997] "is" operator doesn't work on method returned from method descriptor In-Reply-To: <1584475688.33.0.103660819792.issue39997@roundup.psfhosted.org> Message-ID: <1584478595.93.0.715777443176.issue39997@roundup.psfhosted.org> Christian Heimes added the comment: This is not a bug. The "is" operator works as expected. A method descriptor returns a new wrapper object on each access. CPython uses free lists to "recycle" memory locations to increase performance. id(Class.method.__get__(None, Class)) == id(Class.method) is true because the return value of "Class.method.__get__(None, Class)" is garbage collected and the memory address is reused. See: >>> class Class: ... def method(self): ... ... >>> instance = Class() >>> m1 = Class.method.__get__(instance, Class) >>> m2 = instance.method >>> id(m1) == id(m2) False ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:17:31 2020 From: report at bugs.python.org (Yurii) Date: Tue, 17 Mar 2020 21:17:31 +0000 Subject: [issue39997] "is" operator doesn't work on method returned from method descriptor In-Reply-To: <1584475688.33.0.103660819792.issue39997@roundup.psfhosted.org> Message-ID: <1584479851.02.0.880974237289.issue39997@roundup.psfhosted.org> Yurii added the comment: @christian.heimes thanks for the feedback ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:17:51 2020 From: report at bugs.python.org (Yurii) Date: Tue, 17 Mar 2020 21:17:51 +0000 Subject: [issue39997] "is" operator doesn't work on method returned from method descriptor In-Reply-To: <1584475688.33.0.103660819792.issue39997@roundup.psfhosted.org> Message-ID: <1584479871.22.0.728082492937.issue39997@roundup.psfhosted.org> Change by Yurii : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:34:36 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 17 Mar 2020 21:34:36 +0000 Subject: [issue39979] Cannot tune scrypt with large enough parameters In-Reply-To: <1584375448.39.0.689012483556.issue39979@roundup.psfhosted.org> Message-ID: <1584480876.71.0.480667408403.issue39979@roundup.psfhosted.org> Christian Heimes added the comment: Your parameter selection requires about 64 MB of memory (n * 2 * r * 64). As documented maxmem=0 defaults to 32 MB of maximum memory in OpenSSL 1.1.x. OpenSSL needs a bit of internal memory for book keeping and other stuff, so you need maxmem=65*1024*1024 for your parameter set. PyCA cryptography has a default maxmem of sys.maxsize // 2, that's a couple of Exabyte of RAM on a 64bit system. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:41:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:41:16 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584481276.52.0.705611232074.issue39988@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6b97598fb66a08d0f36e4d73bffea5c1b17740d4 by Serhiy Storchaka in branch 'master': bpo-39988: Remove ast.AugLoad and ast.AugStore node classes. (GH-19038) https://github.com/python/cpython/commit/6b97598fb66a08d0f36e4d73bffea5c1b17740d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:43:19 2020 From: report at bugs.python.org (Diogo Flores) Date: Tue, 17 Mar 2020 21:43:19 +0000 Subject: [issue39959] (Possible) bug on multiprocessing.shared_memory In-Reply-To: <1584128583.89.0.486447704556.issue39959@roundup.psfhosted.org> Message-ID: <1584481399.14.0.942525558376.issue39959@roundup.psfhosted.org> Diogo Flores added the comment: Follow up - tested on Linux (The first solution). The solution presented below will fix the problem with the caveat that the base process (the one that creates the shared-memory obj) must outlive any process that use the shared-memory. The rationale is that unless *this* process is creating a new shared-memory object (as opposed to attaching itself to an already existing one), then there is no point to register itself to be tracked. By making this small change, the problem I mentioned when I opened this issue disappears. #---------------------------------------------------- # https://github.com/python/cpython/blob/master/Lib/multiprocessing/shared_memory.py#L116 by changing: from .resource_tracker import register register(self._name, "shared_memory") # To: if create: from .resource_tracker import register register(self._name, "shared_memory") #---------------------------------------------------- To retain the ability for the base process to be able to exit before those that use the shared-memory obj that the base process itself created (the current/problematic implementation), as well as fix the issue, I suggest the following approach: When (and only when) a new shared-memory obj is created, such is registered on a new class variable of the resource-tracker, hence it can always be accessed and closed/unlinked by any process later on - this differs from the current approach, where each process that wants to access the shared-memory obj is being registered on the resource-tracker. I look forward for any discussion on the subject. Thank you, Diogo ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:43:24 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:43:24 +0000 Subject: [issue39719] tempfile.SpooledTemporaryFile still has softspace property In-Reply-To: <1582324328.38.0.787053917409.issue39719@roundup.psfhosted.org> Message-ID: <1584481404.27.0.174680252847.issue39719@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset d469d666b874ae746ca9a17bbfc9dbbf6fb2d6bc by Shantanu in branch 'master': bpo-39719: Remove softspace from tempfile.SpooledTemporaryFile (GH-18599) https://github.com/python/cpython/commit/d469d666b874ae746ca9a17bbfc9dbbf6fb2d6bc ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:46:03 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:46:03 +0000 Subject: [issue38373] List overallocation strategy In-Reply-To: <1570229023.08.0.986734049649.issue38373@roundup.psfhosted.org> Message-ID: <1584481563.78.0.948559206451.issue38373@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2fe815edd6778fb9deef8f8044848647659c2eb8 by Serhiy Storchaka in branch 'master': bpo-38373: Change list overallocating strategy. (GH-18952) https://github.com/python/cpython/commit/2fe815edd6778fb9deef8f8044848647659c2eb8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:51:02 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:51:02 +0000 Subject: [issue39719] tempfile.SpooledTemporaryFile still has softspace property In-Reply-To: <1582324328.38.0.787053917409.issue39719@roundup.psfhosted.org> Message-ID: <1584481862.66.0.0222492929401.issue39719@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:50:33 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:50:33 +0000 Subject: [issue38373] List overallocation strategy In-Reply-To: <1570229023.08.0.986734049649.issue38373@roundup.psfhosted.org> Message-ID: <1584481833.82.0.788466158181.issue38373@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 17:50:06 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Mar 2020 21:50:06 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584481806.09.0.760156873775.issue39988@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 18:02:14 2020 From: report at bugs.python.org (Zachary Ware) Date: Tue, 17 Mar 2020 22:02:14 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584482534.33.0.676243157597.issue39879@roundup.psfhosted.org> Zachary Ware added the comment: Hi Furkan. Please note that Lahfa Samy had already submitted a PR for this issue after "claiming" it with a note here; proper "netiquette" suggests not jumping in with your own PR in such a situation. Fortuitously though, it looks like the both of you have actually implemented about half of the final change that we need here :). I'll be leaving review comments on both PRs; I recommend that the two of you work together to combine your PRs into a single PR with both of your (revised) changes. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 18:09:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 22:09:59 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1584482999.07.0.0860750655891.issue39511@roundup.psfhosted.org> STINNER Victor added the comment: I expect that for objects which are not commonly modified by two interpreters "at the same time", it should be fine. But None, True, small integer singletons, latin-1 str single character singletons, etc. objects are likely to be frequently accessed and so can become a bottleneck. Moreover, Python has an infamous feature: write (modify ob_refcnt) on "read-only" access :-D See "Copy-on-Read" feature popularized by Instagram ;-) https://instagram-engineering.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 18:20:04 2020 From: report at bugs.python.org (Nishant Misra) Date: Tue, 17 Mar 2020 22:20:04 +0000 Subject: [issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows In-Reply-To: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> Message-ID: <1584483604.23.0.947435798041.issue28859@roundup.psfhosted.org> Nishant Misra added the comment: Yes Lahfa Samy, you can take it up. I did not work on the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 19:39:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 23:39:02 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions Message-ID: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> New submission from STINNER Victor : The PyEval_AcquireLock() and PyEval_ReleaseLock() functions are misleading and deprecated since Python 3.2. bpo-10913 deprecated them: commit 5ace8e98da6401827f607292a066da05df3ec5c1 Author: Antoine Pitrou Date: Sat Jan 15 13:11:48 2011 +0000 Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and PyEval_ReleaseLock(). The thread-state aware APIs should be used instead. It's now time to remove them! I *discovered* these functions while working on bpo-39984. Previously, I never ever used them nor really see them. I only made refactoring them in their code, without paying attention to them. ---------- components: C API messages: 364487 nosy: vstinner priority: normal severity: normal status: open title: [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 19:41:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 23:41:26 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584488486.86.0.576865866493.issue39998@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18399 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19048 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 19:51:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 23:51:40 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584489100.29.0.211651840045.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18400 pull_request: https://github.com/python/cpython/pull/19049 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 19:52:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Mar 2020 23:52:03 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584489123.92.0.37268378398.issue39998@roundup.psfhosted.org> STINNER Victor added the comment: What's New In Python 3.2 says: "The misleading functions PyEval_AcquireLock() and PyEval_ReleaseLock() have been officially deprecated. The thread-state aware APIs (such as PyEval_SaveThread() and PyEval_RestoreThread()) should be used instead." https://docs.python.org/dev/whatsnew/3.2.html#porting-to-python-3-2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:00:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:00:44 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584489644.95.0.308744794192.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18401 pull_request: https://github.com/python/cpython/pull/19050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:19:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:19:17 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584490757.19.0.39680214694.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18402 pull_request: https://github.com/python/cpython/pull/19051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:41:45 2020 From: report at bugs.python.org (Matej Cepl) Date: Wed, 18 Mar 2020 00:41:45 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584492105.5.0.953987010494.issue38576@roundup.psfhosted.org> Change by Matej Cepl : ---------- pull_requests: +18403 pull_request: https://github.com/python/cpython/pull/19052 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:42:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:42:09 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584492129.96.0.706657512057.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: In the master branch of Python, trip_signal() calls _PyEval_AddPendingCall(tstate) and tstate is get using _PyRuntimeState_GetThreadState(runtime). trip_signal() can be called while the GIL is not held: tstate is NULL in this case. For example, it's the case when calling signal.raise_signal(). Problem: _PyEval_AddPendingCall() uses tstate if pending->finishing is non-zero. if (pending->finishing) { ... _PyErr_Fetch(tstate, &exc, &val, &tb); _PyErr_SetString(tstate, PyExc_SystemError, "Py_AddPendingCall: cannot add pending calls " "(Python shutting down)"); ... } pending->finishing was addd in bpo-33608 by the change: commit 842a2f07f2f08a935ef470bfdaeef40f87490cfc Author: Eric Snow Date: Fri Mar 15 15:47:51 2019 -0600 bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246) I found this issue while trying to make pending calls per interpreter in bpo-39984: move pending from _PyRuntimeState to PyInterpreterState. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:48:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:48:47 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584492527.55.0.0117068114743.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: > In bpo-33608 I moved the pending calls to per-interpreter state. We saw failures (sometimes sporadic) on a few buildbots (e.g. FreeBSD) during runtime finalization. However, nearly all of the buildbots were fine, so it may be a question of architecture or slow hardware. See bpo-33608 for details on the failures. That was a crash in multiprocessing tests. PyEval_RestoreThread(tstate) was called with a freed PyThreadState: tstate->interp = 0xdbdbdbdbdbdbdbdb for example. I recently fixed PyEval_RestoreThread() in bpo-39877 to exit properly daemon theads without dereferencing tstate which points to freed memory. To reproduce the bug, it helped me to add a sleep at Python exit. Fixed value (ex: 1 second) or better: random sleep (between 1 ms and 1 sec). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:50:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:50:47 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584492647.65.0.638077701897.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: While trying to move pending to PyInterpreterState, I hit in issue in _PyEval_AddPendingCall(): signal.raise_signal() can call it with tstate=NULL. See https://bugs.python.org/issue37127#msg364489 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 20:56:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 00:56:24 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584492984.93.0.34377192958.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d7fabc116269e4650a684eb04f9ecd84421aa247 by Victor Stinner in branch 'master': bpo-39984: Pass tstate to handle_signals() (GH-19050) https://github.com/python/cpython/commit/d7fabc116269e4650a684eb04f9ecd84421aa247 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 21:26:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 01:26:11 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584494771.26.0.81564703954.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 23ef89db7ae46d160650263cc80479c2ed6693fb by Victor Stinner in branch 'master': bpo-39984: _PyThreadState_DeleteCurrent() takes tstate (GH-19051) https://github.com/python/cpython/commit/23ef89db7ae46d160650263cc80479c2ed6693fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 21:33:30 2020 From: report at bugs.python.org (Lahfa Samy) Date: Wed, 18 Mar 2020 01:33:30 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584495210.8.0.223246304464.issue39879@roundup.psfhosted.org> Lahfa Samy added the comment: Hi Furkan, would you mind to combine your revised PR with mine so that we can do as suggested by Zachary? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 21:34:59 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 18 Mar 2020 01:34:59 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584495299.94.0.592079812836.issue37207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18404 pull_request: https://github.com/python/cpython/pull/19053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 21:42:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 01:42:59 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1584495779.05.0.286078319931.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18405 pull_request: https://github.com/python/cpython/pull/19054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 21:42:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 01:42:59 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584495779.21.0.566876817574.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18406 pull_request: https://github.com/python/cpython/pull/19054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 22:04:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 02:04:39 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1584497079.6.0.29095992505.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 29356e03d4f8800b04f799efe7a10e3ce8b16f61 by Victor Stinner in branch 'master': bpo-39877: Fix take_gil() for daemon threads (GH-19054) https://github.com/python/cpython/commit/29356e03d4f8800b04f799efe7a10e3ce8b16f61 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 22:04:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 02:04:39 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584497079.51.0.574009127422.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 29356e03d4f8800b04f799efe7a10e3ce8b16f61 by Victor Stinner in branch 'master': bpo-39877: Fix take_gil() for daemon threads (GH-19054) https://github.com/python/cpython/commit/29356e03d4f8800b04f799efe7a10e3ce8b16f61 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 22:22:49 2020 From: report at bugs.python.org (Inada Naoki) Date: Wed, 18 Mar 2020 02:22:49 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584498169.66.0.609371793666.issue39957@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 611836a69a7a98bb106b4d315ed76a1e17266f4f by Jens Reidel in branch 'master': bpo-39957: Change Signature.parameters to OrderedDict (GH-18988) https://github.com/python/cpython/commit/611836a69a7a98bb106b4d315ed76a1e17266f4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 22:23:05 2020 From: report at bugs.python.org (Inada Naoki) Date: Wed, 18 Mar 2020 02:23:05 +0000 Subject: [issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict In-Reply-To: <1584127483.7.0.559336521807.issue39957@roundup.psfhosted.org> Message-ID: <1584498185.32.0.456396791116.issue39957@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 17 23:23:01 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 18 Mar 2020 03:23:01 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584501781.55.0.139836522178.issue39980@roundup.psfhosted.org> Jason R. Coombs added the comment: I believe this issue was addressed in the latest importlib_resources. If so, that behavior is being ported to Python 3.9 in issue39791. Would you test with `importlib_resources` 1.1 or later and see if that suits your purposes? If so, please use `importlib_resources` on older Pythons. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 00:09:51 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Mar 2020 04:09:51 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584504591.52.0.602050746695.issue38576@roundup.psfhosted.org> Gregory P. Smith added the comment: marking as a 2.7 release blocker just to get benjamin's RM attention before the final 2.7. ---------- assignee: gregory.p.smith -> benjamin.peterson nosy: +benjamin.peterson priority: high -> release blocker stage: resolved -> patch review status: closed -> open versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 02:42:06 2020 From: report at bugs.python.org (tzickel) Date: Wed, 18 Mar 2020 06:42:06 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584513726.0.0.727236937124.issue39974@roundup.psfhosted.org> tzickel added the comment: Regarding getting the buffer and releasing the GIL, if it's wrong, why not fix other places in the code that do it, like: https://github.com/python/cpython/blob/611836a69a7a98bb106b4d315ed76a1e17266f4f/Modules/posixmodule.c#L9619 The GIL is released, the syscall might be blocking, and iov contains pointers to buffers ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 02:49:54 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 18 Mar 2020 06:49:54 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584514194.89.0.58150663143.issue39689@roundup.psfhosted.org> Ronald Oussoren added the comment: Sigh... never mind, I misread the code. Please ignore msg364472 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 03:26:37 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Wed, 18 Mar 2020 07:26:37 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584516397.84.0.00339457838084.issue39879@roundup.psfhosted.org> Furkan ?nder added the comment: Hello Samy, I sent you pr from the docs-dict-ordered branch in your cpython repository. Now both of us have merged pr. I closed my own pr. You can also close your pr and send these changes again as bpo-39879. It's my pr,https://github.com/AkechiShiro/cpython/pull/1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 04:26:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 08:26:28 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584519988.64.0.921799072822.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 56bfdebfb17ea9d3245b1f222e92b8e3b1ed6118 by Victor Stinner in branch 'master': bpo-39984: Pass tstate to _PyEval_SignalAsyncExc() (GH-19049) https://github.com/python/cpython/commit/56bfdebfb17ea9d3245b1f222e92b8e3b1ed6118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:38:50 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Mar 2020 09:38:50 +0000 Subject: [issue39999] Fix some issues with AST node classes Message-ID: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR fixes some issues related to recent changes in the AST node classes. 1. Re-add removed classes Suite, Param, AugLoad and AugStore. They are not used in Python 3, are not created by the parser and are not accepted by the compiler. Param was used in 2.7, other classes were not used longer time. But some third-party projects (e.g. pyflakes) use them for isinstance checks. 2. Add docstrings for all dummy AST classes (Constant subclasses, Index, ExtTuple and the above four classes). Otherwise they inherited docstrings from the parent class. 3. Add docstrings for all attribute aliases. 4. Set __module__ = "ast" instead of "_ast" for all classes defined in the _ast module. Otherwise the help for the ast module would show only dummy classes, not actual AST node classes. It also makes pickles more compatible between versions. ---------- components: Library (Lib) messages: 364504 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix some issues with AST node classes type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:46:12 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 09:46:12 +0000 Subject: [issue40000] Improve AST validation for Constant nodes Message-ID: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> New submission from Batuhan Taskaya : When something that isn't constant found in a ast.Constant node's body, python reports errors like this >>> e = ast.Expression(body=ast.Constant(value=type)) >>> ast.fix_missing_locations(e) <_ast.Expression object at 0x7fc2c23981c0> >>> compile(e, "", "eval") Traceback (most recent call last): File "", line 1, in TypeError: got an invalid type in Constant: type But if something is part of constant tuple and frozenset isn't constant, the error reporting is wrong >>> e = ast.Expression(body=ast.Constant(value=(1,2,type))) >>> compile(e, "", "eval") Traceback (most recent call last): File "", line 1, in TypeError: got an invalid type in Constant: tuple This should've been TypeError: got an invalid type in Constant: type ---------- messages: 364505 nosy: BTaskaya priority: normal severity: normal status: open title: Improve AST validation for Constant nodes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:47:08 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 09:47:08 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584524828.08.0.858334241719.issue40000@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- assignee: -> BTaskaya components: +Library (Lib) type: -> enhancement versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:49:58 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 18 Mar 2020 09:49:58 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584524998.89.0.543933873756.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: I think we are speaking past each other. In my (current) view, the semantics are spelled out in the documentation: "any non-zero value will be True when unpacking". There's also a mention that this corresponds to the _Bool type in C. While this was the case with compilers in the past, it's no longer true with clang 9. In your view, the semantics are dictated by the correspondence to _Bool, and the "non-zero value will be True when unpacking" is the fluff to be ignored and removed. The docs assume the two behaviors (_Bool and non-zero) are equivalent. In this bug we find out that they are not, so to fix the bug, we need to make a choice which one to keep and which one to throw out. I see nothing that would make one view inherently better than the other. What "array libraries expect" is IMO not relevant: under any of the two views, libraries that are well-written (under that view) will be fine. Problems come when the library and Python choose different sides, e.g. when a non-C library can't use _Bool and thus packs arrays with the expectation that "any non-zero value will be True when unpacking". What is a minimal change in *implementation* is a bigger change in *behavior*: unpacking of arrays will now depend greatly on details like the compiler used to build Python. I see that as the greater evil: since the data can be sharted across environments, languages and compilers, keeping the semantics well-defined seems better than leaving them to the compiler. I don't see a compelling reason to choose _Bool semantics, but perhaps there is one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:51:01 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 09:51:01 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584525061.93.0.301762244687.issue39999@roundup.psfhosted.org> Batuhan Taskaya added the comment: > 1. Re-add removed classes Suite, Param, AugLoad and AugStore. They are not used in Python 3, are not created by the parser and are not accepted by the compiler. Param was used in 2.7, other classes were not used longer time. But some third-party projects (e.g. pyflakes) use them for isinstance checks. I dont think Suite used in anywhere related to CPython, and for others (Param and AugXXXX contexts, which both used in pyflakes) I dont think it is necessary to have them. For most of the part they can just do this if not PY27: class Param(ast.expr_context): pass and looks like pyflakes already have a PR about this (not this way, but it is common to have version-specific conditions in AST tools). ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:56:54 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 09:56:54 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584525414.31.0.326101588187.issue40000@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18407 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 05:59:36 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Mar 2020 09:59:36 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584525576.78.0.568821753855.issue39999@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18408 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:05:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Mar 2020 10:05:11 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584525911.56.0.768317992201.issue39999@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, and this what PR 19056 does. It is not difficult, and if we can avoid a breakage, why not do this? We have kept all other deprecated classes, like Num and ExtSlice. In 3.10 we can add runtime warnings, and remove them in some future releases. We alreade got a benefit of simplifying the compiler. Maintaining dummy classes does not cost much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:07:02 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Mar 2020 10:07:02 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584526022.96.0.100948621473.issue40000@roundup.psfhosted.org> Serhiy Storchaka added the comment: You got an anniversary issue! ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:10:08 2020 From: report at bugs.python.org (Oskar Persson) Date: Wed, 18 Mar 2020 10:10:08 +0000 Subject: [issue17023] Subprocess does not find executable on Windows if it is PATH with quotes In-Reply-To: <1359032961.6.0.0734607018969.issue17023@psf.upfronthosting.co.za> Message-ID: <1584526208.15.0.747908945789.issue17023@roundup.psfhosted.org> Change by Oskar Persson : ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:13:08 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 10:13:08 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584526388.44.0.37745107129.issue39999@roundup.psfhosted.org> Batuhan Taskaya added the comment: I see, thanks for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:23:28 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 18 Mar 2020 10:23:28 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1584527008.61.0.286766995829.issue39689@roundup.psfhosted.org> Stefan Krah added the comment: I think this issue should be about fixing the tests so that people looking at the sanitizer buildbots can move on. GH-18969 fixes "?" and "!?", which clearly used wrong semantics with the new compiler behavior. This should be an uncontroversial fix that also takes care of test_struct. Can we please discuss native _Bool in another issue? There is no non-hackish way of unpacking _Bool if new compilers essentially treat values outside [0, 1] as a trap representation. You could determine sizeof(_Bool), use the matching unsigned type, unpack as that, then cast to _Bool. But do you really want to force that procedure on all array libraries that want to be PEP-3118 compatible? I'd rather deprecate _Bool and use uint8_t, but that definitely deserves a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 06:50:30 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 18 Mar 2020 10:50:30 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584528630.19.0.882342581082.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18409 pull_request: https://github.com/python/cpython/pull/19057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 07:19:02 2020 From: report at bugs.python.org (Eryk Sun) Date: Wed, 18 Mar 2020 11:19:02 +0000 Subject: [issue17023] Subprocess does not find executable on Windows if it is PATH with quotes In-Reply-To: <1359032961.6.0.0734607018969.issue17023@psf.upfronthosting.co.za> Message-ID: <1584530342.06.0.11798383198.issue17023@roundup.psfhosted.org> Eryk Sun added the comment: Why are new versions getting added to an issue that was closed 5 years ago? That said, I'd like to clarify that this was not and is not a bug. It happens that the CMD shell strips quotes out, but that doesn't make it valid. PATH in Windows is delimited by semicolons, not spaces, so paths with spaces should never be quoted. In particular, WINAPI SearchPathW, which CreateProcessW calls, leaves quotes in the directory name when testing whether a file is in the directory. Also, the conclusion that Linux doesn't suffer from this problem is incorrect. The shell command that was used actually strips the quotes out as part of command-line pre-processing, i.e. `PATH=$PATH:"test"` results in the same PATH value as `PATH=$PATH:test`. But it will fail to find "script.sh" if you escape the quotes to make the shell add them literally to PATH, e.g. `PATH=$PATH:\"test\"`. ---------- nosy: +eryksun resolution: wont fix -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 07:32:56 2020 From: report at bugs.python.org (Gle) Date: Wed, 18 Mar 2020 11:32:56 +0000 Subject: [issue39979] Cannot tune scrypt with large enough parameters In-Reply-To: <1584375448.39.0.689012483556.issue39979@roundup.psfhosted.org> Message-ID: <1584531176.68.0.7804564922.issue39979@roundup.psfhosted.org> Gle added the comment: Alright, I understand the difference in behaviour now. Thanks a lot for the clear explanation ! Would be nice to have something like: """maxmem must be greater than (n * 2 * r * 64) plus a bit of internal memory for OpenSSL book keeping. Basically, set maxmem = (n * 2 * r * 65) """ in the documentation. Thanks again, and sorry to have bothered you with this non-bug. Have a happy day ! ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:06:49 2020 From: report at bugs.python.org (Aviram) Date: Wed, 18 Mar 2020 12:06:49 +0000 Subject: [issue40001] ignore errors in SimpleCookie Message-ID: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> New submission from Aviram : SimpleCookie (http/cookies.py) load method fails if one of the has an issue. In real life scenarios, we want to be tolerant toward faulty cookies, and just ignore those. My suggestion is to add ignore_errors keyword argument to the load method of SimpleCookie, skipping invalid Morsels. ---------- components: Library (Lib) messages: 364514 nosy: aviramha priority: normal severity: normal status: open title: ignore errors in SimpleCookie type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:10:26 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 18 Mar 2020 12:10:26 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1584458053.2.0.932810940986.issue28009@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: I'll take a look as well. On 17/03/2020 16:14, STINNER Victor wrote: > STINNER Victor added the comment: > >> New changeset 0bcbfa43d55d9558cdcb256d8998366281322080 by Tal Einat (Michael Felt) in branch 'master': >> bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672) > This change introduced a regression: bpo-39991. > > I pushed the commit eb886db1e99a15f15a2342aa496197a5f88fa9c8 to fix my case, but I'm not sure that the fix covers all cases. > > ---------- > nosy: +vstinner > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:22:31 2020 From: report at bugs.python.org (Roundup Robot) Date: Wed, 18 Mar 2020 12:22:31 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1584534151.76.0.984110265465.issue40001@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +18410 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:26:26 2020 From: report at bugs.python.org (Christian Heimes) Date: Wed, 18 Mar 2020 12:26:26 +0000 Subject: [issue39979] Cannot tune scrypt with large enough parameters In-Reply-To: <1584375448.39.0.689012483556.issue39979@roundup.psfhosted.org> Message-ID: <1584534386.06.0.105957283064.issue39979@roundup.psfhosted.org> Christian Heimes added the comment: PS: You are getting a different output because you are feeding a different input to hashlib.scrypt(). The first parameter is the password, not password + salt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:28:41 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 18 Mar 2020 12:28:41 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1584458053.2.0.932810940986.issue28009@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: I may be mistaken, but I do not think the change introduced a regression. While it is true that this case would not have appeared if there was still a count of the field-separators an IPv6 address with 5 ':' and 17 characters would have failed as well. The value being examined is based on it's position, and previously the additional assumption is that whatever is in that position is a MACADDR if it uses the system separator ('.' on AIX, ':' elsewhere). If anyone is interested I will think about what are assumptions are - is this a value we should be considering, or not. IMHO - while issue39991 is resolved - I am not -yet- convinced that the "root cause" has been identified and properly coded Michael On 17/03/2020 16:14, STINNER Victor wrote: > STINNER Victor added the comment: > >> New changeset 0bcbfa43d55d9558cdcb256d8998366281322080 by Tal Einat (Michael Felt) in branch 'master': >> bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672) > This change introduced a regression: bpo-39991. > > I pushed the commit eb886db1e99a15f15a2342aa496197a5f88fa9c8 to fix my case, but I'm not sure that the fix covers all cases. > > ---------- > nosy: +vstinner > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 08:55:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 12:55:40 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1584536140.7.0.340283836395.issue28009@roundup.psfhosted.org> STINNER Victor added the comment: > I may be mistaken, but I do not think the change introduced a regression. I'm talking about this: https://bugs.python.org/issue39991#msg364435 I don't want to blame anyone. My intent here is to get more eyes on the changes that I merged in bpo-39991 to make sure that I didn't break any existing cases, and that I covered all cases. > While it is true that this case would not have appeared if there was still a count of the field-separators an IPv6 address with 5 ':' and 17 characters would have failed as well. Right, I pushed a second fix to also handle this case: commit ebf6bb9f5ef032d1646b418ebbb645ea0b217da6. > IMHO - while issue39991 is resolved - I am not -yet- convinced that the "root cause" has been identified and properly coded If you still see cases which are not handled properly with commit ebf6bb9f5ef032d1646b418ebbb645ea0b217da6, feel free to reopen bpo-39991. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 09:26:23 2020 From: report at bugs.python.org (Bar Harel) Date: Wed, 18 Mar 2020 13:26:23 +0000 Subject: [issue40002] Cookie load error inconsistency Message-ID: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> New submission from Bar Harel : ATM loading cookies is inconsistent. If you encounter an invalid cookie, BaseCookie.load will sometimes raise CookieError and sometimes silently ignore the load: from http.cookies import SimpleCookie s = SimpleCookie() s.load("invalid\x00=cookie") # Silently ignored s.load("invalid/=cookie") # Raises CookieError ---------- components: Library (Lib) messages: 364519 nosy: bar.harel priority: normal severity: normal status: open title: Cookie load error inconsistency versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 09:34:08 2020 From: report at bugs.python.org (Aviram) Date: Wed, 18 Mar 2020 13:34:08 +0000 Subject: [issue40002] Cookie load error inconsistency In-Reply-To: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> Message-ID: <1584538448.13.0.0526228256321.issue40002@roundup.psfhosted.org> Change by Aviram : ---------- keywords: +patch nosy: +aviramha nosy_count: 1.0 -> 2.0 pull_requests: +18411 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 10:08:41 2020 From: report at bugs.python.org (Lahfa Samy) Date: Wed, 18 Mar 2020 14:08:41 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1584540521.26.0.16661708832.issue39879@roundup.psfhosted.org> Lahfa Samy added the comment: Thank you for your quick work, I have successfully merged your changes in the branch of the first PR, now awaiting review from Zachary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 10:29:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 14:29:38 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584541778.64.0.127859949577.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4657a8a0d006c76699ba3d1d4d21a04860bb2586 by Dong-hee Na in branch 'master': bpo-1635741: Port _heapq module to multiphase initialization (GH19057) https://github.com/python/cpython/commit/4657a8a0d006c76699ba3d1d4d21a04860bb2586 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 10:50:29 2020 From: report at bugs.python.org (Bar Harel) Date: Wed, 18 Mar 2020 14:50:29 +0000 Subject: [issue40002] Cookie load error inconsistency In-Reply-To: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> Message-ID: <1584543029.22.0.720304455616.issue40002@roundup.psfhosted.org> Change by Bar Harel : ---------- pull_requests: +18412 pull_request: https://github.com/python/cpython/pull/19059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 10:58:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 14:58:53 +0000 Subject: [issue20986] test_startup_imports fails in test_site when executed inside venv In-Reply-To: <1395261953.74.0.442281582846.issue20986@psf.upfronthosting.co.za> Message-ID: <1584543533.18.0.397658129347.issue20986@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. This bug has no activity for 6 years and was reported on Python 3.4, whereas the development branch is now the future Python 3.9. If you can still reproduce the issue, please reopen the issue or open a new issue (add a reference to this one). ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:00:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:00:02 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584543602.91.0.229724623435.issue27807@roundup.psfhosted.org> STINNER Victor added the comment: Fedora and RHEL downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=1814392 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:14:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:14:15 +0000 Subject: [issue35691] cpython3.7.2 make test failed In-Reply-To: <1546997989.54.0.929715073405.issue35691@roundup.psfhosted.org> Message-ID: <1584544455.84.0.535430522594.issue35691@roundup.psfhosted.org> STINNER Victor added the comment: It's likely a duplicate of bpo-28087. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> macOS 12 poll syscall returns prematurely _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:14:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:14:44 +0000 Subject: [issue35691] cpython3.7.2 make test failed In-Reply-To: <1546997989.54.0.929715073405.issue35691@roundup.psfhosted.org> Message-ID: <1584544484.5.0.478339816105.issue35691@roundup.psfhosted.org> STINNER Victor added the comment: Oops, I mean: bpo-27807 "Prevent site-packages .pth files from causing test_site failure". ---------- superseder: macOS 12 poll syscall returns prematurely -> Prevent site-packages .pth files from causing test_site failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:14:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:14:59 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584544499.93.0.54327610294.issue27807@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-35691 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:15:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:15:26 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584544526.85.0.410295174598.issue27807@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Prevent site-packages .pth files from causing test_site failure -> Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:16:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:16:09 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1584544569.69.0.472437818017.issue28087@roundup.psfhosted.org> STINNER Victor added the comment: No update since 2017, I close the issue. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:17:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:17:14 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584544634.14.0.546018130649.issue27807@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18413 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:48:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:48:15 +0000 Subject: [issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots Message-ID: <1584546495.72.0.913336015216.issue40003@roundup.psfhosted.org> New submission from STINNER Victor : There are some tests which fail randomly in general, but fail in a deterministic way on some specific buildbot workers. bpo-39932 is a good example: test_multiprocessing_fork fails with "test_multiprocessing_fork leaked [0, 2, 0] file descriptors". The test fails while run in paralle, but it also fails when re-run sequentially. Except that when I connect to the buildbot worker, it does not fail anymore. test_multiprocessing_fork contains 356 test methods, the test file (Lib/test/_test_multiprocessing.py) has 5741 lines of Python code, and the multiprocessing is made of 8149 lines of Python code and 1133 lines of C code. It's hard to audit such code. The multiprocessing uses multiple proceses, pipes, signals, etc. It's really hard to debug. I propose to add an --bisect-failed option to test.regrtest to run test.bisect_cmd on failed tests. We can start to experiment it on Refleaks buildbots. Regular tests (not Refleaks tests) are easier to reproduce in general. It should speedup analysis of reference leak and "altered environment" test failures. Having less test methods to audit is way simpler. The implement should be that at the end of regrtest, after tests are re-run, run each failed test in test.bisect_cmd with the same command line arguments than test.regrtest. test.bisect_cmd uses 100 iterations by default. It's ok if the bisection fails to reduce the number of test methods. At least, it should reduce the list in some cases. ---------- components: Tests messages: 364528 nosy: vstinner priority: normal severity: normal status: open title: test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 11:49:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 15:49:39 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584546579.39.0.0885595735467.issue40000@roundup.psfhosted.org> STINNER Victor added the comment: Congratulations Batuhan! You win with the bug number 40000! A nice number ;-) To be honest, I wanted to get it, but I didn't want to cheat by opening a stupid issue. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 12:02:42 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 18 Mar 2020 16:02:42 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584547362.6.0.614311152393.issue40000@roundup.psfhosted.org> Batuhan Taskaya added the comment: sorry to take it Victor, maybe you can get the perfect issue number when we migrate to github? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 12:22:41 2020 From: report at bugs.python.org (Bar Harel) Date: Wed, 18 Mar 2020 16:22:41 +0000 Subject: [issue40002] Cookie load error inconsistency In-Reply-To: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> Message-ID: <1584548561.77.0.741087489823.issue40002@roundup.psfhosted.org> Bar Harel added the comment: The only issue I fear is breakage if people count on it silently ignoring errors. But then again it's inconsistent, and sometimes it will throw errors either way, so I still believe this issue should be addressed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 12:26:36 2020 From: report at bugs.python.org (Michael Felt) Date: Wed, 18 Mar 2020 16:26:36 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1584536140.7.0.340283836395.issue28009@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: On 18/03/2020 13:55, STINNER Victor wrote: > STINNER Victor added the comment: > >> I may be mistaken, but I do not think the change introduced a regression. I meant - I had never considered IPv6 in the Address column, just as I suspect, whoever wrote the original. Your feedback made me realize that something like "fe80::78:9a:de:f0" would have been mistaken as a valid macaddr. > I'm talking about this: > https://bugs.python.org/issue39991#msg364435 > > I don't want to blame anyone. My intent here is to get more eyes on the changes that I merged in bpo-39991 to make sure that I didn't break any existing cases, and that I covered all cases. I will look closely at PR19045 - not because I expect to find anything wrong, but because I thought this is what you requested. Regards, Michael > >> While it is true that this case would not have appeared if there was > still a count of the field-separators an IPv6 address with 5 ':' and 17 > characters would have failed as well. > > Right, I pushed a second fix to also handle this case: commit ebf6bb9f5ef032d1646b418ebbb645ea0b217da6. > > >> IMHO - while issue39991 is resolved - I am not -yet- convinced that the "root cause" has been identified and properly coded > If you still see cases which are not handled properly with commit ebf6bb9f5ef032d1646b418ebbb645ea0b217da6, feel free to reopen bpo-39991. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 12:45:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 16:45:48 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1584549948.11.0.363184509789.issue28009@roundup.psfhosted.org> STINNER Victor added the comment: > I will look closely at PR19045 - not because I expect to find anything wrong, but because I thought this is what you requested. I cannot run functional tests on AIX. I can only rely on unit tests which contains a dump of AIX commands. That's why a review wouldn't hurt ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:19:23 2020 From: report at bugs.python.org (Stefan Krah) Date: Wed, 18 Mar 2020 17:19:23 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584551963.57.0.914137698882.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: Since xlc has elementary bugs like https://github.com/openssl/openssl/issues/10624 it may be worth checking out if this is an optimizer bug with -q64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:25:19 2020 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Wed, 18 Mar 2020 17:25:19 +0000 Subject: [issue40004] String comparison with dotted numerical values wrong Message-ID: <1584552319.24.0.0522121424801.issue40004@roundup.psfhosted.org> New submission from Bo?tjan Mejak : I stumbled upon a possible bug in the Python interpreter while doing some Python version comparisons. Look at this: "3.10.2" < "3.8.2" True # This is not true as a version number comparison Now look at this: "3.10.2" < "3.08.2" False # Adding a leading 0 compares those two version numbers correctly Is it possible Python is fixed to correctly compare such numbers? That would make comparing Python version numbers possible in the future. import platform if platform.python_version() < "3.8.2": # Do something This is currently possible and correct, but this will break when Python version number becomes 3.10 and you wanna compare this version number to, say, 3.9. ---------- components: Interpreter Core messages: 364535 nosy: PedanticHacker, gvanrossum priority: normal severity: normal status: open title: String comparison with dotted numerical values wrong type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:27:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 17:27:51 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584552471.8.0.804241803423.issue27807@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d18de46117d661a4acaf2380cc5ebb1cf6a000e9 by Victor Stinner in branch 'master': bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) https://github.com/python/cpython/commit/d18de46117d661a4acaf2380cc5ebb1cf6a000e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:29:19 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 18 Mar 2020 17:29:19 +0000 Subject: [issue40004] String comparison with dotted numerical values wrong In-Reply-To: <1584552319.24.0.0522121424801.issue40004@roundup.psfhosted.org> Message-ID: <1584552559.81.0.502353130332.issue40004@roundup.psfhosted.org> Guido van Rossum added the comment: That's why for over a decade we've been recommending not to use string comparisons to compare versions. You have to parse the version and then compare the numeric values. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:30:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 17:30:53 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584552653.95.0.174883068955.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1c60567b9a4c8f77e730de9d22690d8e68d7e5f6 by Dong-hee Na in branch 'master': bpo-37207: Use PEP 590 vectorcall to speed up frozenset() (GH-19053) https://github.com/python/cpython/commit/1c60567b9a4c8f77e730de9d22690d8e68d7e5f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:33:20 2020 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Wed, 18 Mar 2020 17:33:20 +0000 Subject: [issue40004] String comparison with dotted numerical values wrong In-Reply-To: <1584552319.24.0.0522121424801.issue40004@roundup.psfhosted.org> Message-ID: <1584552800.22.0.451809888464.issue40004@roundup.psfhosted.org> Bo?tjan Mejak added the comment: What is then the most Pythonic way of comparing two version numbers? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:34:56 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 18 Mar 2020 17:34:56 +0000 Subject: [issue40004] String comparison with dotted numerical values wrong In-Reply-To: <1584552319.24.0.0522121424801.issue40004@roundup.psfhosted.org> Message-ID: <1584552896.15.0.841987805198.issue40004@roundup.psfhosted.org> Guido van Rossum added the comment: That's a question for a user forum. There's some code in Lib/distutils/version.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:36:26 2020 From: report at bugs.python.org (Krzysztof Rusek) Date: Wed, 18 Mar 2020 17:36:26 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584552986.23.0.911393938707.issue39980@roundup.psfhosted.org> Krzysztof Rusek added the comment: I can confirm that this problem doesn't occur when using recent version of importlib_resources (checked importlib_resources==1.3.1). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 13:59:39 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 17:59:39 +0000 Subject: [issue22014] Improve display of OS exception <-> errno mapping In-Reply-To: <1405839624.34.0.825236607584.issue22014@psf.upfronthosting.co.za> Message-ID: <1584554379.39.0.129393183363.issue22014@roundup.psfhosted.org> Brett Cannon added the comment: Is this still important now that OSError has so many subclasses that correspond to specific error codes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:00:00 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:00:00 +0000 Subject: [issue22246] add strptime(s, '%s') In-Reply-To: <1408664936.57.0.427329646216.issue22246@psf.upfronthosting.co.za> Message-ID: <1584554400.21.0.18336519603.issue22246@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:00:37 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:00:37 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1584554437.45.0.881847385822.issue22543@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:02:23 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:02:23 +0000 Subject: [issue22789] Compress the marshalled data in PYC files In-Reply-To: <1415077245.4.0.700609350165.issue22789@psf.upfronthosting.co.za> Message-ID: <1584554543.42.0.151352671906.issue22789@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:02:45 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:02:45 +0000 Subject: [issue22858] unittest.__init__:main shadows unittest.main In-Reply-To: <1415874204.41.0.576776716148.issue22858@psf.upfronthosting.co.za> Message-ID: <1584554565.98.0.282328043908.issue22858@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:03:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:03:56 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584554636.38.0.391395266107.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18414 pull_request: https://github.com/python/cpython/pull/19061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:03:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:03:56 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584554636.45.0.842165812154.issue37127@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18415 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/19061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:03:59 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:03:59 +0000 Subject: [issue21724] resetwarnings doesn't reset warnings registry In-Reply-To: <1402503104.19.0.836333157517.issue21724@psf.upfronthosting.co.za> Message-ID: <1584554639.82.0.886524270882.issue21724@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:04:53 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:04:53 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1584554693.94.0.622824705361.issue21736@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:05:17 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:05:17 +0000 Subject: [issue21737] runpy.run_path() fails with frozen __main__ modules In-Reply-To: <1402590260.07.0.642136179062.issue21737@psf.upfronthosting.co.za> Message-ID: <1584554717.76.0.523706433756.issue21737@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:05:30 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:05:30 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1584554730.36.0.315088454869.issue21760@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:07:04 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:07:04 +0000 Subject: [issue21550] Add Python implementation of the tar utility In-Reply-To: <1400669354.09.0.317678574527.issue21550@psf.upfronthosting.co.za> Message-ID: <1584554824.11.0.753722403658.issue21550@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:10:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:10:40 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584555040.57.0.709624287443.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: > pending->finishing was addd in bpo-33608 by the change: commit 842a2f07f2f08a935ef470bfdaeef40f87490cfc Since this change, Py_AddPendingCall() now requires the thread to have a Python thread state: it is used if pending->finishing is non-zero. The function documentation says: "This function doesn?t need a current thread state to run, and it doesn?t need the global interpreter lock." https://docs.python.org/dev/c-api/init.html#c.Py_AddPendingCall The current implementation seems to contradict the documentation. We may update the documentation to replace "doesn't need" with "requires" (a Python thread state). Or the implementation can use PyGILState_Ensure() and PyGILState_Release() to create a temporary Python thread state if the thread doesn't have one. Removing pending->finishing would only partially fix the issue. With PR 19061, tstate is required to access "ceval" structure. trip_signal() called by the C signal handler has a similar issue: it only requires non-NULL tstate if pending->finishing is non-zero. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:21:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:21:15 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584555675.36.0.686111954375.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: trip_signal() has another problem. If pending->finishing is non-zero, _PyEval_AddPendingCall() uses the C API whereas the current thread may not hold the GIL. That's forbidden by the C API. The more I think about it, the more I think that pending->finishing is fragile and should be removed. I understood that pending->finishing was added to workaround crashes during Python finalization. I fixed multiple crashes related to daemon threads during Python finalization in bpo-39877. Maybe the bugs that I fixed were the ones which pending->finishing was supposed to work around. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:21:33 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:21:33 +0000 Subject: [issue21577] Help for ImportError should show a more useful signature. In-Reply-To: <1401078448.87.0.796266837202.issue21577@psf.upfronthosting.co.za> Message-ID: <1584555693.14.0.0330136121383.issue21577@roundup.psfhosted.org> Change by Brett Cannon : ---------- versions: +Python 3.9 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:21:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:21:42 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584555702.6.0.0461347511951.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: My notes on Python finalization: https://pythondev.readthedocs.io/finalization.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:21:52 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:21:52 +0000 Subject: [issue21614] Case sensitivity problem in multiprocessing. In-Reply-To: <1401479749.7.0.550679517464.issue21614@psf.upfronthosting.co.za> Message-ID: <1584555712.12.0.773739105328.issue21614@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:22:01 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:22:01 +0000 Subject: [issue21199] Python on 64-bit Windows uses signed 32-bit type for read length In-Reply-To: <1397149133.44.0.946556558932.issue21199@psf.upfronthosting.co.za> Message-ID: <1584555721.79.0.0329720031299.issue21199@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:24:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:24:03 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor In-Reply-To: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> Message-ID: <1584555843.2.0.645874149842.issue39995@roundup.psfhosted.org> STINNER Victor added the comment: Same bug on AMD64 FreeBSD Non-Debug 3.x: https://buildbot.python.org/all/#/builders/214/builds/472 ====================================================================== ERROR: test_crash (test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) [crash during func execution on worker] ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/test/test_concurrent_futures.py", line 1119, in test_crash executor.shutdown(wait=True) File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/concurrent/futures/process.py", line 721, in shutdown self._executor_manager_thread_wakeup.wakeup() File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/concurrent/futures/process.py", line 93, in wakeup self._writer.send_bytes(b"") File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/multiprocessing/connection.py", line 205, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/multiprocessing/connection.py", line 416, in _send_bytes self._send(header + buf) File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/multiprocessing/connection.py", line 373, in _send n = write(self._handle, buf) OSError: [Errno 9] Bad file descriptor Stdout: 8.35s Stderr: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) Dangling thread: <_MainThread(MainThread, started 34369908736)> Dangling thread: <_ExecutorManagerThread(Thread-114, stopped daemon 34396434432)> Dangling thread: ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:28:19 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:28:19 +0000 Subject: [issue21242] Generalize configure check for working Python executable In-Reply-To: <1397584205.03.0.366670026915.issue21242@psf.upfronthosting.co.za> Message-ID: <1584556099.31.0.323535869287.issue21242@roundup.psfhosted.org> Brett Cannon added the comment: `make regen-all` has probably taken care of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:28:41 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:28:41 +0000 Subject: [issue21243] Auto-generate exceptions.c from a Python file In-Reply-To: <1397585549.14.0.873533303783.issue21243@psf.upfronthosting.co.za> Message-ID: <1584556121.99.0.712155382994.issue21243@roundup.psfhosted.org> Change by Brett Cannon : ---------- versions: +Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:28:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:28:42 +0000 Subject: [issue21199] [2.7] Python on 64-bit Windows uses signed 32-bit type for read length In-Reply-To: <1397149133.44.0.946556558932.issue21199@psf.upfronthosting.co.za> Message-ID: <1584556122.3.0.415733049573.issue21199@roundup.psfhosted.org> STINNER Victor added the comment: Python 3 doesn't have this issue. Python 2 no longer accepts bugfixes. I close the issue. Note: there was a similar issue specific to macOS: bpo-24658 and PR 9938 (closed since Python 2 moved to end of life). ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed title: Python on 64-bit Windows uses signed 32-bit type for read length -> [2.7] Python on 64-bit Windows uses signed 32-bit type for read length _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:28:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:28:57 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584556137.32.0.8143186159.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8849e5962ba481d5d414b3467a256aba2134b4da by Victor Stinner in branch 'master': bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() (GH-19061) https://github.com/python/cpython/commit/8849e5962ba481d5d414b3467a256aba2134b4da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:28:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:28:57 +0000 Subject: [issue37127] Handling pending calls during runtime finalization may cause problems. In-Reply-To: <1559416306.37.0.716771519489.issue37127@roundup.psfhosted.org> Message-ID: <1584556137.36.0.357594113635.issue37127@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8849e5962ba481d5d414b3467a256aba2134b4da by Victor Stinner in branch 'master': bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() (GH-19061) https://github.com/python/cpython/commit/8849e5962ba481d5d414b3467a256aba2134b4da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:29:22 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:29:22 +0000 Subject: [issue21249] removing pythonXY.zip from sys.path results in additional test failures In-Reply-To: <1397600181.83.0.758754205227.issue21249@psf.upfronthosting.co.za> Message-ID: <1584556162.81.0.949681372403.issue21249@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:29:32 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:29:32 +0000 Subject: [issue21459] DragonFlyBSD support In-Reply-To: <1399626494.21.0.91219272779.issue21459@psf.upfronthosting.co.za> Message-ID: <1584556172.79.0.712258593289.issue21459@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:30:02 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:30:02 +0000 Subject: [issue21108] Add examples for importlib in doc In-Reply-To: <1396240944.13.0.279884654032.issue21108@psf.upfronthosting.co.za> Message-ID: <1584556202.58.0.716029552283.issue21108@roundup.psfhosted.org> Brett Cannon added the comment: There are now examples in the importlib docs. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:30:40 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:30:40 +0000 Subject: [issue21242] Generalize configure check for working Python executable In-Reply-To: <1397584205.03.0.366670026915.issue21242@psf.upfronthosting.co.za> Message-ID: <1584556240.91.0.685442746151.issue21242@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:31:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 18:31:26 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor In-Reply-To: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> Message-ID: <1584556286.09.0.174115199683.issue39995@roundup.psfhosted.org> STINNER Victor added the comment: > Same bug on AMD64 FreeBSD Non-Debug 3.x: > https://buildbot.python.org/all/#/builders/214/builds/472 Oh, test_crash failed twice, but not on the same test case: * ERROR: test_crash (test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) [crash during func execution on worker] * ERROR: test_crash (test.test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest) [crash during func execution on worker] The second failure was when test_concurrent_futures was re-run sequentially. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:33:56 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:33:56 +0000 Subject: [issue20125] We need a good replacement for direct use of load_module(), post-PEP 451 In-Reply-To: <1388888272.45.0.255353824658.issue20125@psf.upfronthosting.co.za> Message-ID: <1584556436.47.0.516034534954.issue20125@roundup.psfhosted.org> Brett Cannon added the comment: I don't think this is still needed as the importlib docs now has enough examples to show people how to get to get similar results with a few method calls. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:34:11 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:34:11 +0000 Subject: [issue20123] pydoc.synopsis fails to load binary modules In-Reply-To: <1388874425.94.0.221860493391.issue20123@psf.upfronthosting.co.za> Message-ID: <1584556451.41.0.757957566183.issue20123@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:34:23 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:34:23 +0000 Subject: [issue20131] warnings module offers no documented, programmatic way to reset "seen-warning" flag In-Reply-To: <1388925569.4.0.616104920228.issue20131@psf.upfronthosting.co.za> Message-ID: <1584556463.83.0.965475629572.issue20131@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:34:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:34:51 +0000 Subject: [issue20205] inspect.getsource(), P302 loader and '<..>' filenames In-Reply-To: <1389273529.73.0.188399599981.issue20205@psf.upfronthosting.co.za> Message-ID: <1584556491.9.0.833025279667.issue20205@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:39:49 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:39:49 +0000 Subject: [issue20506] Command to display all available Import Library In-Reply-To: <1391476994.58.0.915135187283.issue20506@psf.upfronthosting.co.za> Message-ID: <1584556789.14.0.701369385406.issue20506@roundup.psfhosted.org> Brett Cannon added the comment: When a replacement for pkgutil.walk_packages() is added to importlib to work appropriately with the import system then this should be doable. See https://bugs.python.org/issue19939 for work to replace pkgutil as appropriate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:39:54 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:39:54 +0000 Subject: [issue20506] Command to display all available Import Library In-Reply-To: <1391476994.58.0.915135187283.issue20506@psf.upfronthosting.co.za> Message-ID: <1584556794.4.0.820560136143.issue20506@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:40:11 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:40:11 +0000 Subject: [issue20461] Argument Clinic included return converters hard code use of ``_return_value`` In-Reply-To: <1391189327.05.0.0632329148594.issue20461@psf.upfronthosting.co.za> Message-ID: <1584556811.02.0.499909287838.issue20461@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:40:21 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:40:21 +0000 Subject: [issue20459] No Argument Clinic documentation on how to specify a return converter In-Reply-To: <1391185302.8.0.888255910236.issue20459@psf.upfronthosting.co.za> Message-ID: <1584556821.49.0.489236720627.issue20459@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:40:38 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:40:38 +0000 Subject: [issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality In-Reply-To: <1391016633.41.0.856565781171.issue20439@psf.upfronthosting.co.za> Message-ID: <1584556838.65.0.547170854475.issue20439@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:40:46 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:40:46 +0000 Subject: [issue20360] inspect.Signature could provide readable expressions for default values for builtins In-Reply-To: <1390468356.52.0.474182438326.issue20360@psf.upfronthosting.co.za> Message-ID: <1584556846.79.0.58771455345.issue20360@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:40:55 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:40:55 +0000 Subject: [issue20341] Argument Clinic: add "nullable ints" In-Reply-To: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za> Message-ID: <1584556855.34.0.935747972931.issue20341@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:41:35 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:41:35 +0000 Subject: [issue20613] Wrong line information in bytecode generated by compiler module In-Reply-To: <1392261429.58.0.605484301904.issue20613@psf.upfronthosting.co.za> Message-ID: <1584556895.04.0.0497583122299.issue20613@roundup.psfhosted.org> Brett Cannon added the comment: Since 2.7 development is done there is no compiler packages anymore to worry about. :) ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:41:47 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:41:47 +0000 Subject: [issue21078] multiprocessing.managers.BaseManager.__init__'s "serializer" argument is not documented In-Reply-To: <1395938991.3.0.211293361393.issue21078@psf.upfronthosting.co.za> Message-ID: <1584556907.04.0.666889021948.issue21078@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:42:16 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:42:16 +0000 Subject: [issue20899] Nested namespace imports do not work inside zip archives In-Reply-To: <1394656225.26.0.176386437395.issue20899@psf.upfronthosting.co.za> Message-ID: <1584556936.73.0.135917563124.issue20899@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:43:44 2020 From: report at bugs.python.org (Bar Harel) Date: Wed, 18 Mar 2020 18:43:44 +0000 Subject: [issue40002] Cookie load error inconsistency In-Reply-To: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> Message-ID: <1584557024.21.0.973923897762.issue40002@roundup.psfhosted.org> Bar Harel added the comment: For reference, docs already state: "On encountering an invalid cookie, CookieError is raised, so if your cookie data comes from a browser you should always prepare for invalid data and catch CookieError on parsing." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:44:35 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:44:35 +0000 Subject: [issue20890] Miscellaneous PEP 101 additions In-Reply-To: <1394540425.3.0.905657835354.issue20890@psf.upfronthosting.co.za> Message-ID: <1584557075.27.0.89956563501.issue20890@roundup.psfhosted.org> Brett Cannon added the comment: These parts of the devguide don't seem to exist anymore, so I'm closing as outdated. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 14:45:46 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Mar 2020 18:45:46 +0000 Subject: [issue21087] imp.frozen_init() incorrectly removes module during reload In-Reply-To: <1396031443.58.0.0339900849824.issue21087@psf.upfronthosting.co.za> Message-ID: <1584557146.54.0.893256453754.issue21087@roundup.psfhosted.org> Brett Cannon added the comment: No one has cared in nearly 6 years, so I'm closing as "won't fix". :) ---------- resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 15:50:43 2020 From: report at bugs.python.org (Bharat Solanki) Date: Wed, 18 Mar 2020 19:50:43 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. Message-ID: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> New submission from Bharat Solanki : Hi Team, Below code is giving different result in python 2.7 and 3.7 version. Code is running fine when i am using 2.7 but in 3.7, it is showing error. from multiprocessing import Pool import traceback class Utils: def __init__(self): self.count = 10 def function(): global u1 u1 = Utils() l1 = range(3) process_pool = Pool(1) try: process_pool.map(add, l1, 1) process_pool.close() process_pool.join() except Exception as e: process_pool.terminate() process_pool.join() print(traceback.format_exc()) print(e) def add(num): total = num + u1.count print(total) if __name__ == "__main__": function() Could you please help me on this how can it run in 3.7 version. Thanks, Bharat ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 364559 nosy: Bharatsolanki priority: normal severity: normal status: open title: Getting different result in python 2.7 and 3.7. type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 15:59:15 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 18 Mar 2020 19:59:15 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584561555.7.0.500757566178.issue40005@roundup.psfhosted.org> Eric V. Smith added the comment: Note that 2.7 is no longer supported. If you think you found a bug in 3.7, then please: - Reformat your code so that we can understand it. - Show us what output you actually get. - Show us what output you expect, and why. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 16:16:49 2020 From: report at bugs.python.org (Ram Rachum) Date: Wed, 18 Mar 2020 20:16:49 +0000 Subject: [issue40006] enum: Add documentation for _create_pseudo_member_ and composite members Message-ID: <1584562609.71.0.431349886951.issue40006@roundup.psfhosted.org> New submission from Ram Rachum : Looking at the enum source code, there's a method `_create_pseudo_member_` that's used in a bunch of places. Its docstring says "Create a composite member iff value contains only members", which would have been useful if I had any idea what "composite member" meant. It would be good if the documentation for the enum module would include more information about these two concepts. ---------- assignee: docs at python components: Documentation messages: 364561 nosy: cool-RR, docs at python priority: normal severity: normal status: open title: enum: Add documentation for _create_pseudo_member_ and composite members type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 16:33:30 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 18 Mar 2020 20:33:30 +0000 Subject: [issue40006] enum: Add documentation for _create_pseudo_member_ and composite members In-Reply-To: <1584562609.71.0.431349886951.issue40006@roundup.psfhosted.org> Message-ID: <1584563610.51.0.433844337258.issue40006@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 16:39:29 2020 From: report at bugs.python.org (Bharat Solanki) Date: Wed, 18 Mar 2020 20:39:29 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584563969.11.0.923424457201.issue40005@roundup.psfhosted.org> Bharat Solanki added the comment: When you run this test.py in 2.7. you will get output (10 11 20), But in 3.7, Its getting failed. Its showing below error: "Traceback (most recent call last): File "test.py", line 14, in function process_pool.map(add, l1, 1) File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", line 268, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", line 657, in get raise self._value NameError: name 'u1' is not defined" Please let me know if you need any other information. Thanks Bharat ---------- Added file: https://bugs.python.org/file48979/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 16:42:31 2020 From: report at bugs.python.org (Bharat Solanki) Date: Wed, 18 Mar 2020 20:42:31 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584563969.11.0.923424457201.issue40005@roundup.psfhosted.org> Message-ID: Bharat Solanki added the comment: u1 is global variable. So I can use it any where. Rigth! Thanks Bharat On Thu, Mar 19, 2020, 2:09 AM Bharat Solanki wrote: > > Bharat Solanki added the comment: > > When you run this test.py in 2.7. you will get output (10 11 20), But in > 3.7, Its getting failed. Its showing below error: > > "Traceback (most recent call last): > File "test.py", line 14, in function > process_pool.map(add, l1, 1) > File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", > line 268, in map > return self._map_async(func, iterable, mapstar, chunksize).get() > File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", > line 657, in get > raise self._value > NameError: name 'u1' is not defined" > > Please let me know if you need any other information. > > Thanks > Bharat > > ---------- > Added file: https://bugs.python.org/file48979/test.py > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 16:55:38 2020 From: report at bugs.python.org (Tim Peters) Date: Wed, 18 Mar 2020 20:55:38 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584564938.32.0.139491584701.issue40005@roundup.psfhosted.org> Tim Peters added the comment: u1 is a global _only_ in a process that runs `function()`, which declares u1 global and assigns it a value. You have no sane expectation that a worker process (none of which run `function()`) will know anything about it. Are you sure you're running 2.7 and 3.7 on the same machine? It's impossible that this code ever "worked" under Windows, but it might under Linux-y systems, which use `fork()` to create worker processes. The traceback you showed was obviously run under Windows. Under Python 2.7.11 on Windows, I get the same kind of error: NameError: global name 'u1' is not defined This is the code: from multiprocessing import Pool import traceback class Utils: def __init__(self): self.count = 10 def function(): global u1 u1 = Utils() l1 = range(3) process_pool = Pool(1) try: process_pool.map(add, l1, 1) process_pool.close() process_pool.join() except Exception as e: process_pool.terminate() process_pool.join() print(traceback.format_exc()) print(e) def add(num): total = num + u1.count print(total) if __name__ == "__main__": function() ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:00:01 2020 From: report at bugs.python.org (tzickel) Date: Wed, 18 Mar 2020 21:00:01 +0000 Subject: [issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O Message-ID: <1584565201.4.0.349669786045.issue40007@roundup.psfhosted.org> New submission from tzickel : I have a code that tries to be smart and prepare data to be chunked efficiently before sending, so I was happy to read about: https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.writelines Only to see that it simply does: self.write(b''.join(lines)) So I've attempted to write an version that uses sendmsg (scatter I/O) instead (will be attached in PR). What I've learnt is: 1. It's hard to benchmark (If someone has an good example on checking if it's worth it, feel free to add such). 2. sendmsg has an OS limit on how many items can be done in one call. If the user does not call writer.drain() it might have too many items in the buffer, in that case I concat them (might be an expensive operation ? but that should not be th enormal case). 3. socket.socket.sendmsg can accept any bytes like iterable, but os.writev can only accept sequences, is that a bug ? 4. This is for the selector stream socket for now. ---------- components: asyncio messages: 364565 nosy: asvetlov, tzickel, yselivanov priority: normal pull_requests: 18416 severity: normal status: open title: An attempt to make asyncio.transport.writelines (selector) use Scatter I/O type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:04:30 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 18 Mar 2020 21:04:30 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584565470.68.0.933356107385.issue39980@roundup.psfhosted.org> Jason R. Coombs added the comment: How's that for service ;) Glad to hear it worked. I'm going to close this as won't fix (as it was reported against 3.7 and 3.8 and changing it for them would be backward-incompatible, even if more correct). Please report back if that outcome is unsatisfactory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:04:41 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 18 Mar 2020 21:04:41 +0000 Subject: [issue39980] importlib.resources.path() may return incorrect path when using custom loader In-Reply-To: <1584384973.79.0.673963797108.issue39980@roundup.psfhosted.org> Message-ID: <1584565481.2.0.627626817717.issue39980@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:12:06 2020 From: report at bugs.python.org (Riccardo Polignieri) Date: Wed, 18 Mar 2020 21:12:06 +0000 Subject: [issue28686] py.exe ignored PATH when using python3 shebang In-Reply-To: <1479110844.15.0.911795795866.issue28686@psf.upfronthosting.co.za> Message-ID: <1584565926.3.0.297661176074.issue28686@roundup.psfhosted.org> Riccardo Polignieri added the comment: Three years later, this problem seems on the way to fix itself (https://xkcd.com/1822/). Versioned shebangs (and versioned "/env" shebangs) used to be a more prominent issue when you needed a way to tell Python 2 / Python 3 scripts apart. With the sunset of Python 2.7-3.3 almost completed, now we have a reasonably homogeneous block of inter-compatible Pythons. True, py.exe won't cope very well with versioned shebangs, but this seems to become less and less annoying by the day. As for the other problem from issue 39785, ie Python 2 still being selected as "default" in deference to some arcane Linux convention that we have been dragging for ten years (even on Windows!)... it would be nice to finally have *that* fixed. But then again, having Python 2 installed on your Windows box is becoming increasingly rare. Most users are likely never hitting this weirdness any more. In the meantime, now we have yet another way of installing Python on Windows... versioned executables from the Store! With no py.exe! So, who knows, maybe py.exe is the past, versioned executable are the future... To sum up, while I would certainly add a note to the docs, to clarify that py.exe does not support versioned "/env" shebangs, IMO today the work needed to specify a behaviour for all possible cases, possibly even extending/modifying Linux conventions, is just too much to be worth the effort. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:26:21 2020 From: report at bugs.python.org (Tal Einat) Date: Wed, 18 Mar 2020 21:26:21 +0000 Subject: [issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1584566781.06.0.816380294848.issue28009@roundup.psfhosted.org> Tal Einat added the comment: Your fix LGTM, Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:36:17 2020 From: report at bugs.python.org (Bar Harel) Date: Wed, 18 Mar 2020 21:36:17 +0000 Subject: [issue40002] Cookie load error inconsistency In-Reply-To: <1584537983.88.0.845939425655.issue40002@roundup.psfhosted.org> Message-ID: <1584567377.04.0.294884282786.issue40002@roundup.psfhosted.org> Bar Harel added the comment: Patch done, ready for upload. No http experts for nosy, triage needed. ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:57:07 2020 From: report at bugs.python.org (Jack Reigns) Date: Wed, 18 Mar 2020 21:57:07 +0000 Subject: [issue40008] Best Mac Cleaner Software and Optimization Utilities Message-ID: <1584568627.94.0.447674354664.issue40008@roundup.psfhosted.org> New submission from Jack Reigns : Mac Optimizer Pro a bunch of tools that can be used to perform various actions on your Mac. A number of the tools on offer can be used to clean your Mac. ---------- files: MacOptimizerPro.jpg messages: 364570 nosy: Jack Reigns priority: normal severity: normal status: open title: Best Mac Cleaner Software and Optimization Utilities type: performance Added file: https://bugs.python.org/file48980/MacOptimizerPro.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 17:59:51 2020 From: report at bugs.python.org (Todd Levi) Date: Wed, 18 Mar 2020 21:59:51 +0000 Subject: [issue39917] new_compiler() called 2nd time causes error In-Reply-To: <1583784112.25.0.514690253102.issue39917@roundup.psfhosted.org> Message-ID: <1584568791.05.0.639786638265.issue39917@roundup.psfhosted.org> Todd Levi added the comment: In looking through the setup.py file for uvloop, I see that they purposely do not call super().initialize_options() or super().finalize_options() in their code if they've already been called once. I think that is why their code is revealing this problem - the 2nd command to be run is inheriting the self.compiler value from the first command since build_ext.initialize_options() isn't being called to (re)set self.compiler to be None. I'm not sure if there's a "rule" that says each command must call initialize_options() to "sanitize" the object or not but that does explain why the 2nd command is seeing a CCompiler object() for self.compiler on the 2nd time through. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:02:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 22:02:49 +0000 Subject: [issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1584568969.93.0.160460635388.issue38865@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18417 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:11:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 22:11:43 +0000 Subject: [issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1584569503.37.0.452968301074.issue38865@roundup.psfhosted.org> STINNER Victor added the comment: This issue became a blocker issue while working on bpo-39984, when I tried to move pending calls from _PyRuntimeState to PyInterpreterState. I wrote PR 19063 to deny calling Py_FinalizeEx() from a subinterpreter. Eric: > On the other hand, if the "main" interpreter isn't special after runtime init is done (i.e. a subinterpreter is effectively indistinguishable by nature) then it certainly would not matter which one finalizes (or is active during fork() for that matter). On top of that, the effort we are making to identify the main interpreter (both in the code and in the docs) becomes unnecessary. Well. Maybe we will be able to reach this point later, but right now, there are concrete implementation issues. The main interpreter remains special. Only the main interpreter is allowed to call fork(), spawn daemon threads, handle signals, etc. If we manage to make subinterpreters less special, we can change Py_FinalizeEx() again later. I asked: > Is Python supposed to magically destroy the 3 interpreters? Currently, Py_FinalizeEx() fails with a fatal error if there are remaining subinterpreters: --- Fatal Python error: PyInterpreterState_Delete: remaining subinterpreters Python runtime state: finalizing (tstate=0xfaa1c0) Abandon (core dumped) --- IMHO it's a good behavior. if we want, we can modify Py_FinalizeEx() to magically end subinterpters later. The opposite may be more annoying for embedders. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:02:32 2020 From: report at bugs.python.org (Jack Reigns) Date: Wed, 18 Mar 2020 22:02:32 +0000 Subject: [issue40009] Best Mac Cleaner Apps to Optimize and Speed up your Mac Message-ID: <1584568952.13.0.436638052986.issue40009@roundup.psfhosted.org> New submission from Jack Reigns : Mac Optimizer Pro's simple drag and drop functionality makes it the best program to clean up Mac. Apart from this, you can also select an app and view its detailed information so that you know what is hogging up your device?s space. Moreover, it lets you clean the cache and rebuild the database regardless of the OS version you are using. Other than this, it also has some premium features such as software uninstaller and updater to optimize and give your Mac?s hard disk the much-needed breathing space. Call at +1 866-252-2104 for more info or visit:- https://www.macoptimizerpro.com/ ---------- files: MacOptimizerPro.jpg messages: 364572 nosy: Jack Reigns priority: normal severity: normal status: open title: Best Mac Cleaner Apps to Optimize and Speed up your Mac type: performance Added file: https://bugs.python.org/file48981/MacOptimizerPro.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:17:56 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:17:56 +0000 Subject: [issue40008] Spam In-Reply-To: <1584568627.94.0.447674354664.issue40008@roundup.psfhosted.org> Message-ID: <1584569876.95.0.56633976623.issue40008@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -Jack Reigns title: Best Mac Cleaner Software and Optimization Utilities -> Spam type: performance -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:18:09 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:18:09 +0000 Subject: [issue40008] Spam Message-ID: <1584569889.24.0.916214469748.issue40008@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg364570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:18:19 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:18:19 +0000 Subject: [issue40008] Spam Message-ID: <1584569899.22.0.616376908942.issue40008@roundup.psfhosted.org> Change by Zachary Ware : Removed file: https://bugs.python.org/file48980/MacOptimizerPro.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:19:28 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:19:28 +0000 Subject: [issue40009] Spam In-Reply-To: <1584568952.13.0.436638052986.issue40009@roundup.psfhosted.org> Message-ID: <1584569968.21.0.367206417236.issue40009@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -Jack Reigns title: Best Mac Cleaner Apps to Optimize and Speed up your Mac -> Spam type: performance -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:19:39 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:19:39 +0000 Subject: [issue40009] Spam Message-ID: <1584569979.79.0.0618000446028.issue40009@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg364572 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:19:48 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:19:48 +0000 Subject: [issue40009] Spam Message-ID: <1584569988.1.0.266734966954.issue40009@roundup.psfhosted.org> Change by Zachary Ware : Removed file: https://bugs.python.org/file48981/MacOptimizerPro.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:20:57 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:20:57 +0000 Subject: [issue40009] Spam Message-ID: <1584570057.0.0.907159733706.issue40009@roundup.psfhosted.org> Change by Zachary Ware : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:21:11 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 18 Mar 2020 22:21:11 +0000 Subject: [issue40008] Spam Message-ID: <1584570071.32.0.913275300479.issue40008@roundup.psfhosted.org> Change by Zachary Ware : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:39:19 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 18 Mar 2020 22:39:19 +0000 Subject: [issue22699] cross-compilation of Python3.4 In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584571159.88.0.633117606846.issue22699@roundup.psfhosted.org> Steve Dower added the comment: I'm now hitting this too, on nearly all the compiled modules in the stdlib. One example: building '_codecs_jp' extension x86_64-my-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/opt/my-generic/0.0.1-dev/sysroots/core2-64-my-linux -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../Include/internal -I. -IObjects -IInclude -IPython -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/include/python3.8 -c cjkcodecs/_codecs_jp.c -o build/temp.linux-x86_64-3.8/cjkcodecs/_codecs_jp.o x86_64-my-linux-gcc: error: cjkcodecs/_codecs_jp.c: No such file or directory x86_64-my-linux-gcc: fatal error: no input files compilation terminated. I think the working directory is incorrect at some stage - note that the first two -I would make sense from Modules, but the next three do not. ---------- nosy: +steve.dower versions: +Python 3.8, Python 3.9 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 18:56:40 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 18 Mar 2020 22:56:40 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584572200.99.0.603042481468.issue22699@roundup.psfhosted.org> Steve Dower added the comment: Trimmed a bit from setup.py here, but I think this is the cause: def build_extensions(self): self.srcdir = sysconfig.get_config_var('srcdir') self.srcdir = os.path.abspath(self.srcdir) [SNIP] # Fix up the autodetected modules, prefixing all the source files # with Modules/. moddirlist = [os.path.join(self.srcdir, 'Modules')] In my build, I've set PYTHON_FOR_BUILD=python3.8, and the contents of moddirlist is '/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Modules'. So it's picking the wrong source directory. I replaced the second line of the function above with: self.srcdir = os.path.dirname(os.path.abspath(__file__)) Which made things a little better (I can launch my build now), but all the -I/usr/* options need to be replaced as well or there are no dynamically loaded modules. ---------- title: cross-compilation of Python3.4 -> Module source files not found when cross-compiling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:02:13 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Mar 2020 23:02:13 +0000 Subject: [issue39220] constant folding affects annotations despite 'from __future__ import annotations' In-Reply-To: <1578230811.94.0.250306045254.issue39220@roundup.psfhosted.org> Message-ID: <1584572533.6.0.995098150096.issue39220@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d112c600ab3f5e2910345bcc4bfc39439917ed87 by Pablo Galindo in branch 'master': bpo-39220: Do not optimise annotation if 'from __future__ import annotations' is used (GH-17866) https://github.com/python/cpython/commit/d112c600ab3f5e2910345bcc4bfc39439917ed87 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:02:35 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Mar 2020 23:02:35 +0000 Subject: [issue39220] constant folding affects annotations despite 'from __future__ import annotations' In-Reply-To: <1578230811.94.0.250306045254.issue39220@roundup.psfhosted.org> Message-ID: <1584572555.45.0.382856952098.issue39220@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:02:39 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Mar 2020 23:02:39 +0000 Subject: [issue39220] constant folding affects annotations despite 'from __future__ import annotations' In-Reply-To: <1578230811.94.0.250306045254.issue39220@roundup.psfhosted.org> Message-ID: <1584572559.89.0.816482892928.issue39220@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:06:22 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 18 Mar 2020 23:06:22 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584572782.87.0.405843764167.issue22699@roundup.psfhosted.org> Steve Dower added the comment: Perhaps sysconfig needs an overhaul to be able to handle _PYTHON_PROJECT_BASE properly? I see so many values in there that are taken from the running interpreter (sys.prefix, for example) that ought to come from the cross-compilation target. Wouldn't surprise me if the host's CFLAGS are leaking through and adding those extra includes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:27:20 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Mar 2020 23:27:20 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584574040.03.0.685070788525.issue39576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will try to investigate that but it think this is because without OBJECT_MODE=64 the value of decimal.MAX_PREC is much lower (425000000 instead 999999999999999999) so whatever is happening downstream with the higher does not happen with the lower one. I will update If I found something useful on what is going on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 19:34:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Mar 2020 23:34:15 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584574455.43.0.686773151977.issue39576@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 20:03:12 2020 From: report at bugs.python.org (Maxwell Bernstein) Date: Thu, 19 Mar 2020 00:03:12 +0000 Subject: [issue39985] str.format and string.Formatter subscript behaviors diverge In-Reply-To: <1584409340.15.0.380295025491.issue39985@roundup.psfhosted.org> Message-ID: <1584576192.68.0.957571055833.issue39985@roundup.psfhosted.org> Change by Maxwell Bernstein : ---------- keywords: +patch pull_requests: +18418 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 20:10:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 00:10:55 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584576655.24.0.529051108062.issue39984@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18420 pull_request: https://github.com/python/cpython/pull/19066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 20:51:21 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Thu, 19 Mar 2020 00:51:21 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1584579081.78.0.31678473125.issue39982@roundup.psfhosted.org> Kubilay Kocak added the comment: I've been in touch with the FreeBSD SCTP maintainer and will continue to investigate that avenue. In the meantime, I'm re-running the last successful 3.x build (382 [1]) to see if that fails or not to isolate Cpython code changes as contributing causes [1] https://buildbot.python.org/all/#/builders/152/builds/382 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 20:57:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 00:57:19 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications Message-ID: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> New submission from STINNER Victor : When a thread gets a signal, SIGNAL_PENDING_SIGNALS() sets signals_pending to 1 and eval_breaker to 1. In this case, _PyEval_EvalFrameDefault() calls handle_signals(), but since it's not the main thread, it does nothing and signals_pending value remains 1. Moreover, eval_breaker value remains 1 which means that the following code will be called before executing *each* bytecode instruction. if (_Py_atomic_load_relaxed(eval_breaker)) { (...) opcode = _Py_OPCODE(*next_instr); if (opcode == SETUP_FINALLY || ...) { ... } if (_Py_atomic_load_relaxed(&ceval->signals_pending)) { if (handle_signals(tstate) != 0) { goto error; } } if (_Py_atomic_load_relaxed(&ceval->pending.calls_to_do)) { ... } if (_Py_atomic_load_relaxed(&ceval->gil_drop_request)) { ... } if (tstate->async_exc != NULL) { ... } } This is inefficient. I'm working on a PR modifying SIGNAL_PENDING_SIGNALS() to not set eval_breaker to 1 if the current thread is not the main thread. ---------- components: Interpreter Core messages: 364580 nosy: vstinner priority: normal severity: normal status: open title: Inefficient sigal handling in multithreaded applications versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 20:57:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 00:57:25 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584579445.78.0.265419418514.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:14:42 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 19 Mar 2020 01:14:42 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584580482.55.0.4184627282.issue39939@roundup.psfhosted.org> Dennis Sweeney added the comment: If no one has started, I can draft such a PEP. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:25:17 2020 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 19 Mar 2020 01:25:17 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584581117.68.0.450973261306.issue39939@roundup.psfhosted.org> Guido van Rossum added the comment: Sounds good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:31:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 01:31:35 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584581495.09.0.860921452967.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18421 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:35:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 01:35:28 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584581728.84.0.987014747668.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: I found this issue while working on PR 19066 of bpo-39984. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:35:47 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Mar 2020 01:35:47 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1584581747.82.0.729994583128.issue38576@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset e176e0c105786e9f476758eb5438c57223b65e7f by Mat?j Cepl in branch '2.7': [2.7] closes bpo-38576: Disallow control characters in hostnames in http.client. (GH-19052) https://github.com/python/cpython/commit/e176e0c105786e9f476758eb5438c57223b65e7f ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:41:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 01:41:27 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584582087.75.0.215588020766.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 50e6e991781db761c496561a995541ca8d83ff87 by Victor Stinner in branch 'master': bpo-39984: Move pending calls to PyInterpreterState (GH-19066) https://github.com/python/cpython/commit/50e6e991781db761c496561a995541ca8d83ff87 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:45:57 2020 From: report at bugs.python.org (=?utf-8?q?H=C3=AAnio_Tierra_Sampaio?=) Date: Thu, 19 Mar 2020 01:45:57 +0000 Subject: [issue40011] Widget events are of type Tuple Message-ID: <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org> New submission from H?nio Tierra Sampaio : I'm maintainer for a project for the RaspberryPi, a GUI for OMXPlayer called TBOPlayer. This GUI was originally made for Python 2, but with Python 2 deprecation, I decided to convert it to Python 3. After (supposedly) converting all of it I had a surprise to see that the events that worked in the original code with Python 2 didn't work anymore in Python 3 with errors like File "/home/henio/Projetos/tboplayer/lib/tboplayer.py", line 1566, in select_track sel = event.widget.curselection() AttributeError: 'tuple' object has no attribute 'widget' And upon investigation, I noticed all the widget events (originally of type tkinter.Event) were now of type Tuple. WTF. Ok, I tried to circumvent this by using the tuple "attributes", like, in the event (('17685', '1', '??', '??', '??', '256', '59467466', '??', '212', '11', '??', '0', '??', '??', '.!listbox', '5', '1030', '344', '??'),) I can access the x position of the cursor in relation to the widget by doing: event[0][8] Which I did. However, I obviously cannot use any of the Event methods, and this way I cannot get the current selection from a Listbox, for example, and trying to gives me the exact error mentioned above. This renders TBOPlayer useless as the user cannot even select a track for playing. I could circumvent this specific problem by keeping track of the previous clicked position over the Listbox and do a simple math calculation to get the current list item, but that's is very annoying, and not the right way to do it, meaning it would make the code more complex than it should be, and making maintaing more difficult. And unfortunately, I was unable to reproduce this issue with a minimum code, so I have no idea what's going on. This issue comment describes how to reproduce the bug inside of TBOPlyaer: https://github.com/KenT2/tboplayer/issues/175#issuecomment-600861514 ---------- components: Tkinter files: tboplayer.py hgrepos: 387 messages: 364586 nosy: H?nio Tierra Sampaio priority: normal severity: normal status: open title: Widget events are of type Tuple type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48982/tboplayer.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 21:52:32 2020 From: report at bugs.python.org (=?utf-8?q?H=C3=AAnio_Tierra_Sampaio?=) Date: Thu, 19 Mar 2020 01:52:32 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org> Message-ID: <1584582752.42.0.209495641883.issue40011@roundup.psfhosted.org> Change by H?nio Tierra Sampaio : ---------- title: Widget events are of type Tuple -> Tkinter widget events are of type Tuple _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 22:00:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 02:00:56 +0000 Subject: [issue36225] Lingering subinterpreters should be implicitly cleared on shutdown In-Reply-To: <1551964663.69.0.686712846789.issue36225@roundup.psfhosted.org> Message-ID: <1584583256.74.0.118008407655.issue36225@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-38865: "Can Py_Finalize() be called if the current interpreter is not the main interpreter?". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 22:01:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 02:01:09 +0000 Subject: [issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1584583269.3.0.789887810336.issue38865@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-36225: "Lingering subinterpreters should be implicitly cleared on shutdown". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 22:14:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 02:14:12 +0000 Subject: [issue36479] Exit threads when interpreter is finalizing rather than runtime. In-Reply-To: <1553896742.19.0.478613119545.issue36479@roundup.psfhosted.org> Message-ID: <1584584052.19.0.918723275106.issue36479@roundup.psfhosted.org> STINNER Victor added the comment: I suggest to close this issue, I don't think that it can be implemented because of daemon threads. -- > This behavior should instead be triggered by the thread's interpreter finalizing rather than the runtime. What is the motivation for that? -- take_gil() cannot access interp->finalizing since interp memory is freed during Python finalization. take_gil() can only rely on a global variable like _PyRuntime to check if a daemon thread must exit during the Python finalization. I modified take_gil() recently to fix 2 or 3 different crashes caused by daemon threads during Python finalization. Extract of ceval.c: /* Check if a Python thread must exit immediately, rather than taking the GIL if Py_Finalize() has been called. When this function is called by a daemon thread after Py_Finalize() has been called, the GIL does no longer exist. tstate must be non-NULL. */ static inline int tstate_must_exit(PyThreadState *tstate) { /* bpo-39877: Access _PyRuntime directly rather than using tstate->interp->runtime to support calls from Python daemon threads. After Py_Finalize() has been called, tstate can be a dangling pointer: point to PyThreadState freed memory. */ _PyRuntimeState *runtime = &_PyRuntime; PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); return (finalizing != NULL && finalizing != tstate); } And simplified take_gil(): static void take_gil(PyThreadState *tstate) { if (tstate_must_exit(tstate)) { /* bpo-39877: If Py_Finalize() has been called and tstate is not the thread which called Py_Finalize(), exit immediately the thread. This code path can be reached by a daemon thread after Py_Finalize() completes. In this case, tstate is a dangling pointer: points to PyThreadState freed memory. */ PyThread_exit_thread(); } (... logic to acquire the GIL ...) if (must_exit) { /* bpo-36475: If Py_Finalize() has been called and tstate is not the thread which called Py_Finalize(), exit immediately the thread. This code path can be reached by a daemon thread which was waiting in take_gil() while the main thread called wait_for_thread_shutdown() from Py_Finalize(). */ drop_gil(ceval, ceval2, tstate); PyThread_exit_thread(); } } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 22:26:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 02:26:28 +0000 Subject: [issue31200] address sanitizer build fails In-Reply-To: <1502702493.31.0.645434199194.issue31200@psf.upfronthosting.co.za> Message-ID: <1584584788.23.0.817983676287.issue31200@roundup.psfhosted.org> STINNER Victor added the comment: FYI there is bpo-1635741 which tries to cleanup more things at Python exit. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 23:13:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 03:13:40 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584587620.79.0.965742731362.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: I added PyInterpreterState_Get() and PyThreadState_GetInterpreter() functions to get the interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 18 23:26:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 03:26:02 +0000 Subject: [issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression) In-Reply-To: <1571242626.68.0.14615334114.issue38500@roundup.psfhosted.org> Message-ID: <1584588362.77.0.603988165302.issue38500@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 00:04:24 2020 From: report at bugs.python.org (=?utf-8?q?H=C3=AAnio_Tierra_Sampaio?=) Date: Thu, 19 Mar 2020 04:04:24 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org> Message-ID: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> H?nio Tierra Sampaio added the comment: I'm maintainer for a project for the RaspberryPi, a GUI for OMXPlayer called TBOPlayer. This GUI was originally made for Python 2, but with Python 2 deprecation, I decided to convert it to Python 3. After (supposedly) converting all of it I had a surprise to see that the events that worked in the original code with Python 2 didn't work anymore in Python 3 with errors like File "/home/henio/Projetos/tboplayer/lib/tboplayer.py", line 1566, in select_track sel = event.widget.curselection() AttributeError: 'tuple' object has no attribute 'widget' And upon investigation, I noticed all the widget events (originally of type tkinter.Event) were now of type Tuple. WTF. Ok, I tried to circumvent this by using the tuple "attributes", like, in the event (('17685', '1', '??', '??', '??', '256', '59467466', '??', '212', '11', '??', '0', '??', '??', '.!listbox', '5', '1030', '344', '??'),) I can access the x position of the cursor in relation to the widget by doing: event[0][8] Which I did. However, I obviously cannot use any of the Event methods, and this way I cannot get the current selection from a Listbox, for example, and trying to gives me the exact error mentioned above. This renders TBOPlayer useless as the user cannot even select a track for playing. And unfortunately, I was unable to reproduce this issue with a minimum code, so I have no idea what's going on. This issue comment describes how to reproduce the bug inside of TBOPlyaer: https://github.com/KenT2/tboplayer/issues/175#issuecomment-600861514 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 00:09:41 2020 From: report at bugs.python.org (=?utf-8?q?H=C3=AAnio_Tierra_Sampaio?=) Date: Thu, 19 Mar 2020 04:09:41 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org> Message-ID: <1584590981.31.0.0161305813173.issue40011@roundup.psfhosted.org> H?nio Tierra Sampaio added the comment: Sorry for the similar messages. The second one was to remove the paragraph stating that it would be possible to circumvent the problem of the Listbox - it is not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 00:34:07 2020 From: report at bugs.python.org (hai shi) Date: Thu, 19 Mar 2020 04:34:07 +0000 Subject: [issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1584592447.45.0.926756514598.issue39984@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 02:04:30 2020 From: report at bugs.python.org (Bruce Merry) Date: Thu, 19 Mar 2020 06:04:30 +0000 Subject: [issue39974] A race condition with GIL releasing exists in stringlib_bytes_join In-Reply-To: <1584338520.98.0.250313296967.issue39974@roundup.psfhosted.org> Message-ID: <1584597870.65.0.185410644356.issue39974@roundup.psfhosted.org> Bruce Merry added the comment: +tzickel I'd suggest reading the discussion in issue 36051, and maybe raising a new issue about it if you still have concerns. In short, dropping the GIL in more bytes.join cases wouldn't necessarily be wrong, but it might break code that made the assumption that bytes.join is atomic even though that's never been claimed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 02:47:39 2020 From: report at bugs.python.org (tzickel) Date: Thu, 19 Mar 2020 06:47:39 +0000 Subject: [issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O In-Reply-To: <1584565201.4.0.349669786045.issue40007@roundup.psfhosted.org> Message-ID: <1584600459.73.0.501979486838.issue40007@roundup.psfhosted.org> tzickel added the comment: BTW, if wanted a much more simpler PR can be made, where writelines simply calls sendmsg on the input if no buffer exists, and if not only then concats and acts like the current code base. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 02:51:53 2020 From: report at bugs.python.org (Bharat Solanki) Date: Thu, 19 Mar 2020 06:51:53 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584564938.32.0.139491584701.issue40005@roundup.psfhosted.org> Message-ID: Bharat Solanki added the comment: Hi Tim, Thank you for clearing that up. I ran the same code in 2.7 and 3.7 on Windows, Its showing the same error. Yes, Its running in Linux-y systems. It depends on OS. Regards, Bharat On Thu, Mar 19, 2020 at 2:25 AM Tim Peters wrote: > > Tim Peters added the comment: > > u1 is a global _only_ in a process that runs `function()`, which declares > u1 global and assigns it a value. You have no sane expectation that a > worker process (none of which run `function()`) will know anything about it. > > Are you sure you're running 2.7 and 3.7 on the same machine? It's > impossible that this code ever "worked" under Windows, but it might under > Linux-y systems, which use `fork()` to create worker processes. > > The traceback you showed was obviously run under Windows. Under Python > 2.7.11 on Windows, I get the same kind of error: > > NameError: global name 'u1' is not defined > > This is the code: > > from multiprocessing import Pool > import traceback > > class Utils: > def __init__(self): > self.count = 10 > > def function(): > global u1 > u1 = Utils() > l1 = range(3) > process_pool = Pool(1) > try: > process_pool.map(add, l1, 1) > process_pool.close() > process_pool.join() > except Exception as e: > process_pool.terminate() > process_pool.join() > print(traceback.format_exc()) > print(e) > > def add(num): > total = num + u1.count > print(total) > > if __name__ == "__main__": > function() > > ---------- > nosy: +tim.peters > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 05:35:59 2020 From: report at bugs.python.org (Peter Bittner) Date: Thu, 19 Mar 2020 09:35:59 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results Message-ID: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> New submission from Peter Bittner : Currently, when you do a Web search (e.g. using Google, Bing, Yahoo!, DuckDuckGo, et al.) for a Python module or function call you'll find a link to the related Python 2 documentation first. How to reproduce: 1. Search for simply "os.environ" in your favorite search engine. 2. Find a link to the Python documentation in the first 3 results. Typically, this will point to the Python 2 docs first. (Side note: Google seems to now actively manipulate the results ranking Python 3 results higher. Apparently, this is the only popular search engine behaving like that.) Expected result: - When searching for Python modules, functions, builtins, etc. on the Web, no search results for Python 2 should pop up at all if the same content exists for Python 3 Possible implementation: - Add a "noindex" meta tag to the header of the generated HTML documentation - see https://support.google.com/webmasters/answer/93710 ---------- messages: 364597 nosy: bittner priority: normal severity: normal status: open title: Avoid Python 2 documentation to appear in Web search results type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 06:08:27 2020 From: report at bugs.python.org (Matej Cepl) Date: Thu, 19 Mar 2020 10:08:27 +0000 Subject: [issue31046] ensurepip does not honour the value of $(prefix) In-Reply-To: <1501087168.72.0.253170854096.issue31046@psf.upfronthosting.co.za> Message-ID: <1584612507.66.0.782366333669.issue31046@roundup.psfhosted.org> Change by Matej Cepl : ---------- pull_requests: +18422 pull_request: https://github.com/python/cpython/pull/19068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 06:37:30 2020 From: report at bugs.python.org (Moshe Sambol) Date: Thu, 19 Mar 2020 10:37:30 +0000 Subject: [issue40013] CSV DictReader parameter documentation Message-ID: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> New submission from Moshe Sambol : The csv.DictReader constructor takes two optional parameters, restkey and restval. restkey is documented well, but restval is not: "If a row has more fields than fieldnames, the remaining data is put in a list and stored with the fieldname specified by restkey (which defaults to None). If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with None." Since restval is not mentioned here, the reader may assume that the next sentence applies to it: "All other optional or keyword arguments are passed to the underlying reader instance." But this is not the case for restval. I suggest that the text be amended to "If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with the value of restval (which defaults to None)." ---------- assignee: docs at python components: Documentation messages: 364598 nosy: Moshe Sambol, docs at python priority: normal severity: normal status: open title: CSV DictReader parameter documentation versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 06:40:07 2020 From: report at bugs.python.org (hai shi) Date: Thu, 19 Mar 2020 10:40:07 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584614407.97.0.916170588983.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18423 pull_request: https://github.com/python/cpython/pull/19069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 06:40:43 2020 From: report at bugs.python.org (hai shi) Date: Thu, 19 Mar 2020 10:40:43 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1584614443.65.0.809528762805.issue39337@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18424 pull_request: https://github.com/python/cpython/pull/19069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 07:20:59 2020 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 19 Mar 2020 11:20:59 +0000 Subject: [issue39656] shebanged scripts can escape from `venv` depending on how it was created In-Reply-To: <1581880911.6.0.392245585345.issue39656@roundup.psfhosted.org> Message-ID: <1584616859.88.0.262761543506.issue39656@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 07:32:51 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 19 Mar 2020 11:32:51 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584617571.7.0.0792450635728.issue40000@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0ac59f93c0e3f91fd994d7245578cce65654fb22 by Batuhan Ta?kaya in branch 'master': bpo-40000: Improve error messages when validating invalid ast.Constant nodes (GH-19055) https://github.com/python/cpython/commit/0ac59f93c0e3f91fd994d7245578cce65654fb22 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 07:35:47 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 19 Mar 2020 11:35:47 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584617747.89.0.23834360528.issue39562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9052f7a41b90f2d34011c8da68f9a4facebc8a97 by Batuhan Ta?kaya in branch 'master': bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968) https://github.com/python/cpython/commit/9052f7a41b90f2d34011c8da68f9a4facebc8a97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 07:36:06 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Mar 2020 11:36:06 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584617766.47.0.00773209108965.issue39562@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +18425 pull_request: https://github.com/python/cpython/pull/19070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 07:54:20 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Mar 2020 11:54:20 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584618860.35.0.058270744.issue39562@roundup.psfhosted.org> miss-islington added the comment: New changeset ec8a973f7cf080d9c0679f058b2371f0b7c7862c by Miss Islington (bot) in branch '3.8': bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968) https://github.com/python/cpython/commit/ec8a973f7cf080d9c0679f058b2371f0b7c7862c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 08:00:48 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 19 Mar 2020 12:00:48 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1584619248.67.0.859181573868.issue39562@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 08:01:11 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 19 Mar 2020 12:01:11 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584619271.78.0.758885221109.issue40000@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 08:40:30 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 19 Mar 2020 12:40:30 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1584621630.06.0.59520452684.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: The lower MAX_PREC for 32-bit could be the reason. On the other hand, historically, suncc and xlc have had a lot of problems with the 64-bit build. The winner is suncc, which seriously miscompiled libmpdec without a whole litany of flags: https://bugs.python.org/issue15963#msg170661 This is why I keep insisting on experimenting with obscure flags, but of course the actual cause may be different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 09:21:27 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 19 Mar 2020 13:21:27 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1584624087.9.0.0691075186645.issue40012@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 10:33:52 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 19 Mar 2020 14:33:52 +0000 Subject: [issue39985] str.format and string.Formatter subscript behaviors diverge In-Reply-To: <1584409340.15.0.380295025491.issue39985@roundup.psfhosted.org> Message-ID: <1584628432.52.0.740027406788.issue39985@roundup.psfhosted.org> Eric V. Smith added the comment: Can you see if the patch in issue27307 solves your problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 10:35:23 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Mar 2020 14:35:23 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584628523.64.0.994240376221.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18426 pull_request: https://github.com/python/cpython/pull/19071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 10:45:47 2020 From: report at bugs.python.org (Matej Cepl) Date: Thu, 19 Mar 2020 14:45:47 +0000 Subject: [issue33327] Add a method to move messages to IMAPlib In-Reply-To: <1524337803.72.0.682650639539.issue33327@psf.upfronthosting.co.za> Message-ID: <1584629147.42.0.809644185288.issue33327@roundup.psfhosted.org> Change by Matej Cepl : ---------- keywords: +patch pull_requests: +18427 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/19072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:02:18 2020 From: report at bugs.python.org (Matej Cepl) Date: Thu, 19 Mar 2020 15:02:18 +0000 Subject: [issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm In-Reply-To: <1570283238.14.0.402660591178.issue38377@roundup.psfhosted.org> Message-ID: <1584630138.85.0.726358470662.issue38377@roundup.psfhosted.org> Change by Matej Cepl : ---------- pull_requests: +18428 pull_request: https://github.com/python/cpython/pull/19073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:05:44 2020 From: report at bugs.python.org (szb512) Date: Thu, 19 Mar 2020 15:05:44 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584630344.77.0.299703178889.issue39107@roundup.psfhosted.org> szb512 added the comment: I'll update my PR to include some changes for windows. ---------- nosy: +alittleman512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:22:01 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Mar 2020 15:22:01 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584631321.09.0.935456167876.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18430 pull_request: https://github.com/python/cpython/pull/19074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:22:33 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 19 Mar 2020 15:22:33 +0000 Subject: [issue39985] str.format and string.Formatter subscript behaviors diverge In-Reply-To: <1584409340.15.0.380295025491.issue39985@roundup.psfhosted.org> Message-ID: <1584631353.71.0.503076095784.issue39985@roundup.psfhosted.org> Eric V. Smith added the comment: In fact, this is a duplicate of issue27307, so I'm going to close this. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> string.Formatter does not support key/attribute access on unnumbered fields _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:22:42 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 19 Mar 2020 15:22:42 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584631362.88.0.156873140839.issue27307@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +tekknolagi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 11:22:58 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 19 Mar 2020 15:22:58 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584631378.58.0.470214580131.issue27307@roundup.psfhosted.org> Change by Eric V. Smith : ---------- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:04:55 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Mar 2020 16:04:55 +0000 Subject: [issue40014] os.getgrouplist can raise OSError during the Display build info Message-ID: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> New submission from Dong-hee Na : example: https://github.com/python/cpython/pull/19073/checks?check_run_id=519539592 I suggest to not to add information for os.getgrouplist if the OSError is raised. ---------- components: Tests messages: 364607 nosy: corona10, vstinner priority: normal severity: normal status: open title: os.getgrouplist can raise OSError during the Display build info type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:06:14 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Mar 2020 16:06:14 +0000 Subject: [issue40014] os.getgrouplist can raise OSError during the Display build info In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584633974.89.0.409518472199.issue40014@roundup.psfhosted.org> Dong-hee Na added the comment: or adding might be great just like getpwuid ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:13:45 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Mar 2020 16:13:45 +0000 Subject: [issue40014] os.getgrouplist can raise OSError during the Display build info In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584634425.09.0.797247210697.issue40014@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +18431 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:16:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 16:16:12 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584634572.31.0.527322865748.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 77248a28896d39cae0a7e084965b9ffc2624b7f4 by Dong-hee Na in branch 'master': bpo-1635741: Port _collections module to multiphase initialization (GH-19074) https://github.com/python/cpython/commit/77248a28896d39cae0a7e084965b9ffc2624b7f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:36:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 16:36:37 +0000 Subject: [issue40014] os.getgrouplist() fails on macOS of GH Actions (Azure) In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584635797.15.0.893344766933.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: These errors are really strange. Steve Dower: are you aware of anything recent change on the macOS job of Azure Pipelines / GH Actions. pythoninfo: --- os.uname: posix.uname_result(sysname='Darwin', nodename='Mac-1422.local', release='19.3.0', version='Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64', machine='x86_64') platform.architecture: 64bit platform.platform: macOS-10.15.3-x86_64-i386-64bit --- > example: https://github.com/python/cpython/pull/19073/checks?check_run_id=519539592 ./python.exe -m test.pythoninfo ERROR: collect_pwd() failed Traceback (most recent call last): File "/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/pythoninfo.py", line 761, in collect_info collect_func(info_add) File "/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/pythoninfo.py", line 336, in collect_pwd groups = os.getgrouplist(entry.pw_name, entry.pw_gid) OSError: [Errno 0] Error Collection failed: exit with error > PR 19075 test_posix.test_getgrouplist() failed with: ====================================================================== ERROR: test_getgrouplist (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/runners/2.165.2/work/cpython/cpython/Lib/test/test_posix.py", line 1028, in test_getgrouplist self.assertIn(group, posix.getgrouplist(user, group)) OSError: [Errno 25] Inappropriate ioctl for device ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, steve.dower title: os.getgrouplist can raise OSError during the Display build info -> os.getgrouplist() fails on macOS of GH Actions (Azure) versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:40:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 16:40:16 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584636016.16.0.357743561892.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5a3a71dddbe80edc75a3a74ce3b7978cf8635901 by Victor Stinner in branch 'master': bpo-40010: Optimize signal handling in multithreaded applications (GH-19067) https://github.com/python/cpython/commit/5a3a71dddbe80edc75a3a74ce3b7978cf8635901 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:48:06 2020 From: report at bugs.python.org (Venkatesh-Prasad Ranganath) Date: Thu, 19 Mar 2020 16:48:06 +0000 Subject: [issue40015] logging.Logger.disabled field is redundant Message-ID: <1584636486.61.0.64483912043.issue40015@roundup.psfhosted.org> New submission from Venkatesh-Prasad Ranganath : `logging.Logger.disabled` field is assigned `False` while initializing `logging.Logger` instance and never updated. However, this field is also involved in two checks: https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1586 and https://github.com/python/cpython/blob/da1fe768e582387212201ab8737a1a5f26110664/Lib/logging/__init__.py#L1681 that are executed in the context of every logging method. So, these checks are likely to contribute to unnecessary computation while logging. Further, since the library documentation does not mention this field, the field is probably not part of the public API of the logging library. So, the field seems to be redundant. Given the checks on the hot paths are redundant as the field never changes value and fields is not part of the public API, removing it will help improve logging performance and simplify the code base. ---------- components: Library (Lib) messages: 364612 nosy: rvprasad priority: normal severity: normal status: open title: logging.Logger.disabled field is redundant type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:53:18 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 19 Mar 2020 16:53:18 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584636798.54.0.835333331564.issue27307@roundup.psfhosted.org> Eric V. Smith added the comment: It would be good if someone could convert this to a pull request and beef up the tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 12:53:34 2020 From: report at bugs.python.org (hai shi) Date: Thu, 19 Mar 2020 16:53:34 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584636814.67.0.430362399058.issue39824@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18432 pull_request: https://github.com/python/cpython/pull/19076 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:00:07 2020 From: report at bugs.python.org (Venkatesh-Prasad Ranganath) Date: Thu, 19 Mar 2020 17:00:07 +0000 Subject: [issue40015] logging.Logger.disabled field is redundant In-Reply-To: <1584636486.61.0.64483912043.issue40015@roundup.psfhosted.org> Message-ID: <1584637207.9.0.684730845043.issue40015@roundup.psfhosted.org> Venkatesh-Prasad Ranganath added the comment: `logging.Logger.disabled` field is used in logging.config module to disable loggers during configuration. Since the field is not redundant, the issue is invalid and, hence, should be closed. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:09:33 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 19 Mar 2020 17:09:33 +0000 Subject: [issue40014] os.getgrouplist() fails on macOS of GH Actions (Azure) In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584637773.01.0.943549001328.issue40014@roundup.psfhosted.org> Ned Deily added the comment: This error has to do with the number of groups a particular user is associated with. We?ve squashed similar bugs in the past but it looks like something has changed again in recent releases of macOS. It?s not Azure specific. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:11:29 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 19 Mar 2020 17:11:29 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584637889.26.0.674451298441.issue40014@roundup.psfhosted.org> Change by Ned Deily : ---------- title: os.getgrouplist() fails on macOS of GH Actions (Azure) -> os.getgrouplist() can fail on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:11:37 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Mar 2020 17:11:37 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584637897.24.0.078202975115.issue39824@roundup.psfhosted.org> miss-islington added the comment: New changeset 13397ee47d23fda2e8d4bef40c1df986457673d1 by Hai Shi in branch 'master': bpo-39824: Convert PyModule_GetState() to get_module_state() (GH-19076) https://github.com/python/cpython/commit/13397ee47d23fda2e8d4bef40c1df986457673d1 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:38:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 17:38:10 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584639490.0.0.0083466119206.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18433 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:40:50 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 17:40:50 +0000 Subject: [issue40016] Clarify flag case in `re` module Message-ID: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> New submission from Ram Rachum : Today I was tripped up by an inconsistency in the `re` docstring. I wanted to use DOTALL as a flag inside my regex, rather than as an argument to the `compile` function. Here are two lines from the docstring: (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below). ... S DOTALL "." matches any character at all, including the newline. The DOTALL flag appears as an uppercase S in 2 places, and as a lowercase s in one place. This is confusing, and I initially tried using the uppercase S only to get an error. I'm attaching a PR to this ticket. ---------- components: Library (Lib) messages: 364617 nosy: cool-RR priority: normal severity: normal status: open title: Clarify flag case in `re` module type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:42:34 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 17:42:34 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584639754.35.0.396849008133.issue40016@roundup.psfhosted.org> Change by Ram Rachum : ---------- keywords: +patch pull_requests: +18434 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19078 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 13:44:27 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 17:44:27 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584639867.18.0.604959432574.issue40016@roundup.psfhosted.org> Ram Rachum added the comment: As you can see I left the old uppercase enums defined, to avoid breaking backward compatibility. We could make them trigger a DeprecationWarning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:17:14 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Mar 2020 18:17:14 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584641834.3.0.364178760876.issue40016@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is very inconvenient to use single-letter lowercase names for constants. It contradicts PEP 8: https://www.python.org/dev/peps/pep-0008/#constants ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:18:29 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Mar 2020 18:18:29 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1584641909.3.0.408796851897.issue38237@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18436 pull_request: https://github.com/python/cpython/pull/19079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:22:05 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 18:22:05 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584642125.52.0.480393943967.issue40016@roundup.psfhosted.org> Ram Rachum added the comment: Well, these aren't the textbook case of a constant, since they're enums, and not defined in the global namespace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:23:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Mar 2020 18:23:21 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584642201.49.0.130147732795.issue40016@roundup.psfhosted.org> Serhiy Storchaka added the comment: They are. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:28:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:28:08 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584642488.76.0.697248230202.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18438 pull_request: https://github.com/python/cpython/pull/19080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:28:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:28:08 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1584642488.12.0.161615319602.issue39877@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18437 pull_request: https://github.com/python/cpython/pull/19080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:31:58 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 18:31:58 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584642718.2.0.00767843933892.issue40016@roundup.psfhosted.org> Ram Rachum added the comment: Oops, my mistake. Any other idea how to solve this discrepancy? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:35:38 2020 From: report at bugs.python.org (Maxwell Bernstein) Date: Thu, 19 Mar 2020 18:35:38 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584642938.92.0.467038286315.issue27307@roundup.psfhosted.org> Maxwell Bernstein added the comment: I'll take a look at the patch and see if this solves my problem. If it does, I'll update my PR with tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:37:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:37:38 +0000 Subject: [issue39969] Remove Param expression context from AST In-Reply-To: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> Message-ID: <1584643058.27.0.702074596327.issue39969@roundup.psfhosted.org> STINNER Victor added the comment: FYI this change broke the chameleon project: https://github.com/malthe/chameleon/issues/303 Batuhan: You maybe want to propose a fix there. It shouldn't be hard to fix the issue. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:42:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Mar 2020 18:42:59 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584643379.5.0.318597609075.issue40016@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not see any issue except that you was careless when read the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:43:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:43:55 +0000 Subject: [issue40000] Improve AST validation for Constant nodes In-Reply-To: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> Message-ID: <1584643435.11.0.0860926728113.issue40000@roundup.psfhosted.org> STINNER Victor added the comment: > _PyType_Name(Py_TYPE(value))) Why truncating the type name in the error message? The qualified name (don't call _PyType_Name()) should provide more information, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:44:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:44:09 +0000 Subject: [issue33327] Add a method to move messages to IMAPlib In-Reply-To: <1524337803.72.0.682650639539.issue33327@psf.upfronthosting.co.za> Message-ID: <1584643449.01.0.951386772806.issue33327@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:43:57 2020 From: report at bugs.python.org (Palak Kumar Jha) Date: Thu, 19 Mar 2020 18:43:57 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1584643437.78.0.81709165611.issue39994@roundup.psfhosted.org> Change by Palak Kumar Jha : ---------- nosy: +fdrake versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:46:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:46:20 +0000 Subject: [issue39321] AMD64 FreeBSD Non-Debug 3.x: main regrtest process killed by SIGKILL (Signal 9) In-Reply-To: <1578925087.43.0.642221025557.issue39321@roundup.psfhosted.org> Message-ID: <1584643580.32.0.525115884993.issue39321@roundup.psfhosted.org> STINNER Victor added the comment: The bug still occurs time to time. AMD64 FreeBSD Non-Debug 3.x: https://buildbot.python.org/all/#/builders/214/builds/475 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:48:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:48:34 +0000 Subject: [issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process In-Reply-To: <1583504548.68.0.765659096989.issue39877@roundup.psfhosted.org> Message-ID: <1584643714.54.0.835494342817.issue39877@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a36adfa6bbf5e612a4d4639124502135690899b8 by Victor Stinner in branch 'master': bpo-39877: 4th take_gil() fix for daemon threads (GH-19080) https://github.com/python/cpython/commit/a36adfa6bbf5e612a4d4639124502135690899b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:48:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 18:48:34 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584643714.42.0.185147095365.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a36adfa6bbf5e612a4d4639124502135690899b8 by Victor Stinner in branch 'master': bpo-39877: 4th take_gil() fix for daemon threads (GH-19080) https://github.com/python/cpython/commit/a36adfa6bbf5e612a4d4639124502135690899b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:56:52 2020 From: report at bugs.python.org (Maxwell Bernstein) Date: Thu, 19 Mar 2020 18:56:52 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584644212.65.0.354857666108.issue27307@roundup.psfhosted.org> Maxwell Bernstein added the comment: Looks like the patch solves my problem, so I am going to update my PR sometime today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 14:59:47 2020 From: report at bugs.python.org (Ram Rachum) Date: Thu, 19 Mar 2020 18:59:47 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584644387.33.0.133440547498.issue40016@roundup.psfhosted.org> Ram Rachum added the comment: I'm gonna look past the rudeness, and I'll just say that if I was tripped up by this, after 11 years of working with Python and the re module, then people in a beginner or intermediate level could be tripped up by this as well. Here's another, simpler suggestion for preventing confusion. Replace this line in the docstring: (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below). With this line: (?aiLmsux) Apply flags to the entire pattern, allowing small tweaks to the matching logic (details below). There's no reason to mention the letters there because they're already mentioned. And it's helpful to add a short explanation, like the other entries in that list. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 15:05:08 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 19 Mar 2020 19:05:08 +0000 Subject: [issue39969] Remove Param expression context from AST In-Reply-To: <1584284182.17.0.0536293535661.issue39969@roundup.psfhosted.org> Message-ID: <1584644708.94.0.638490444138.issue39969@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Batuhan: You maybe want to propose a fix there. It shouldn't be hard to fix the issue. Serhiy has an open PR about adding some dummy classes that will represent recent deletions like Suite, Param and AugStore/Load. https://github.com/python/cpython/pull/19056 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 15:14:59 2020 From: report at bugs.python.org (Russell Owen) Date: Thu, 19 Mar 2020 19:14:59 +0000 Subject: [issue40017] Please support CLOCK_TAI in the time module. Message-ID: <1584645299.09.0.45620556685.issue40017@roundup.psfhosted.org> New submission from Russell Owen : It is becoming common (at least in astronomy) to want to use TAI as a time standard because it is a uniform time with no leap seconds, and differs from UTC (standard computer clock time) by an integer number of seconds that occasionally changes. Linux offers a clock for TAI time: CLOCK_TAI. It would be very helpful to have this constant in the time module, e.g. for calling time.clock_gettime Caveat: linux CLOCK_TAI will return UTC time if the leap second table has not been set up. Both ntp and ptp can be configured to maintain this table. So this is a caveat worth mentioning in the docs. But I hope it is not sufficient reason to deny the request. ---------- components: Library (Lib) messages: 364633 nosy: r3owen priority: normal severity: normal status: open title: Please support CLOCK_TAI in the time module. type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 15:45:50 2020 From: report at bugs.python.org (Alexander Riccio) Date: Thu, 19 Mar 2020 19:45:50 +0000 Subject: [issue25878] CPython on Windows builds with /W3, not /W4 In-Reply-To: <1450224755.83.0.682115702996.issue25878@psf.upfronthosting.co.za> Message-ID: <1584647150.46.0.654769200748.issue25878@roundup.psfhosted.org> Alexander Riccio added the comment: Ok, so I finally have some proper time to work on this. How would people (who are higher up in python than me, obviously) feel about suppressing most of the warnings via a user macro in Visual Studio? I've found that it's quite easy to add a macro to the project properties (i.e. pyproject), and have it import into the "Disable specific warnings" build options. This keeps our build files hand-crafted (let's keep the hipsters happy!), and consistent. By doing this, I can get it down to ~100 warnings, which are essentially code that we may want to keep an eye on. The following warnings are essentially always spurious for python. C4100 is everywhere, and is nearly always benign, but would still require a lot of careful inspection to determine it its truly on purpose. C4127 is fine since C doesn't have `constexpr`, let alone `if constexpr`, and it's just easier to use if statements than `#ifdef`s everywhere. C4152 is used in every module exports array. C4100 (unreferenced formal parameter) https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4100?view=vs-2019 C4115 'type' : named type definition in parentheses https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-1-and-4-c4115?view=vs-2019 C4127 conditional expression is constant https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4127?view=vs-2019 C4131 'function' : uses old-style declarator https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4131?view=vs-2019 C4152 non standard extension, function/data ptr conversion in expression https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4152?view=vs-2019 These are usually spurious, since zero-sized arrays are common across the C world, and is one of several ways of implementing dynamic structs (e.g. unsized arrays, ANYSIZE_ARRAY, etc...). C4204 and C4221 exist all over the place, and are probably fine as long as we don't make any lifetime mistakes, which of course is a solved problem in C. Instances of C4244 should each be individually inspected carefully since they could be bugs, but there are way too many of them to allow the warning right now. C4200 nonstandard extension used : zero-sized array in struct/union https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-2-and-4-c4200?view=vs-2019 C4201 nonstandard extension used : nameless struct/union https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4201?view=vs-2019 C4204 nonstandard extension used : non-constant aggregate initializer https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4204?view=vs-2019 C4221 nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4221?view=vs-2019 C4232 nonstandard extension used : 'identifier' : address of dllimport 'dllimport' is not static, identity not guaranteed https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4232?view=vs-2019 C4244 'conversion' conversion from 'type1' to 'type2', possible loss of data https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-3-and-4-c4244?view=vs-2019 C4245 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4245?view=vs-2019 Instances of C4389 should each be individually inspected carefully since they could be bugs, but there are way too many of them to allow the warning right now. C4389 'operator' : signed/unsigned mismatch https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4389?view=vs-2019 Instances of C4456 and C4457 are likely ok given the length of many CPython functions, but should be inspected for mistakes. There are lots of places where `i` and such are used as variables, and it's there's no way to know if the author intended it. C4456 declaration of 'identifier' hides previous local declaration https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4456?view=vs-2019 C4457 declaration of 'identifier' hides function parameter https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4457?view=vs-2019 Instances of C4701 occur pretty frequently around code that initializes C objects with the funky PyArg_ParseTuple format string mechanism, since the compiler has no built in support for understanding custom format strings. Personally, I would support zero-initializing these variables. Would it break anything? I assume there's a performance impact, but the compiler can't see that across translation units. If there were some other way to enforce proper variable initialization other than zeroing, that would work too. We could ABSOLUTLEY use SAL for this to get the performance benefit of not zero initializing everything and statically checking if the functions are being used correctly, but I doubt there's community support for that. 4706 is addressed already. 4702 is everywhere, and would require a lot of inspection to suppress the warning. C4701 Potentially uninitialized local variable 'name' used https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4701?view=vs-2019 C4702 unreachable code https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4702?view=vs-2019 C4703 Potentially uninitialized local pointer variable 'name' used https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4703?view=vs-2019 C4706 assignment within conditional expression https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706?view=vs-2019 I could submit a patch to set up the macro with a few warnings that we can all agree on, and not turn on W4 yet, or I can submit a patch with those few warnings disabled and W4 enabled but very noisy builds. What is preferred? List formatted for macro: 4100;4115;4127;4131;4152;4200;4201;4204;4221;4232;4244;4245;4389;4456;4457;4701;4702;4703;4706 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 16:19:19 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 19 Mar 2020 20:19:19 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584649159.96.0.0274847446188.issue22699@roundup.psfhosted.org> Steve Dower added the comment: So ultimately this is a major sysconfig design flaw, and it likely requires a rewrite. The mix of information sources between _sysconfigdata (even when overriding the name and PYTHONPATH) and the Makefile, and the order in which you can rely them to be loaded (you can't) and the fact that INSTALL_SCHEMES depends on _neither_ (it only uses the running interpreter's sys module) means you can't possibly get a coherent view of the settings for anything other than the running interpreter. Since we need something else for cross-compiling, we should either fix sysconfig so that it's possible to override the source of information reliably, or we avoid using it completely for building the CPython extension modules. The former would likely help third-party cross-compilation more. I'm not sure who needs to be in on this, so I'll post to python-dev before going any further. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 16:28:05 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 19 Mar 2020 20:28:05 +0000 Subject: [issue25878] CPython on Windows builds with /W3, not /W4 In-Reply-To: <1450224755.83.0.682115702996.issue25878@psf.upfronthosting.co.za> Message-ID: <1584649685.26.0.540002147027.issue25878@roundup.psfhosted.org> Steve Dower added the comment: Thanks for all that work! We definitely don't want a noisy build to be merged, but if you submit a PR with only your most confident suppressions then it'll be easier for us to look at the others and see which are scary/not-scary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 16:37:23 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Mar 2020 20:37:23 +0000 Subject: [issue40017] Please support CLOCK_TAI in the time module. In-Reply-To: <1584645299.09.0.45620556685.issue40017@roundup.psfhosted.org> Message-ID: <1584650243.45.0.119010294813.issue40017@roundup.psfhosted.org> Benjamin Peterson added the comment: I think we could certainly take a patch to expose that constant if libc/kernel headers expose it. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 16:43:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 20:43:09 +0000 Subject: [issue40017] Please support CLOCK_TAI in the time module. In-Reply-To: <1584645299.09.0.45620556685.issue40017@roundup.psfhosted.org> Message-ID: <1584650589.53.0.679878484049.issue40017@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 16:55:46 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Mar 2020 20:55:46 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e Message-ID: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> New submission from Benjamin Peterson : ====================================================================== ERROR: test_ciphers (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2120, in test_ciphers s.connect(self.server_addr) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_connect (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 1944, in test_connect s.connect(self.server_addr) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_connect_cadata (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2062, in test_connect_cadata s.connect(self.server_addr) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2041, in test_connect_capath s.connect(self.server_addr) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2002, in test_connect_with_context s.connect(self.server_addr) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2107, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 2272, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1484, in get_server_certificate with context.wrap_socket(sock) as sslsock: File "/home/benjamin/repos/cpython/Lib/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1040, in _create self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_session_handling (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 4346, in test_session_handling s.connect((HOST, server.port)) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_tls_unique_channel_binding (test.test_ssl.ThreadedTests) Test tls-unique channel binding. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/benjamin/repos/cpython/Lib/test/test_ssl.py", line 3922, in test_tls_unique_channel_binding s.connect((HOST, server.port)) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/benjamin/repos/cpython/Lib/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ---------------------------------------------------------------------- ---------- assignee: christian.heimes components: SSL messages: 364638 nosy: benjamin.peterson, christian.heimes priority: normal severity: normal status: open title: test_ssl fails with OpenSSL 1.1.1e versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 17:18:03 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 19 Mar 2020 21:18:03 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584652683.69.0.371583565943.issue22699@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:19:18 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Mar 2020 23:19:18 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584659958.36.0.686240385499.issue40018@roundup.psfhosted.org> Benjamin Peterson added the comment: I think this is caused by their EOF change: https://github.com/openssl/openssl/issues/10880 read() now sometimes gives you the infamous OSError errno 0 rather than b'' at the end of the stream. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:20:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 23:20:34 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized Message-ID: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> New submission from STINNER Victor : On my PR 19077 which changes Python/ceval.c, test_gdb fails on Travis CI with Python compiled with clang -Og. The -Og optimization level is a compromise between performance and the ability to debug Python. The problem is that gdb fails to retrieve some information and so test_gdb fails. I proposed bpo-38350 "./configure --with-pydebug should use -O0 rather than -Og", but the status quo is to continue to use -Og by default. See examples of test_gdb failures from PR 19077 below. I propose to skip a test if one of the follow pattern is found in gdb output: * '', * '(frame information optimized out)', * 'Unable to read information on python frame', ====================================================================== FAIL: test_basic_command (test.test_gdb.PyListTests) Verify that the "py-list" command works ---------------------------------------------------------------------- (...) AssertionError: (...) 'Breakpoint 1 at 0x5aabf1: file Python/bltinmodule.c, line 1173. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Breakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:1173 1173\t PyObject *id = PyLong_FromVoidPtr(v); Unable to read information on python frame ' did not end with ' 5 6 def bar(a, b, c): 7 baz(a, b, c) 8 9 def baz(*args): >10 id(42) 11 12 foo(1, 2, 3) ' ====================================================================== FAIL: test_bt (test.test_gdb.PyBtTests) Verify that the "py-bt" command works ---------------------------------------------------------------------- (...) AssertionError: 'Breakpoint 1 at 0x5aabf1: file Python/bltinmodule.c, line 1173. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Breakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:1173 1173\t PyObject *id = PyLong_FromVoidPtr(v); Traceback (most recent call first): (frame information optimized out) File "/home/travis/build/python/cpython/Lib/test/gdb_sample.py", line 7, in bar baz(a, b, c) File "/home/travis/build/python/cpython/Lib/test/gdb_sample.py", line 4, in foo bar(a, b, c) (frame information optimized out) ' did not match '^.* Traceback \\(most recent call first\\): File ".*gdb_sample.py", line 10, in baz id\\(42\\) File ".*gdb_sample.py", line 7, in bar baz\\(a, b, c\\) File ".*gdb_sample.py", line 4, in foo bar\\(a, b, c\\) File ".*gdb_sample.py", line 12, in foo\\(1, 2, 3\\) ' ---------- components: Tests messages: 364640 nosy: vstinner priority: normal severity: normal status: open title: test_gdb should better detect when Python is optimized versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:30:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 23:30:59 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1584660659.71.0.889542282209.issue40019@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18440 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:33:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Mar 2020 23:33:21 +0000 Subject: [issue38350] ./configure --with-pydebug should use -O0 rather than -Og In-Reply-To: <1570034107.68.0.232468214894.issue38350@roundup.psfhosted.org> Message-ID: <1584660801.73.0.0481918724912.issue38350@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-40019: "test_gdb should better detect when Python is optimized". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:37:48 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Mar 2020 23:37:48 +0000 Subject: [issue39953] Let's update ssl error codes In-Reply-To: <1584072470.83.0.437860249809.issue39953@roundup.psfhosted.org> Message-ID: <1584661068.45.0.780908386315.issue39953@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- keywords: +patch nosy: +benjamin.peterson nosy_count: 6.0 -> 7.0 pull_requests: +18441 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 19:49:45 2020 From: report at bugs.python.org (Maxwell Bernstein) Date: Thu, 19 Mar 2020 23:49:45 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1584661785.93.0.931886978923.issue27307@roundup.psfhosted.org> Maxwell Bernstein added the comment: Okay, well it doesn't provide the desired behavior of raising the error when switching back and forth between manual and auto numbering, so I am looking into that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 20:37:09 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 20 Mar 2020 00:37:09 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584664629.8.0.00898383536049.issue39939@roundup.psfhosted.org> Dennis Sweeney added the comment: Here is a draft PEP -- I believe it needs a Core Developer sponsor now? ---------- Added file: https://bugs.python.org/file48983/pep-9999.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 20:58:27 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 20 Mar 2020 00:58:27 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash Message-ID: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> New submission from Alexander Riccio : growable_comment_array_add in parsetok.c incorrectly uses realloc, which leaks the array when allocation fails, and then causes a null pointer deref crash later when the array is freed in growable_comment_array_deallocate (the array pointer is dereferenced, passing null to free is fine). It's unlikely that this codepath is reached in normal use, since type comments need to be turned on (via the PyCF_TYPE_COMMENTS compiler flag), but I've managed to replicate the issue by injecting faults with Application Verifier. It's easiest to cause it to fail with a very large number of type comments, but presumably this could also happen with some form of heap fragmentation. The buggy code is: static int growable_comment_array_add(growable_comment_array *arr, int lineno, char *comment) { if (arr->num_items >= arr->size) { arr->size *= 2; arr->items = realloc(arr->items, arr->size * sizeof(*arr->items)); if (!arr->items) { return 0; } } arr->items[arr->num_items].lineno = lineno; arr->items[arr->num_items].comment = comment; arr->num_items++; return 1; } and the correct code would be something like: static int growable_comment_array_add(growable_comment_array *arr, int lineno, char *comment) { if (arr->num_items >= arr->size) { arr->size *= 2; void* new_items_array = realloc(arr->items, arr->size * sizeof(*arr->items)); if (!new_items_array) { return 0; } arr->items = new_items_array; } arr->items[arr->num_items].lineno = lineno; arr->items[arr->num_items].comment = comment; arr->num_items++; return 1; } ---------- components: Interpreter Core messages: 364644 nosy: Alexander Riccio, benjamin.peterson priority: normal severity: normal status: open title: growable_comment_array_add leaks, causes crash type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 21:14:30 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 20 Mar 2020 01:14:30 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1584666870.02.0.450463295801.issue40020@roundup.psfhosted.org> Alexander Riccio added the comment: Sidenote: visual studio was misleading and made this look like a use-after-free for a little while, which was interesting. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 21:48:17 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 20 Mar 2020 01:48:17 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1584668897.06.0.251587339732.issue40020@roundup.psfhosted.org> Change by Alexander Riccio : ---------- keywords: +patch pull_requests: +18442 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:25:20 2020 From: report at bugs.python.org (ThePokestarFan) Date: Fri, 20 Mar 2020 02:25:20 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow Message-ID: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> New submission from ThePokestarFan : If I set up a simple recursion exception function, that calls itself every time an error is raised, Python throws a SIGABRT and crashes due to a "Stack Overflow". def x(): try: raise Exception() except Exception: x() Oddly enough, my system installation of Python 2.7 threw a RuntimeError instead of aborting, which is what I expected. ---------- components: Interpreter Core, macOS files: error.log messages: 364646 nosy: ThePokestarFan, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Throwing an Exception results in stack overflow type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48984/error.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:26:39 2020 From: report at bugs.python.org (ThePokestarFan) Date: Fri, 20 Mar 2020 02:26:39 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow In-Reply-To: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> Message-ID: <1584671199.73.0.781959295582.issue40021@roundup.psfhosted.org> Change by ThePokestarFan : Added file: https://bugs.python.org/file48985/interpter.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:29:52 2020 From: report at bugs.python.org (ThePokestarFan) Date: Fri, 20 Mar 2020 02:29:52 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow In-Reply-To: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> Message-ID: <1584671392.83.0.514853000887.issue40021@roundup.psfhosted.org> Change by ThePokestarFan : Added file: https://bugs.python.org/file48986/python2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:30:56 2020 From: report at bugs.python.org (ThePokestarFan) Date: Fri, 20 Mar 2020 02:30:56 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow In-Reply-To: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> Message-ID: <1584671456.75.0.981875012542.issue40021@roundup.psfhosted.org> Change by ThePokestarFan : Added file: https://bugs.python.org/file48987/program.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:33:20 2020 From: report at bugs.python.org (ThePokestarFan) Date: Fri, 20 Mar 2020 02:33:20 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow In-Reply-To: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> Message-ID: <1584671600.26.0.667013825454.issue40021@roundup.psfhosted.org> ThePokestarFan added the comment: I tested the program against my 3.8 installation and got the same error. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:37:12 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 20 Mar 2020 02:37:12 +0000 Subject: [issue40021] Throwing an Exception results in stack overflow In-Reply-To: <1584671119.97.0.0188719299435.issue40021@roundup.psfhosted.org> Message-ID: <1584671832.62.0.38706913301.issue40021@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Interpreter aborts when chaining an infinite number of exceptions versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 19 22:45:45 2020 From: report at bugs.python.org (yepan Li) Date: Fri, 20 Mar 2020 02:45:45 +0000 Subject: =?utf-8?b?W2lzc3VlNDAwMjJdIOWFs+S6juWIl+ihqOeahOWfuuehgOeul+azlemXrg==?= =?utf-8?b?6aKY?= Message-ID: <1584672345.36.0.799930749688.issue40022@roundup.psfhosted.org> New submission from yepan Li : English is very poor so I use Chinese, ????????? lis1 = [1,2,3,4,5,6,7,8,9,10]#?????? lislen = len(lis1)#?????? ??lislen(??1)???10 lis2 = []*lislen#???????????????????????? print(lis1)#????????????? for i in lis1:#?i??????1 lis2.insert(lislen,i)#???2??10(lislen)??????i(i???1) lislen = lislen-lislen#?lislen(10) = 10(lislen) - 10(lislen) == 0 #????????lis2.insert(0,i)??????????????? print(lis2) ---------- components: Windows files: Test01.py messages: 364648 nosy: paul.moore, steve.dower, tim.golden, yepan Li, zach.ware priority: normal severity: normal status: open title: ??????????? versions: Python 3.8 Added file: https://bugs.python.org/file48988/Test01.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 00:26:06 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 20 Mar 2020 04:26:06 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584678366.62.0.924861652691.issue39939@roundup.psfhosted.org> Change by Dennis Sweeney : Added file: https://bugs.python.org/file48989/pep-9999.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 00:26:34 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 20 Mar 2020 04:26:34 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584678394.18.0.657039949631.issue39939@roundup.psfhosted.org> Change by Dennis Sweeney : Removed file: https://bugs.python.org/file48983/pep-9999.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 01:31:01 2020 From: report at bugs.python.org (hai shi) Date: Fri, 20 Mar 2020 05:31:01 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584682261.73.0.245842495479.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18444 pull_request: https://github.com/python/cpython/pull/19084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 02:57:26 2020 From: report at bugs.python.org (zd nex) Date: Fri, 20 Mar 2020 06:57:26 +0000 Subject: [issue39672] SIGSEGV crash on shutdown with shelve & c pickle In-Reply-To: <1582019462.33.0.255360625193.issue39672@roundup.psfhosted.org> Message-ID: <1584687446.42.0.250665047002.issue39672@roundup.psfhosted.org> zd nex added the comment: Hello, so I was trying to figure out where actually is problem is. As I do not think it is in shelve itself. So I have made different method for __setitem__ on shelve and I have found that it is actually in pickle.dump > Here is code which I have used def __setitem__(self, key, value): if self.writeback: self.cache[key] = value f = BytesIO() print("set") p = pickle.Pickler(f, self._protocol) try: print("before dumps - > crash",value) p.dump(value) print("after dump > will not be printed on crash") except Exception as e: print("error set",e) print("after dump",key) self.dict[key.encode(self.keyencoding)] = f.getvalue() print("saved") When in this code user changes p.dump to another method cpython crash does not happen. Can you please try to see if it is like that? ---------- components: +Interpreter Core, ctypes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 03:23:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 07:23:39 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1584689019.66.0.401805634154.issue40019@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7bf069b6110278102c8f4719975a5eb5a5af25f9 by Victor Stinner in branch 'master': bpo-40019: Skip test_gdb if Python was optimized (GH-19081) https://github.com/python/cpython/commit/7bf069b6110278102c8f4719975a5eb5a5af25f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 03:39:00 2020 From: report at bugs.python.org (tzickel) Date: Fri, 20 Mar 2020 07:39:00 +0000 Subject: [issue40023] os.writev and socket.sendmsg return value are not ideal Message-ID: <1584689940.47.0.494767367712.issue40023@roundup.psfhosted.org> New submission from tzickel : os.writev and socket.sendmsg accept an iterable but the return value is number of bytes sent. That is not helpful as the user will have to write manual code to figure out which part of the iterable was not sent. I propose to make a version of the functions where: 1. The return value is an iterable of the leftovers (including a maybe one-time memoryview into an item who has been partly-sent). 2. There is a small quirk where writev accepts only sequences but sendmsg accepts any iterable, which causes them not to behave the same for no good reason. 3. Do we want an sendmsgall like sendall in socket, where it doesn't give up until everything is sent ? 4. Today trying to use writev / sendmsg to be fully complaint requires checking the number of input items in the iterable to not go over IOV_MAX, maybe the python version of the functions should handle this automatically (and if it overflows, return the extra in leftovers) ? Should the functions be the current one with an optional argument (return_leftovers) or a new function altogether. ---------- components: Library (Lib) messages: 364651 nosy: larry, tzickel priority: normal severity: normal status: open title: os.writev and socket.sendmsg return value are not ideal type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:03:21 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 08:03:21 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584691401.72.0.835997318977.issue39797@roundup.psfhosted.org> miss-islington added the comment: New changeset 2de7ac97981c30e9c1001b05a771f52a41772c54 by amaajemyfren in branch 'master': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/2de7ac97981c30e9c1001b05a771f52a41772c54 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:03:42 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 08:03:42 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584691422.06.0.974705487058.issue39797@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18446 pull_request: https://github.com/python/cpython/pull/19086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:03:34 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 08:03:34 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584691414.6.0.524201845989.issue39797@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18445 pull_request: https://github.com/python/cpython/pull/19085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:08:56 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 08:08:56 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584691736.19.0.943541552104.issue39797@roundup.psfhosted.org> miss-islington added the comment: New changeset 29723368e797f36ba8940f25b6e677852b7313b2 by Miss Islington (bot) in branch '3.8': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/29723368e797f36ba8940f25b6e677852b7313b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:08:51 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 08:08:51 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584691731.56.0.234201478772.issue39797@roundup.psfhosted.org> miss-islington added the comment: New changeset 64937d308c71a5c95627b0a0d0574d164c0cf30a by Miss Islington (bot) in branch '3.7': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/64937d308c71a5c95627b0a0d0574d164c0cf30a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:15:34 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Mar 2020 08:15:34 +0000 Subject: [issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever() In-Reply-To: <1582981466.61.0.0832265256128.issue39797@roundup.psfhosted.org> Message-ID: <1584692134.21.0.39213089496.issue39797@roundup.psfhosted.org> Ned Deily added the comment: Thank you for your PR! ---------- nosy: +ned.deily resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:16:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 08:16:58 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584692218.88.0.269018506353.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8334f30a74abcf7e469b901afc307887aa85a888 by Hai Shi in branch 'master': bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19084) https://github.com/python/cpython/commit/8334f30a74abcf7e469b901afc307887aa85a888 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:26:52 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Mar 2020 08:26:52 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584692812.56.0.729953836014.issue40011@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg364586 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:27:02 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Mar 2020 08:27:02 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584692822.02.0.366758223093.issue40011@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg364593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:27:45 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Mar 2020 08:27:45 +0000 Subject: [issue40011] Tkinter widget events are of type Tuple In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584692865.07.0.399857368141.issue40011@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +gpolo, serhiy.storchaka type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:27:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 08:27:46 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584692866.99.0.879299112531.issue39939@roundup.psfhosted.org> STINNER Victor added the comment: The PEP is a good start. Can you try to convert it to a PR on https://github.com/python/peps/ ? It seems like the next available PEP number is 616. I would prefer to leave comments on a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:29:15 2020 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 20 Mar 2020 08:29:15 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584692955.89.0.179838337761.issue22699@roundup.psfhosted.org> Xavier de Gaye added the comment: Steve wrote: > In my build, I've set PYTHON_FOR_BUILD=python3.8 This will not work, PYTHON_FOR_BUILD when cross-compiling is set by configure as: PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp FWIW there is no problem cross-compiling Python and the standard library extension modules on Android, see for example the 'termux' Android application and its Python build. On the other hand there are problems when cross-compiling third party extension modules due to: * PYTHON_FOR_BUILD must be set correctly. * distutils is still refering to sysconfig values of the build system instead of the target system. But setup.py handles this correctly and does not need to be modified. ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:29:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 08:29:20 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584692960.05.0.618796035084.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: New changeset da2914db4b6f786a1e9f0b424efeeb6ca9418912 by Victor Stinner in branch 'master': bpo-40010: Pass tstate to ceval GIL functions (GH-19077) https://github.com/python/cpython/commit/da2914db4b6f786a1e9f0b424efeeb6ca9418912 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:30:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 08:30:59 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1584693059.67.0.170675899596.issue40019@roundup.psfhosted.org> STINNER Victor added the comment: The fix works as expected: test_gdb passed on PR 19077. Well, likely because a few tests have been skipped. I don't think that in test_gdb can do better than skipping the test if gdb fails to read debug information. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 04:38:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 08:38:42 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584693522.4.0.647897479796.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18447 pull_request: https://github.com/python/cpython/pull/19087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 05:39:49 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 20 Mar 2020 09:39:49 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function Message-ID: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> New submission from Dong-hee Na : See: https://github.com/python/cpython/pull/19084#discussion_r395486583 ---------- assignee: corona10 components: C API messages: 364661 nosy: corona10, vstinner priority: normal severity: normal status: open title: Add _PyModule_AddType private helper function type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 05:42:24 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 20 Mar 2020 09:42:24 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1584697344.75.0.26985970808.issue40024@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +18448 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 05:56:01 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 09:56:01 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584698161.86.0.506598191356.issue22699@roundup.psfhosted.org> Steve Dower added the comment: Is that epic line automatically generated? It didn't work for me for some reason (was trying to launch the built Python, not the host). Even so, I got to the point of filling in all those values manually while testing sysconfig, and while I'm 100% sure sysconfig still gave some wrong values, I'm 99% sure they weren't being fixed up by setup.py. Need to get back on my work machine to check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 06:35:26 2020 From: report at bugs.python.org (Amir Mohamadi) Date: Fri, 20 Mar 2020 10:35:26 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1584700526.51.0.896163033619.issue39966@roundup.psfhosted.org> Amir Mohamadi added the comment: I'd like to work on it. Should I add tests to 'Lib/unittest/test/testmock/testmock.py'?? ---------- nosy: +Amir _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 06:42:55 2020 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Fri, 20 Mar 2020 10:42:55 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584700975.65.0.0610818660352.issue39939@roundup.psfhosted.org> Walter D?rwald added the comment: IMHO the names don't fit Pythons current naming scheme, so what about naming them "lchop" and "rchop"? ---------- nosy: +doerwalter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 07:12:14 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 20 Mar 2020 11:12:14 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1584702734.62.0.198210262358.issue40020@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 07:25:04 2020 From: report at bugs.python.org (Luis E.) Date: Fri, 20 Mar 2020 11:25:04 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() Message-ID: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> New submission from Luis E. : I ran into this issue when attempting to add a custom _generate_next_value_ method to an existing Enum. Adding the method definition to the bottom of the class causes it to not be called at all: from enum import Enum, auto class E(Enum): A = auto() B = auto() def _generate_next_value_(name, *args): return name E.B.value # Returns 2, E._generate_next_value_ is not called class F(Enum): def _generate_next_value_(name, *args): return name A = auto() B = auto() F.B.value # Returns 'B', as intended I do not believe that the order of method/attribute definition should affect the behavior of the class, or at least it should be mentioned in the documentation. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 364665 nosy: docs at python, edd07 priority: normal severity: normal status: open title: enum: _generate_next_value_ is not called if its definition occurs after calls to auto() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 07:27:27 2020 From: report at bugs.python.org (Luis E.) Date: Fri, 20 Mar 2020 11:27:27 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584703647.77.0.501141149819.issue40025@roundup.psfhosted.org> Change by Luis E. : ---------- components: -Documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 08:39:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 12:39:06 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584707946.22.0.653395427393.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d2a8e5b42c5e9c4e745a0589043a8aebb49f8ca2 by Victor Stinner in branch 'master': bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter (GH-19087) https://github.com/python/cpython/commit/d2a8e5b42c5e9c4e745a0589043a8aebb49f8ca2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:02:57 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 13:02:57 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584709377.99.0.620355198956.issue27807@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18449 pull_request: https://github.com/python/cpython/pull/19089 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:04:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 13:04:25 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584709465.31.0.374428866571.issue27807@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18450 pull_request: https://github.com/python/cpython/pull/19090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:13:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 13:13:01 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584709981.3.0.769966738865.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18451 pull_request: https://github.com/python/cpython/pull/19091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:23:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 13:23:44 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584710624.45.0.320388397281.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18452 pull_request: https://github.com/python/cpython/pull/19092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:35:17 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 20 Mar 2020 13:35:17 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584711317.74.0.660867682185.issue40025@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 09:50:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 13:50:38 +0000 Subject: [issue40010] Inefficient sigal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584712238.77.0.436008831138.issue40010@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d83168854e19d0381fa57db25fca6c622917624f by Victor Stinner in branch 'master': bpo-40010: Optimize pending calls in multithreaded applications (GH-19091) https://github.com/python/cpython/commit/d83168854e19d0381fa57db25fca6c622917624f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:10:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:10:20 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584713420.46.0.997029354782.issue27807@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ba26bf30940f4347fedcf8ebc374c6e2dc375afa by Victor Stinner in branch '3.8': [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090) https://github.com/python/cpython/commit/ba26bf30940f4347fedcf8ebc374c6e2dc375afa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:10:37 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 14:10:37 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584713437.52.0.448284186288.issue27807@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18453 pull_request: https://github.com/python/cpython/pull/19093 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:18:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:18:47 +0000 Subject: [issue40010] Inefficient signal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1584713927.22.0.16936193252.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Inefficient sigal handling in multithreaded applications -> Inefficient signal handling in multithreaded applications _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:19:02 2020 From: report at bugs.python.org (Daniel) Date: Fri, 20 Mar 2020 14:19:02 +0000 Subject: [issue40026] Create render_*_diff variants to the *_diff functions in difflib Message-ID: <1584713942.67.0.900708769232.issue40026@roundup.psfhosted.org> New submission from Daniel : Currently difflib offers no way to synthesize a diff output without having to assemble the original and modified strings and then asking difflib to calculate the diff. It would be nice if I could just call a `render_unified_diff(a, b, grouped_opcodes)` and get a diff output. This is useful when I'm synthesizing a patch dynamically and I don't necessarily want to load the entire original file and apply the changes. One example usage would be something like: ``` def make_patch(self): # simplified input for synthesizing the diff a = [] b = [] include_lines = [] for header, _ in self.missing.items(): include_lines.append(f"#include <{header}>\n") while len(b) < self.line: b.append(None) b.extend(include_lines) opcodes = [ [('insert', self.line, self.line, self.line, self.line + len(include_lines))] ] diff = render_unified_diff( a, b, opcodes, fromfile=os.path.join('a', self.filename), tofile=os.path.join('b', self.filename), ) return ''.join(diff) ``` ---------- components: Library (Lib) messages: 364669 nosy: pablogsal, ruoso priority: normal severity: normal status: open title: Create render_*_diff variants to the *_diff functions in difflib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:20:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:20:31 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1584714031.33.0.526322348474.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: I partially reimplemented commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 in the following issues: * bpo-39984: Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval * bpo-40010: Inefficient signal handling in multithreaded applications * bpo-39877: Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process * bpo-37127: Handling pending calls during runtime finalization may cause problems. I cannot give a list of commits, I made too many of them :-D The most important change is: commit 50e6e991781db761c496561a995541ca8d83ff87 Author: Victor Stinner Date: Thu Mar 19 02:41:21 2020 +0100 bpo-39984: Move pending calls to PyInterpreterState (GH-19066) If Py_AddPendingCall() is called in a subinterpreter, the function is now scheduled to be called from the subinterpreter, rather than being called from the main interpreter. Each subinterpreter now has its own list of scheduled calls. * Move pending and eval_breaker fields from _PyRuntimeState.ceval to PyInterpreterState.ceval. * new_interpreter() now calls _PyEval_InitThreads() to create pending calls lock. * Fix Py_AddPendingCall() for subinterpreters. It now calls _PyThreadState_GET() which works in a subinterpreter if the caller holds the GIL, and only falls back on PyGILState_GetThisThreadState() if _PyThreadState_GET() returns NULL. My plan is now to fix pending calls in subinterpreters. Currently, they are only executed in the "main thread"... _PyRuntimeState.main_thread must be moved to PyInterpreterState, as it was done in commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465. This issue shows that it's dangerous to change too many things at once. Python internals were still very fragile: bpo-39877 and and bpo-37127 are good examples of that. I'm trying to move *very slowly*. Move pieces one by one. I added _Py_ThreadCanHandlePendingCalls() function in commit d83168854e19d0381fa57db25fca6c622917624f (bpo-40010): it should ease moving _PyRuntimeState.main_thread to PyInterpreterState. I also added _Py_ThreadCanHandleSignals() in a previous commit, so it's easier to change which thread is allowed or not to handle signals and pending calls. I also plan to revisit (removal) pending_calls.finalizing added by commit 842a2f07f2f08a935ef470bfdaeef40f87490cfc (bpo-33608). I plan to work on that in bpo-37127. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:23:10 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 20 Mar 2020 14:23:10 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584714190.14.0.85882537014.issue39939@roundup.psfhosted.org> Dennis Sweeney added the comment: https://github.com/python/peps/pull/1332 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:28:02 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Mar 2020 14:28:02 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584714482.14.0.492386582084.issue27807@roundup.psfhosted.org> miss-islington added the comment: New changeset 6056b7b84f2f77e2c3b49a18cfebe061fc23a08a by Miss Islington (bot) in branch '3.7': [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090) https://github.com/python/cpython/commit/6056b7b84f2f77e2c3b49a18cfebe061fc23a08a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:32:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:32:53 +0000 Subject: [issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure In-Reply-To: <1471644323.86.0.0589241929234.issue27807@psf.upfronthosting.co.za> Message-ID: <1584714773.43.0.663180656689.issue27807@roundup.psfhosted.org> STINNER Victor added the comment: The issue is now fixed in 3.7, 3.8 and master branches. Thanks Chris Angelico for the bug report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:51:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:51:53 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1584715913.0.0.495297608242.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b by Victor Stinner in branch 'master': bpo-39947: Add PyThreadState_GetFrame() function (GH-19092) https://github.com/python/cpython/commit/fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 10:52:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 14:52:33 +0000 Subject: [issue39946] Is it time to remove _PyThreadState_GetFrame() hook? In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584715953.44.0.46664110034.issue39946@roundup.psfhosted.org> STINNER Victor added the comment: I added PyThreadState_GetFrame() function in bpo-39947: commit fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 11:24:52 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 20 Mar 2020 15:24:52 +0000 Subject: [issue40026] Create render_*_diff variants to the *_diff functions in difflib In-Reply-To: <1584713942.67.0.900708769232.issue40026@roundup.psfhosted.org> Message-ID: <1584717892.68.0.537265242826.issue40026@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 11:50:52 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Mar 2020 15:50:52 +0000 Subject: [issue40026] Create render_*_diff variants to the *_diff functions in difflib In-Reply-To: <1584713942.67.0.900708769232.issue40026@roundup.psfhosted.org> Message-ID: <1584719452.82.0.360273634985.issue40026@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:01:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:01:11 +0000 Subject: [issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1584720071.26.0.227622316834.issue38865@roundup.psfhosted.org> STINNER Victor added the comment: I changed my mind. I managed to implement bpo-39984 without needing my PR 19063, so I closed it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:22:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:22:25 +0000 Subject: [issue39946] Is it time to remove _PyThreadState_GetFrame() hook? In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584721345.33.0.363512086919.issue39946@roundup.psfhosted.org> STINNER Victor added the comment: It looks safe to remove this feature. I failed to find any recent user of _PyThreadState_GetFrame. Moreover, _PyRuntime.getframe and _PyThreadState_GetFrame have been moved to the internal C API in Python 3.7. This C API was not accessible by third-party projects in Python 3.7. The internal C API can only be used by third-party projects since Python 3.8 and it's tricky to use it... on purpose. I don't recall any complain about _PyThreadState_GetFrame becoming inaccessible. -- I searched for "_PyThreadState_GetFrame" in C code on GitHub. I only found copies of Python/pystate.c files in the first 10 pages of search results, with one exception. I found one file: https://github.com/Mistobaan/pdb-clone/blob/517f6d19902b64395b4c7218cbbbecfa5a1de607/lib/pdb_clone/_pdbhandler-py27.c It's an old (latest commit on Mar 31, 2015) debugger project written by Xavier de Gaye. It seems like the following flavor is more recent (latest commit on Apr 20, 2019): https://github.com/corpusops/pdbclone/ Note: the project contains 4 .c files, but only _pdbhandler-py27.c uses _PyThreadState_GetFrame: _pdbhandler-py3.c which is for Python 3 doesn't use _PyThreadState_GetFrame. But Python 2.7 reached its end of life, it's no longer supported. Copy of the code: /* Disable the Python 2 restricted mode in the subinterpreter (see * PyEval_GetRestricted()) that prevents linecache to open the source * files and prevents attribute access. */ saved_globals = mainstate->frame->f_globals; saved_locals = mainstate->frame->f_locals; saved_tstate_getframe = _PyThreadState_GetFrame; mainstate->frame->f_globals = globals; mainstate->frame->f_locals = locals; _PyThreadState_GetFrame = threadstate_getframe; pdbhandler_tstate = mainstate; So _PyThreadState_GetFrame was used to "disable the Python 2 restricted mode", but this mode has been removed from Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:26:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:26:09 +0000 Subject: [issue39946] Is it time to remove _PyThreadState_GetFrame() hook? In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584721569.71.0.116810843298.issue39946@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18454 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:27:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:27:56 +0000 Subject: [issue39946] Remove _PyThreadState_GetFrame In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584721676.26.0.268985130729.issue39946@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Is it time to remove _PyThreadState_GetFrame() hook? -> Remove _PyThreadState_GetFrame _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:38:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:38:49 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584722329.69.0.319706425149.issue39998@roundup.psfhosted.org> STINNER Victor added the comment: PyEval_AcquireLock() is declared with Py_DEPRECATED(3.2) since Python 3.7 PyEval_ReleaseLock() is not declared with Py_DEPRECATED(), but PyEval_ReleaseLock() cannot be used without PyEval_AcquireLock(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:47:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:47:01 +0000 Subject: [issue39946] Remove _PyThreadState_GetFrame In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584722821.91.0.421949106938.issue39946@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6723e933c4d90a408cf3818362a0e4de6d84c932 by Victor Stinner in branch 'master': bpo-39946: Remove _PyThreadState_GetFrame (GH-19094) https://github.com/python/cpython/commit/6723e933c4d90a408cf3818362a0e4de6d84c932 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:49:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:49:31 +0000 Subject: [issue39946] Remove _PyThreadState_GetFrame In-Reply-To: <1584034848.74.0.766421748348.issue39946@roundup.psfhosted.org> Message-ID: <1584722971.43.0.17704293349.issue39946@roundup.psfhosted.org> STINNER Victor added the comment: I removed the function. FYI I asked Armin Rigo, the author of _PyThreadState_GetFrame, if PyPy uses it: no, it doesn't. Moreover, psyco project is outdated, only supports Python 2.6 and older, and is superseded by PyPy. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:53:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 16:53:23 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584723203.48.0.226292573331.issue39939@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/python/peps/pull/1332 Thank you. And good luck for handling incoming discussions on the PEP ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:54:20 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Mar 2020 16:54:20 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584723260.08.0.894361584008.issue39998@roundup.psfhosted.org> Serhiy Storchaka added the comment: We cannot just remove functions from stable ABI. We can undocument them, remove their declaration from header files, but we can't remove the implementation. Just make them always failing. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:55:24 2020 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 20 Mar 2020 16:55:24 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584723324.29.0.944855348093.issue22699@roundup.psfhosted.org> Xavier de Gaye added the comment: > Is that epic line automatically generated? When cross compiling it is generated by the configure script and configure replaces the right hand side of "PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@" of Makefile.pre.in with the generated value into Makefile.pre. I think you may be missing the point that when this 'epic line' is being used then PYTHONPATH points to the location of the sysconfig module that has been newly built for the target platform, and so the values should be correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 12:57:39 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Mar 2020 16:57:39 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584723459.43.0.456931042818.issue39998@roundup.psfhosted.org> Serhiy Storchaka added the comment: See for example _PyTrash_deposit_object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:01:44 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 17:01:44 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584723704.32.0.830964262451.issue22699@roundup.psfhosted.org> Steve Dower added the comment: So it's possible that my first few attempts didn't have a matched build of Python on the host - the cross-build certainly relies on mixing the installed runtime with the source stdlib, so that could have been an early cause of issues. I can only suspect that it was a factor in all the earlier reports too. Maybe we should detect this situation and fail faster? The final problem in my case is that the multiarch paths conflict with the cross-compiling paths. The change below to configure_compiler() got me through a full build: if CROSS_COMPILING: self.add_cross_compiling_paths() - self.add_multiarch_paths() + else: + self.add_multiarch_paths() self.add_ldflags_cppflags() I have no idea whether this is a safe change in general. Anyone able to weigh in? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:16:47 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 17:16:47 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584724607.45.0.262201993768.issue22699@roundup.psfhosted.org> Steve Dower added the comment: The values that are used are (apparently) correct, but most of sysconfig is not. That's very confusing, and makes it difficult to debug. I'm glad I get to maintain the *other* monster (MSBuild) :) I would much rather sysconfig had a single variable pointing directly to whatever source of information it needs to tell everything about any Python install, whether that's _sysconfigdata or something else. But I've also got my stuff working with only a minimal patch, so I'm not too concerned here. I'll go invest my time in improving the Windows cross-compilation support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:19:38 2020 From: report at bugs.python.org (Matthias Klose) Date: Fri, 20 Mar 2020 17:19:38 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584724778.02.0.377804152389.issue22699@roundup.psfhosted.org> Matthias Klose added the comment: I think the patch is wrong. why would you want to differentiate between native and cross builds? There should be a generic way to pick up those for both cross and native builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:21:13 2020 From: report at bugs.python.org (Wayne Davison) Date: Fri, 20 Mar 2020 17:21:13 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 Message-ID: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> New submission from Wayne Davison : There is an inconsistency in re.sub() when substituting at the end of a string using a prior match with a '*' qualifier: the substitution now occurs twice. For example: txt = re.sub(r'\s*\Z', "\n", txt) This should work like txt.rstrip() + "\n", but beginning in 3.7, the re.sub version now matches twice and changes any non-empty whitespace into "\n\n" instead of "\n". (If there is no trailing whitespace it only matches once.) The bug is the same if '$' is used instead of '\Z', but it does not happen if an actual character is specified (e.g. a substitution of r'\s*x' does not substitute twice if x has preceding whitespace). I tested 2.7.17, 3.6.9, 3.7.7, 3.8.2, and 3.9.0a4, and it starts to fail in 3.7.7 and beyond. Attached is a test program. ---------- components: Regular Expressions files: sub-bug.py messages: 364688 nosy: Wayne Davison, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub inconsistency beginning with 3.7 type: behavior versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file48990/sub-bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:21:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:21:43 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584724903.74.0.798653589392.issue39998@roundup.psfhosted.org> STINNER Victor added the comment: Hum, I found multiple projects using PyEval_AcquireLock() and PyEval_ReleaseLock(). Many of them look abandonned. But a few were modified earlier than 1 year old. -- ntripcaster2: Latest commit on Jun 2019 https://github.com/rinex20/ntripcaster2/blob/ef45763c4c0b063e46ef3bbfc9d63bafcd76e421/src/interpreter.c Example: PyEval_AcquireLock (); maininterpreterstate = mainthreadstate->interp; newthreadstate = PyThreadState_New (maininterpreterstate); PyEval_ReleaseLock (); -- I found usage of PyEval_AcquireLock() in an old version of pygame (1.9.1, latest is 1.9.6): PyEval_AcquireLock (); oldstate = PyThreadState_Swap (helper->thread); ... result = PyObject_CallFunction (helper->tell, NULL); ... PyThreadState_Swap (oldstate); PyEval_ReleaseLock (); https://github.com/z-pan/pygame_tankScout/blob/7977cc6756e948c37cb4aa56fb1009a74288b65c/pygame-1.9.1release/src/rwobject.c pygame changed to "PyGILState_Ensure() ... PyGILState_Release()" instead. -- giljoy (Latest commit in 2013): it seems to override symloads using LD_PRELOAD to measure time when the GIL is acquired and released. https://github.com/itamarst/giljoy/blob/master/giljoy.c -- xmlbus: Latest commit in 2014. https://github.com/olger/xmlbus/blob/148692997a481d10827a1aa86dc0ed3d70d84209/server/xmlbusd/pyrunner/pyrunner.c Example: PyEval_AcquireLock(); mainInterpreterState = mainThreadState->interp; PyThreadState_Swap(mainThreadState); myThreadState = PyThreadState_New(mainInterpreterState); PyEval_ReleaseLock(); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:28:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:28:03 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584725283.08.0.330719138335.issue39998@roundup.psfhosted.org> STINNER Victor added the comment: (Trashcan is somehow off-topic here, but let me comment anyway ;-)) > See for example _PyTrash_deposit_object. I know that this one is kept for ABI backward compatibility... but the TRASHCAN API is excluded from the limited API. So I'm not sure that it is worth it to keep _PyTrash_deposit_object() in the ABI. I modified the TRASHCAN API in Python 3.9 to no longer leak implementation details (access PyThreadState structure fields). The implementation now only uses function calls. => commit 38965ec5411da60d312b59be281f3510d58e0cf1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:31:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:31:26 +0000 Subject: [issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions In-Reply-To: <1584488342.57.0.981206411156.issue39998@roundup.psfhosted.org> Message-ID: <1584725486.76.0.49013286419.issue39998@roundup.psfhosted.org> STINNER Victor added the comment: Oh no, PyEval_AcquireLock() and PyEval_ReleaseLock() are part of the limited C API (and so the stable ABI). Sadly, we have to keep them. I close the issue as rejected. > We cannot just remove functions from stable ABI. Alright, sadly it's part of the limited C API :-( > We can undocument them, remove their declaration from header files, but we can't remove the implementation. Just make them always failing. Since I found a few projects using these functions, I'm no longer sure that it's worth it to remove these functions. Continuing to maintain these functions is not really a major maintenance burden right now. So I simply close this issue. If someone disagree, you can propose an implementation of Serhiy's suggestion. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:42:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:42:46 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584726166.79.0.532581067643.issue39360@roundup.psfhosted.org> STINNER Victor added the comment: > Victor, are you OK if we backport both changes to 3.8? Let me look at commit 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6: "bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848)" Calling _PyThreadState_DeleteExcept() in Py_FinalizeEx() is really dangerous. It frees PyThreadState memory of daemon threads. Daemon threads continue to run while Py_FinalizeEx() is running (which takes an unknown amount of time, we only know that it's larger than 0 seconds). When a daemon thread attempts to acquire the GIL, it will likely crash if its PyThreadState memory is freed. This memory can be overriden by another memory allocation, or dereferencing the pointer can trigger a segmentation fault. This change caused multiple regressions in the master branch. I had hard time to fix all crashes: I modified take_gil() 4 times, and I'm still not sure that my fix is correct. I had to modify take_gil() function which acquire the GIL: this function is really fragile and I would prefer to not touch it in a stable branch. See bpo-39877 changes to have an idea of the complexity of the problem. Python finalization is really fragile: https://pythondev.readthedocs.io/finalization.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:44:40 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 17:44:40 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584726280.73.0.677224482588.issue22699@roundup.psfhosted.org> Steve Dower added the comment: > I think the patch is wrong. why would you want to differentiate between native and cross builds? Because the multiarch headers are incompatible with my SDK's headers, and because of the -I ordering they override mine. I tried swapping the order of calls without a difference, but excluding them entirely made it work. I'll happily take suggestions for a better patch. I don't even know what the multiarch headers are for, but I don't seem to need them here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:46:26 2020 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 20 Mar 2020 17:46:26 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1584726386.32.0.73054360435.issue40027@roundup.psfhosted.org> Matthew Barnett added the comment: Duplicate of Issue39687. See https://docs.python.org/3/library/re.html#re.sub and https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:47:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:47:10 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584726430.74.0.108460379705.issue39360@roundup.psfhosted.org> STINNER Victor added the comment: commit 4d96b4635aeff1b8ad41d41422ce808ce0b971c8 "bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296)" "(...) The release_sentinel() function is now called when the C API is still fully working." This change is "safer" than the other one, but there is still a risk of introducing a regression. The problem is that this commit is part of a larger effort to make the Python finalization more reliable. The commit makes sense in the serie of commits pushed into the master branch, but I'm not sure that it makes sense if it's taken alone. I don't have the bandwidth right now to investigate this issue, to identify the root issue, and suggest which commits should be backported or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:49:26 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 20 Mar 2020 17:49:26 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584726566.67.0.245920961103.issue39360@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:49:21 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 20 Mar 2020 17:49:21 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584726561.68.0.331599290261.issue39360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, so sadly it seems that we need to close this issue as is fixed in master but the backport is risky. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:53:25 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 17:53:25 +0000 Subject: [issue22497] msiexec not creating msvcr90.dll with python -2.7.6.msi In-Reply-To: <1411663009.27.0.792160557257.issue22497@psf.upfronthosting.co.za> Message-ID: <1584726805.92.0.841976080085.issue22497@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:56:29 2020 From: report at bugs.python.org (Wayne Davison) Date: Fri, 20 Mar 2020 17:56:29 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1584726989.33.0.892522799736.issue40027@roundup.psfhosted.org> Wayne Davison added the comment: This is not the same thing because the match is anchored, so it is not adjacent to the prior match -- it is the same match. I think that r'\s*\Z' should behave the same way as r'\s*x' due to the anchor point. The current behavior is matching the same \Z twice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 13:58:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 17:58:16 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584727096.74.0.0634473407197.issue39360@roundup.psfhosted.org> STINNER Victor added the comment: If you want to get a reliable behavior, don't rely on destructors. Python finalization is not determistic and destructors can be called while Python is not longer fully functional. Release ressources explicitly. For example, use multiprocessing.Pool with a context manager, or even call close() and join() methods explicitly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:06:18 2020 From: report at bugs.python.org (Wayne Davison) Date: Fri, 20 Mar 2020 18:06:18 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1584727578.25.0.412976472178.issue40027@roundup.psfhosted.org> Wayne Davison added the comment: Another argument in favor of this being a bug, this does not exhibit the same doubling: txt = ' test' txt = re.sub(r'^\s*', '^', txt) That always substitutes once. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:11:24 2020 From: report at bugs.python.org (=?utf-8?q?Arkadiusz_Mi=C5=9Bkiewicz?=) Date: Fri, 20 Mar 2020 18:11:24 +0000 Subject: [issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever In-Reply-To: <1579181024.48.0.144429938254.issue39360@roundup.psfhosted.org> Message-ID: <1584727884.96.0.436441986521.issue39360@roundup.psfhosted.org> Arkadiusz Mi?kiewicz added the comment: So only this test (from first commit) should be added on master to check for further regressions in the area, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:28:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 18:28:54 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584728934.12.0.733794472242.issue39939@roundup.psfhosted.org> STINNER Victor added the comment: Where should I leave comments on the PEP? Do you plan to post it on python-dev soon? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:38:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Mar 2020 18:38:39 +0000 Subject: [issue39380] ftplib uses latin-1 as default encoding In-Reply-To: <1579776260.84.0.333075912412.issue39380@roundup.psfhosted.org> Message-ID: <1584729519.7.0.811129917315.issue39380@roundup.psfhosted.org> STINNER Victor added the comment: I'm now fine with changing the default. But I would still prefer to have an encoding parameter in the constructor. Making these two changes at once now makes sense to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:50:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 18:50:24 +0000 Subject: [issue39963] Subclassing slice objects In-Reply-To: <1584164100.31.0.19477580242.issue39963@roundup.psfhosted.org> Message-ID: <1584730224.19.0.295586542356.issue39963@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> test needed type: -> enhancement versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:52:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 18:52:10 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1584730330.86.0.313554863835.issue39966@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:52:58 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 20 Mar 2020 18:52:58 +0000 Subject: [issue39939] Add str methods to remove prefixes or suffixes In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1584730378.14.0.0397404225395.issue39939@roundup.psfhosted.org> Dennis Sweeney added the comment: Just posted it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 14:58:45 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 20 Mar 2020 18:58:45 +0000 Subject: [issue39380] ftplib uses latin-1 as default encoding In-Reply-To: <1579776260.84.0.333075912412.issue39380@roundup.psfhosted.org> Message-ID: <1584730725.08.0.753578315551.issue39380@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:01:03 2020 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 20 Mar 2020 19:01:03 +0000 Subject: [issue39380] ftplib uses latin-1 as default encoding In-Reply-To: <1579776260.84.0.333075912412.issue39380@roundup.psfhosted.org> Message-ID: <1584730863.21.0.248256975695.issue39380@roundup.psfhosted.org> Giampaolo Rodola' added the comment: +1 from me as well. @SebastianGPedersen could you update the PR (constructor + doc changes)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:07:48 2020 From: report at bugs.python.org (Matthias Klose) Date: Fri, 20 Mar 2020 19:07:48 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584731268.5.0.663457455325.issue22699@roundup.psfhosted.org> Matthias Klose added the comment: the multiarch approach allows you to install libraries and headers for many architectures in the same installation/chroot. This can then be used to cross-build stuff. you can check that on WSL with having Debian or Ubuntu installed. A short reference is https://wiki.debian.org/Multiarch/HOWTO you don't need to build packages, you can build upstream sources as well, just use apt to install the required packages for the target architecture. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:09:21 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 20 Mar 2020 19:09:21 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584731361.64.0.597175570021.issue40025@roundup.psfhosted.org> Ethan Furman added the comment: Immediate solution is to raise an exception if `_generate_next_value_` is defined after members. Possible future solution is to save all member definitions until after class is defined. The exception-raising solution would require a check in `_EnumDict` where `_generate_next_value_` is saved -- if any members already exist, raise. ---------- assignee: docs at python -> ethan.furman keywords: +easy stage: -> needs patch versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:17:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 19:17:32 +0000 Subject: [issue39971] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1584731852.56.0.619542851397.issue39971@roundup.psfhosted.org> Terry J. Reedy added the comment: In think examples should run and that '...' should be replaced by something like "' \n', ''". The blank string looks ahead to the next example, which adds ' if line != ""' to the comprehension. ---------- nosy: +terry.reedy stage: -> needs patch title: Error on documentation - Quick fix. -> Error in functional how-to example versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:25:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 19:25:10 +0000 Subject: [issue39971] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1584732310.48.0.580980866915.issue39971@roundup.psfhosted.org> Terry J. Reedy added the comment: Working on PR. The example 1 further on has a stray meaningless ellipsis. for expr3 in sequence3 ... if condition3 Perhaps this was meant to follow the next line, but I will remove it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:44:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 19:44:24 +0000 Subject: [issue39971] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1584733464.34.0.791741882184.issue39971@roundup.psfhosted.org> Terry J. Reedy added the comment: Looking around further, examples meant to be executable as is are given interactive prompts and needed doctest directives >>> gen #doctest: +ELLIPSIS I think that this example should get the same treatment. Non-executable examples are usually clearly non-executable because then contain undefined names line 'expr2' and 'sequence2', whereas this example starts by defining 'line_list'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 15:52:54 2020 From: report at bugs.python.org (Ross Rhodes) Date: Fri, 20 Mar 2020 19:52:54 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n Message-ID: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> New submission from Ross Rhodes : Hello, Thoughts on a new function in the math module to find prime factors for non-negative integer, n? After a brief search, I haven't found previous enhancement tickets raised for this proposal, and I am not aware of any built-in method within either Python's math module or numpy, but happy to be corrected on that front. If there's no objection and the method does not already exist, I'm happy to implement it and open for review. Ross ---------- messages: 364711 nosy: trrhodes priority: normal severity: normal status: open title: Math module method to find prime factors for non-negative int n versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:03:14 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 20:03:14 +0000 Subject: [issue39975] Commands running in 3.7.6 Shell, but failing as script In-Reply-To: <1584343119.59.0.433664804662.issue39975@roundup.psfhosted.org> Message-ID: <1584734594.06.0.124932877149.issue39975@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is for improving future versions of python. Questions about using current python belong on python-list or other help forums, such as stackoverflow. Reading the following will help you ask good questions. https://stackoverflow.com/help/minimal-reproducible-example A few notes: 1. The minimal example is likely 'import tensorflow as tf'. 2. The 'shell' part of your post is not copied from an interactive session (IDLE?), as there are no prompts. 3. The typical reason for the same import working and then not working is running the import with two different python binaries with different installed 3rd-party packages. If you ran twice in the same IDLE, once interactively and once from an editor, that would not be an issue, and I would not know why the difference. 4. Tensorflow keras assumes that it is outputting to a text terminal, which IDLE is not, so there may be glitches in output formatting. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed title: Group of commands running in Python 3.7.6 Shell, but failing as Script file. -> Commands running in 3.7.6 Shell, but failing as script _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:12:24 2020 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 20 Mar 2020 20:12:24 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584735144.23.0.918035684212.issue39988@roundup.psfhosted.org> Jack O'Connor added the comment: This change may have broken pyflakes on nightly Python. Is that expected or problematic? Error message: "pyflakes" failed during execution due to "module 'ast' has no attribute 'AugLoad'" Seen at: https://travis-ci.org/github/buildinspace/peru/jobs/665005023 ---------- nosy: +oconnor663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:13:32 2020 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 20 Mar 2020 20:13:32 +0000 Subject: [issue39988] Remove AugLoad and AugStore expression context from AST In-Reply-To: <1584430191.22.0.892292018718.issue39988@roundup.psfhosted.org> Message-ID: <1584735212.8.0.250797620884.issue39988@roundup.psfhosted.org> Jack O'Connor added the comment: Ah never mind, it looks like that's covered by https://bugs.python.org/issue39999 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:22:43 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Mar 2020 20:22:43 +0000 Subject: [issue22699] Module source files not found when cross-compiling In-Reply-To: <1413992946.14.0.956103683321.issue22699@psf.upfronthosting.co.za> Message-ID: <1584735763.75.0.775931132252.issue22699@roundup.psfhosted.org> Steve Dower added the comment: > the multiarch approach allows you to install libraries and headers for many architectures in the same installation/chroot That makes sense, but I'm not using it. So presumably I've added a configure option that I didn't need (either "--host=x86_64-my-linux" or "--build=x86_64"). I'm building against a Yocto SDK (like described at https://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-installing-the-sdk), and the --host option identifies the sysroot. When I add just --host, I also have to add --build, and IIRC only x86_64 worked. Could that have enabled the multiarch settings? Or it is always enabled because I'm building on an Ubuntu VM? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:30:32 2020 From: report at bugs.python.org (Ram Rachum) Date: Fri, 20 Mar 2020 20:30:32 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584736232.91.0.0909654871523.issue40016@roundup.psfhosted.org> Ram Rachum added the comment: I updated my PR to match. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:31:18 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Mar 2020 20:31:18 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584736278.54.0.750627405775.issue40028@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:38:56 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 20:38:56 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584736736.03.0.403688822293.issue40005@roundup.psfhosted.org> Terry J. Reedy added the comment: Bharat, when responding by email, *please* delete from your response the the post you are responding to. Your response is added below that message, and including it is duplicate noise. Tim, you seem to be saying that this should be closed as 'not a bug'. Correct? ---------- nosy: +terry.reedy type: compile error -> behavior versions: +Python 3.7 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:42:24 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 20 Mar 2020 20:42:24 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584736944.86.0.687740029691.issue40005@roundup.psfhosted.org> Eric V. Smith added the comment: I agree it's not a bug. It's a known difference between Windows and Linux, due to fork() semantics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 16:44:15 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 20 Mar 2020 20:44:15 +0000 Subject: [issue40005] Getting different result in python 2.7 and 3.7. In-Reply-To: <1584561043.46.0.995570290808.issue40005@roundup.psfhosted.org> Message-ID: <1584737055.18.0.986864891517.issue40005@roundup.psfhosted.org> Change by Tim Peters : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 17:14:19 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 20 Mar 2020 21:14:19 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584738859.34.0.580582424.issue40028@roundup.psfhosted.org> Tim Peters added the comment: Good idea, but yet another that really belongs in an `imath` module (which doesn't yet exist). How ambitious should it be? Sympy supplies a `factorint()` function for this, which uses 4 approaches under the covers: perfect power, trial division, Pollard rho, and Pollard p-1. All relatively simple to code with trivial memory burden, but not really practical (too slow) for "hard" composites well within the practical range of advanced methods. But I'd be happy enough to settle for that. ---------- components: +Library (Lib) nosy: +tim.peters stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 19:05:05 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 23:05:05 +0000 Subject: [issue40011] Tkinter widget events become tuples In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584745505.33.0.615156224938.issue40011@roundup.psfhosted.org> Terry J. Reedy added the comment: IDLE uses tkinter extensively and runs fine on 3.0 to the upcoming 3.9. Events remain Events and event.type, event.widget, event.x, and so on continue to work as appropriate for the event type. As far as I know, the only directly tkinter-related changes were the import names for tkinter and its subpackages. The same has been true for countless other tkinter users. So until you or someone can produce a short example that only imports tkinter and definitely not anything outside of the stdlib, I (and I think 'we') will assume that the problem is with your code or one of the modules you import or possibly a system-specific bad compilation of tcl/tk/_tkinter.c or mangled tkinter.py. Some notes to maybe help: 1. When reporting an exception, one should nearly always paste the complete traceback. 2. The first post-import statement in tboplayer.py monkey-patches tkinter with tk.CallWrapper = ExceptionCatcher where ExceptionCatcher must be a class from one of the 3rd party * imports. To see if one of the 3rd party modules is replacing tk.Event when imported, put 'print(Event)' after 'from tkinter import *'. You should see "". If not, move the import and debug print up. If so, put debug prints down in your code. 3. Passing non-Events (like False) as the event argument, especially when this unusually possibility is not documented. A common idiom would be def select_track(event=None): ... if event is not None: ... A reader should be able to assume that any non-None event is really an event. Python-list, which I read, would be one good place for any further discussion. ---------- nosy: +terry.reedy -gpolo resolution: -> third party stage: -> resolved status: open -> closed title: Tkinter widget events are of type Tuple -> Tkinter widget events become tuples _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 19:10:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 23:10:20 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1584745820.44.0.293947849966.issue40012@roundup.psfhosted.org> Terry J. Reedy added the comment: I completely agree with the goal. But I think that this is duplicate of at one previous issue either here or on the website tracker. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 19:36:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Mar 2020 23:36:20 +0000 Subject: =?utf-8?b?W2lzc3VlNDAwMjJdIOWFs+S6juWIl+ihqOeahOWfuuehgOeul+azlemXrg==?= =?utf-8?b?6aKY?= In-Reply-To: <1584672345.36.0.799930749688.issue40022@roundup.psfhosted.org> Message-ID: <1584747380.06.0.225322877201.issue40022@roundup.psfhosted.org> Terry J. Reedy added the comment: Test01.py runs as expected with no exceptions. This issue appears to be based on a misunderstanding of one or both of two things: a) multiplying an empty list does nothing other than returning a new empty list. b) list.insert(index, value) treats the index as a slice index. This is specified in the doc by "same as s[index:index] = [value]". (I spelled out the parameter names.) https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types >>> l1, l2 = [], [] >>> l1.insert(6, 0); l2[6:6] = [0] >>> l1, l2 ([0], [0]) ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 20:14:41 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Sat, 21 Mar 2020 00:14:41 +0000 Subject: [issue20459] No Argument Clinic documentation on how to specify a return converter In-Reply-To: <1391185302.8.0.888255910236.issue20459@psf.upfronthosting.co.za> Message-ID: <1584749681.49.0.974023157537.issue20459@roundup.psfhosted.org> Furkan ?nder added the comment: I couldn't understand your problem.Can you explain more? ---------- nosy: +furkanonder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 20:28:33 2020 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 21 Mar 2020 00:28:33 +0000 Subject: [issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache In-Reply-To: <1512157614.6.0.213398074469.issue32173@psf.upfronthosting.co.za> Message-ID: <1584750513.46.0.204494273533.issue32173@roundup.psfhosted.org> A.M. Kuchling added the comment: Patch has been applied. ---------- nosy: +akuchling resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 20:36:25 2020 From: report at bugs.python.org (Russell Owen) Date: Sat, 21 Mar 2020 00:36:25 +0000 Subject: [issue40017] Please support CLOCK_TAI in the time module. In-Reply-To: <1584645299.09.0.45620556685.issue40017@roundup.psfhosted.org> Message-ID: <1584750985.27.0.786972856264.issue40017@roundup.psfhosted.org> Change by Russell Owen : ---------- keywords: +patch pull_requests: +18455 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 20 21:17:40 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Sat, 21 Mar 2020 01:17:40 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1584753460.02.0.238321074538.issue21760@roundup.psfhosted.org> Change by Furkan ?nder : ---------- keywords: +patch nosy: +furkanonder nosy_count: 3.0 -> 4.0 pull_requests: +18457 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 00:39:25 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 04:39:25 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1584765565.02.0.665782274249.issue40012@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also the approach to use robots.txt https://github.com/python/pythondotorg/issues/1030 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 01:15:28 2020 From: report at bugs.python.org (Ethan Onstott) Date: Sat, 21 Mar 2020 05:15:28 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584767728.4.0.681929030651.issue40025@roundup.psfhosted.org> Change by Ethan Onstott : ---------- keywords: +patch nosy: +Ethan Onstott nosy_count: 5.0 -> 6.0 pull_requests: +18458 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 01:42:57 2020 From: report at bugs.python.org (Larry Hastings) Date: Sat, 21 Mar 2020 05:42:57 +0000 Subject: [issue38945] Remove newline characters from uu encoding methods In-Reply-To: <1575133561.73.0.538278905149.issue38945@roundup.psfhosted.org> Message-ID: <1584769377.56.0.772473322921.issue38945@roundup.psfhosted.org> Larry Hastings added the comment: New changeset 8835f465fa94f114dcf865429c0410821d365dae by Ned Deily in branch '3.5': bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418) (GH-17444) (#17445) https://github.com/python/cpython/commit/8835f465fa94f114dcf865429c0410821d365dae ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 03:27:13 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 07:27:13 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked Message-ID: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : I was trying to compile and run tests on a fresh ubuntu 18.03 machine that didn't zlib. test_importlb.test_zip seems to have some tests that depend on zlib but not marked as such causing test errors. Like other tests these could be skipped zlib is not available using test.support.requires_zlib . Tests are as below : test_zip_version test_zip_entry_points test_case_insensitive test_files ---------- components: Tests messages: 364727 nosy: brett.cannon, xtreak priority: normal severity: normal status: open title: test_importlib.test_zip requires zlib but not marked type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 03:30:12 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 07:30:12 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1584775812.52.0.190864872555.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Amir, this needs a test like the initial report without preferably using sys.stdout and patch for cases below : 1. Where the attribute is present on the wrapped object and uses it. 2. Where the attribute is not present on the wrapped object and uses the default value of the magic method. @aviso Feel free to add in if I have missed any scenarios. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 03:44:34 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 07:44:34 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1584776674.29.0.261886742424.issue40013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This looks like a good clarification to me where None is clarified that it's the value of restval. DictWriter has a similar doc "The optional restval parameter specifies the value to be written if the dictionary is missing a key in fieldnames" at https://docs.python.org/3/library/csv.html#csv.DictWriter ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 04:04:31 2020 From: report at bugs.python.org (Juhana Jauhiainen) Date: Sat, 21 Mar 2020 08:04:31 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1584777871.23.0.83508915183.issue40013@roundup.psfhosted.org> Change by Juhana Jauhiainen : ---------- keywords: +patch nosy: +Juhana.Jauhiainen nosy_count: 3.0 -> 4.0 pull_requests: +18459 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 04:39:28 2020 From: report at bugs.python.org (Larry Hastings) Date: Sat, 21 Mar 2020 08:39:28 +0000 Subject: [issue38945] Remove newline characters from uu encoding methods In-Reply-To: <1575133561.73.0.538278905149.issue38945@roundup.psfhosted.org> Message-ID: <1584779968.6.0.0138758562212.issue38945@roundup.psfhosted.org> Change by Larry Hastings : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 04:43:30 2020 From: report at bugs.python.org (Mathias Talbo) Date: Sat, 21 Mar 2020 08:43:30 +0000 Subject: [issue40030] Error with math.fsum() regarding float-point error Message-ID: <1584780209.99.0.70577499312.issue40030@roundup.psfhosted.org> New submission from Mathias Talbo : An issue occurs when running the following code. import math math.fsum([0.1, 0.2]), math.fsum([0.1, 0.7]) This should output 0.3, 0.8 respectively. Instead, it output 0.30000000000000004, 0.7999999999999999 The very floating-point error it is trying to stop from occurring. Thank you for your time. ---------- components: Extension Modules messages: 364730 nosy: Mathias Talbo priority: normal severity: normal status: open title: Error with math.fsum() regarding float-point error type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 04:48:09 2020 From: report at bugs.python.org (Ross Rhodes) Date: Sat, 21 Mar 2020 08:48:09 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584780489.77.0.950770451373.issue40028@roundup.psfhosted.org> Ross Rhodes added the comment: Hi Tim, Are there any open discussions or threads following the proposed ?imath? module? I?m a relatively new entrant to the Python community, so if there?s any ongoing discussion on that front I?d be happy to read further. I think as a first step it would be good to implement this logic for a limited range of non-negative n, imposing an upper limit (suggestions welcome) to make sure all provided input can be safely processed. We can then build from there to support larger n going forward if the demand is out there. Ross ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 04:58:51 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 08:58:51 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584781131.36.0.616959005336.issue40028@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Are there any open discussions or threads following the proposed ?imath? module? https://mail.python.org/archives/list/python-ideas at python.org/message/YYJ5YJBJNCVXQWK5K3WSVNMPUSV56LOR/ Issue37132. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:01:45 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 09:01:45 +0000 Subject: [issue40030] Error with math.fsum() regarding float-point error In-Reply-To: <1584780209.99.0.70577499312.issue40030@roundup.psfhosted.org> Message-ID: <1584781305.56.0.75821467695.issue40030@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be a similar case of https://docs.python.org/3/tutorial/floatingpoint.html. See also comment https://stackoverflow.com/questions/55534307/calculating-sum-of-float-numbers-using-math-fsum-showing-incorrect-values#comment97782231_55534307 . ---------- nosy: +mark.dickinson, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:03:29 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 09:03:29 +0000 Subject: [issue40030] Error with math.fsum() regarding float-point error In-Reply-To: <1584780209.99.0.70577499312.issue40030@roundup.psfhosted.org> Message-ID: <1584781409.53.0.0855122761309.issue40030@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:04:15 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 09:04:15 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked In-Reply-To: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> Message-ID: <1584781455.78.0.583740071088.issue40029@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:04:26 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 09:04:26 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked In-Reply-To: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> Message-ID: <1584781466.39.0.489576021087.issue40029@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:12:24 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 09:12:24 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584781944.96.0.491066372733.issue40016@roundup.psfhosted.org> Serhiy Storchaka added the comment: I apologize if I was rude. It's only because of my bad English. There were many translation options for my words suggested by Google Translator and I obviously picked up the wrong one. Improving documentation is always a good thing. But I leave the final decision to someone who is fluent in English. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, mrabarnett, terry.reedy type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 05:42:34 2020 From: report at bugs.python.org (Saaheer Purav) Date: Sat, 21 Mar 2020 09:42:34 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. Message-ID: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> New submission from Saaheer Purav : In Python 3.8.2 IDLE, when I try to select a new theme or change the font and font size in the Configure IDLE section, and click on 'Ok' or 'Apply', nothing happens. The buttons have no action. Even when I tried to press F5 to run module, nothing happened. In the 'config-keys.def' file, I edited the run module to 'F6' and tried to run module, but still nothing happened. However, when I edited the file back to 'F5' for run module, it worked, strangely. But still I am unable to select a new theme or change the font and font size as the buttons do not work. ---------- assignee: terry.reedy components: IDLE messages: 364735 nosy: Vader27, terry.reedy priority: normal severity: normal status: open title: Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 06:00:25 2020 From: report at bugs.python.org (hai shi) Date: Sat, 21 Mar 2020 10:00:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584784825.15.0.626231132873.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18460 pull_request: https://github.com/python/cpython/pull/19100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 06:26:18 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 10:26:18 +0000 Subject: [issue40011] Tkinter widget events become tuples In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584786378.54.0.507667260446.issue40011@roundup.psfhosted.org> Serhiy Storchaka added the comment: The problem is in ExceptionCatcher. It uses builtin function apply() which was outdated even in Python 2.7 and was removed in Python 3 (instead of apply(func, args) you can use func(*args)). So that code always failed, but all exceptions were logged and suppressed. You may see it in your logs at the start of the application. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 07:11:04 2020 From: report at bugs.python.org (Joshua Y) Date: Sat, 21 Mar 2020 11:11:04 +0000 Subject: [issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported. In-Reply-To: <1579611222.47.0.288920213647.issue39410@roundup.psfhosted.org> Message-ID: <1584789064.82.0.464214815189.issue39410@roundup.psfhosted.org> Joshua Y added the comment: I am hitting a possibly related issue. System is running Centos6.9 and SQLite 3.10.0. Python 3.8.2 built successfully (using pyenv / python-build), and I can import the sqlite3 lib with seemingly no issue... % python3 Python 3.8.2 (default, Mar 21 2020, 20:15:25) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> from sqlite3.dbapi2 import * >>> from _sqlite3 import * >>> However, after I installed and ran jupyterhub, and attempted to log in, I hit the same 'undefined symbol' error [I 2020-03-21 21:42:52.465 JupyterHub spawner:1417] Spawning jupyterhub-singleuser --port=38433 Traceback (most recent call last): File "/opt/pyenv/versions/3.8.2/lib/python3.8/site-packages/notebook/services/sessions/sessionmanager.py", line 9, in import sqlite3 File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/__init__.py", line 23, in from sqlite3.dbapi2 import * File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ImportError: /opt/pyenv/versions/3.8.2/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined symbol: sqlite3_close_v2 ---------- nosy: +Joshua Y _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 07:39:56 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 21 Mar 2020 11:39:56 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584790796.36.0.314954891908.issue39824@roundup.psfhosted.org> Stefan Behnel added the comment: > I think Cython makes use of PEP-489 so unless I am missing something all generated extensions use PEP-489 structures. Cython doesn't make complete use of PEP-489 yet, specifically not of the module state feature (nor module subclasses). This change looks good from my side. Good idea, Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 07:52:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 11:52:16 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584791536.3.0.56487045039.issue24916@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18461 pull_request: https://github.com/python/cpython/pull/19101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 08:40:37 2020 From: report at bugs.python.org (Julin) Date: Sat, 21 Mar 2020 12:40:37 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions Message-ID: <1584794437.59.0.496209203348.issue40032@roundup.psfhosted.org> New submission from Julin : In the source, many class definitions still explicitly inherit from `object` though it is no longer necessary in Python3. Can't we change it? ---------- components: Library (Lib) messages: 364739 nosy: ju-sh priority: normal severity: normal status: open title: Remove explicit inheriting of object in class definitions versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 08:47:16 2020 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Mar 2020 12:47:16 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584794836.28.0.0452113449138.issue28180@roundup.psfhosted.org> Matej Cepl added the comment: I have tried to port this patch to Python 3.4 (still maintained by SUSE on SLE-12), but I have the hardest time to debug this. All affected tests end with errors like this: [ 493s] ====================================================================== [ 493s] FAIL: test_test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) (PYTHONCOERCECLOCALE=None, env_var='LC_CTYPE', nominal_locale='invalid.ascii') [ 493s] ---------------------------------------------------------------------- [ 493s] Traceback (most recent call last): [ 493s] File "/home/abuild/rpmbuild/BUILD/Python-3.4.10/Lib/test/test_c_locale_coercion.py", line 326, in _check_c_locale_coercion [ 493s] coercion_expected) [ 493s] File "/home/abuild/rpmbuild/BUILD/Python-3.4.10/Lib/test/test_c_locale_coercion.py", line 219, in _check_child_encoding_details [ 493s] self.assertEqual(encoding_details, expected_details) [ 493s] AssertionError: {'fse[79 chars]cii:strict', 'stderr_info': 'ascii:backslashre[45 chars]ict'} != {'fse[79 chars]cii:surrogateescape', 'stderr_info': 'ascii:ba[63 chars]ape'} [ 493s] {'fsencoding': 'ascii', [ 493s] 'lang': '', [ 493s] 'lc_all': '', [ 493s] 'lc_ctype': 'invalid.ascii', [ 493s] 'stderr_info': 'ascii:backslashreplace', [ 493s] - 'stdin_info': 'ascii:strict', [ 493s] ? ^^ ^ [ 493s] [ 493s] + 'stdin_info': 'ascii:surrogateescape', [ 493s] ? ++++++ ^^^ ^^^ [ 493s] [ 493s] - 'stdout_info': 'ascii:strict'} [ 493s] ? ^^ ^ [ 493s] [ 493s] + 'stdout_info': 'ascii:surrogateescape'} [ 493s] ? ++++++ ^^^ ^^^ yes, it is always a conflict between strict and surrogateescape. I probably don?t have time to finish debugging this, so I am just leaving this for posterity. ---------- nosy: +mcepl Added file: https://bugs.python.org/file48991/pep538_coerce_legacy_c_locale.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 08:53:06 2020 From: report at bugs.python.org (Amir Mohamadi) Date: Sat, 21 Mar 2020 12:53:06 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1584795186.16.0.375824991744.issue39966@roundup.psfhosted.org> Change by Amir Mohamadi : ---------- keywords: +patch pull_requests: +18462 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/19102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:06:09 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Mar 2020 13:06:09 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions In-Reply-To: <1584794437.59.0.496209203348.issue40032@roundup.psfhosted.org> Message-ID: <1584795969.56.0.36292589814.issue40032@roundup.psfhosted.org> Steven D'Aprano added the comment: Code churn for no good reason is not a good idea. I cannot think of any good reasons to change this: - it doesn't add new functionality; - it doesn't fix bugs; - it doesn't make the code easier to maintain; - it makes the code LESS clear instead of more clear; - PEP 8 doesn't have an opinion on whether to explicitly or implicitly inherit from object; - but the Zen of Python ("import this") does. Do you have any good reasons for removing the explicit inheritance from object? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:30:13 2020 From: report at bugs.python.org (Julin) Date: Sat, 21 Mar 2020 13:30:13 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions In-Reply-To: <1584794437.59.0.496209203348.issue40032@roundup.psfhosted.org> Message-ID: <1584797413.91.0.674911861709.issue40032@roundup.psfhosted.org> Julin added the comment: I just thought it looked different compared to the usual code that some of us were used to. Though it is probably familiar enough to the people who actually maintain the cpython code base. I agree with everything that you mentioned with regards to what I could understand (No new functionality, no bug fix). Not experienced enough to know about what makes code more maintainable. Why do you think it makes the code less clear, though? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:37:10 2020 From: report at bugs.python.org (Ross Rhodes) Date: Sat, 21 Mar 2020 13:37:10 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584797830.5.0.409810191778.issue40028@roundup.psfhosted.org> Ross Rhodes added the comment: Hi Serhiy, Thanks for sharing your thread. I support this proposal, and would be happy to help where time permits if we can gather sufficient support. I inadvertently posted my support twice on your thread with no obvious means of deleting the duplicate post, since the first one had a delay appearing. Regardless, how can we best move forward with this idea? Ross ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:41:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 13:41:47 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions In-Reply-To: <1584794437.59.0.496209203348.issue40032@roundup.psfhosted.org> Message-ID: <1584798107.8.0.82507665339.issue40032@roundup.psfhosted.org> Serhiy Storchaka added the comment: We usually do not accept mass cosmetic changes. It messes the history and may break pending PRs. It also consumes the time of core developers for review and has a risk of introducing bugs. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:44:19 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 13:44:19 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584798259.28.0.456751982404.issue40028@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Regardless, how can we best move forward with this idea? Provide a pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:45:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 13:45:44 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584798344.91.0.257326479298.issue24916@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 684d2b9a071fa8e54749e0eec3c16aafcd642ed4 by Serhiy Storchaka in branch 'master': bpo-24916: Remove an outdated comment. (GH-19101) https://github.com/python/cpython/commit/684d2b9a071fa8e54749e0eec3c16aafcd642ed4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:46:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 13:46:40 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584798400.62.0.760556477573.issue24916@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:51:39 2020 From: report at bugs.python.org (Ross Rhodes) Date: Sat, 21 Mar 2020 13:51:39 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584798699.61.0.287184632141.issue40028@roundup.psfhosted.org> Ross Rhodes added the comment: Hi Serhiy, > Provide a pull request. Apologies, by "this idea" I should clarify I meant the "imath" module proposal. On this particular enhancement, yes, I'm happy to work on and later provide a pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 09:53:49 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 13:53:49 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584798829.85.0.801761217658.issue39652@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b146568dfcbcd7409c724f8917e4f77433dd56e4 by Serhiy Storchaka in branch 'master': bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942) https://github.com/python/cpython/commit/b146568dfcbcd7409c724f8917e4f77433dd56e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:07:01 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Mar 2020 14:07:01 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584799621.72.0.812557880105.issue39652@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18463 pull_request: https://github.com/python/cpython/pull/19103 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:10:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 14:10:34 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584799834.28.0.788332745694.issue39652@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18464 pull_request: https://github.com/python/cpython/pull/19104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:16:10 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Mar 2020 14:16:10 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584800170.56.0.567976580319.issue40028@roundup.psfhosted.org> Steven D'Aprano added the comment: I don't know... To my mind, if we are going to support working with primes, the minimum API is: - is_prime(n) - next_prime(n) - prev_prime(n) - factorise(n) - generate_primes(start=0) (I trust the names are self-explanatory.) There are various other interesting prime-related factors which can be built on top of those, but the above five are, in my opinion, a minimal useful set. Factorising negative numbers is simple: just include a factor of -1 with the prime factors. We would probably want to also support factorising 0 and 1 even though they don't have prime factors. The alternative is to raise an exception, which I expect would be more annoying than useful. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:25:26 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Mar 2020 14:25:26 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584800726.33.0.107983167368.issue40028@roundup.psfhosted.org> Steven D'Aprano added the comment: Ross: "implement this logic for a limited range of non-negative n, imposing an upper limit (suggestions welcome) to make sure all provided input can be safely processed. We can then build from there to support larger n going forward if the demand is out there." Urgh, please no! Arbitrary limits are horrible. Whatever maximum limit N you guess, somebody will want to factorise N+1. Consider this evidence of demand :-) On what basis would you choose that limit? Basing it on the size of n is the wrong answer: factorising 2**10000000 is easy, and will be found by trial division almost instantly, even though it's a large number with over three million digits. Another question: since factorization can take a long time, should it be a generator that yields the factors as they are found? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:27:32 2020 From: report at bugs.python.org (=?utf-8?q?H=C3=AAnio_Tierra_Sampaio?=) Date: Sat, 21 Mar 2020 14:27:32 +0000 Subject: [issue40011] Tkinter widget events become tuples In-Reply-To: <1584590664.06.0.905222736843.issue40011@roundup.psfhosted.org> Message-ID: <1584800852.82.0.114635391962.issue40011@roundup.psfhosted.org> H?nio Tierra Sampaio added the comment: Yes, you guys were right. I solved the problem by writing a new, simpler debugging class. I'm sorry for taking your time! Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:32:29 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Mar 2020 14:32:29 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584801149.04.0.991974721555.issue39652@roundup.psfhosted.org> miss-islington added the comment: New changeset 687f5921a46cf95c2a648d8031f9e99cdcc3e6b7 by Miss Islington (bot) in branch '3.8': bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942) https://github.com/python/cpython/commit/687f5921a46cf95c2a648d8031f9e99cdcc3e6b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:33:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 14:33:47 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584801227.54.0.399190709271.issue39652@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 39680fb7043e555469e08d3c4f49073acca77b20 by Serhiy Storchaka in branch '3.7': [3.7] bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942). (GH-19104) https://github.com/python/cpython/commit/39680fb7043e555469e08d3c4f49073acca77b20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:35:22 2020 From: report at bugs.python.org (Ross Rhodes) Date: Sat, 21 Mar 2020 14:35:22 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584801322.8.0.0248320201079.issue40028@roundup.psfhosted.org> Ross Rhodes added the comment: Hi Steven, I agree, your set of proposed methods seem sensible to me. I'm happy to start with an implementation of at least some of those methods and open for review, taking this one step at a time for easier review and regular feedback. > Another question: since factorization can take a long time, should it be a generator that yields the factors as they are found? Yes, I think a generator is a sensible shout. Happy to proceed with this suggestion. Ross ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:35:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Mar 2020 14:35:30 +0000 Subject: [issue39652] sqlite3 bug handling column names that contain square braces In-Reply-To: <1581873007.59.0.213823942208.issue39652@roundup.psfhosted.org> Message-ID: <1584801330.88.0.485898941008.issue39652@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:40:37 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Mar 2020 14:40:37 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions In-Reply-To: <1584794437.59.0.496209203348.issue40032@roundup.psfhosted.org> Message-ID: <1584801637.0.0.698265383709.issue40032@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Previous discussion: https://bugs.python.org/issue17351 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 10:42:43 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Mar 2020 14:42:43 +0000 Subject: [issue40032] Remove explicit inheriting of object in class definitions In-Reply-To: <1584797413.91.0.674911861709.issue40032@roundup.psfhosted.org> Message-ID: <20200321144100.GB4114@ando.pearwood.info> Steven D'Aprano added the comment: On Sat, Mar 21, 2020 at 01:30:13PM +0000, Julin wrote: > Why do you think it makes the code less clear, though? Classes that inherit from object, and those which don't ("classic classes") behave differently in Python 2. But in Python 3, they are precisely the same. Anyone who is familiar with Python 2, perhaps because they still have to deal with a legacy code base, or just because they learned using that version, will have to mentally adjust each time they see something which looks like a classic class, but actually is a new-style type. Beginners who are only starting to learn Python may not understand the type hierarchy, and may believe that a class that doesn't explicitly inherit from object is a stand-alone class that doesn't inherit from object. Perhaps they have come from another language with different rules, or that lacks a single base object, like Python originally did. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 11:43:23 2020 From: report at bugs.python.org (Roman Yurchak) Date: Sat, 21 Mar 2020 15:43:23 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked In-Reply-To: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> Message-ID: <1584805403.28.0.401873245887.issue40029@roundup.psfhosted.org> Change by Roman Yurchak : ---------- keywords: +patch nosy: +rth nosy_count: 2.0 -> 3.0 pull_requests: +18465 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 12:11:06 2020 From: report at bugs.python.org (Jonathan Fine) Date: Sat, 21 Mar 2020 16:11:06 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584807066.66.0.112575835754.issue40028@roundup.psfhosted.org> Jonathan Fine added the comment: A pre-computed table of primes might be better. Of course, how long should the table be. There's an infinity of primes. Consider >>> 2**32 4294967296 This number is approximately 4 * (10**9). According to https://en.wikipedia.org/wiki/Prime_number_theorem, there are 50,847,534 primes less than 10**9. So, very roughly, there are 200,000,000 primes less than 2**32. Thus, storing a list of all these prime numbers as 32 bit unsigned integers would occupy about >>> 200_000_000 / (1024**3) * 4 0.7450580596923828 or in other words 3/4 gigabytes on disk. A binary search into this list, using as starting point the expected location provided by the prime number theorem, might very well require on average less than two block reads into the file that holds the prime number list on disk. And if someone needs to find primes of this size, they've probably got a spare gigabyte or two. I'm naturally inclined to this approach because by mathematical research involves spending gigahertz days computing tables. I then use the tables to examine hypotheses. See https://arxiv.org/abs/1011.4269. This involves subsets of the vertices of the 5-dimensional cube. There are of course 2**32 such subsets. ---------- nosy: +jfine2358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 12:40:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 21 Mar 2020 16:40:23 +0000 Subject: [issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated In-Reply-To: <1583142742.19.0.316214627808.issue39824@roundup.psfhosted.org> Message-ID: <1584808823.89.0.792413836097.issue39824@roundup.psfhosted.org> STINNER Victor added the comment: > Cython doesn't make complete use of PEP-489 yet, specifically not of the module state feature (nor module subclasses). This change looks good from my side. Good idea, Victor. Thanks for the confirmation Stefan ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 12:49:09 2020 From: report at bugs.python.org (Damian Yurzola) Date: Sat, 21 Mar 2020 16:49:09 +0000 Subject: [issue40033] Just defined class missing from scope Message-ID: <1584809349.61.0.7412480872.issue40033@roundup.psfhosted.org> New submission from Damian Yurzola : In the following example the last line throws as 'NameError: name 'Level1A' is not defined' for both 3.7 and 3.8 I assumed that Level1A should already be in scope while defining the insides of Level1B. But it isn't. Is this a bug, or am I missing something? from typing import List, Union class Level0A: pass class Level0B: class Level1A: subs: List[Level0A] class Level1B: subs: List[Level1A] ---------- components: Interpreter Core messages: 364759 nosy: yurzo priority: normal severity: normal status: open title: Just defined class missing from scope versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 12:51:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 21 Mar 2020 16:51:34 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584809494.56.0.0477346761759.issue28180@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.4 is no longer supported upstream. Python 3 got tons of Unicode fixes between Python 3.4 and Python 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 12:58:12 2020 From: report at bugs.python.org (Damian Yurzola) Date: Sat, 21 Mar 2020 16:58:12 +0000 Subject: [issue40033] Just defined class missing from scope In-Reply-To: <1584809349.61.0.7412480872.issue40033@roundup.psfhosted.org> Message-ID: <1584809892.34.0.328687096088.issue40033@roundup.psfhosted.org> Damian Yurzola added the comment: This is even a better example: Level1A is available to inherit from, but not to type with. Example: from typing import List class Level0A: pass class Level0B: class Level1A: pass class Level1B(Level1A): pass class Level1C: test: Level1A ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 13:23:48 2020 From: report at bugs.python.org (San) Date: Sat, 21 Mar 2020 17:23:48 +0000 Subject: [issue40034] cgi.parse() does not work with multipart POST requests. Message-ID: <1584811428.88.0.0218295989168.issue40034@roundup.psfhosted.org> New submission from San : The cgi.parse stdlib function works in most cases but never works when given a multipart/form-data POST request because it does not set up pdict in a way cgi.parse_multipart() likes (boundary as bytes (not str) and including content length). $ pwd /tmp $ $ /tmp/cpython/python --version Python 3.9.0a4+ $ $ cat cgi-bin/example.cgi #!/tmp/cpython/python import sys, cgi query_dict = cgi.parse() write = sys.stdout.buffer.write write("Content-Type: text/plain; charset=utf-8\r\n\r\n".encode("ascii")) write(f"Worked, query dict is {query_dict}.\n".encode()) $ $ /tmp/cpython/python -m http.server --cgi & sleep 1 [1] 30201 Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... $ $ # GET (url-encoded) requests work: $ curl localhost:8000/cgi-bin/example.cgi?example_key=example_value 127.0.0.1 - - [20/Mar/2020 23:33:48] "GET /cgi-bin/example.cgi?example_key=example_value HTTP/1.1" 200 - Worked, query dict is {'example_key': ['example_value']}. $ $ # POST (multipart) requests do not: $ curl localhost:8000/cgi-bin/example.cgi -F example_key=example_value 127.0.0.1 - - [20/Mar/2020 23:34:15] "POST /cgi-bin/example.cgi HTTP/1.1" 200 - Traceback (most recent call last): File "/tmp/cgi-bin/example.cgi", line 3, in query_dict = cgi.parse() File "/tmp/cpython/Lib/cgi.py", line 159, in parse return parse_multipart(fp, pdict) File "/tmp/cpython/Lib/cgi.py", line 201, in parse_multipart boundary = pdict['boundary'].decode('ascii') AttributeError: 'str' object has no attribute 'decode' 127.0.0.1 - - [20/Mar/2020 23:34:16] CGI script exit status 0x100 $ $ $EDITOR /tmp/cpython/Lib/cgi.py $ $ # After changing cgi.parse POST (multipart) requests work: $ curl localhost:8000/cgi-bin/example.cgi -F example_key=example_value 127.0.0.1 - - [20/Mar/2020 23:35:10] "POST /cgi-bin/example.cgi HTTP/1.1" 200 - Worked, query dict is {'example_key': ['example_value']}. $ ---------- components: Library (Lib) messages: 364762 nosy: sangh priority: normal severity: normal status: open title: cgi.parse() does not work with multipart POST requests. type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 13:32:59 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 17:32:59 +0000 Subject: [issue40035] ilteration of the .txt file Message-ID: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> New submission from Hamed Elahi : Hello, I saw a problem when this line of code is used in Python 3: settings = [line for line in settings if (line!='' and line[0] != '#')] Before updating windows, this line of code filtered the texts from the beginning of .txt file, so only the first lines remained after filtration, but now, after windows update, it filters the texts so that the last rows of .txt file will remain after filtration. Shouldn't a line of code acts the same in different updates? ---------- components: Windows messages: 364763 nosy: Hamed, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ilteration of the .txt file type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 13:34:59 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 17:34:59 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584812099.43.0.914672596715.issue40035@roundup.psfhosted.org> Hamed Elahi added the comment: Hello, I saw a problem when this line of code is used in Python 3: settings = [line for line in settings if (line!='' and line[0] != '#')] Before updating windows, this line of code filtered the texts from the beginning of .txt file, so only the first lines remained after filtration, but now, after windows update, it filters the texts so that the last rows of .txt file will remain after filtration. Shouldn't a line of code acts the same in different updates? ---------- title: ilteration of the .txt file -> Filtration of the .txt file _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 13:37:53 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 17:37:53 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584812273.49.0.345192791152.issue40035@roundup.psfhosted.org> Hamed Elahi added the comment: Hello, I saw a problem when this line of code is used in Python 3: settings = [line for line in settings if (line!='' and line[0] != '#')] Before updating windows, this line of code filtered the texts from the beginning of .txt file, so only the first lines remained after filtration, but now, after windows update, it filters the texts so that the last rows of .txt file will remain after filtration. Shouldn't a line of code act the same in different updates? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 13:38:56 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 21 Mar 2020 17:38:56 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584812336.61.0.442008147775.issue40035@roundup.psfhosted.org> Eric V. Smith added the comment: What versions of Windows were involved? Are the versions of Python the same? What's the exact version? Best would be the 2 lines you get after running python, like: $ python3 Python 3.7.4 (default, Jul 21 2019, 14:43:25) [GCC 7.4.0] on cygwin Please provide a short text file that shows this problem. Also, show us how you're opening the file. I've never heard of a Windows update causing a problem like this, so I suspect there's something else going on. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 14:06:02 2020 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Mar 2020 18:06:02 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584813962.49.0.845213728693.issue28180@roundup.psfhosted.org> Matej Cepl added the comment: > Python 3.4 is no longer supported upstream. Python 3 got tons of Unicode fixes between Python 3.4 and Python 3.8. Of course, I know that, but I just didn?t want to throw all my effort away, when I spent some hours on making it. And I guess, there may be somebody else who cares for 3.4 (ehm, RHEL-7 has 3.3, doesn?t it?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 14:19:50 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 18:19:50 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584814790.88.0.652265486113.issue40035@roundup.psfhosted.org> Hamed Elahi added the comment: Windows 10 Home Python 3.7.3 [MSC v.1916 64 bit (AMD64)] on win32 I open the file so etc.: settings_file = open('settings.txt','r') settings = [line.strip() for line in settings_file.readlines()] # Filter out comments and empties settings = [line for line in settings if (line!='' and line[0] != '#')] I attach the .txt file. I think the problem can be because of that line, because, before windows update, I used this .txt file and the first 4 parts of its content has been used to begin the program, but now, it sees that as None. The problem is with my new folders, when I create a new folder. It works different there, but in the old folders, it works as before. ---------- Added file: https://bugs.python.org/file48992/settings.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 14:29:39 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 21 Mar 2020 18:29:39 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584815379.27.0.130620650844.issue40035@roundup.psfhosted.org> Eric V. Smith added the comment: So are you saying that you see this problem on the current version of Windows that you're running, but whether or not you see the problem depends on if the file was created before or after you updated Windows? How are you creating these files? Does the file you attached show the problem or not? And could you explain exactly what you're seeing, versus what you're expecting to see? It's not clear from your last message. For example, what is the value of the variable "settings", and what do you expect it to be? If you have two files on your system which currently show the problem, please attach them both, with different names, and tell us which one shows the problem and which one doesn't. My only guess is that this is related to encodings or line endings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 14:33:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 21 Mar 2020 18:33:09 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584815589.94.0.995012541063.issue28180@roundup.psfhosted.org> STINNER Victor added the comment: RHEL 7.7 and RHEL 8 provides Python 3.6. PEP 538 was implemented in Python 3.7. PEP 538 feature was backported in RHEL 7.7 and RHEL 8 Python 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 15:48:58 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 19:48:58 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584820138.59.0.786343428155.issue40035@roundup.psfhosted.org> Hamed Elahi added the comment: I don't have any other windows to run on them, too. But, now, when I run .py file from older folders before updating windows, then I've got this problem or when I copy the folders and run .py file from these newly created folders. See here: I ran both files. See the result of filter: First file: ['sampling:rate 0', 'sampling:depth 3', 'ch1:mapping 2', 'shared 1', 'ch1:range_i 2', 'ch2:mapping 0', 'ch2:range_i 1', 'ch1:mapping 0', 'ch1:range_i 0'] Second file: ['sampling:rate 0', 'sampling:depth 3', 'ch1:mapping 2', 'shared 1', 'ch1:range_i 2', 'ch2:mapping 0', 'ch2:range_i 1', 'ch1:mapping 0', 'ch1:range_i 0'] So, both of them give the same result after filtering, but see the result of program here: First file: 0 0.000 -0.000000 -0.000788 Second file: 0 0.000 160095.125000 -0.000525 So, as you see, the first file has None values, because of that, I'm getting that line of code with these values: -0.000000 -0.000788 I sent an attachment before which is the file that give me the wrong result. When I use a .txt file with 4 parts like the attachment, the program works correctly, but I wanted to know how I received different results from two folders from different times. So, It is not a big problem. Sorry that I cannot give you more information, because I wrote this program for university, it is forbidden to send for others. And currently, I'm writing my thesis and testing new programs, so please do not reply to my message. Because I don't have time to answer the questions, now. But, when my thesis finishes after two months and I saw the problem is disturbing me another time, thus I will give you more information about it. Thank you for your help. ---------- Added file: https://bugs.python.org/file48993/settings.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 16:05:45 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 21 Mar 2020 20:05:45 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584811979.62.0.778885388555.issue40035@roundup.psfhosted.org> Message-ID: <1584821145.83.0.61499631123.issue40035@roundup.psfhosted.org> Eric V. Smith added the comment: I don't see a problem here. Your first file has more lines, so it produces more output than the second file. Presumably the difference in output you see when you run your program is a result of this. But since we can't see the code, we can't know for sure. I don't see anything to make me think this is related to what version of Windows your program is running under, or that there's a bug in python. So I'm going to close this issue. If you can produce a program that demonstrates a bug in python, you can provide more details (including the full source code) and re-open this issue. I suggest you look for help on the python-list mailing list: https://mail.python.org/mailman/listinfo/python-list ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 16:26:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Mar 2020 20:26:13 +0000 Subject: [issue40016] Clarify flag case in `re` module In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584822373.26.0.861406132036.issue40016@roundup.psfhosted.org> Terry J. Reedy added the comment: The root confusion is that re compilation has several variations with two sets of indicators, each with an unhelpful exception, and each combined and used in different ways. 1. Module constants with uppercase English words or word pairs, also abbreviated by uppercase letters that are the first letter of the word -- except for S-DOTALL and X-VERBOSE. As arguments for the flags parameter of functions other than escape and purge, they are combined with '|'. 2. Syntax letters within '(?...)', itself within an regex string, that are the single letter module constants lowercased b -- except that L is not lowercased because some fonts make l and 1 look nearly the same or even identical. Multiple syntax letters are combined by concatenation. The additional issue for docstrings is the extreme compression, including the omission (here) of 're.' prefixes. They are intended as reminders for those who have read and understood the full doc, but we try to make them as clear as possible. I am working on an alternate revision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 16:26:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Mar 2020 20:26:32 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584822392.81.0.375840559269.issue40016@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: Clarify flag case in `re` module -> Clarify flag case in `re` module docstring _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 16:37:09 2020 From: report at bugs.python.org (Hamed Elahi) Date: Sat, 21 Mar 2020 20:37:09 +0000 Subject: [issue40035] Filtration of the .txt file In-Reply-To: <1584821145.83.0.61499631123.issue40035@roundup.psfhosted.org> Message-ID: Hamed Elahi added the comment: No, the .txt files were the same, when I sent the results. I send another .txt file to show the different, but the results were created with the same .txt file for both runs. Unfortunately, it is forbidden to send .py files. On Sat, Mar 21, 2020 at 9:05 PM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > I don't see a problem here. Your first file has more lines, so it produces > more output than the second file. Presumably the difference in output you > see when you run your program is a result of this. But since we can't see > the code, we can't know for sure. > > I don't see anything to make me think this is related to what version of > Windows your program is running under, or that there's a bug in python. So > I'm going to close this issue. If you can produce a program that > demonstrates a bug in python, you can provide more details (including the > full source code) and re-open this issue. > > I suggest you look for help on the python-list mailing list: > https://mail.python.org/mailman/listinfo/python-list > > ---------- > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 16:44:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Mar 2020 20:44:10 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1584823450.41.0.52452689124.issue40031@roundup.psfhosted.org> Terry J. Reedy added the comment: I have no problem with 3.8.2 on Windows 10. Tal and Cheryl, what about your systems? Saaheer, what OS, and if macOS, what version are you using? (macOS Catalina has had some problems.) How did you install or upgrade to 3.8.2? ---------- nosy: +cheryl.sabella, taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 17:45:08 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Sat, 21 Mar 2020 21:45:08 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584827108.9.0.302452692651.issue40025@roundup.psfhosted.org> Jonathan Hsu added the comment: While the current behavior may be initially unexpected, it does match the way that python normally behaves when defining class variables. For example, the following class will throw an exception because the function number_two() is called before it is defined: class Numbers: one = 1 two = number_two() def number_two(): return 2 # NameError: name 'number_two' is not defined However, this version is fine: class Numbers: one = 1 def number_two(): return 2 two = number_two() ---------- nosy: +Jonathan Hsu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 18:12:47 2020 From: report at bugs.python.org (AlphaHot) Date: Sat, 21 Mar 2020 22:12:47 +0000 Subject: [issue40036] Deleting duplicates in itertoolsmodule.c Message-ID: <1584828767.94.0.279667413693.issue40036@roundup.psfhosted.org> Change by AlphaHot : ---------- nosy: AlphaHot priority: normal pull_requests: 18466 severity: normal status: open title: Deleting duplicates in itertoolsmodule.c versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 19:00:46 2020 From: report at bugs.python.org (Curtis Bucher) Date: Sat, 21 Mar 2020 23:00:46 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584831646.26.0.93052171675.issue36144@roundup.psfhosted.org> Change by Curtis Bucher : ---------- pull_requests: +18467 pull_request: https://github.com/python/cpython/pull/19106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 19:43:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 21 Mar 2020 23:43:55 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584834235.81.0.801477251484.issue36144@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 19:49:18 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Mar 2020 23:49:18 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584834558.64.0.230648180515.issue40016@roundup.psfhosted.org> Terry J. Reedy added the comment: The docstring line in question is (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below). This is exceptional in that other syntaxes in the special characters list use lower case only for syntax variables (m, n, name, id/name, yes, no). Here, each letter is a separate and literal special character. (Also exceptional is that the syntax given is illegal, as 'a', 'L', and 'u' are mutually exclusive.) The corresponding doc entry starts "(One or more letters from the set 'a', 'i', 'L', 'm', 's', 'u', 'x'.) ... the letters set the corresponding flags:" followed by 6 more lines. I suggest the following as the replacement here (followed by more 'below'). (?aiLmsux) The letters set the corresponding flags defined below. I think 'letters' pretty clearly refers to 'a', 'i', ..., and 'x' as given, and that each 'corresponds' to and sets a flag that is a separate entity. The more complicated inline flags syntax, "(?aiLmsux-imsx:...)", is omitted from the docstring. Perhaps this is intentional. The flag constants are currently introduced by Some of the functions in this module takes flags as optional parameters: My suggested more accurate and expanded replacement: "Each function other than purge and escape can take an optional 'flags' argument consisting of one or more of the following module constants, joined by "|". A, L, and U are mutually exclusive." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 20:18:30 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 22 Mar 2020 00:18:30 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1584836310.27.0.019062281602.issue40016@roundup.psfhosted.org> Terry J. Reedy added the comment: The docstring is currently 103 lines. I intentionally replaced 1 line with 1 line that I believe to be more informative and kept the expansion of the other line to 3 lines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 21 20:23:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 22 Mar 2020 00:23:20 +0000 Subject: [issue24916] In sysconfig, don't rely on sys.version format In-Reply-To: <1440265954.47.0.288307978254.issue24916@psf.upfronthosting.co.za> Message-ID: <1584836600.09.0.338316736804.issue24916@roundup.psfhosted.org> STINNER Victor added the comment: Since this issue has been closed, I closed PR 10321 and PR 18487. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 00:03:53 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Sun, 22 Mar 2020 04:03:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584849833.09.0.817926666247.issue1635741@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18468 pull_request: https://github.com/python/cpython/pull/19107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 00:34:22 2020 From: report at bugs.python.org (Vikash Balasubramanian) Date: Sun, 22 Mar 2020 04:34:22 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function Message-ID: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> New submission from Vikash Balasubramanian : I just had a random crash while using the autocomplete feature of Emacs. The error message was basically thrown by py_compile.py:213 quiet is undefined. I tracked down the code and sure enough, there is a comparison if quiet < 2: .... Please confirm this. ---------- components: Library (Lib) messages: 364780 nosy: Vikash Balasubramanian priority: normal severity: normal status: open title: py_compile.py quiet undefined in main function type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 00:42:10 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 22 Mar 2020 04:42:10 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1584852130.86.0.362345814573.issue40037@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is a duplicate of https://bugs.python.org/issue38731 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 00:57:09 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Sun, 22 Mar 2020 04:57:09 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584853029.26.0.594429093419.issue37207@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- nosy: +phsilva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 00:59:04 2020 From: report at bugs.python.org (Joshua Y) Date: Sun, 22 Mar 2020 04:59:04 +0000 Subject: [issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported. In-Reply-To: <1579611222.47.0.288920213647.issue39410@roundup.psfhosted.org> Message-ID: <1584853144.93.0.892276258932.issue39410@roundup.psfhosted.org> Joshua Y added the comment: It always a good idea to sleep on these things before I comment. Because I compiled SQLite3 under prefix /usr/local, I rebuilt Python 3.8.2 with `-L /usr/local/lib64` added to my LDFLAGS and now things are working fine (so far). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 01:15:30 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 22 Mar 2020 05:15:30 +0000 Subject: [issue40038] pathlib: remove partial support for preserving accessor when modifying a path Message-ID: <1584854130.01.0.225016964026.issue40038@roundup.psfhosted.org> New submission from Barney Gale : `pathlib.Path._init()` accepts a 'template' argument that pathlib uses - in some cases - to preserve the current accessor object when creating modified path objects. This works for `resolve()`, `absolute()` and `readlink()`, *but no other cases*! As customizing the accessor is not something we support (yet! see https://discuss.python.org/t/make-pathlib-extensible/3428), and the majority of path methods do not call `_init()` with a 'template' argument (and so do not preserve the accessor), I suggest this internal functionality be removed. Together with bpo-39682 / gh-18846, I believe this would allow us to remove `Path._init()` entirely, which would be a small performance win and a simplification of the code. Demo: ``` import pathlib class CustomAccessor(pathlib._NormalAccessor): pass def print_accessor(path): if isinstance(path._accessor, CustomAccessor): print(" %r: custom" % path) else: print(" %r: normal" % path) print("Here's a path with a custom accessor:") p = pathlib.Path("/tmp") p._accessor = CustomAccessor() print_accessor(p) print("Our accessor type is retained in resolve(), absolute() and readlink():") print_accessor(p.absolute()) print_accessor(p.resolve()) #print_accessor(p.readlink()) print("But not in any other path-creating methods!") print_accessor(p.with_name("foo")) print_accessor(p.with_suffix(".foo")) print_accessor(p.relative_to("/")) print_accessor(p / "foo") print_accessor(p.joinpath("foo")) print_accessor(p.parent) print_accessor(p.parents[0]) print_accessor(list(p.iterdir())[0]) print_accessor(list(p.glob("*"))[0]) print_accessor(list(p.rglob("*"))[0]) #print_accessor(p.expanduser()) ``` ---------- components: Library (Lib) messages: 364783 nosy: barneygale priority: normal severity: normal status: open title: pathlib: remove partial support for preserving accessor when modifying a path type: performance versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 01:20:26 2020 From: report at bugs.python.org (Ethan Furman) Date: Sun, 22 Mar 2020 05:20:26 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1584854426.55.0.322456655994.issue40025@roundup.psfhosted.org> Ethan Furman added the comment: Jonathan Hsu, you are correct -- and "don't do that" was my initial response; but Enum takes many pains to make sure the user doesn't shoot themselves in the foot, so raising a TypeError is appropriate instead of silently doing the wrong thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 01:49:22 2020 From: report at bugs.python.org (Junyu Zhang) Date: Sun, 22 Mar 2020 05:49:22 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability Message-ID: <1584856162.09.0.166116541026.issue40039@roundup.psfhosted.org> Change by Junyu Zhang : ---------- components: Library (Lib) files: Python-multiprocessing-RCE-vulnerability.pdf nosy: Junyu Zhang priority: normal severity: normal status: open title: [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability type: security versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file48994/Python-multiprocessing-RCE-vulnerability.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 01:52:04 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Mar 2020 05:52:04 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584856324.09.0.213372838896.issue40028@roundup.psfhosted.org> Raymond Hettinger added the comment: I would just call gnu's gfactor for this task. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 01:58:16 2020 From: report at bugs.python.org (Junyu Zhang) Date: Sun, 22 Mar 2020 05:58:16 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability Message-ID: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> New submission from Junyu Zhang : description: When we were using python to develop a distributed process service, I noticed that the default serialization parameter of Manager and ManagerBase in multiprocessing was pickl, and it didn't seem to be mentioned in the official website's documentation. This is unsafe unless our server is completely You can trust recv data, but if authkey is not set or leaked, it will cause RCE on the server side, so I applied for a CVE-ID to remind everyone to use this security issue. For details of the vulnerability and the poc code, please refer to the pdf file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 02:01:40 2020 From: report at bugs.python.org (Martin Panter) Date: Sun, 22 Mar 2020 06:01:40 +0000 Subject: [issue26527] CGI library - Using unicode in header fields In-Reply-To: <1457607871.95.0.782640087152.issue26527@psf.upfronthosting.co.za> Message-ID: <1584856900.46.0.375771257424.issue26527@roundup.psfhosted.org> Martin Panter added the comment: I?m not an expert on the topic, but it sounds like this might be a duplicate of Issue 23434, which has more discussion. ---------- nosy: +martin.panter resolution: -> duplicate status: open -> pending superseder: -> support encoded filename in Content-Disposition for HTTP in cgi.FieldStorage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 03:17:39 2020 From: report at bugs.python.org (SilentGhost) Date: Sun, 22 Mar 2020 07:17:39 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584861459.01.0.449419992002.issue40039@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 04:15:17 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 22 Mar 2020 08:15:17 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584864917.1.0.772461488256.issue40039@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the report. Is this a case of the warning below? https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing.connection.Connection.recv > Warning The Connection.recv() method automatically unpickles the data it receives, which can be a security risk unless you can trust the process which sent the message. > Therefore, unless the connection object was produced using Pipe() you should only use the recv() and send() methods after performing some sort of authentication. See Authentication keys. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 04:17:44 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 22 Mar 2020 08:17:44 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584865064.88.0.222028047106.issue40039@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I am not sure if this was done but CPython has a page on reporting security issues that you can use for future reports so that they can be triaged before being public. https://www.python.org/dev/security/ ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:03:37 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 09:03:37 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1584867817.16.0.611154454006.issue36543@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18469 pull_request: https://github.com/python/cpython/pull/19108 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:07:43 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Sun, 22 Mar 2020 09:07:43 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584868063.37.0.848283696206.issue40039@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:21:37 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 09:21:37 +0000 Subject: [issue39538] SystemError when set Element.attrib to non-dict In-Reply-To: <1580725155.12.0.53190069949.issue39538@roundup.psfhosted.org> Message-ID: <1584868897.38.0.33454401732.issue39538@roundup.psfhosted.org> Serhiy Storchaka added the comment: Fixed by issue39822. e.attrib = 1 now raises a TypeError. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed versions: -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:27:46 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 09:27:46 +0000 Subject: [issue4926] putenv() accepts names containing '=', return value of unsetenv() not checked In-Reply-To: <1231803037.62.0.52390349364.issue4926@psf.upfronthosting.co.za> Message-ID: <1584869266.82.0.702142631054.issue4926@roundup.psfhosted.org> Serhiy Storchaka added the comment: posix_putenv_garbage no longer used on Windows. ---------- resolution: -> fixed stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:28:19 2020 From: report at bugs.python.org (hai shi) Date: Sun, 22 Mar 2020 09:28:19 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584869299.98.0.748234953548.issue40014@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:31:24 2020 From: report at bugs.python.org (Saaheer Purav) Date: Sun, 22 Mar 2020 09:31:24 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1584869484.48.0.720625933343.issue40031@roundup.psfhosted.org> Saaheer Purav added the comment: I use Windows 10. I had a similar issue with python 3.8.0, which is why I uninstalled it and installed Python 3.8.2. The issue had been cleared, but then after a few weeks it happened again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:53:53 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Sun, 22 Mar 2020 09:53:53 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1584870833.42.0.00441698828283.issue32592@roundup.psfhosted.org> C.A.M. Gerlach added the comment: Hey, any update on this? As I mentioned, I'm willing to implement everything I mention here in one or more PRs, but I wanted to wait for a go-ahead in case some of the changes were not desired. Let me know and I'll go ahead. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 05:59:42 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 09:59:42 +0000 Subject: [issue40040] ProactorEventLoop fails on recvfrom with IPv6 sockets Message-ID: <1584871182.68.0.304558218275.issue40040@roundup.psfhosted.org> New submission from Kjell Braden : on Windows 10 with Python 3.8.2 and Python 3.9.0a4, the ProactorEventLoop raises "OSError: [WinError 87] The parameter is incorrect" when recvfrom on an AF_INET6 socket returns data: DEBUG:asyncio:Using proactor: IocpProactor INFO:asyncio:Datagram endpoint local_addr=('::', 11111) remote_addr=None created: (<_ProactorDatagramTransport fd=288>, <__main__.Prot object at 0x0000028739A09580>) ERROR:root:error_received Traceback (most recent call last): File "...\Python\Python39\lib\asyncio\proactor_events.py", line 548, in _loop_reading res = fut.result() File "...\Python\Python39\lib\asyncio\windows_events.py", line 808, in _poll value = callback(transferred, key, ov) File "...\Python\Python39\lib\asyncio\windows_events.py", line 496, in finish_recv return ov.getresult() OSError: [WinError 87] The parameter is incorrect The same code works without issues on python 3.7 or when using WindowsSelectorEventLoopPolicy. ---------- components: asyncio files: udp_ipv6_server.py messages: 364794 nosy: asvetlov, kbr, yselivanov priority: normal severity: normal status: open title: ProactorEventLoop fails on recvfrom with IPv6 sockets type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file48995/udp_ipv6_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 06:20:39 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 10:20:39 +0000 Subject: [issue40040] ProactorEventLoop fails on recvfrom with IPv6 sockets In-Reply-To: <1584871182.68.0.304558218275.issue40040@roundup.psfhosted.org> Message-ID: <1584872439.38.0.00759188341246.issue40040@roundup.psfhosted.org> Kjell Braden added the comment: sorry - is a duplicate of https://bugs.python.org/issue39148 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 06:21:29 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 10:21:29 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584872489.43.0.0720768085062.issue39148@roundup.psfhosted.org> Change by Kjell Braden : ---------- nosy: +kbr Added file: https://bugs.python.org/file48996/udp_ipv6_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 06:21:39 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 10:21:39 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584872499.35.0.228322963668.issue39148@roundup.psfhosted.org> Change by Kjell Braden : Removed file: https://bugs.python.org/file48996/udp_ipv6_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 06:22:33 2020 From: report at bugs.python.org (Saaheer Purav) Date: Sun, 22 Mar 2020 10:22:33 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1584872553.79.0.970447810968.issue40031@roundup.psfhosted.org> Saaheer Purav added the comment: I have tried everything like going to the .idlerc folder and making changes, but nothing worked. Finally, I had to change the original config files and it worked because Python is assuming that another theme which I put under 'IDLE Classic' is the original one. Also, the key for run-module(F5) doesn't work. In the original config file, the key for run-module is . However, Python does not read only that particular line and in the configure IDLE it shows that the field for run-module is empty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 07:40:31 2020 From: report at bugs.python.org (Yasunobu Imamura) Date: Sun, 22 Mar 2020 11:40:31 +0000 Subject: [issue40041] Typo in argparse ja-document wrong:'append', correct:'extend' Message-ID: <1584877231.67.0.450516943499.issue40041@roundup.psfhosted.org> New submission from Yasunobu Imamura : In Japanese document of argparse, https://docs.python.org/ja/3/library/argparse.html In explain of action, ENGLISH DOCUMENT: ..., 'append', ..., 'extend' JAPANESE DOCUMENT: ..., 'append', ..., 'append' So, Japanese document is wrong. ---------- assignee: docs at python components: Documentation messages: 364797 nosy: Yasunobu Imamura, docs at python priority: normal severity: normal status: open title: Typo in argparse ja-document wrong:'append', correct:'extend' type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:01:48 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 22 Mar 2020 12:01:48 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1584878508.66.0.584872685259.issue32592@roundup.psfhosted.org> Steve Dower added the comment: Go ahead. I think you should create three PRs (docs, tests and code), with only as many tests in the code PR as are needed to keep it passing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:14:13 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 22 Mar 2020 12:14:13 +0000 Subject: [issue40041] Typo in argparse ja-document wrong:'append', correct:'extend' In-Reply-To: <1584877231.67.0.450516943499.issue40041@roundup.psfhosted.org> Message-ID: <1584879253.12.0.979359977598.issue40041@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Japanese translation is tracked in GitHub and can be reported there. https://github.com/python/python-docs-ja ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:15:50 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 22 Mar 2020 12:15:50 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1584879350.92.0.846780893048.issue40037@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Closing this as duplicate. Feel free to reopen if it's a mistake. Thanks. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> bad input crashes py_compile library _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:31:06 2020 From: report at bugs.python.org (Ard Kuijpers) Date: Sun, 22 Mar 2020 12:31:06 +0000 Subject: [issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1584880266.22.0.886322371717.issue36759@roundup.psfhosted.org> Ard Kuijpers added the comment: Encountered this bug on Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)], so on Windows 10. I can reproduce the bug with the code in message https://bugs.python.org/msg341149. It does not seem to be a duplicate of #29097 since I cannot reproduce that issue. ---------- nosy: +Ard Kuijpers versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:31:48 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 12:31:48 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1584880308.97.0.502652344768.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b33e52511a59c6da7132c226b7f7489b092a33eb by Serhiy Storchaka in branch 'master': bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108) https://github.com/python/cpython/commit/b33e52511a59c6da7132c226b7f7489b092a33eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:45:27 2020 From: report at bugs.python.org (Ethan Furman) Date: Sun, 22 Mar 2020 12:45:27 +0000 Subject: [issue40042] Enum Flag: psuedo-members have None for name attribute Message-ID: <1584881127.96.0.708352464709.issue40042@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: ethan.furman nosy: ethan.furman priority: normal severity: normal stage: needs patch status: open title: Enum Flag: psuedo-members have None for name attribute versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:45:55 2020 From: report at bugs.python.org (Ethan Furman) Date: Sun, 22 Mar 2020 12:45:55 +0000 Subject: [issue40042] Enum Flag: psuedo-members have None for name attribute Message-ID: <1584881155.67.0.681720508458.issue40042@roundup.psfhosted.org> Change by Ethan Furman : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:52:40 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 12:52:40 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584881560.19.0.841696116804.issue39148@roundup.psfhosted.org> Kjell Braden added the comment: I tried some debugging with Python 3.9.0a4 and it looks like unparse_address in overlapped.c (https://github.com/python/cpython/blob/v3.9.0a4/Modules/overlapped.c#L689) raises the error. Almost seems like ENABLE_IPV6 is not set... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 08:55:15 2020 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 22 Mar 2020 12:55:15 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584881715.97.0.40455945223.issue28180@roundup.psfhosted.org> Nick Coghlan added the comment: The test cases for locale coercion *not* triggering still assume that bpo-19977, using surrogateescape on the standard streams in the POSIX locale, has been implemented (since that was implemented in Python 3.5). Hence the various test cases complaining that they found "ascii:strict" (Py 3.4 behaviour without bpo-19977) where they expected "ascii:surrogateescape" (the Py 3.5+ behaviour *with* bpo-19977). To get a PEP 538 backport to work as intended on 3.4, you'd need to backport that earlier IO stream error handling change as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 09:07:10 2020 From: report at bugs.python.org (=?utf-8?b?5pyx6IGW6buO?=) Date: Sun, 22 Mar 2020 13:07:10 +0000 Subject: [issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows In-Reply-To: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> Message-ID: <1584882430.97.0.168066419149.issue28859@roundup.psfhosted.org> Change by ??? : ---------- keywords: +patch nosy: +akarei nosy_count: 10.0 -> 11.0 pull_requests: +18470 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/19109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 11:48:45 2020 From: report at bugs.python.org (Junyu Zhang) Date: Sun, 22 Mar 2020 15:48:45 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584892125.54.0.770180782307.issue40039@roundup.psfhosted.org> Junyu Zhang added the comment: Thank you for your reply, this report is indeed the situation prompted by the warning. There will be few problems in the single-machine deployment mode. Of course, it is also possible to take advantage of the possibility of elevation of privilege. In the distributed deployment mode, the client script is leaked. The resulting authkey leak will also cause RCE problems. I have an idea. If ManagerBase can allow users to customize the serialization operation, it may be greatly relieved. Your suggestion is that I need to submit this to security at python.org Report it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 11:56:30 2020 From: report at bugs.python.org (Sebastian G Pedersen) Date: Sun, 22 Mar 2020 15:56:30 +0000 Subject: [issue39380] ftplib uses latin-1 as default encoding In-Reply-To: <1579776260.84.0.333075912412.issue39380@roundup.psfhosted.org> Message-ID: <1584892590.42.0.29689515888.issue39380@roundup.psfhosted.org> Sebastian G Pedersen added the comment: Yes, I will update the PR before the end of next week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 12:01:11 2020 From: report at bugs.python.org (Kjell Braden) Date: Sun, 22 Mar 2020 16:01:11 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584892871.16.0.317361281271.issue39148@roundup.psfhosted.org> Kjell Braden added the comment: Just to confirm, for some reason ENABLE_IPV6 is not set when compiling _overlapped. I'm not familiar enough with the windows build infrastructure to submit a PR though. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 12:03:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 22 Mar 2020 16:03:11 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1584892991.91.0.505388860348.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: Remaining issue: optimize list(iterable), PR 18928. I reviewed the PR and I'm waiting for Petr. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 12:17:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 22 Mar 2020 16:17:41 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1584893861.53.0.45192217492.issue40024@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 05e4a296ecc127641160a04f39cc02c0f66a8c27 by Dong-hee Na in branch 'master': bpo-40024: Add PyModule_AddType() helper function (GH-19088) https://github.com/python/cpython/commit/05e4a296ecc127641160a04f39cc02c0f66a8c27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 12:25:00 2020 From: report at bugs.python.org (Matej Cepl) Date: Sun, 22 Mar 2020 16:25:00 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1584894300.66.0.419220879143.issue28180@roundup.psfhosted.org> Matej Cepl added the comment: Thank you very much for the hint. Do I have to include the patch for bpo-19977 only (that would be easy), or also all twelve PRs for bpo-29240 (that would probably broke my will to do it)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 13:44:39 2020 From: report at bugs.python.org (Leon Hampton) Date: Sun, 22 Mar 2020 17:44:39 +0000 Subject: [issue40043] Poor RegEx example for (?(id/name)yes-pattern|no-pattern) Message-ID: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> New submission from Leon Hampton : Hello, In the 3.7.7 documentation on Regular Expression, the Conditional Construct, (?(id/name)yes-pattern|no-pattern), is discussed. (This is a very thorough document, by the way. Good job!) One example given for the Conditional Construct does not work as described. Specifically, the example gives this matching pattern '(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that it will NOT MATCH the string ' _______________________________________ From report at bugs.python.org Sun Mar 22 13:55:41 2020 From: report at bugs.python.org (Leon Hampton) Date: Sun, 22 Mar 2020 17:55:41 +0000 Subject: [issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem In-Reply-To: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> Message-ID: <1584899741.37.0.154796453538.issue40043@roundup.psfhosted.org> Leon Hampton added the comment: Hello, There may be a bug in the implementation of the Conditional Construction of Regular Expressions, namely the (?(id/name)yes-pattern|no-pattern). In the Regular Expression documentation (https://docs.python.org/3.7/library/re.html), in the portion about the Conditional Construct, it gives this sample pattern '(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that the pattern WILL NOT MATCH this string ' RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 14:31:58 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 18:31:58 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584901918.21.0.787119389884.issue22490@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 044cf94f610e831464a69a8e713dad89878824ce by Ronald Oussoren in branch 'master': bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) https://github.com/python/cpython/commit/044cf94f610e831464a69a8e713dad89878824ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 14:32:11 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Mar 2020 18:32:11 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584901931.47.0.222876360486.issue22490@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +18471 pull_request: https://github.com/python/cpython/pull/19110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 14:33:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 18:33:41 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584902021.42.0.764452803491.issue39999@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset bace59d8b8e38f5c779ff6296ebdc0527f6db14a by Serhiy Storchaka in branch 'master': bpo-39999: Improve compatibility of the ast module. (GH-19056) https://github.com/python/cpython/commit/bace59d8b8e38f5c779ff6296ebdc0527f6db14a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 14:35:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 18:35:56 +0000 Subject: [issue39999] Fix some issues with AST node classes In-Reply-To: <1584524330.37.0.654792714903.issue39999@roundup.psfhosted.org> Message-ID: <1584902156.13.0.0800867204107.issue39999@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 Mar 22 14:47:18 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 18:47:18 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584902838.5.0.911800585154.issue22490@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +18472 pull_request: https://github.com/python/cpython/pull/19111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 14:56:30 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 18:56:30 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584903390.1.0.422491279369.issue22490@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset c959fa9353b92ce95dd7fe3f25fe65bacbe22338 by Miss Islington (bot) in branch '3.8': bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19110) https://github.com/python/cpython/commit/c959fa9353b92ce95dd7fe3f25fe65bacbe22338 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:05:36 2020 From: report at bugs.python.org (Matthew Barnett) Date: Sun, 22 Mar 2020 19:05:36 +0000 Subject: [issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem In-Reply-To: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> Message-ID: <1584903936.21.0.898852291448.issue40043@roundup.psfhosted.org> Matthew Barnett added the comment: The documentation is talking about whether it'll match at the current position in the string. It's not a bug. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:25:24 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 19:25:24 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584905124.12.0.612481678099.issue22490@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 5765acaf64cc2c52ce8a35de9407faddf6885598 by Jason R. Coombs in branch '3.7': [3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19111) https://github.com/python/cpython/commit/5765acaf64cc2c52ce8a35de9407faddf6885598 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:33:29 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 19:33:29 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584905609.69.0.974612947409.issue22490@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:33:39 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 19:33:39 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584905619.62.0.609112254571.issue22490@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:35:21 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 19:35:21 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584905721.35.0.683404098118.issue37319@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18473 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19112 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:36:36 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Sun, 22 Mar 2020 19:36:36 +0000 Subject: [issue40044] Tests failing with the latest update of openssl to version 1.1.1e Message-ID: <1584905796.83.0.576027833923.issue40044@roundup.psfhosted.org> New submission from Charalampos Stratakis : The fedora rawhide buildbots started failing due to the latest update of openssl to version 1.1.1e. e.g. https://buildbot.python.org/all/#/builders/607/builds/137 Changelog: https://www.openssl.org/news/cl111.txt The relevant info which seems to make the tests fail: Properly detect EOF while reading in libssl. Previously if we hit an EOF while reading in libssl then we would report an error back to the application (SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. Upstream PR: https://github.com/openssl/openssl/pull/10882 urllib3 issue: https://github.com/urllib3/urllib3/issues/1825 ---------- assignee: christian.heimes components: Library (Lib), SSL, Tests messages: 364818 nosy: christian.heimes, cstratak priority: normal severity: normal status: open title: Tests failing with the latest update of openssl to version 1.1.1e versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 15:41:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 19:41:00 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584906060.95.0.576784715605.issue37319@roundup.psfhosted.org> Serhiy Storchaka added the comment: Many functions that accepts non-integer arguments (except float) and truncate them to integers emits a deprecation warning since 3.8 (see issue36048 and issue20092). They will be errors in 3.10 (see 37999). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 16:24:31 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Sun, 22 Mar 2020 20:24:31 +0000 Subject: [issue40044] Tests failing with the latest update of openssl to version 1.1.1e In-Reply-To: <1584905796.83.0.576027833923.issue40044@roundup.psfhosted.org> Message-ID: <1584908671.27.0.293448154424.issue40044@roundup.psfhosted.org> Charalampos Stratakis added the comment: Closing it as duplicate of https://bugs.python.org/issue40018 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 16:24:51 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Sun, 22 Mar 2020 20:24:51 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584908691.95.0.939009463047.issue40018@roundup.psfhosted.org> Charalampos Stratakis added the comment: The relevant info which seems to make the tests fail: Properly detect EOF while reading in libssl. Previously if we hit an EOF while reading in libssl then we would report an error back to the application (SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. Upstream PR: https://github.com/openssl/openssl/pull/10882 urllib3 issue: https://github.com/urllib3/urllib3/issues/1825 ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 16:52:50 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Mar 2020 20:52:50 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584910370.35.0.821223182543.issue37319@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm generally against "fixing" things that aren't broken. AFAICT, this has never been an issue for any real user over its 20 year history. Also, the current PR makes the code look gross and may impact code that is currently working. Tim, this is mostly your code, what do you think? ---------- assignee: -> tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:07:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Mar 2020 21:07:01 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584911221.13.0.625034202431.issue37319@roundup.psfhosted.org> Serhiy Storchaka added the comment: Using index() simplifies the code. Adding deprecation warnings complicates it. The PR consists of two commits, look at the first one to see how the code can finally look. If you think that the deprecation is not needed, we can just keep the simplified version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:07:55 2020 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 22 Mar 2020 21:07:55 +0000 Subject: [issue39989] Output closing parenthesis in ast.dump() on separate line In-Reply-To: <1584432372.22.0.904187572723.issue39989@roundup.psfhosted.org> Message-ID: <1584911275.81.0.765604457618.issue39989@roundup.psfhosted.org> Anthony Sottile added the comment: fwiw, astpretty's output looks like the black output: https://github.com/asottile/astpretty >>> astpretty.pprint(ast.parse('if x == y: y += 4').body[0]) If( lineno=1, col_offset=0, test=Compare( lineno=1, col_offset=3, left=Name(lineno=1, col_offset=3, id='x', ctx=Load()), ops=[Eq()], comparators=[Name(lineno=1, col_offset=8, id='y', ctx=Load())], ), body=[ AugAssign( lineno=1, col_offset=11, target=Name(lineno=1, col_offset=11, id='y', ctx=Store()), op=Add(), value=Num(lineno=1, col_offset=16, n=4), ), ], orelse=[], ) ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:40:46 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 22 Mar 2020 21:40:46 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1584913246.62.0.931567927655.issue22490@roundup.psfhosted.org> Jason R. Coombs added the comment: I've filed [Homebrew/brew#7204](https://github.com/Homebrew/brew/issues/7204) to track the testing/validation of this change against Homebrew. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:41:54 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 22 Mar 2020 21:41:54 +0000 Subject: [issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS) In-Reply-To: <1576838540.23.0.689551930127.issue39107@roundup.psfhosted.org> Message-ID: <1584913314.26.0.678683318688.issue39107@roundup.psfhosted.org> Change by Ido Michael : ---------- nosy: -Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:42:47 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 22 Mar 2020 21:42:47 +0000 Subject: [issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError In-Reply-To: <1574201186.66.0.441437608856.issue38856@roundup.psfhosted.org> Message-ID: <1584913367.29.0.765196422286.issue38856@roundup.psfhosted.org> Change by Ido Michael : ---------- nosy: -Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 17:47:14 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 22 Mar 2020 21:47:14 +0000 Subject: [issue15436] __sizeof__ is not documented In-Reply-To: <1343073282.53.0.774447573036.issue15436@psf.upfronthosting.co.za> Message-ID: <1584913634.27.0.519252700541.issue15436@roundup.psfhosted.org> Change by Ido Michael : ---------- nosy: -Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 18:01:50 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 22 Mar 2020 22:01:50 +0000 Subject: [issue35885] configparser: indentation In-Reply-To: <1549061954.1.0.734541407213.issue35885@roundup.psfhosted.org> Message-ID: <1584914510.96.0.756964342529.issue35885@roundup.psfhosted.org> Ido Michael added the comment: @SilentGhost Added documentation to the module and a test for a give space indent in the module test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 18:06:01 2020 From: report at bugs.python.org (Ido Michael) Date: Sun, 22 Mar 2020 22:06:01 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1584914761.96.0.628962786824.issue10572@roundup.psfhosted.org> Ido Michael added the comment: GH-18727 Only tkinter module for start. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 18:33:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Mar 2020 22:33:40 +0000 Subject: [issue15436] __sizeof__ is not documented In-Reply-To: <1343073282.53.0.774447573036.issue15436@psf.upfronthosting.co.za> Message-ID: <1584916420.09.0.732929479439.issue15436@roundup.psfhosted.org> Raymond Hettinger added the comment: > I can add those changes if someone didn't take it already? I think we've decided that this is an implementation specific detail. ---------- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 18:40:38 2020 From: report at bugs.python.org (SilentGhost) Date: Sun, 22 Mar 2020 22:40:38 +0000 Subject: [issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem In-Reply-To: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> Message-ID: <1584916838.68.0.888212510997.issue40043@roundup.psfhosted.org> SilentGhost added the comment: Leon, this most likely is not a bug, not because what's stated in documentation, but because you're most likely not testing what you think you do. Here is the test that you should be doing: >>> re.match(r'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)', '>> No match. If there is a different output in your setup, please provide both the output and the details of your system and Python installation. ---------- nosy: +SilentGhost stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 19:29:08 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Sun, 22 Mar 2020 23:29:08 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1584919748.34.0.420865406907.issue21760@roundup.psfhosted.org> Furkan ?nder added the comment: I sent a PR to fix a __file__ description. https://github.com/python/cpython/pull/19097 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 20:50:33 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 23 Mar 2020 00:50:33 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate Message-ID: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> New submission from Kyle Stanley : In a recent python-ideas thread, the rule of dunder methods being reserved for Python internal usage only was brought up (https://mail.python.org/archives/list/python-ideas at python.org/message/GMRPSSQW3SXNCP4WU7SYDINL67M2WLQI/), due to an author of a third party library using them without knowing better. Steven D'Aprano linked the following section of the docs that defines the rule: https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers. When I had attempted to search for the rule in the documentation (prior to the above discussion), I noticed that it was rather difficult to discover because it was written just as "System-defined names" with no mention of "dunder" (which is what the dev community typically refers to them as, at least in more recent history). To make it easier for the average user and library maintainer to locate this section, I propose changing the first line to one of the following: 1) System-defined names, also known as "dunder" names. 2) System-defined names, informally known as "dunder" names. I'm personally in favor of (1), but I could also see a reasonable argument for (2). If we can decide on the wording, it would make for a good first-time PR to the CPython docs. ---------- assignee: docs at python components: Documentation keywords: easy, newcomer friendly messages: 364832 nosy: aeros, docs at python priority: normal severity: normal status: open title: Make "dunder" method documentation easier to locate type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 20:54:55 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 23 Mar 2020 00:54:55 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1584924895.23.0.762639628148.issue40045@roundup.psfhosted.org> Change by Kyle Stanley : ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 21:44:12 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Mon, 23 Mar 2020 01:44:12 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584927852.39.0.517418376285.issue1635741@roundup.psfhosted.org> Paulo Henrique Silva added the comment: About half of the remaining refs are related to encodings. I noticed that caches on Lib/encodings/__init__.py and codec_search_cach of PyInterpreterState are the places holding the refs. I removed those caches and number went do to: Before: 4382 refs left After : 2344 refs left (-46%) The way to destroy codec_search_cache was recently changed on #36854 and $38962. (Not proposing to merge this, but my changes are at https://github.com/python/cpython/compare/master...phsilva:remove-codec-caches). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 22 21:47:10 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 23 Mar 2020 01:47:10 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584928030.05.0.944021852989.issue37319@roundup.psfhosted.org> Tim Peters added the comment: I have scant memory of working on this code. But back then Python wasn't at all keen to enforce type checking in harmless contexts. If, e.g., someone found it convenient to pass integers that happened to be in float format to randrange(), why not? Going "tsk, tsk, tsk" won't help them get their work done ;-) If we were restarting from scratch, I'd be happy enough to say "screw floats here - _and_ screw operator.index() - this function requires ints, period". But, as is, I see insufficient benefit to potentially making code that's been working fine for decades "deprecated". Yes, I realize the code may eventually become marginally faster then. That doesn't, to my eyes, outweigh the certainty of annoying some users. ---------- assignee: tim.peters -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 00:14:40 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 23 Mar 2020 04:14:40 +0000 Subject: [issue40028] Math module method to find prime factors for non-negative int n In-Reply-To: <1584733974.83.0.0417466712916.issue40028@roundup.psfhosted.org> Message-ID: <1584936880.72.0.411150920782.issue40028@roundup.psfhosted.org> Tim Peters added the comment: Jonathan, _almost_ no factoring algorithms have any use for a table of primes. Brute force trial division can use one, but that's about it. A table of primes _is_ useful for implementing functions related to pi(x) = the number of primes <= x, and the bigger the table the better. But that's not what this report is about. Raymond, spinning up a process to factor a small integer is pretty wildly expensive and clumsy - even if you're on a box with gfactor. This is the kind of frequently implemented thing where someone who knows what they're doing can easily whip up relatively simple Python code that's _far_ better than what most users come up with on their own. For example, to judge from many stabs I've seen on StackOverflow, most users don't even realize that trial division can be stopped when the trial divisor exceeds the square root of what remains of the integer to be factored. Trial division alone seems perfectly adequate for factoring 32-bit ints, even at Python speed, and even if it merely skips multiples of 2 and 3 (except, of course, for 2 and 3 themselves). Pollard rho seems perfectly adequate for factoring 64-bit ints that _are_ composite (takes time roughly proportional to the square root of the smallest factor), but really needs to be backed by a fast "is it a prime?" test to avoid taking "seemingly forever" if fed a large prime. To judge from the docs I could find, that's as far as gfactor goes too. Doing that much in Python isn't a major project. Arguing about the API would consume 10x the effort ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 01:15:30 2020 From: report at bugs.python.org (hai shi) Date: Mon, 23 Mar 2020 05:15:30 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584940530.81.0.925899209505.issue1635741@roundup.psfhosted.org> hai shi added the comment: > I noticed that caches on Lib/encodings/__init__.py and codec_search_cach of PyInterpreterState are the places holding the refs. I removed those caches and number went do to. Good Catch, Paulo. IMHO, caches is useful in codecs(it's improve the search efficiency). I have two humble idea: 1. Clean all item of codec_search_xxx in `Py_Finalize()`; 2. change the refcount mechanism(in this case, refcount+1 or refcount+2 make no differenct); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 01:17:57 2020 From: report at bugs.python.org (laike9m) Date: Mon, 23 Mar 2020 05:17:57 +0000 Subject: [issue30951] Documentation error in inspect module In-Reply-To: <1500312575.69.0.52467451771.issue30951@psf.upfronthosting.co.za> Message-ID: <1584940677.5.0.78394085109.issue30951@roundup.psfhosted.org> Change by laike9m : ---------- nosy: +laike9m _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 02:02:28 2020 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Mon, 23 Mar 2020 06:02:28 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584943348.38.0.0356355621962.issue39148@roundup.psfhosted.org> Alex Gr?nholm added the comment: Well, I found this: https://github.com/python/cpython/blob/3c97e1e457033bbb8bbe0b7198bd13fc794a12b0/configure.ac#L3278-L3279 Could it be that the official binaries were compiled without --enable-ipv6? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 02:03:39 2020 From: report at bugs.python.org (zd nex) Date: Mon, 23 Mar 2020 06:03:39 +0000 Subject: [issue39672] SIGSEGV crash on shutdown with shelve & c pickle In-Reply-To: <1582019462.33.0.255360625193.issue39672@roundup.psfhosted.org> Message-ID: <1584943419.75.0.828247794203.issue39672@roundup.psfhosted.org> zd nex added the comment: So I want to properly debug this? How I can debug that call dump() for pickle? It does not seem to be possible. I guess I need to make some custom build? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 02:13:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Mar 2020 06:13:32 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584944012.2.0.239004495026.issue37319@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you are against deprecating this "feature", it should be at least documented and covered by tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 05:01:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Mar 2020 09:01:11 +0000 Subject: [issue40046] Increase test coverage of the random module Message-ID: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> New submission from Serhiy Storchaka : The propose test adds several tests for random module. Mainly tests for integer, sequence and iterable arguments. It also documents that randrange() accepts non-integers. ---------- assignee: docs at python components: Documentation, Tests messages: 364840 nosy: docs at python, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters priority: normal severity: normal status: open title: Increase test coverage of the random module type: enhancement versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 05:03:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Mar 2020 09:03:00 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1584954180.19.0.0891182309841.issue40046@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18475 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 05:23:54 2020 From: report at bugs.python.org (Kjell Braden) Date: Mon, 23 Mar 2020 09:23:54 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584955434.09.0.403690328242.issue39148@roundup.psfhosted.org> Kjell Braden added the comment: ./configure is not run on Windows, but I believe the define should go here: https://github.com/python/cpython/blob/8510f430781118d9b603c3a2f06945d6ebc5fe42/PC/pyconfig.h#L678 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 05:57:37 2020 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 23 Mar 2020 09:57:37 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584957457.81.0.0761289784017.issue39148@roundup.psfhosted.org> Andrew Svetlov added the comment: Would somebody be a champion for the issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 06:40:03 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Mar 2020 10:40:03 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1584960003.84.0.904480860343.issue38691@roundup.psfhosted.org> ?ukasz Langa added the comment: Re-opening as it causes refleaks all across the stable buildbots. I can reproduce on macOS Catalina as well. Run this to see for yourself: - ./python.exe -E -Wd -m test -uall,-gui -l -L -R: test_importlib Reverting GH-18627 fixes the issue. ---------- keywords: +needs review -patch nosy: +lukasz.langa resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 06:40:39 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Mar 2020 10:40:39 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1584960039.6.0.923357181375.issue38691@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- stage: resolved -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 07:38:31 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 23 Mar 2020 11:38:31 +0000 Subject: [issue39830] zipfile.Path is not included in __all__ In-Reply-To: <1583176669.44.0.585908649046.issue39830@roundup.psfhosted.org> Message-ID: <1584963511.14.0.343806859749.issue39830@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +18476 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 07:42:24 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Mar 2020 11:42:24 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1584963744.52.0.679347448883.issue38691@roundup.psfhosted.org> ?ukasz Langa added the comment: > Reverting GH-18627 fixes the issue. Sorry, this is false. I just checked out to the last commit to importlib before GH-18627 and it did not refleak. But when I actually reverted just GH-18627, the issue persisted. By bisecting, I found out that it's GH-19084 which causes the refleak and it only just so happens that this refleak appears in importlib tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 07:45:45 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Mar 2020 11:45:45 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584963945.28.0.24676498349.issue1635741@roundup.psfhosted.org> ?ukasz Langa added the comment: The last merged pull request, GH-GH-19084, causes refleaks in importlib tests. Stable buildbots are failing, I can reproduce on macOS Catalina. You can test yourself by running: $ ./python.exe -E -Wd -m test -uall,-gui -l -L -R: test_importlib Master at 2de7ac9798 does not fail while the next commit, 8334f30a74, introduces the failure. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 08:25:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 12:25:13 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584966313.62.0.881565583226.issue40018@roundup.psfhosted.org> STINNER Victor added the comment: bpo-40044 was marked as a duplicate of this issue. Copy of Charalampos's message: """ The fedora rawhide buildbots started failing due to the latest update of openssl to version 1.1.1e. e.g. https://buildbot.python.org/all/#/builders/607/builds/137 Changelog: https://www.openssl.org/news/cl111.txt The relevant info which seems to make the tests fail: Properly detect EOF while reading in libssl. Previously if we hit an EOF while reading in libssl then we would report an error back to the application (SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. Upstream PR: https://github.com/openssl/openssl/pull/10882 urllib3 issue: https://github.com/urllib3/urllib3/issues/1825 """ ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 09:16:45 2020 From: report at bugs.python.org (Tomohiko Kinebuchi) Date: Mon, 23 Mar 2020 13:16:45 +0000 Subject: [issue40041] Typo in argparse ja-document wrong:'append', correct:'extend' In-Reply-To: <1584877231.67.0.450516943499.issue40041@roundup.psfhosted.org> Message-ID: <1584969405.65.0.100172740591.issue40041@roundup.psfhosted.org> Tomohiko Kinebuchi added the comment: Japanese translation issues are tracked in the repository below for historical reasons. So, please create a report about this issue in English or Japanese. https://github.com/python-doc-ja/python-doc-ja/issues ---------- nosy: +cocoatomo versions: +Python 3.8 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 09:29:57 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 23 Mar 2020 13:29:57 +0000 Subject: [issue39830] zipfile.Path is not included in __all__ In-Reply-To: <1583176669.44.0.585908649046.issue39830@roundup.psfhosted.org> Message-ID: <1584970197.7.0.683861347407.issue39830@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 9a81ab107a54b8ca320fb703f7c68e14ccd9d016 by Zackery Spytz in branch 'master': bpo-39830: Add zipfile.Path to __all__ (GH-19115) https://github.com/python/cpython/commit/9a81ab107a54b8ca320fb703f7c68e14ccd9d016 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 09:30:18 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Mar 2020 13:30:18 +0000 Subject: [issue39830] zipfile.Path is not included in __all__ In-Reply-To: <1583176669.44.0.585908649046.issue39830@roundup.psfhosted.org> Message-ID: <1584970218.24.0.936983427984.issue39830@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18477 pull_request: https://github.com/python/cpython/pull/19116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:34:33 2020 From: report at bugs.python.org (=?utf-8?q?Peter_W=C3=BCrtz?=) Date: Mon, 23 Mar 2020 14:34:33 +0000 Subject: [issue40047] itertools.tee does not release resources during iteration? Message-ID: <1584974073.92.0.811600975239.issue40047@roundup.psfhosted.org> New submission from Peter W?rtz : Itertools `tee` does not seem to de-reference yielded items, even after consumption of all items from all tee-iterators. According to the documentation (to my understanding), there shouldn't be any extra memory requirement as long as the tee-iterators are consumed in a balanced way. I.e. after an item was pulled from all iterators there shouldn't be any residual reference to it. This is true for the example-implementation mentioned in the documentation, but `itertools.tee` doesn't de-reference items until the tee-iterator itself is deleted: https://pastebin.com/r3JUkH41 Is this a bug or am I missing something? ---------- components: Library (Lib) messages: 364849 nosy: pwuertz priority: normal severity: normal status: open title: itertools.tee does not release resources during iteration? type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:36:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 14:36:53 +0000 Subject: [issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails Message-ID: <1584974213.54.0.484285807208.issue40048@roundup.psfhosted.org> New submission from STINNER Victor : tstate->frame is a borrowed references to the current frame object. It's set tp the frame at _PyEval_EvalFrameDefault() and resets to frame->f_back at _PyEval_EvalFrameDefault() exit. Problem: when _PyCode_InitOpcache() fails, tstate->frame is not reset to frame->f_back. ---------- components: Interpreter Core messages: 364850 nosy: vstinner priority: normal severity: normal status: open title: _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:43:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 14:43:29 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1584974609.62.0.876680884643.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: Right now, threading_shutdown_interrupted.py does crash on the master branch (commit 05e4a296ecc127641160a04f39cc02c0f66a8c27). I reintroduced the bug with: commit 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 Author: Victor Stinner Date: Mon Mar 9 23:37:49 2020 +0100 bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848) Clear the frames of daemon threads earlier during the Python shutdown to call objects destructors. So "unclosed file" resource warnings are now emitted for daemon threads in a more reliable way. I investigated this bug with Pablo Galindo Salgado. When the bug triggers, there are 2 strong references to a Frame object: * Traceback object * Generator object The bug occurs in "except ValueError as exc:" of EvilThread.coroutine(). The exception contains a traceback object which has a strong reference to the frame. The frame object contains "exc" variable (the exception) which contains a reference to the tracecback (exc.__traceback__) which contains a refererence to the frame (tb.tb_frame): there is a reference cycle. (It's not really an issue by itself). There are 2 strong references to the Frame object. Py_FinalizeEx() calls _PyThreadState_DeleteExcept() which doesn't clear the reference cycle. But PyThreadState_Clear() calls Py_CLEAR(tstate->frame) which reduces the Frame reference counter from 2 to 1, even if there are still 2 strong references to it (traceback and generator). tstate->frame is only set at 3 places: * new_threadstate(): when a Python thread state is created (it's initialized to NULL) * _PyEval_EvalFrameDefault() entry: set to frame * _PyEval_EvalFrameDefault() exit: set to frame->f_back (which can be NULL By the way, _PyEval_EvalFrameDefault() has a bug: tstate->frame is not reset if _PyCode_InitOpcache() fails: bpo-40048. Py_FinalizeEx() calls _PyRuntimeState_SetFinalizing(runtime, tstate) and so threads which tries to take the GIL must exit immediately. Extract of take_gil(): --- static inline int tstate_must_exit(PyThreadState *tstate) { PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(&_PyRuntime); return (finalizing != NULL && finalizing != tstate); } static void take_gil(PyThreadState *tstate) { ... if (tstate_must_exit(tstate)) { PyThread_exit_thread(); } ... } --- The thread is exited in the middle of _PyEval_EvalFrameDefault() by take_gil() which calls PyThread_exit_thread() because the thread must exit (because the main thread destroyed its Python thread state and so accessing it would crash the thread). _PyThreadState_DeleteExcept() calls PyThreadState_Clear() which calls Py_CLEAR(tstate->frame): this case only occurs because the thread exited in the middle of _PyEval_EvalFrameDefault(). In the normal case, _PyEval_EvalFrameDefault() always resets tstate->frame to its previous value. Py_CLEAR(tstate->frame) is wrong: it's a *borrowed* reference. Pablo and me agree with PyThreadState_Clear() must not call Py_CLEAR(tstate->frame): it's borrowed reference, not a strong reference. I'm working on a PR to fix the issue. ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:48:32 2020 From: report at bugs.python.org (Matheus Castanho) Date: Mon, 23 Mar 2020 14:48:32 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584974912.42.0.57695284284.issue40018@roundup.psfhosted.org> Matheus Castanho added the comment: Hi, I believe this is the exact same problem as reported by https://bugs.python.org/issue39787 Both issues could be closed by the same fix =) ---------- nosy: +mscastanho _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:52:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 14:52:52 +0000 Subject: [issue39787] test_ssl and test_urllib2_localnet failing with new OpenSSL In-Reply-To: <1582920158.93.0.343168507997.issue39787@roundup.psfhosted.org> Message-ID: <1584975172.01.0.890781426492.issue39787@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-40018. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_ssl fails with OpenSSL 1.1.1e _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:52:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 14:52:54 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584975174.93.0.345895832368.issue40018@roundup.psfhosted.org> STINNER Victor added the comment: I closed bpo-39787 "test_ssl and test_urllib2_localnet failing with new OpenSSL" as a duplicate of this issue. Copy of the message: """ test_ssl and test_urllib2_localnet are failing when Python is built against top-of-tree OpenSSL. I'm attaching the output of: `regrtest.py test_ssl test_urllib2_localnet -W` The output is from a powerpc64le machine with Python 3.8.2+ (1bbb81b251bc) and OpenSSL master (db943f43a60d1b). A git bisect showed the problems started with the following OpenSSL commit: commit db943f43a60d1b5b1277e4b5317e8f288e7a0a3a Author: Matt Caswell Date: Fri Jan 17 17:39:19 2020 +0000 Detect EOF while reading in libssl If we hit an EOF while reading in libssl then we will report an error back to the application (SSL_ERROR_SYSCALL) but errno will be 0. We add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. Contains a partial fix for #10880 Reviewed-by: Tomas Mraz Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/10882) This also looks similar to: https://bugs.python.org/issue28689 """ There is a file attached which contains test failures like these ones: test_ciphers (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 39550) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: selected protocol is now None Test server failure: Traceback (most recent call last): File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/test_ssl.py", line 2388, in run msg = self.read() File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/test_ssl.py", line 2365, in read return self.sslconn.read() File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1101, in read return self._sslobj.read(len) OSError: [Errno 0] Error ERROR ====================================================================== ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/test_ssl.py", line 2038, in test_connect_capath s.connect(self.server_addr) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1333, in _real_connect self.do_handshake() File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ====================================================================== ERROR: test_https (test.test_urllib2_localnet.TestUrlopen) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/test_urllib2_localnet.py", line 560, in test_https data = self.urlopen("https://localhost:%s/bizarre" % handler.port, context=context) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/test_urllib2_localnet.py", line 464, in urlopen l.extend(f.readlines(200)) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/http/client.py", line 655, in readline result = self.fp.readline(limit) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/socket.py", line 669, in readinto return self._sock.recv_into(b) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1241, in recv_into return self.read(nbytes, buffer) File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/ssl.py", line 1099, in read return self._sslobj.read(len, buffer) ssl.SSLError: [SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:2607) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 10:58:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 14:58:02 +0000 Subject: [issue38243] [security][CVE-2019-16935] A reflected XSS in python/Lib/DocXMLRPCServer.py In-Reply-To: <1569032250.18.0.545337961077.issue38243@roundup.psfhosted.org> Message-ID: <1584975482.73.0.126802332681.issue38243@roundup.psfhosted.org> STINNER Victor added the comment: Charalampos Strataris's advice: If you backport the security fix and test_docxmlrpc starts to hang randomly, you should also backport bpo-27614 fix. For example, it's the commit 3911d8333c5b6f9374fa11ab7c912f1471580f0f for Python 2.7. We had the issue on RHEL 7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:18:44 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 23 Mar 2020 15:18:44 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1584976724.21.0.0613994462309.issue40018@roundup.psfhosted.org> Kubilay Kocak added the comment: Confirming on FreeBSD CURRENT buildbot worker which had its openssl updated to 1.1.1e a number of days ago. I reverted back to 1.1.1d Full log of the failing build/tests with 1.1.1e attached ---------- nosy: +koobs Added file: https://bugs.python.org/file48997/amd64.freebsd.shared.3.x.build.450.test.stdio.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:36:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 15:36:40 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584977800.36.0.322078033599.issue37319@roundup.psfhosted.org> Raymond Hettinger added the comment: How about we just leave it alone. AFAICT nothing is broken -- no user is having any issues. We really don't need to go through every tool in the standard library that uses int() and document that it accepts any type that defines __int__, nor do we need to test those cases. I understand that you are bugged by this but it isn't a real problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:42:53 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 15:42:53 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1584978173.98.0.858912824878.issue40046@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm against this doc change. While factually true, it is irrelevant and distracting to most users. We do not need to test and document every implementation detail, nor should we. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:48:10 2020 From: report at bugs.python.org (Damian Yurzola) Date: Mon, 23 Mar 2020 15:48:10 +0000 Subject: [issue40033] Just defined class missing from scope In-Reply-To: <1584809349.61.0.7412480872.issue40033@roundup.psfhosted.org> Message-ID: <1584978490.22.0.961560027989.issue40033@roundup.psfhosted.org> Change by Damian Yurzola : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:51:20 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Mar 2020 15:51:20 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1584978680.2.0.710831334589.issue40046@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is wrong with adding more tests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 11:54:18 2020 From: report at bugs.python.org (Danijel) Date: Mon, 23 Mar 2020 15:54:18 +0000 Subject: [issue40049] tarfile cannot extract from stdin Message-ID: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> New submission from Danijel : Hi, I have the following code: ``` import tarfile import sys tar = tarfile.open(fileobj=sys.stdin.buffer, mode='r|*') tar.extractall("tarout") tar.close() ``` then doing the following on a debian 10 system: ``` $ python -m tarfile -c git.tar /usr/share/doc/git $ python -V Python 3.8.1 $ cat git.tar | python foo.py $ cat git.tar | python foo.py Traceback (most recent call last): File "foo.py", line 5, in tar.extractall("tarout") File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2026, in extractall self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(), File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2067, in extract self._extract_member(tarinfo, os.path.join(path, tarinfo.name), File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2139, in _extract_member self.makefile(tarinfo, targetpath) File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2178, in makefile source.seek(tarinfo.offset_data) File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 513, in seek raise StreamError("seeking backwards is not allowed") tarfile.StreamError: seeking backwards is not allowed ``` The second extraction trys to seek, although the mode is 'r|*'. For reference if I remove ".buffer" from the code above, I can run it with python2 without problems: ``` $ cat foo2.py import tarfile import sys tar = tarfile.open(fileobj=sys.stdin, mode='r|*') tar.extractall("tarout") tar.close() $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py ``` ---------- components: Library (Lib) messages: 364860 nosy: dtamuc priority: normal severity: normal status: open title: tarfile cannot extract from stdin versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 12:12:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 16:12:15 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584979935.37.0.855474623404.issue40014@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18478 pull_request: https://github.com/python/cpython/pull/19117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 12:21:48 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Mar 2020 16:21:48 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584980508.23.0.612105516297.issue39148@roundup.psfhosted.org> Steve Dower added the comment: Main thing we need is a PR (straightforward) and confirming that the relevant tests all run. We can use the buildbot fleet to make sure that all supported platforms have the necessary APIs, but it wouldn't surprise me if there's some weird edge cases here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 12:56:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 16:56:12 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584982572.53.0.181558568838.issue40014@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18479 pull_request: https://github.com/python/cpython/pull/19118 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 12:58:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 16:58:20 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584982700.06.0.322930820627.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: tl; dr os.getgrouplist() is limited to 17 groups and fails with a random OSError if the request user has more groups. PR 19118 fix the issue. -- On macOS-10.15.1-x86_64-i386-64bit (python -m platform), os.getgrouplist() fails with my user name and group identifier: >>> os.getgrouplist('haypo', 20) Traceback (most recent call last): File "", line 1, in OSError: [Errno 0] Error Full example: macbook:master haypo$ ./python.exe Python 3.9.0a4+ (heads/master:da2914d, Mar 20 2020, 09:45:36) [Clang 11.0.0 (clang-1100.0.33.8)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os, pwd >>> entry=pwd.getpwuid(os.getuid()) >>> os.getgrouplist(entry.pw_name, entry.pw_gid) Traceback (most recent call last): File "", line 1, in InterruptedError: [Errno 4] Interrupted system call >>> os.getgrouplist(entry.pw_name, entry.pw_gid) Traceback (most recent call last): File "", line 1, in OSError: [Errno 0] Error >>> entry pwd.struct_passwd(pw_name='haypo', pw_passwd='********', pw_uid=502, pw_gid=20, pw_gecos='Victor Stinner', pw_dir='/Users/haypo', pw_shell='/bin/bash') My user has the following groups: macbook:master haypo$ id uid=502(haypo) gid=20(staff) groups=20(staff),702(com.apple.sharepoint.group.2),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),703(com.apple.sharepoint.group.3) My user has 18 groups. MAX_GROUPS=16, Python uses 1 + MAX_GROUPS. getgrouplist() manual page says: RETURN VALUES The getgrouplist() function returns 0 on success. If the size of the group list is too small to hold all the user's groups, getgrouplist() returns -1 to indicate failure. In this case, the group array will be filled with as many groups as will fit. In short, getgrouplist() doesn't set errno on failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 12:59:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 16:59:57 +0000 Subject: [issue40014] os.getgrouplist() fails on macOS 10.15 (Catalina) if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584982797.9.0.420513789854.issue40014@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: os.getgrouplist() can fail on macOS -> os.getgrouplist() fails on macOS 10.15 (Catalina) if the user has more than 17 groups _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:02:45 2020 From: report at bugs.python.org (Derek Keeler) Date: Mon, 23 Mar 2020 17:02:45 +0000 Subject: [issue38972] [venv] Link to instructions to change PowerShell execution policy for venv activation In-Reply-To: <1575483846.28.0.24893284684.issue38972@roundup.psfhosted.org> Message-ID: <1584982965.36.0.938255145596.issue38972@roundup.psfhosted.org> Derek Keeler added the comment: Where would we like to put this information? My proposal would be to add this in a combination of places: 1. Add a further note near the symlinks on Windows comment in this document: `Doc\using\venv-create.inc` 2. Add a blurb in the Activate.ps1 script itself, so that any user can see it very near where the problem might occur. `Lib\venv\scripts\common\Activate.ps1` I'd probably put something like the following in there: --- .. note:: On Microsoft Windows, it may be required to enable the ``Activate.ps1`` script by setting the execution policy for the user. You can do this by issuing the following Powershell command from a Powershell command window: PS C:\Users\user> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser See `About Execution Policies `_ for more information. --- (This would exist as a ".Notes" section in the Activate.ps1 script) What do folks think? ---------- nosy: +d3r3kk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:02:57 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Mar 2020 17:02:57 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1584982977.83.0.921730009958.issue40024@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18480 pull_request: https://github.com/python/cpython/pull/19119 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:22:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 17:22:07 +0000 Subject: [issue40014] os.getgrouplist() fails on macOS 10.15 (Catalina) if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584984127.84.0.292322389754.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.7 and 3.8 are also affected on macOS 10.15 (Catalina). ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:24:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 17:24:30 +0000 Subject: [issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails In-Reply-To: <1584974213.54.0.484285807208.issue40048@roundup.psfhosted.org> Message-ID: <1584984270.01.0.744320859203.issue40048@roundup.psfhosted.org> STINNER Victor added the comment: Note: I found this issue with Pablo Galindo Galgado while investigating bpo-20526. ---------- nosy: +inada.naoki, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:27:54 2020 From: report at bugs.python.org (SilentGhost) Date: Mon, 23 Mar 2020 17:27:54 +0000 Subject: [issue36759] astimezone() fails on Windows for pre-epoch times In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1584984474.54.0.199956054179.issue36759@roundup.psfhosted.org> SilentGhost added the comment: Yes, I was also able to verify this issue on 3.8.2 on win10. Argument to astimezone is not required, and this happens for both na?ve and aware objects. ---------- nosy: +belopolsky, p-ganssle resolution: duplicate -> stage: resolved -> test needed status: closed -> open superseder: [Windows] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6 -> title: datetime: astimezone() results in OSError: [Errno 22] Invalid argument -> astimezone() fails on Windows for pre-epoch times versions: +Python 3.8, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:30:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 17:30:39 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1584984639.51.0.564203654701.issue40039@roundup.psfhosted.org> STINNER Victor added the comment: Lib/multiprocessing/connection.py uses a challenge to authenticate the client. How do you connect to the server? Yes, it's known that pickle is not safe, there is a big red warning at the top of the doc: https://docs.python.org/dev/library/pickle.html But please elaborate your attack scenario. How do you execute arbitrary code on a server? How do you inject code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:34:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 17:34:40 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1584984880.68.0.737142236598.issue20526@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18481 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 13:57:09 2020 From: report at bugs.python.org (Terry Davis) Date: Mon, 23 Mar 2020 17:57:09 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1584986229.41.0.847593849866.issue40012@roundup.psfhosted.org> Terry Davis added the comment: It seems like using "noindex" to tell search engines not to look at Python 2 docs at all would have the side-effect of breaking Python 2 documentation searches. I have gotten into the habit of searching for "python 3" explicitly, which I think is a reasonable work-around. Especially since python 2 and 3 could be considered different languages. ---------- nosy: +Terry Davis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:01:04 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 18:01:04 +0000 Subject: [issue34591] smtplib mixes RFC821 and RFC822 addresses In-Reply-To: <1536180104.03.0.56676864532.issue34591@psf.upfronthosting.co.za> Message-ID: <1584986464.94.0.503042992236.issue34591@roundup.psfhosted.org> Manjusaka added the comment: > This is a problem because not all RFC822 addresses are valid RFC821 addresses. Do you mean that we would add a verification before we send the command? ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:14:50 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 23 Mar 2020 18:14:50 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584987290.58.0.0455565137475.issue40014@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR, Victor, it does address the problem. I went back and explicitly tested on macOS 10.14 and 10.13 by creating some more groups and adding the user to them and the same failure occurred there so this is not just a 10.15 issue. Most likely this hasn't been an issue before is that 10.15 creates more groups for system services than the earlier versions did. So the PR should be updated to remove the 10.15 (and 10.5!) references. ---------- title: os.getgrouplist() fails on macOS 10.15 (Catalina) if the user has more than 17 groups -> os.getgrouplist() can fail on macOS if the user has more than 17 groups _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:15:55 2020 From: report at bugs.python.org (hai shi) Date: Mon, 23 Mar 2020 18:15:55 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584987355.87.0.706334981533.issue1635741@roundup.psfhosted.org> hai shi added the comment: > The last merged pull request, GH-GH-19084, causes refleaks in importlib tests. Stable buildbots are failing, I can reproduce on macOS Catalina. thanks, ?ukasz. I catched this problem in my vm of centos too. I don't the broken reason temporarily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:19:36 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 23 Mar 2020 18:19:36 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584987576.82.0.0448955047893.issue37319@roundup.psfhosted.org> Tim Peters added the comment: It's neither "bug" nor "feature" - it's an inherited quirk CPython maintains to avoid annoying users for no good reason. If you absolutely have to "do something", how about adding a mere footnote? The docs already imply the args have the same restrictions as for `range()`. A footnote could add that, to preserve historical compatibility, CPython also accepts arguments `x` for which `int(x) == x`, and uses `int(x)` in such cases - but portable code shouldn't rely on that. But nobody cares, so putting that in the main part of the docs would also annoy 99.99% of users for no good reason ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:21:44 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 18:21:44 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1584987704.29.0.209544073128.issue39853@roundup.psfhosted.org> Manjusaka added the comment: I have tried it on Python 3.7.3 Ubuntu 18.04 Linux-4.15.0-1060-aws-x86_64-with-debian-buster-sid Python 3.7.3 (default, Mar 23 2020, 18:15:26) [GCC 7.5.0] there is no segmentation fault would you mind sharing the core dump to help us find more detail about the crash? ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:21:56 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 18:21:56 +0000 Subject: [issue40033] Just defined class missing from scope In-Reply-To: <1584809349.61.0.7412480872.issue40033@roundup.psfhosted.org> Message-ID: <1584987716.51.0.391600348305.issue40033@roundup.psfhosted.org> Raymond Hettinger added the comment: > I assumed that Level1A should already be in scope while defining > the insides of Level1B. But it isn't. That analysis is correct. Class namespaces don't nest like functions do. The "enclosing" namespace is globals, not the surrounding class. This isn't a bug, but it is understandable why you might assume otherwise. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:24:41 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 18:24:41 +0000 Subject: [issue37319] Deprecate using random.randrange() with non-integers In-Reply-To: <1560801155.55.0.20318571261.issue37319@roundup.psfhosted.org> Message-ID: <1584987881.47.0.314637675856.issue37319@roundup.psfhosted.org> Raymond Hettinger added the comment: Marking this as rejected. Nothing good would come from obfuscating the docs to note a minor implementation detail. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:26:20 2020 From: report at bugs.python.org (Kjell Braden) Date: Mon, 23 Mar 2020 18:26:20 +0000 Subject: [issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop In-Reply-To: <1577530511.62.0.532247879973.issue39148@roundup.psfhosted.org> Message-ID: <1584987980.04.0.592673792817.issue39148@roundup.psfhosted.org> Change by Kjell Braden : ---------- keywords: +patch pull_requests: +18482 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:29:55 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 18:29:55 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1584988195.83.0.00246970375963.issue39853@roundup.psfhosted.org> Manjusaka added the comment: use the same GCC 8.3.0 to recompile the Python 3.7.3 still no fault maybe we need the core dump to figure it out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:31:28 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Mon, 23 Mar 2020 18:31:28 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584988288.72.0.292596768194.issue1635741@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18483 pull_request: https://github.com/python/cpython/pull/19122 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:35:09 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 18:35:09 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1584988509.02.0.455241816084.issue40045@roundup.psfhosted.org> Raymond Hettinger added the comment: I vote for #2. It improves findability while also recognizing that "dunder" isn't a formal term and lies somewhere between slang and jargon. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:40:45 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 23 Mar 2020 18:40:45 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1584988845.6.0.818657676271.issue20526@roundup.psfhosted.org> Ned Deily added the comment: (This issue previously had "release blocker" priority before it was closed. Now that it is re-opened does it still need that? I'm assuming not.) ---------- nosy: +ned.deily priority: release blocker -> high versions: +Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:42:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 18:42:02 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1584988922.12.0.972777423194.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: > (This issue previously had "release blocker" priority before it was closed. Now that it is re-opened does it still need that? I'm assuming not.) Techicanilly, it's a 3.9 regression but I don't think that it should be hold 3.9 release. So no, it's not a blocker issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:46:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 18:46:03 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584989163.88.0.46400990746.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: > Most likely this hasn't been an issue before is that 10.15 creates more groups for system services than the earlier versions did. Aha, interesting. I updated my PR to remove mentions of the macOS version number. I just wrote "on macOS". Yeah, I wouldn't be surprised that the function always failed. -- I'm not sure that the Linux implementation is correct. It rely on errno, whereas Linux manual page of getgrouplist() doesn't say anything about errno being set on error. Moreover, on Linux, getgrouplist() can also fail with -1 if the group list is too small. In that case, ngroups is updated to the number of groups and so can be used to enlarge the list! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:49:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 18:49:38 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1584989378.64.0.203272643382.issue39853@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.7.3 is outdated. Can you please try on newer Python version? I failed to reproduce the crash on Fedora 31. I tested: vstinner at apu$ python3.7 -VV Python 3.7.6 (default, Jan 30 2020, 09:44:41) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] vstinner at apu$ python3.8 -VV Python 3.8.2 (default, Feb 26 2020, 00:00:00) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] vstinner at apu$ python3.9 -VV Python 3.9.0a4 (default, Feb 27 2020, 00:00:00) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] vstinner at apu$ python3-debug -VV Python 3.7.6 (default, Jan 30 2020, 09:04:19) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:57:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 18:57:54 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1584989874.54.0.717680214198.issue39853@roundup.psfhosted.org> STINNER Victor added the comment: Try to get the gdb traceback (C call stack). You may also try: python3 -X faulthandler urllib_segfault.py. But I expect a crash in Python finalization, where there is no Python frame and so empty traceback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 14:58:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 18:58:31 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1584989911.43.0.339237651077.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bd409bb5b78e7ccac5fcda9ab4cec770552f3090 by Paulo Henrique Silva in branch 'master': bpo-1635741: Port time module to multiphase initialization (PEP 489) (GH-19107) https://github.com/python/cpython/commit/bd409bb5b78e7ccac5fcda9ab4cec770552f3090 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:00:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 19:00:15 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584990015.12.0.13820614615.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: test.pythoninfo of the macOS job on the PR: os.getgrouplist: 20, 0, 12, 61, 79, 80, 81, 98, 264, 399, 701, 33, 100, 204, 250, 395, 398, 400 os.getgroups: 20, 0, 12, 61, 79, 80, 81, 98, 264, 399, 701, 33, 100, 204, 250, 395, 398, 400 So yeah, there are 18 groups ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:01:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 19:01:05 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584990065.06.0.59123771464.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8ec7370c89aa522602eb9604086ce9f09770953d by Victor Stinner in branch 'master': bpo-40014: Fix os.getgrouplist() on macOS (GH-19118) https://github.com/python/cpython/commit/8ec7370c89aa522602eb9604086ce9f09770953d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:01:23 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Mar 2020 19:01:23 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584990083.88.0.460155074245.issue40014@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18485 pull_request: https://github.com/python/cpython/pull/19124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:01:16 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Mar 2020 19:01:16 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584990076.18.0.339392488446.issue40014@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +18484 pull_request: https://github.com/python/cpython/pull/19123 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:01:55 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 19:01:55 +0000 Subject: [issue40047] itertools.tee does not release resources during iteration? In-Reply-To: <1584974073.92.0.811600975239.issue40047@roundup.psfhosted.org> Message-ID: <1584990115.97.0.0939268345559.issue40047@roundup.psfhosted.org> Raymond Hettinger added the comment: Whats going on is that the implementation tracks blocks of 56 references at a time, freeing entire blocks at time. So the memory release does occur periodically, but not as aggressively as it could. This code shows what is going on: # Show the timing of when objects are decreffed from itertools import tee class Notify: def __init__(self, x): self.x = x def __del__(self): print('' % self.x) def __repr__(self): return 'Notify(%r)' % self.x it = map(Notify, range(100)) p, q = tee(it) for i in range(100): next(p) next(q) print(i) print('Deleting it') del it print('Deleting p') del p print('Deleting q') del q I'll look to see if the objects can be freed sooner without doing major brain surgery to the existing code. ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:02:12 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Mar 2020 19:02:12 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584990132.02.0.899624733544.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset f393b2c588559162dc2e77f8079a42e48558870a by Curtis Bucher in branch 'master': bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832) https://github.com/python/cpython/commit/f393b2c588559162dc2e77f8079a42e48558870a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:18:48 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Mar 2020 19:18:48 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584991128.3.0.182699011598.issue40014@roundup.psfhosted.org> miss-islington added the comment: New changeset 21bee0bd71e1ad270274499f9f58194ebb52e236 by Miss Islington (bot) in branch '3.8': bpo-40014: Fix os.getgrouplist() on macOS (GH-19118) https://github.com/python/cpython/commit/21bee0bd71e1ad270274499f9f58194ebb52e236 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:21:14 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Mar 2020 19:21:14 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1584991274.64.0.710474464207.issue40014@roundup.psfhosted.org> miss-islington added the comment: New changeset 1cdc61c7673f71f2cef57715e482c84efda6d9e0 by Miss Islington (bot) in branch '3.7': bpo-40014: Fix os.getgrouplist() on macOS (GH-19118) https://github.com/python/cpython/commit/1cdc61c7673f71f2cef57715e482c84efda6d9e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:30:26 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 19:30:26 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1584991826.16.0.923709301406.issue39853@roundup.psfhosted.org> Manjusaka added the comment: Hello Victor I have tried on both MacOS and Ubuntu 18.04 from 3.8.2 to the newest code in master, and can't reproduce this problem macOS-10.15.4-x86_64-i386-64bit Python 3.9.0a4+ (heads/master:9a81ab107a, Mar 24 2020, 02:06:30) [Clang 11.0.3 (clang-1103.0.32.26)] Linux-4.15.0-1060-aws-x86_64-with-glibc2.27 Python 3.8.2 (default, Mar 23 2020, 19:21:16) [GCC 8.3.0] Linux-4.15.0-1060-aws-x86_64-with-glibc2.27 Python 3.9.0a4 (default, Mar 23 2020, 19:25:43) [GCC 8.3.0] I think it may be caused by the kernel version and the glibc version, I don't have enough evidence to prove it. I will try the Python 3.7.6 to the newest version in Ubuntu 19.10 with Kernel 5.3.0-29 and GCC 8.3.0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:43:43 2020 From: report at bugs.python.org (ntninja) Date: Mon, 23 Mar 2020 19:43:43 +0000 Subject: [issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information In-Reply-To: <1580703962.85.0.294314145935.issue39533@roundup.psfhosted.org> Message-ID: <1584992623.75.0.960870251739.issue39533@roundup.psfhosted.org> Change by ntninja : ---------- keywords: +patch pull_requests: +18486 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 15:44:20 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 19:44:20 +0000 Subject: [issue40047] itertools.tee does not release resources during iteration? In-Reply-To: <1584974073.92.0.811600975239.issue40047@roundup.psfhosted.org> Message-ID: <1584992660.77.0.737112078544.issue40047@roundup.psfhosted.org> Raymond Hettinger added the comment: I've just reviewed the code. The observed behavior is an intrinsic part of the design and was an expected behavior (noted in the comments). I don't see a non-invasive way of making the memory releases more aggressive. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:01:42 2020 From: report at bugs.python.org (Alexander Hirner) Date: Mon, 23 Mar 2020 20:01:42 +0000 Subject: [issue19462] Add remove_argument() method to argparse.ArgumentParser In-Reply-To: <1383240778.45.0.779487488351.issue19462@psf.upfronthosting.co.za> Message-ID: <1584993702.52.0.663857861683.issue19462@roundup.psfhosted.org> Alexander Hirner added the comment: @paul j3 FWIW, popping optionals from a cache that is maintained in addition to self._actions, makes special conflict handling unnecessary. i.e.: for option_string in a.option_strings: parser._option_string_actions.pop(option_string) ---------- nosy: +cybertreiber _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:04:07 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 23 Mar 2020 20:04:07 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1584993847.65.0.816576042895.issue40045@roundup.psfhosted.org> Kyle Stanley added the comment: > I vote for #2. It improves findability while also recognizing that "dunder" isn't a formal term and lies somewhere between slang and jargon. Yeah, I suppose it is a bit more of a slang or jargon term rather than something with a formal definition, so (2) is fine with me. Thanks for the feedback. I'll leave the issue open for a new contributor as it would be an easy PR to work on. But, if it doesn't receive any attention within a few months or so, I'll likely just add it myself since it would be useful to me for easily locating the section in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:09:47 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 20:09:47 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1584994187.35.0.944746032661.issue36054@roundup.psfhosted.org> Manjusaka added the comment: Hello Mike, thanks for your code. I think it's a good way I think if cpu.quota and cpu.shares are -1, just return the original value in os.cpu_count() is OK ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:11:14 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 20:11:14 +0000 Subject: [issue19462] Add remove_argument() method to argparse.ArgumentParser In-Reply-To: <1383240778.45.0.779487488351.issue19462@psf.upfronthosting.co.za> Message-ID: <1584994274.85.0.353389753667.issue19462@roundup.psfhosted.org> Raymond Hettinger added the comment: > In order to migrate from optparse to argparse we need to have > an ability to substitute anguments, e.g. remove and then create. It seems to me that the original use case is obsolete. Paul, do you think this issue should be closed? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:14:46 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 20:14:46 +0000 Subject: [issue40036] Deleting duplicates in itertoolsmodule.c Message-ID: <1584994486.07.0.937671332048.issue40036@roundup.psfhosted.org> New submission from Raymond Hettinger : New changeset 8dd1792c680caaf94a00cead82b238238f419172 by AlphaHot in branch 'master': bpo-40036: Deleting duplicates in itertoolsmodule.c (GH-18958) https://github.com/python/cpython/commit/8dd1792c680caaf94a00cead82b238238f419172 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:15:51 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Mar 2020 20:15:51 +0000 Subject: [issue40036] Deleting duplicates in itertoolsmodule.c In-Reply-To: <1584994486.07.0.937671332048.issue40036@roundup.psfhosted.org> Message-ID: <1584994551.87.0.228538583236.issue40036@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the patch. I've applied it to the 3.9. Don't see any need to backport this because it is just a minor code cleanup. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:18:52 2020 From: report at bugs.python.org (Manjusaka) Date: Mon, 23 Mar 2020 20:18:52 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1584994732.1.0.746944808058.issue36054@roundup.psfhosted.org> Manjusaka added the comment: I will make a PR in this week ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:39:39 2020 From: report at bugs.python.org (C.A.M. Gerlach) Date: Mon, 23 Mar 2020 20:39:39 +0000 Subject: [issue32592] Drop support of Windows Vista and 7 in Python 3.9 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1584995979.93.0.0117530324074.issue32592@roundup.psfhosted.org> C.A.M. Gerlach added the comment: Thanks, will do as requested. I was planning on knocking it out yesterday, but some unexpected things came up so I might have to push it all the way to next weekend, but I'll get it done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 16:49:53 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Mar 2020 20:49:53 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1584996593.07.0.127535595068.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 25e580a73c163f472fdeb5489bebef85da21655c by Curtis Bucher in branch 'master': bpo-36144: Add union operators to WeakKeyDictionary (#19106) https://github.com/python/cpython/commit/25e580a73c163f472fdeb5489bebef85da21655c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 17:18:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 21:18:09 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1584998289.18.0.425509513127.issue36054@roundup.psfhosted.org> STINNER Victor added the comment: I'm not sure that it's a good idea to change os.cpucount(). I suggest to add a new function instead. os.cpu_count() iss documented as: "Return the number of CPUs in the system." https://docs.python.org/dev/library/os.html#os.cpu_count By the way, the documentation adds: "This number is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with len(os.sched_getaffinity(0))" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 17:21:46 2020 From: report at bugs.python.org (Keir Lawson) Date: Mon, 23 Mar 2020 21:21:46 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1584998506.91.0.162914648503.issue36054@roundup.psfhosted.org> Change by Keir Lawson : ---------- nosy: -keirlawson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 17:28:47 2020 From: report at bugs.python.org (Christian Heimes) Date: Mon, 23 Mar 2020 21:28:47 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1584998927.69.0.0857717657847.issue36054@roundup.psfhosted.org> Christian Heimes added the comment: I suggest that your provide a low solution that returns general information from cgroup v1 and unified cgroup v2 rather than a solution that focuses on CPU only. Then you can provide a high level interface that returns effective CPU cores. cgroup v2 (unified hierarchy) has been around for 6 years and slowly gains traction as container platforms start to support them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 17:39:14 2020 From: report at bugs.python.org (paul j3) Date: Mon, 23 Mar 2020 21:39:14 +0000 Subject: [issue19462] Add remove_argument() method to argparse.ArgumentParser In-Reply-To: <1383240778.45.0.779487488351.issue19462@psf.upfronthosting.co.za> Message-ID: <1584999554.98.0.858564304286.issue19462@roundup.psfhosted.org> paul j3 added the comment: I think it can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:11:02 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Mon, 23 Mar 2020 22:11:02 +0000 Subject: [issue38948] os.path.ismount() returns False for current working drive In-Reply-To: <1575196854.18.0.0543230038393.issue38948@roundup.psfhosted.org> Message-ID: <1585001462.37.0.457275814648.issue38948@roundup.psfhosted.org> Change by Jonathan Hsu : ---------- nosy: +Jonathan Hsu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:13:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:13:43 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585001623.65.0.75882905156.issue40014@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18487 pull_request: https://github.com/python/cpython/pull/19126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:15:37 2020 From: report at bugs.python.org (Curtis Bucher) Date: Mon, 23 Mar 2020 22:15:37 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585001737.78.0.416613871152.issue36144@roundup.psfhosted.org> Change by Curtis Bucher : ---------- pull_requests: +18488 pull_request: https://github.com/python/cpython/pull/19127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:17:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:17:06 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585001826.93.0.196162890346.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: > Moreover, on Linux, getgrouplist() can also fail with -1 if the group list is too small. In that case, ngroups is updated to the number of groups and so can be used to enlarge the list! I tested by manually initializing ngroups to a value way lower than MAX_GROUPS (65536 on my Fedora 31): os.getgrouplist() raises OSError() with a random errno, getgrouplist() doesn't set errno on failure. I wrote PR 19126 to fix the issue on all platforms. The glibc implementation is detected and used: use updated ngroups value (only if it's larger). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:41:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:41:03 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references Message-ID: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/206/builds/119 test_importlib leaked [6303, 6299, 6303] references, sum=18905 test_importlib leaked [2022, 2020, 2022] memory blocks, sum=6064 Issue reported at: https://bugs.python.org/issue1635741#msg364845 It seems like the regression was introduced by the following change: commit 8334f30a74abcf7e469b901afc307887aa85a888 (HEAD) Author: Hai Shi Date: Fri Mar 20 16:16:45 2020 +0800 bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19084) ---------- components: Tests messages: 364905 nosy: vstinner priority: normal severity: normal status: open title: test_importlib leaked [6303, 6299, 6303] references versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:42:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:42:55 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585003375.84.0.631008348052.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > The last merged pull request, GH-GH-19084, causes refleaks in importlib tests. Stable buildbots are failing, I can reproduce on macOS Catalina. I expect that the bug is non-trivial, so I prefer to open a separated issue: bpo-40050 "test_importlib leaked [6303, 6299, 6303] references". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:45:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:45:33 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585003533.85.0.527508917157.issue40050@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 18:45:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 22:45:33 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585003533.68.0.143610468821.issue1635741@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18489 pull_request: https://github.com/python/cpython/pull/19128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 19:13:27 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Mon, 23 Mar 2020 23:13:27 +0000 Subject: [issue36759] astimezone() fails on Windows for pre-epoch times In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1585005207.64.0.486127354748.issue36759@roundup.psfhosted.org> Change by Jonathan Hsu : ---------- nosy: +Jonathan Hsu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 19:32:03 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Mon, 23 Mar 2020 23:32:03 +0000 Subject: [issue36759] astimezone() fails on Windows for pre-epoch times In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1585006323.4.0.916053265261.issue36759@roundup.psfhosted.org> Jonathan Hsu added the comment: I'd like to take on this issue if no one else is working on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 19:32:35 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 23 Mar 2020 23:32:35 +0000 Subject: [issue38972] [venv] Link to instructions to change PowerShell execution policy for venv activation In-Reply-To: <1575483846.28.0.24893284684.issue38972@roundup.psfhosted.org> Message-ID: <1585006355.41.0.764667309096.issue38972@roundup.psfhosted.org> Brett Cannon added the comment: All sound reasonable, Derek. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 19:48:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 23:48:06 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585007286.71.0.213371796228.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 188078c39dec24aa5b3f2073bdc9a68ebaae42de by Victor Stinner in branch 'master': Revert "bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19084)" (#19128) https://github.com/python/cpython/commit/188078c39dec24aa5b3f2073bdc9a68ebaae42de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 19:48:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 23 Mar 2020 23:48:06 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585007286.53.0.922680919999.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 188078c39dec24aa5b3f2073bdc9a68ebaae42de by Victor Stinner in branch 'master': Revert "bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19084)" (#19128) https://github.com/python/cpython/commit/188078c39dec24aa5b3f2073bdc9a68ebaae42de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 20:23:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 00:23:37 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585009417.79.0.143098659034.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: I can reproduce the leak with the following test, stored as Lib/test/test_leak.py: --- from test import support import unittest class Tests(unittest.TestCase): def test_import_fresh(self): support.import_fresh_module('importlib.machinery', fresh=('importlib',), blocked=('_frozen_importlib', '_frozen_importlib_external')) --- Extract of "./python -m test -R 3:3 test_leak" output: --- test_leak leaked [6303, 6299, 6303] references, sum=18905 test_leak leaked [2022, 2020, 2022] memory blocks, sum=6064 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 20:36:32 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 24 Mar 2020 00:36:32 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585010192.48.0.553498881592.issue40018@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- keywords: +patch pull_requests: +18491 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 20:38:45 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 24 Mar 2020 00:38:45 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585010325.61.0.121254939458.issue40018@roundup.psfhosted.org> Charalampos Stratakis added the comment: Still searching the issue and created a first draft PR. With it, tesT_ssl and test_imaplib pass now, urllib2_localnet still has issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 21:00:21 2020 From: report at bugs.python.org (Yasunobu Imamura) Date: Tue, 24 Mar 2020 01:00:21 +0000 Subject: [issue40041] Typo in argparse ja-document wrong:'append', correct:'extend' In-Reply-To: <1584877231.67.0.450516943499.issue40041@roundup.psfhosted.org> Message-ID: <1585011621.54.0.719790713362.issue40041@roundup.psfhosted.org> Yasunobu Imamura added the comment: moved to https://github.com/python-doc-ja/python-doc-ja/issues/825 ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 21:03:00 2020 From: report at bugs.python.org (San) Date: Tue, 24 Mar 2020 01:03:00 +0000 Subject: [issue40034] cgi.parse() does not work with multipart POST requests. In-Reply-To: <1584811428.88.0.0218295989168.issue40034@roundup.psfhosted.org> Message-ID: <1585011780.79.0.647430422278.issue40034@roundup.psfhosted.org> Change by San : ---------- keywords: +patch pull_requests: +18492 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 21:16:52 2020 From: report at bugs.python.org (Derek Keeler) Date: Tue, 24 Mar 2020 01:16:52 +0000 Subject: [issue38972] [venv] Link to instructions to change PowerShell execution policy for venv activation In-Reply-To: <1575483846.28.0.24893284684.issue38972@roundup.psfhosted.org> Message-ID: <1585012612.54.0.535936423311.issue38972@roundup.psfhosted.org> Change by Derek Keeler : ---------- keywords: +patch pull_requests: +18493 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 22:01:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 02:01:34 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585015294.18.0.331099415943.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: Before commit 8334f30a74abcf7e469b901afc307887aa85a888, at the first _imp.create_builtin() calls, it calls _PyImport_FixupExtensionObject() which stores the created module in an internal "extensions" dictionary. PyInit__weakref() returns a module object. Next calls to _imp.create_builtin("_weakref") simply returned the cached _weakref module. At commit 8334f30a74abcf7e469b901afc307887aa85a888, _imp.create_builtin() doesn't store it in the internal "extensions" dictionary, but calls PyModule_FromDefAndSpec() instead. PyInit__weakref() returns a module definition (PyModuleDef_Type: "moduledef"). Each _imp.create_builtin("_weakref") creates a new module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 23 23:41:46 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 24 Mar 2020 03:41:46 +0000 Subject: [issue40017] Please support CLOCK_TAI in the time module. In-Reply-To: <1584645299.09.0.45620556685.issue40017@roundup.psfhosted.org> Message-ID: <1585021306.93.0.96758144174.issue40017@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 6000087fe979705dc588a46a35da884cc0198c67 by Russell Owen in branch 'master': closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096) https://github.com/python/cpython/commit/6000087fe979705dc588a46a35da884cc0198c67 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 00:03:08 2020 From: report at bugs.python.org (Manjusaka) Date: Tue, 24 Mar 2020 04:03:08 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1585022588.39.0.777384077335.issue36054@roundup.psfhosted.org> Manjusaka added the comment: Actually, we already have some third party libs to support cgroup. But most of them get these questions 1. They are not std lib 2. They are just support cgroup1 But if we want to add a new std lib. Should we create a PEP? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 00:41:34 2020 From: report at bugs.python.org (hai shi) Date: Tue, 24 Mar 2020 04:41:34 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585024894.44.0.0373891087597.issue40050@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 01:06:26 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 24 Mar 2020 05:06:26 +0000 Subject: [issue40051] Dead link in help(lib2to3) Message-ID: <1585026386.04.0.352572849659.issue40051@roundup.psfhosted.org> New submission from wyz23x2 : When typing this in shell: >>> import lib2to3 >>> help(lib2to3) The output contains this link: --snip-- MODULE REFERENCE https://docs.python.org/3.8/library/lib2to3 <-- The following documentation is automatically generated from the Python --snip-- But when you access it, 404! This works: https://docs.python.org/3.8/library/2to3.html#module-lib2to3 Please change it. Thanks! ---------- assignee: docs at python components: 2to3 (2.x to 3.x conversion tool), Documentation, Library (Lib) messages: 364917 nosy: docs at python, wyz23x2 priority: normal severity: normal status: open title: Dead link in help(lib2to3) type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 01:43:15 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Tue, 24 Mar 2020 05:43:15 +0000 Subject: [issue36759] astimezone() fails on Windows for pre-epoch times In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1585028595.71.0.575387949851.issue36759@roundup.psfhosted.org> Jonathan Hsu added the comment: This exception is raised because astimezone() ends up calling time.localtime() to determine the appropriate time zone. If the datetime object has a pre-epoch value, it passes a negative timestamp to time.localtime(). On Windows, time.localtime() does not accept values greater than 0 (more discussion in issue #35796). This is the minimal code required to reproduce the error: from datetime import datetime datetime(1969, 1, 1).astimezone() Without the ability to ascertain the time zone with localtime(), I'm not sure if the time zone can be accurately determined. It's not clear what the proper behavior is. Maybe raise a ValueError? PEP 615 proposes to include the IANA tz database, which would negate the need for a system call. Should we wait for this PEP before fixing this issue? Thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 02:58:12 2020 From: report at bugs.python.org (Andreas Schneider) Date: Tue, 24 Mar 2020 06:58:12 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h Message-ID: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> New submission from Andreas Schneider : In file included from /builds/cryptomilk/pam_wrapper/src/python/pypamtest.c:21: In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. The correct way to do it would be: union { char *data; vectorcallfunc *ptr; } vc; vc.data = (char *)callable + offset; return *vc.ptr; ---------- components: C API messages: 364919 nosy: asn priority: normal severity: normal status: open title: Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 02:59:55 2020 From: report at bugs.python.org (Roundup Robot) Date: Tue, 24 Mar 2020 06:59:55 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585033195.77.0.71702986869.issue40052@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +18494 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 03:21:17 2020 From: report at bugs.python.org (Nan Hua) Date: Tue, 24 Mar 2020 07:21:17 +0000 Subject: [issue40053] Document the behavior that no interplotation is applied when no *args are passed in for logging statements Message-ID: <1585034477.86.0.546029969231.issue40053@roundup.psfhosted.org> New submission from Nan Hua : As I see, Python's logging module's implementation has a nice property that, when no additional args are passed in, the msg (first argument) will be directly printed. For example, logging.error('abc %s') can be handled peacefully with printing "ERROR:root:abc %s" in the log. However, the logging's documentation only said the followings: "The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator." >From what I see, this implementation (seems the case for both Python2 and Python3) has many benefits: saving CPU resources, safe handling pre-formated string, etc. More importantly, it also de-facto allows using the convenient f-string in logging statement, e.g. logging.error(f'Started at {start_time}, finished at {finish_time}' f' by user {user}') can run correctly and smoothly even with user containing %s inside. In summary, I hope this de-facto actual behavior can be officially endorsed, with wordings like, "When *args is empty, i.e. no additional positional arguments passed in, the msg be of any string (no need to be a format string) and will be directly used as is without interpolation." What do you think? Thank you a lot! ---------- components: Library (Lib) messages: 364920 nosy: nhua priority: normal severity: normal status: open title: Document the behavior that no interplotation is applied when no *args are passed in for logging statements type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 03:40:31 2020 From: report at bugs.python.org (Andreas Schneider) Date: Tue, 24 Mar 2020 07:40:31 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585035631.23.0.456480543114.issue40052@roundup.psfhosted.org> Change by Andreas Schneider : ---------- type: -> compile error versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 03:56:29 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Mar 2020 07:56:29 +0000 Subject: [issue40053] Document the behavior that no interplotation is applied when no *args are passed in for logging statements In-Reply-To: <1585034477.86.0.546029969231.issue40053@roundup.psfhosted.org> Message-ID: <1585036589.21.0.0544042180842.issue40053@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 04:53:35 2020 From: report at bugs.python.org (Ard Kuijpers) Date: Tue, 24 Mar 2020 08:53:35 +0000 Subject: [issue36759] astimezone() fails on Windows for pre-epoch times In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1585040015.05.0.810659840302.issue36759@roundup.psfhosted.org> Ard Kuijpers added the comment: It would be helpful to have a better error message than '[Errno 22] Invalid argument' on Windows, so a ValueError seems to be a good idea at the moment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 05:12:02 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 24 Mar 2020 09:12:02 +0000 Subject: [issue40053] Document the behavior that no interplotation is applied when no *args are passed in for logging statements In-Reply-To: <1585034477.86.0.546029969231.issue40053@roundup.psfhosted.org> Message-ID: <1585041122.46.0.20778897523.issue40053@roundup.psfhosted.org> Eric V. Smith added the comment: I think it's important that logging has this feature for the reasons stated, so it should be documented. And hopefully it's also tested for, but I haven't looked. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, eric.smith stage: -> needs patch versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 05:37:12 2020 From: report at bugs.python.org (zd nex) Date: Tue, 24 Mar 2020 09:37:12 +0000 Subject: [issue39672] Segmentation fault on shutdown with shelve & c pickle In-Reply-To: <1582019462.33.0.255360625193.issue39672@roundup.psfhosted.org> Message-ID: <1585042632.79.0.257725181916.issue39672@roundup.psfhosted.org> Change by zd nex : ---------- title: SIGSEGV crash on shutdown with shelve & c pickle -> Segmentation fault on shutdown with shelve & c pickle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 05:37:47 2020 From: report at bugs.python.org (Zbynek Winkler) Date: Tue, 24 Mar 2020 09:37:47 +0000 Subject: [issue23882] unittest discovery doesn't detect namespace packages when given no parameters In-Reply-To: <1428406596.02.0.0629964312505.issue23882@psf.upfronthosting.co.za> Message-ID: <1585042667.27.0.0102021910221.issue23882@roundup.psfhosted.org> Change by Zbynek Winkler : ---------- nosy: +Zbynek.Winkler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 05:43:01 2020 From: report at bugs.python.org (Zbynek Winkler) Date: Tue, 24 Mar 2020 09:43:01 +0000 Subject: [issue11218] pattern=None when following documentation for load_tests and unittest.main() In-Reply-To: <1297758807.39.0.713611114484.issue11218@psf.upfronthosting.co.za> Message-ID: <1585042981.76.0.755479248005.issue11218@roundup.psfhosted.org> Change by Zbynek Winkler : ---------- nosy: +Zbynek.Winkler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 06:30:42 2020 From: report at bugs.python.org (Peter Eisentraut) Date: Tue, 24 Mar 2020 10:30:42 +0000 Subject: [issue39615] cpython/abstract.h not compatible with C90 In-Reply-To: <1581508507.12.0.731337298421.issue39615@roundup.psfhosted.org> Message-ID: <1585045842.56.0.162974055444.issue39615@roundup.psfhosted.org> Peter Eisentraut added the comment: 3.9.0a5 fixes my original issue. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 07:07:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 11:07:37 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585048057.83.0.203708285213.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: I can reproduce the leak with command: ./python -m test -R 3:3 test_leak File 1: --- import unittest import sys from importlib import _bootstrap as BOOTSTRAP def _save_and_remove_module(name, orig_modules): """Helper function to save and remove a module from sys.modules Raise ImportError if the module can't be imported. """ # try to import the module and raise an error if it can't be imported if name not in sys.modules: __import__(name) del sys.modules[name] for modname in list(sys.modules): if modname == name or modname.startswith(name + '.'): orig_modules[modname] = sys.modules[modname] del sys.modules[modname] def _save_and_block_module(name, orig_modules): """Helper function to save and block a module in sys.modules Return True if the module was in sys.modules, False otherwise. """ saved = True try: orig_modules[name] = sys.modules[name] except KeyError: saved = False sys.modules[name] = None return saved def import_fresh_module(): name = 'importlib3' fresh = ('importlib',) blocked = ('_frozen_importlib', '_frozen_importlib_external') orig_modules = {} names_to_remove = [] _save_and_remove_module(name, orig_modules) try: for fresh_name in fresh: _save_and_remove_module(fresh_name, orig_modules) for blocked_name in blocked: if not _save_and_block_module(blocked_name, orig_modules): names_to_remove.append(blocked_name) with BOOTSTRAP._ModuleLockManager(name): spec = BOOTSTRAP._find_spec(name, None) module = BOOTSTRAP.module_from_spec(spec) sys.modules[spec.name] = module spec.loader.exec_module(module) del sys.modules[spec.name] finally: for orig_name, module in orig_modules.items(): sys.modules[orig_name] = module for name_to_remove in names_to_remove: del sys.modules[name_to_remove] class Tests(unittest.TestCase): def test_import_fresh(self): import_fresh_module() --- File 2: Lib/importlib3.py --- import _imp import sys try: import _frozen_importlib as _bootstrap case = 1 except ImportError: case = 2 if case == 2: _bootstrap = type(sys)("_bootstrap") _bootstrap._weakref = sys.modules['_weakref'] class ModuleSpec: @staticmethod def method(): pass spec = ModuleSpec() spec.name = "_weakref" module = _imp.create_builtin(spec) module.__spec__ = spec sys.modules["_weakref"] = module --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 07:10:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 11:10:22 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585048222.73.0.331948104825.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: With the latest Lib/importlib3.py, there are less leaked references, but there are still leaked references: test_leak leaked [139, 139, 139] references, sum=417 test_leak leaked [42, 42, 42] memory blocks, sum=126 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 07:11:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 11:11:48 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585048308.62.0.876183793147.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: > File 1: Oops, you should read: File 1: Lib/test/test_leak.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:01:22 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 13:01:22 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585054882.21.0.323703616077.issue39689@roundup.psfhosted.org> miss-islington added the comment: New changeset 472fc843ca816d65c12f9508ac762ca492165c45 by Stefan Krah in branch 'master': bpo-39689: Do not use native packing for format "?" with standard size (GH-18969) https://github.com/python/cpython/commit/472fc843ca816d65c12f9508ac762ca492165c45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:03:50 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 24 Mar 2020 13:03:50 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585055030.77.0.663210750783.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: I see. Thanks for your patience explaining this to me! I will merge and continue in a different issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:26:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 13:26:06 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585056366.95.0.223309018439.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: Code extremely simplified: --- import unittest import sys import _imp class ModuleSpec: pass class Tests(unittest.TestCase): def test_import_fresh(self): spec = ModuleSpec() spec.sys_weakref = sys.modules["_weakref"] spec.name = "_weakref" module = _imp.create_builtin(spec) module.__spec__ = spec sys.modules["_weakref"] = module --- I still get a leak: --- test_leak leaked [34, 34, 34] references, sum=102 test_leak leaked [11, 11, 11] memory blocks, sum=33 --- I understand that sys.modules["_weakref"] is overriden by the test with a new module, and the new module holds a reference somehow to the previous _weakref module. The old and the new modules remain alive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:44:32 2020 From: report at bugs.python.org (Danijel) Date: Tue, 24 Mar 2020 13:44:32 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585057472.09.0.00617230317555.issue40049@roundup.psfhosted.org> Change by Danijel : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:52:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 13:52:23 +0000 Subject: [issue40050] test_importlib leaked [6303, 6299, 6303] references In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585057943.26.0.625012471894.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: > Code extremely simplified: (...) Relationship between origin unmodified code and the extremely simplified code: * Lib/test/test_importlib/__init__.py: load_tests() is called at each "test -R 3:3" iteration * Lib/test/test_importlib/test_windows.py: at each iteartion: * machinery = test.test_importlib.util.import_importlib('importlib.machinery') is called: it reloads the whole importlib package, with _frozen_importlib and _frozen_importlib_external blocked (force to reload pure Python importlib._bootstrap and importlib._bootstrap_external modules) * support.import_module('winreg', required_on=['win']) is called with the fresh new importlib package: in short, it tries to import winreg which fails with ModuleNotFoundError * Lib/importlib/__init__.py: each time the module is reloaded * importlib._bootstrap._setup() is called: it copies '_thread', '_warnings' and '_weakref' from sys.modules into importlib._bootstrap namespace (module globals) using setattr(self_module, ...) * importlib._bootstrap_external._setup() is called: it calls _bootstrap._builtin_from_name('_weakref') When importlib._bootstrap_external._setup() calls _bootstrap._builtin_from_name('_weakref'), _init_module_attrs() copies the "spec" into module.__spec__. But the spec contains a reference to importlib._bootstrap namespace. Before _weakref is converted to multiphase initialization: $ ./python >>> import _weakref >>> id(_weakref) 140119879580176 >>> id(_weakref.__spec__.__init__.__globals__['_weakref']) 140119879580176 => same module After the change: $ ./python >>> import _weakref >>> id(_weakref) 140312826159952 >>> id(_weakref.__spec__.__init__.__globals__['_weakref']) 140312826366288 => two different objects The problem is that module.__spec__ pulls the whole importlib package which contains tons of objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:58:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 13:58:13 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585058293.99.0.210484704215.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: Quick & dirty workaround: diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 7353bf9a78..d988552f2d 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1620,7 +1620,10 @@ def _setup(_bootstrap_module): setattr(self_module, '_thread', thread_module) # Directly load the _weakref module (needed during bootstrap). - weakref_module = _bootstrap._builtin_from_name('_weakref') + if '_weakref' not in sys.modules: + weakref_module = _bootstrap._builtin_from_name('_weakref') + else: + weakref_module = sys.modules['_weakref'] setattr(self_module, '_weakref', weakref_module) # Directly load the winreg module (needed during bootstrap). But I think that the issue is larger than just _weakref. * Maybe the test_importlib should before save/restore the the "Python state" rather than modifying modules * Maybe module.__spec__ should leak less importlib internals: explicitly clear namespaces? Use static methods? I'm not sure how to do that. * Remove module.__spec__? ... that would mean rejecting PEP 451 implemented in Python 3.4, that sounds like a major regression :-( ---------- nosy: +brett.cannon, eric.snow, ncoghlan title: test_importlib leaked [6303, 6299, 6303] references -> importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 09:59:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 13:59:53 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585058393.16.0.125233362294.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: > Before _weakref is converted to multiphase initialization: > (...) > => same module That's because modules which don't use the multiphase initialization are cached in _PyImport_FixupExtensionObject(): see msg364914 for details. Next calls to _imp.create_builtin("_weakref") simply returned the cached _weakref module. It's loaded exactly once. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 10:56:23 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 24 Mar 2020 14:56:23 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585061783.0.0.778081701926.issue39689@roundup.psfhosted.org> Petr Viktorin added the comment: Moved to Discourse, IMO that's a better place for maintainers of other PEP-3118-compatible libraries to chime in: https://discuss.python.org/t/behavior-of-struct-format-native-bool/3774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:16:57 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 24 Mar 2020 15:16:57 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585063017.11.0.404661720122.issue40050@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:19:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 15:19:34 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585063174.97.0.439799035387.issue40050@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18496 pull_request: https://github.com/python/cpython/pull/19135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:23:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 15:23:47 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585063427.34.0.409904509931.issue1635741@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18497 pull_request: https://github.com/python/cpython/pull/19135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:29:16 2020 From: report at bugs.python.org (Richard Neumann) Date: Tue, 24 Mar 2020 15:29:16 +0000 Subject: [issue40054] Allow formatted strings as docstrings Message-ID: <1585063756.05.0.0379809062913.issue40054@roundup.psfhosted.org> New submission from Richard Neumann : Currently only plain strings can be used as docstrings, such as: class Foo: """Spamm eggs.""" For dynamic class generation, it would be useful to allow format strings as docstrings as well: doc = 'eggs' class Foo: """Spamm {}.""".format(doc) or: doc = 'eggs' class Foo: f"""Spamm {doc}.""" A current use case in which I realized that this feature was missing is: class OAuth2ClientMixin(Model, ClientMixin): # pylint: disable=R0904 """An OAuth 2.0 client mixin for peewee models.""" @classmethod def get_related_models(cls, model=Model): """Yields related models.""" for mixin, backref in CLIENT_RELATED_MIXINS: yield cls._get_related_model(model, mixin, backref) @classmethod def _get_related_model(cls, model, mixin, backref): """Returns an implementation of the related model.""" class ClientRelatedModel(model, mixin): f"""Implementation of {mixin.__name__}.""" client = ForeignKeyField( cls, column_name='client', backref=backref, on_delete='CASCADE', on_update='CASCADE') return ClientRelatedModel It actually *is* possible to dynamically set the docstring via the __doc__ attribute: doc = 'eggs' class Foo: pass Foo.__doc__ = doc Allowing format strings would imho be more obvious when reading the code as it is set, where a docstring is expected i.e. below the class / function definition. ---------- messages: 364934 nosy: conqp priority: normal severity: normal status: open title: Allow formatted strings as docstrings type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:32:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 15:32:29 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585063949.71.0.715789078333.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5804f878e779712e803be927ca8a6df389d82cdf by Victor Stinner in branch 'master': bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) https://github.com/python/cpython/commit/5804f878e779712e803be927ca8a6df389d82cdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:40:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 15:40:20 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585064420.3.0.312152068261.issue20526@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18498 pull_request: https://github.com/python/cpython/pull/19136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:54:09 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 24 Mar 2020 15:54:09 +0000 Subject: [issue40054] Allow formatted strings as docstrings In-Reply-To: <1585063756.05.0.0379809062913.issue40054@roundup.psfhosted.org> Message-ID: <1585065249.99.0.270504354609.issue40054@roundup.psfhosted.org> Eric V. Smith added the comment: The problem is that __doc__ is set at compile time, not run time. The ''.format call (and f-strings) are evaluated at run time. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 11:54:23 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Tue, 24 Mar 2020 15:54:23 +0000 Subject: [issue20899] Nested namespace imports do not work inside zip archives In-Reply-To: <1394656225.26.0.176386437395.issue20899@psf.upfronthosting.co.za> Message-ID: <1585065263.1.0.785258559254.issue20899@roundup.psfhosted.org> Jonathan Hsu added the comment: It appears this issue has been fixed, as I am unable to reproduce it on Windows 10/Python 3.7: Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path += ['project1', 'project2.zip', 'project3', 'project4.zip'] >>> import parent.child.hello1 Hello 1 >>> import parent.child.hello2 Hello 2 >>> import parent.child.hello3 Hello 3 >>> import parent.child.hello4 Hello 4 >>> import boo boo! >>> import parent.boo boo! ---------- nosy: +Jonathan Hsu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:05:14 2020 From: report at bugs.python.org (Thomas Heller) Date: Tue, 24 Mar 2020 16:05:14 +0000 Subject: [issue20899] Nested namespace imports do not work inside zip archives In-Reply-To: <1394656225.26.0.176386437395.issue20899@psf.upfronthosting.co.za> Message-ID: <1585065914.55.0.570193293019.issue20899@roundup.psfhosted.org> Change by Thomas Heller : ---------- nosy: -theller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:12:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:12:28 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585066348.82.0.627142164761.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e97c8b0688bc62959ced477d842fcd37992ef649 by Victor Stinner in branch '3.8': bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136) https://github.com/python/cpython/commit/e97c8b0688bc62959ced477d842fcd37992ef649 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:16:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:16:35 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585066595.49.0.978765491363.issue20526@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18499 pull_request: https://github.com/python/cpython/pull/19137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:19:23 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Mar 2020 16:19:23 +0000 Subject: [issue40054] Allow formatted strings as docstrings In-Reply-To: <1585063756.05.0.0379809062913.issue40054@roundup.psfhosted.org> Message-ID: <1585066763.61.0.224800298379.issue40054@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue28739 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:25:15 2020 From: report at bugs.python.org (khoja) Date: Tue, 24 Mar 2020 16:25:15 +0000 Subject: [issue36852] Python3.7.2 fails to cross-compile (yocto / openembedded) when target is mips softfloat In-Reply-To: <1557331268.61.0.662119534756.issue36852@roundup.psfhosted.org> Message-ID: <1585067115.21.0.107828965065.issue36852@roundup.psfhosted.org> khoja added the comment: I had an issue with yocto warrior and zeus branch for target simulation Qemu_x86. I did a report http://bugzilla.yoctoproject.org/show_bug.cgi?id=13842 Thank you to let me know what you think about It. ---------- nosy: +medhi type: -> compile error versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:51:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:51:30 +0000 Subject: [issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning Message-ID: <1585068690.81.0.102478946521.issue40055@roundup.psfhosted.org> New submission from STINNER Victor : Even when no test is run, test_distutils alters the environment: $ ./python -m test -v --fail-env-changed test_distutils -m DONTEXISTS == CPython 3.7.7+ (heads/3.7:1cdc61c767, Mar 24 2020, 17:25:30) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] == Linux-5.5.9-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One little-endian == cwd: /home/vstinner/python/3.7/build/test_python_157151 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.37 Run tests sequentially 0:00:00 load avg: 0.37 [1/1] test_distutils ---------------------------------------------------------------------- Ran 0 tests in 0.001s OK Warning -- warnings.filters was modified by test_distutils Before: (140048876788832, [], []) After: (140048876788832, [], [('ignore', None, , None, 0)]) test_distutils run no tests == Tests result: NO TEST RUN == 1 test run no tests: test_distutils Total duration: 655 ms Tests result: NO TEST RUN The problem comes from Lib/distutils/tests/test_check.py: "from distutils.command.check import check, HAS_DOCUTILS" imports indirectly the docutils module which imports pkg_resources. pkg_resources changes warnings filters. docutils is installed by python3-docutils-0.15.2-1.fc31.noarch package and pkg_resources comes from python3-setuptools-41.6.0-1.fc31.noarch package. Attached PR disables docutils to avoid side effects of "import docutils" like pkg_resources modifying warnings filters. ---------- components: Distutils, Tests messages: 364941 nosy: dstufft, eric.araujo, vstinner priority: normal severity: normal status: open title: test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:52:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:52:18 +0000 Subject: [issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning In-Reply-To: <1585068690.81.0.102478946521.issue40055@roundup.psfhosted.org> Message-ID: <1585068738.99.0.821756536429.issue40055@roundup.psfhosted.org> STINNER Victor added the comment: > pkg_resources comes from python3-setuptools-41.6.0-1.fc31.noarch package. Here is the line which alters warnings filters: $ grep warnings /usr/lib/python3.7/site-packages/pkg_resources/__init__.py (...) warnings.filterwarnings("ignore", category=PEP440Warning, append=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:55:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:55:44 +0000 Subject: [issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning In-Reply-To: <1585068690.81.0.102478946521.issue40055@roundup.psfhosted.org> Message-ID: <1585068944.67.0.547483197572.issue40055@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18500 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:56:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:56:05 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585068965.37.0.494102056516.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d1c09896c3b91d0ad7e3a14fabecde268f70dac7 by Victor Stinner in branch '3.7': bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136) (GH-19137) https://github.com/python/cpython/commit/d1c09896c3b91d0ad7e3a14fabecde268f70dac7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 12:58:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 16:58:23 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585069103.94.0.493466448291.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: I ran threading_shutdown_interrupted.py 10 times on the master branch (at commit 9b8e74ca77da7167033917d155e5f55c67b92f14): it does no longer crash. I consider that the root issue is now fixed, so I close again the bug. Thanks Pablo for the helpful debugging session! ---------- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:01:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:01:40 +0000 Subject: [issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed. In-Reply-To: <1391678042.33.0.420181737425.issue20526@psf.upfronthosting.co.za> Message-ID: <1585069300.14.0.162988535744.issue20526@roundup.psfhosted.org> STINNER Victor added the comment: Just in case, I also ran asyncio_gc.py 10x times on the master branch. I just replaced asyncio.async with asyncio.ensure_future. In short, I consider that the bug is now fixed. I interrupted the test two times with CTRL+c. 9 runs were stopped correctly. 1 run failed with: Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads But this is a different issue, unrelated to "Modules/gcmodule.c:379: visit_decref: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed". It's just that the test uses print() in threads, whereas using print() during Python finalization is not reliable. Using os.write() or avoiding print() would avoid the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:03:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:03:41 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585069421.49.0.289171541712.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 83d46e0622d2efdf5f3bf8bf8904d0dcb55fc322 by Victor Stinner in branch 'master': bpo-40050: Fix importlib._bootstrap_external (GH-19135) https://github.com/python/cpython/commit/83d46e0622d2efdf5f3bf8bf8904d0dcb55fc322 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:05:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:05:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585069525.99.0.262669232072.issue1635741@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18501 pull_request: https://github.com/python/cpython/pull/19140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:09:11 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 24 Mar 2020 17:09:11 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585069751.25.0.945850373073.issue40050@roundup.psfhosted.org> Brett Cannon added the comment: >From Victor: * Maybe the test_importlib should before save/restore the the "Python state" rather than modifying modules You will have to be more specific than that as there is an import_state() context manager to control import state via the sys module. * Maybe module.__spec__ should leak less importlib internals: explicitly clear namespaces? Use static methods? I'm not sure how to do that. Are you saying change everything on __spec__ objects to be static methods? That won't work because the whole point of __spec__ objects is to essentially be data classes to store details of a module. * Remove module.__spec__? ... that would mean rejecting PEP 451 implemented in Python 3.4, that sounds like a major regression :-( No. You would break the world and undo years of work to clean up import semantics with no good way to go back to the old way. Can I ask why you suddenly want to throw __spec__ objects out due to a leak tied back to _weakref switching to multi-phase initialization? Also note that the use of weakrefs by importlib isn't tied to __spec__ objects but to per-module import locks in importlib._bootstrap. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:11:46 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Mar 2020 17:11:46 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585069906.33.0.631183813173.issue40013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 4b3252cb764807fdb3a661b458d43e4af55cf4df by Juhana Jauhiainen in branch 'master': bpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099) https://github.com/python/cpython/commit/4b3252cb764807fdb3a661b458d43e4af55cf4df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:11:56 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:11:56 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585069916.5.0.307665891844.issue40013@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18502 pull_request: https://github.com/python/cpython/pull/19141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:12:03 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:12:03 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585069923.37.0.510187694065.issue40013@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18503 pull_request: https://github.com/python/cpython/pull/19142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:15:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:15:43 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585070143.54.0.903461423343.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. I pushed commit 83d46e0622d2efdf5f3bf8bf8904d0dcb55fc322 which should not be controversial. In short, the fix is to remove two unused imports :-D The fix doesn't remove module.__spec__ nor avoid usage of _weakref, it only fix this issue (reference leak) by copying code from _bootstrap.py to _bootstrap_external.py. In fact, modules like _io were already correctly imported by _bootstrap_external._setup(). Only _thread, _weakref and winreg imports caused this bug. I don't think that it's worth it to backport the change to stable branches 3.7 and 3.8, since stable branches don't use multiphase initialization for _weakref. The two unused imports don't cause any harm in importlib._bootstrap_external. > Can I ask why you suddenly want to throw __spec__ objects out due to a leak tied back to _weakref switching to multi-phase initialization? I was thinking just aloud to try to find a solution for this reference leak. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:22:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:22:16 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585070536.81.0.816746876675.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f5c7cabb2be4e42a5975ba8aac8bb458c8d9d6d7 by Victor Stinner in branch 'master': bpo-40014: Fix os.getgrouplist() (GH-19126) https://github.com/python/cpython/commit/f5c7cabb2be4e42a5975ba8aac8bb458c8d9d6d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:22:31 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:22:31 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585070551.61.0.981858040482.issue40014@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18505 pull_request: https://github.com/python/cpython/pull/19144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:22:23 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:22:23 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585070543.67.0.746878441953.issue40014@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18504 pull_request: https://github.com/python/cpython/pull/19143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:31:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:31:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585071085.69.0.608645878119.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 93460d097f50db0870161a63911d61ce3c5f4583 by Victor Stinner in branch 'master': bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19140) https://github.com/python/cpython/commit/93460d097f50db0870161a63911d61ce3c5f4583 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:32:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:32:49 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585071169.72.0.584493236809.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: I managed to identify bpo-40050 (test_importlib reference leak) root issue and to fix it, so I reapplied Hai Shi's change for _weakref. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:33:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:33:29 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585071209.62.0.435607799952.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: Since this reference leak is fixed, I reapplied Hai Shi's change for _weakref in bpo-1635741: New changeset 93460d097f50db0870161a63911d61ce3c5f4583 by Victor Stinner in branch 'master': bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 489) (GH-19140) https://github.com/python/cpython/commit/93460d097f50db0870161a63911d61ce3c5f4583 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:34:09 2020 From: report at bugs.python.org (Alex Budovski) Date: Tue, 24 Mar 2020 17:34:09 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585071249.01.0.883733220938.issue1635741@roundup.psfhosted.org> Change by Alex Budovski : ---------- nosy: -Alex Budovski _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:34:44 2020 From: report at bugs.python.org (Emmanuel Arias) Date: Tue, 24 Mar 2020 17:34:44 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585071284.49.0.0821011304548.issue40052@roundup.psfhosted.org> Emmanuel Arias added the comment: Hi! I cannot reproduce the error. Could you provide the way to reproduce? thanks ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:39:21 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:39:21 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585071561.61.0.281535301964.issue40014@roundup.psfhosted.org> miss-islington added the comment: New changeset 5753fc69977bd9f70ecb4d466bda650efccf9e0a by Miss Islington (bot) in branch '3.7': bpo-40014: Fix os.getgrouplist() (GH-19126) https://github.com/python/cpython/commit/5753fc69977bd9f70ecb4d466bda650efccf9e0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:40:35 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Mar 2020 17:40:35 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585071635.34.0.205466530778.issue40014@roundup.psfhosted.org> miss-islington added the comment: New changeset af6fd1faa68f57c11c862624798f8510b7cac68a by Miss Islington (bot) in branch '3.8': bpo-40014: Fix os.getgrouplist() (GH-19126) https://github.com/python/cpython/commit/af6fd1faa68f57c11c862624798f8510b7cac68a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 13:51:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 17:51:27 +0000 Subject: [issue40014] os.getgrouplist() can fail on macOS if the user has more than 17 groups In-Reply-To: <1584633894.99.0.197171599241.issue40014@roundup.psfhosted.org> Message-ID: <1585072287.27.0.0940799583711.issue40014@roundup.psfhosted.org> STINNER Victor added the comment: Ned: so Linux was also impacted, but Linux only has an issue with more than 65536 groups :-D macOS MAX_GROUPS is now only 16 (Python uses MAX_GROUPS+1)! Maybe MAX_GROUPS was reduced recently. I'm not sure. Anyway, os.getgrouplist() does no longer depend on MAX_GROUPS hardcoded limit, but grow the group list dynamically. It should now work with any number of groups an all platforms (which provide the getgrouplist() function ;-)) on Python 3.7, 3.8 and master branches. Thanks Dong-hee Na for the bug report and your PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 14:17:04 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 24 Mar 2020 18:17:04 +0000 Subject: [issue39798] Update and Improve README.AIX In-Reply-To: <1582984117.38.0.490903429644.issue39798@roundup.psfhosted.org> Message-ID: <1585073824.23.0.175295474308.issue39798@roundup.psfhosted.org> Michael Felt added the comment: @BTaskaya - can you elaborate on what issues you ran into? Perhaps open an issue on the repository I started to work on getting this improved. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 15:03:00 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 24 Mar 2020 19:03:00 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked In-Reply-To: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> Message-ID: <1585076580.99.0.66344183298.issue40029@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 15e5024d04fc89d948ae761d88048bc58a56b650 by Roman Yurchak in branch 'master': bpo-40029 mark test_importlib.test_zip as requiring zlib (#19105) https://github.com/python/cpython/commit/15e5024d04fc89d948ae761d88048bc58a56b650 ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 15:08:19 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 24 Mar 2020 19:08:19 +0000 Subject: [issue40029] test_importlib.test_zip requires zlib but not marked In-Reply-To: <1584775633.1.0.206140912196.issue40029@roundup.psfhosted.org> Message-ID: <1585076899.77.0.101530103087.issue40029@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks for the report and the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 16:15:16 2020 From: report at bugs.python.org (Evin Liang) Date: Tue, 24 Mar 2020 20:15:16 +0000 Subject: [issue40056] more user-friendly turtledemo Message-ID: <1585080915.97.0.255153547178.issue40056@roundup.psfhosted.org> New submission from Evin Liang : [minor] 1. Display underscores as spaces in menu bar 2. Allow user to run custom code ---------- components: Library (Lib) messages: 364961 nosy: Evin Liang priority: normal pull_requests: 18506 severity: normal status: open title: more user-friendly turtledemo type: enhancement versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 16:57:35 2020 From: report at bugs.python.org (Seth Troisi) Date: Tue, 24 Mar 2020 20:57:35 +0000 Subject: [issue39949] truncating match in regular expression match objects repr In-Reply-To: <1584049767.16.0.188415292253.issue39949@roundup.psfhosted.org> Message-ID: <1585083455.95.0.812925845493.issue39949@roundup.psfhosted.org> Change by Seth Troisi : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 17:04:16 2020 From: report at bugs.python.org (Andreas Schneider) Date: Tue, 24 Mar 2020 21:04:16 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585083856.46.0.308563531886.issue40052@roundup.psfhosted.org> Andreas Schneider added the comment: clang -Werror -Wcast-align ... rpm -q clang9 clang9-9.0.1-8.1.x86_64 Does that help? Found in CI of https://gitlab.com/cwrap/pam_wrapper ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 17:04:04 2020 From: report at bugs.python.org (OverMighty) Date: Tue, 24 Mar 2020 21:04:04 +0000 Subject: [issue40057] Missing mention of some class attributes in socketserver documentation Message-ID: <1585083844.09.0.775894389563.issue40057@roundup.psfhosted.org> New submission from OverMighty : The documentation of the `socketserver` module of the Python standard library, available here: https://docs.python.org/3/library/socketserver.html, doesn't mention the existence of the following class attributes: StreamRequestHandler.connection (defined at line 764 of socketserver.py) DatagramRequestHandler.packet (defined at line 812 of socketserver.py) DatagramRequestHandler.socket (defined at line 812 of socketserver.py) ---------- assignee: docs at python components: Documentation messages: 364962 nosy: docs at python, overmighty priority: normal severity: normal status: open title: Missing mention of some class attributes in socketserver documentation type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 17:16:35 2020 From: report at bugs.python.org (OverMighty) Date: Tue, 24 Mar 2020 21:16:35 +0000 Subject: [issue40057] Missing mention of some class attributes in socketserver documentation In-Reply-To: <1585083844.09.0.775894389563.issue40057@roundup.psfhosted.org> Message-ID: <1585084595.8.0.544783468144.issue40057@roundup.psfhosted.org> Change by OverMighty : ---------- keywords: +patch pull_requests: +18507 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 17:55:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 21:55:30 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585086930.73.0.673359206254.issue40050@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18509 pull_request: https://github.com/python/cpython/pull/19148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 18:08:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 22:08:58 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585087738.3.0.427302016643.issue40024@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 37fcbb65d4589fbb5a72153e9338cf8e6495f64f by Dong-hee Na in branch 'master': bpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119) https://github.com/python/cpython/commit/37fcbb65d4589fbb5a72153e9338cf8e6495f64f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 18:50:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 22:50:09 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1585090209.6.0.702631390991.issue40039@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I missed that the PDF contains a link to a PoC: https://github.com/RGDZ-GZU/Python-Remote-code-exec/tree/master/poc I attach a copy to this issue: server.py and poc.py. ---------- Added file: https://bugs.python.org/file48998/server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 18:50:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 22:50:17 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1585090217.22.0.832123649823.issue40039@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file48999/poc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 19:02:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 24 Mar 2020 23:02:19 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1585090939.06.0.445230636753.issue40039@roundup.psfhosted.org> STINNER Victor added the comment: > if authkey is not set or leaked, it will cause RCE on the server side In which situation the authkey can be empty? Lib/mulitprocessing/process.py creates an authkey of 256 bits of entropy using: AuthenticationString(os.urandom(32)) It's used by default if I understand correctly. I understand that the authkey can only be empty if the developer explicitly pass an empty string to authkey when the manager is created. Am I right? -- About leaking the authkey: I don't know how the authkey is transfered to the child processes. Through a pipe controlled by the parent process? -- > it will cause RCE on the server side I read somewhere that multiprocessing is now supposed to accept other serialization protocol than pickle, but I failed to find the documentation :-( pickle remains the default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 20:30:40 2020 From: report at bugs.python.org (Kyle Stanley) Date: Wed, 25 Mar 2020 00:30:40 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585096240.78.0.00519040234956.issue39812@roundup.psfhosted.org> Change by Kyle Stanley : ---------- keywords: +patch pull_requests: +18510 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 20:55:55 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Wed, 25 Mar 2020 00:55:55 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1585097755.72.0.633952681719.issue40025@roundup.psfhosted.org> Jonathan Hsu added the comment: Thank you for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 21:18:23 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 25 Mar 2020 01:18:23 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585099103.88.0.938494329415.issue1635741@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18511 pull_request: https://github.com/python/cpython/pull/19150 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 21:28:25 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 25 Mar 2020 01:28:25 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585099705.43.0.671485811214.issue1635741@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18512 pull_request: https://github.com/python/cpython/pull/19151 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 21:46:40 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 25 Mar 2020 01:46:40 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585100800.07.0.137732099062.issue1635741@roundup.psfhosted.org> Paulo Henrique Silva added the comment: Updating on my findings on msg364833. It looks like encodings module is not being destoyed at all and keeping all the encoding refs alive. Looks like some cycle but I am not sure yet how to solve it. To validate this, I: - removed codec_search_cach of PyInterpreterState. - Py_DECREFd(encodings) after loading it on codecs.c. Before: 4376 refs left (37fcbb65d4) After : 352 refs left (-92%) I've updated the changes at https://github.com/python/cpython/compare/master...phsilva:remove-codec-caches (not a proposed patch, just to validate the idea) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 21:51:35 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 25 Mar 2020 01:51:35 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585101095.96.0.66229634099.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8f1ed21ecf57cc8b8095d9d1058af2b9b3ed0413 by Curtis Bucher in branch 'master': bpo-36144: Add union operators to WeakValueDictionary584 (#19127) https://github.com/python/cpython/commit/8f1ed21ecf57cc8b8095d9d1058af2b9b3ed0413 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 21:54:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 01:54:40 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' Message-ID: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> New submission from STINNER Victor : vstinner at apu$ ./python -m test -v test_datetime test_datetime -m test_divide_and_round == CPython 3.9.0a5+ (heads/pr/19122:0ac3031a80, Mar 25 2020, 02:25:19) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] == Linux-5.5.9-200.fc31.x86_64-x86_64-with-glibc2.30 little-endian == cwd: /home/vstinner/python/master/build/test_python_233006 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.82 Run tests sequentially 0:00:00 load avg: 0.82 [1/2] test_datetime test_divide_and_round (test.datetimetester.TestModule_Pure) ... ok test_divide_and_round (test.datetimetester.TestModule_Fast) ... skipped 'Only run for Pure Python implementation' ---------------------------------------------------------------------- Ran 2 tests in 0.002s OK (skipped=1) 0:00:00 load avg: 0.82 [2/2] test_datetime test_divide_and_round (test.datetimetester.TestModule_Pure) ... ERROR test_divide_and_round (test.datetimetester.TestModule_Fast) ... skipped 'Only run for Pure Python implementation' ====================================================================== ERROR: test_divide_and_round (test.datetimetester.TestModule_Pure) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/datetimetester.py", line 87, in test_divide_and_round dar = datetime_module._divide_and_round AttributeError: module 'datetime' has no attribute '_divide_and_round' ---------------------------------------------------------------------- Ran 2 tests in 0.006s FAILED (errors=1, skipped=1) test test_datetime failed test_datetime failed == Tests result: FAILURE == 1 test OK. 1 test failed: test_datetime Total duration: 448 ms Tests result: FAILURE ---------- components: Tests messages: 364970 nosy: vstinner priority: normal severity: normal status: open title: Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 22:18:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 02:18:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585102733.98.0.0833588617601.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f3d5ac47720045a72f7ef5af13046d9531e6007b by Paulo Henrique Silva in branch 'master': bpo-1635741: Port operator module to multiphase initialization (PEP 489) (GH-19150) https://github.com/python/cpython/commit/f3d5ac47720045a72f7ef5af13046d9531e6007b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 22:20:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 02:20:06 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585102806.42.0.283511462992.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7dd549eb08939e1927fba818116f5202e76f8d73 by Paulo Henrique Silva in branch 'master': bpo-1635741: Port _functools module to multiphase initialization (PEP 489) (GH-19151) https://github.com/python/cpython/commit/7dd549eb08939e1927fba818116f5202e76f8d73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 22:41:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 02:41:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585104113.28.0.236723933414.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: Hum, some clarification is needed here. "Port xxx extension module to multiphase initialization (PEP 489)" changes are helping to fix "Py_Finalize() doesn't clear all Python objects at exit", but alone they don't fix all issues. -- For example, if a module still uses globals using "static ..." in C, these globals will not be cleared magically. Example with _datetimemodule.c: static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python int */ static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python int */ static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python int */ These variables initialized once in PyInit__datetime(): us_per_hour = PyLong_FromDouble(3600000000.0); us_per_day = PyLong_FromDouble(86400000000.0); us_per_week = PyLong_FromDouble(604800000000.0); Converting the module to multiphase initialization will not magically clear these variables at exit. The _datetime module should be modified to store these variables in a module state: this module could be cleared at exit. The binascii is a good example: it has a module state, traverse, clear and free methods, and it uses the multiphase initialization. This module can be fully unloaded at exit. It's a "simple" module: it doesn't define types for example. -- Another issue is that converting a module to the multiphase initialization doesn't magically fully isolate two instances of the module. For exmaple, the _abc module still uses a type defined statically: static PyTypeObject _abc_data_type = { PyVarObject_HEAD_INIT(NULL, 0) "_abc_data", /*tp_name*/ sizeof(_abc_data), /*tp_basicsize*/ .tp_dealloc = (destructor)abc_data_dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_alloc = PyType_GenericAlloc, .tp_new = abc_data_new, }; Example: vstinner at apu$ ./python Python 3.9.0a5+ (heads/pr/19122:0ac3031a80, Mar 25 2020, 02:25:19) >>> import _abc >>> class Bla: pass ... >>> _abc._abc_init(Bla) >>> type(Bla._abc_impl) # load a second instance of the module >>> import sys; del sys.modules['_abc'] >>> import _abc as _abc2 >>> class Bla2: pass ... >>> _abc._abc_init(Bla2) >>> type(Bla2._abc_impl) # _abc and _abc2 have exactly the same type, # they are not fully isolated >>> type(Bla2._abc_impl) is type(Bla._abc_impl) True That's more an issue for subinterpreters: each interpreter should have its own fully isolated instance of an C extension module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 22:49:20 2020 From: report at bugs.python.org (Junyu Zhang) Date: Wed, 25 Mar 2020 02:49:20 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1585104560.87.0.205980111023.issue40039@roundup.psfhosted.org> Junyu Zhang added the comment: Thank you for your reply. Yes, under normal circumstances, keys are generally not leaked. I may have only considered the following attacks at the time: 1. If the client script of the distributed process is on another machine, or the key is leaked due to accidental leak. 2. When the attacker has obtained some server permissions, but not the highest permissions, and this distributed service process runs with the highest management permissions, and the attacker has read permissions to the script code, this may cause a Simple elevation. Of course, after thinking about it carefully, I found that the above problem is just a conjecture, so now I have decided to give up reporting it as CVE, unless I find such a situation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 23:23:33 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 25 Mar 2020 03:23:33 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585106613.55.0.165384710662.issue1635741@roundup.psfhosted.org> Paulo Henrique Silva added the comment: Thanks for the clarifications. I will keep looking for simple modules, no state and easy to migrate but also dedicate more time to work on the more complex like datetime. I'm working on PR19122 corrections. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 23:36:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 25 Mar 2020 03:36:45 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1585107405.96.0.248283144479.issue40031@roundup.psfhosted.org> Terry J. Reedy added the comment: Once you touch the idlelib/*.def files or manually edit the .idlerc/*.cfg files, you are on your own. You could rename any *.def files and try to 'repair' the installation, or delete the *.cfg files and rebuild then through the dialog. You could also start IDLE from Command Prompt with 'py -m idlelib' and report any error messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 24 23:43:45 2020 From: report at bugs.python.org (Andy Lester) Date: Wed, 25 Mar 2020 03:43:45 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585107825.54.0.105484502482.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18513 pull_request: https://github.com/python/cpython/pull/19152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 01:49:25 2020 From: report at bugs.python.org (Andreas Schneider) Date: Wed, 25 Mar 2020 05:49:25 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585115365.89.0.925745091033.issue40052@roundup.psfhosted.org> Andreas Schneider added the comment: I forgot, for detecting alignment issues or strict aliasing and this also falls under strict aliasing, you need to turn on optimizations. clang -O2 -Werror -Wcast-align ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 02:35:08 2020 From: report at bugs.python.org (Javad Mokhtari Koushyar) Date: Wed, 25 Mar 2020 06:35:08 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585118108.68.0.312478995284.issue40045@roundup.psfhosted.org> Javad Mokhtari Koushyar added the comment: Hi, I'm ready to work on this. ---------- nosy: +javadmokhtari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 02:44:41 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Mar 2020 06:44:41 +0000 Subject: [issue40054] Allow formatted strings as docstrings In-Reply-To: <1585063756.05.0.0379809062913.issue40054@roundup.psfhosted.org> Message-ID: <1585118681.9.0.721515004265.issue40054@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 02:54:21 2020 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Wed, 25 Mar 2020 06:54:21 +0000 Subject: [issue40059] Provide a toml module in the standard library Message-ID: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> New submission from Micha? G?rny : PEP 518 uses the TOML format to specify build system requirements. AFAIU this means that all new build systems will require a TOML parser. Could you consider adding one to the standard library to reduce the number of chicken-egg problems? The referenced PEP states that 'pytoml TOML parser is ~300 lines of pure Python code', so I don't think integrating it would be a large maintenance cost. [1] https://www.python.org/dev/peps/pep-0518/ ---------- components: Library (Lib) messages: 364979 nosy: brett.cannon, dstufft, mgorny, njs priority: normal severity: normal status: open title: Provide a toml module in the standard library type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:00:26 2020 From: report at bugs.python.org (Javad Mokhtari Koushyar) Date: Wed, 25 Mar 2020 07:00:26 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585119626.81.0.871157994757.issue40045@roundup.psfhosted.org> Change by Javad Mokhtari Koushyar : ---------- keywords: +patch pull_requests: +18514 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:01:01 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 07:01:01 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585119661.76.0.731356167186.issue40013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 2227c1a4ca87034ed9eac55eb260a5fb0a04375d by Miss Islington (bot) in branch '3.8': bpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099) (GH-19141) https://github.com/python/cpython/commit/2227c1a4ca87034ed9eac55eb260a5fb0a04375d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:01:18 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 07:01:18 +0000 Subject: [issue40013] CSV DictReader parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585119678.97.0.310658869298.issue40013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset e5527f0edf7edc98e5e859b5fe823878684b4b6a by Miss Islington (bot) in branch '3.7': bpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099) (GH-19142) https://github.com/python/cpython/commit/e5527f0edf7edc98e5e859b5fe823878684b4b6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:05:19 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 07:05:19 +0000 Subject: [issue40013] CSV DictReader restval parameter documentation In-Reply-To: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org> Message-ID: <1585119919.17.0.827307154897.issue40013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Closing this as fixed. Thanks Moshe for the report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: CSV DictReader parameter documentation -> CSV DictReader restval parameter documentation type: -> enhancement versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:15:57 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 07:15:57 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1585120557.75.0.343694097395.issue40059@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Relevant python-dev discussion : https://mail.python.org/pipermail/python-dev/2019-May/157405.html . The format has still not reached 1.0. Issue to track the 1.0 release candidate : https://github.com/toml-lang/toml/issues/698 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 03:20:26 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 25 Mar 2020 07:20:26 +0000 Subject: [issue40060] socket.TCP_NOTSENT_LOWAT is missing in official macOS builds Message-ID: <1585120826.63.0.863724436073.issue40060@roundup.psfhosted.org> New submission from Dima Tisnek : Somehow, it turns out that `TCP_NOTSENT_LOWAT` that's available since 3.7.x is not available in the official macOS builds ?: > python3.7 Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.TCP_NOTSENT_LOWAT Traceback (most recent call last): File "", line 1, in AttributeError: module 'socket' has no attribute 'TCP_NOTSENT_LOWAT' > python3.8 Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.TCP_NOTSENT_LOWAT Traceback (most recent call last): File "", line 1, in AttributeError: module 'socket' has no attribute 'TCP_NOTSENT_LOWAT' > python3.9 Python 3.9.0a4 (v3.9.0a4:6e02691f30, Feb 25 2020, 18:14:13) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.TCP_NOTSENT_LOWAT Traceback (most recent call last): File "", line 1, in AttributeError: module 'socket' has no attribute 'TCP_NOTSENT_LOWAT' And my local build has it ?: > ~/cpython/python.exe Python 3.9.0a4+ (heads/master:be501ca241, Mar 4 2020, 15:16:49) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.TCP_NOTSENT_LOWAT 513 So... my guess is official builds are using old SDK or header files. ? My system has it e.g. here: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/netinet/tcp.h 230:#define TCP_NOTSENT_LOWAT 0x201 /* Low water mark for TCP unsent data */ And in fact it's present in every `netinet/tcp.h` on my system: CommandLineTools 10.14 and 10.5 sdks; MacOSX dev sdk, {AppleTV,Watch,iPhone}{OS,Simulator} sdks. ---------- components: Extension Modules messages: 364984 nosy: Dima.Tisnek, Mariatta, njs priority: normal severity: normal status: open title: socket.TCP_NOTSENT_LOWAT is missing in official macOS builds versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 05:36:53 2020 From: report at bugs.python.org (Kyle Stanley) Date: Wed, 25 Mar 2020 09:36:53 +0000 Subject: [issue40061] Possible refleak in _asynciomodule.c future_add_done_callback() Message-ID: <1585129013.48.0.185605805596.issue40061@roundup.psfhosted.org> New submission from Kyle Stanley : When using the `test-with-buildbots` label in GH-19149 (which involved no C changes), a failure occurred in test_asyncio for several of the refleak buildbots. Here's the output of a few: AMD64 Fedora Stable Refleaks PR: test_asyncio leaked [3, 3, 27] references, sum=33 test_asyncio leaked [3, 3, 28] memory blocks, sum=34 2 tests failed again: test__xxsubinterpreters test_asyncio == Tests result: FAILURE then FAILURE == AMD64 RHEL8 Refleaks PR: test_asyncio leaked [3, 3, 3] references, sum=9 test_asyncio leaked [3, 3, 3] memory blocks, sum=9 2 tests failed again: test__xxsubinterpreters test_asyncio == Tests result: FAILURE then FAILURE == RHEL7 Refleaks PR: test_asyncio leaked [3, 3, 3] references, sum=9 test_asyncio leaked [3, 3, 3] memory blocks, sum=9 2 tests failed again: test__xxsubinterpreters test_asyncio == Tests result: FAILURE then FAILURE == I'm unable to replicate it locally, but I think I may have located a subtle, uncommon refleak in `future_add_done_callback()`, within _asynciomodule.c. Specifically: ``` PyObject *tup = PyTuple_New(2); if (tup == NULL) { return NULL; } Py_INCREF(arg); PyTuple_SET_ITEM(tup, 0, arg); Py_INCREF(ctx); PyTuple_SET_ITEM(tup, 1, (PyObject *)ctx); if (fut->fut_callbacks != NULL) { int err = PyList_Append(fut->fut_callbacks, tup); if (err) { Py_DECREF(tup); return NULL; } Py_DECREF(tup); } else { fut->fut_callbacks = PyList_New(1); if (fut->fut_callbacks == NULL) { // Missing ``Py_DECREF(tup);`` ? return NULL; } ``` (The above code is located at: https://github.com/python/cpython/blob/7668a8bc93c2bd573716d1bea0f52ea520502b28/Modules/_asynciomodule.c#L664-L685) In the above conditional for "if (fut->fut_callbacks == NULL)", it appears that `tup` is pointing to a non-NULL new reference at this point, and thus should be decref'd prior to returning NULL. Otherwise, it seems like it could be leaked. But, I would appreciate it if someone could double check this (the C-API isn't an area I'm experienced); particularly since this code has been in place for a decent while (since 3.7). I _suspect_ it's gone undetected and only failed intermittently because this specific ``return NULL`` path is rather uncommon. I'd be glad to open a PR to address the issue, assuming I'm not missing something with the above refleak. Otherwise, feel free to correct me. ---------- assignee: aeros components: C API, Extension Modules messages: 364985 nosy: aeros, asvetlov, yselivanov priority: high severity: normal status: open title: Possible refleak in _asynciomodule.c future_add_done_callback() type: resource usage versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 08:27:46 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 25 Mar 2020 12:27:46 +0000 Subject: [issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability In-Reply-To: <1584856696.55.0.228869164986.issue40039@roundup.psfhosted.org> Message-ID: <1585139266.34.0.694991859288.issue40039@roundup.psfhosted.org> Steve Dower added the comment: Thanks for reporting this. In future, security issues should be reported *first* through https://www.python.org/dev/security/ *Do not* request a CVE number until we've reviewed it. It causes unnecessary stress for our users who actually pay attention to those disclosures. CVEs are a tool for *us* to communicate with our users, not for researchers to communicate with us (just send us an email :) ). Since you appear to have a number assigned, I've requested that MITRE retract it. Though it seems you may have done the same already. Looking forward to meeting you soon on the security mailing list! ---------- nosy: +steve.dower resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 08:54:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 12:54:50 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585140890.78.0.84509618871.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > Thanks for the clarifications. I will keep looking for simple modules, no state and easy to migrate but also dedicate more time to work on the more complex like datetime. I'm working on PR19122 corrections. I like changes which convert C extension modules to multiphase initialization API since they fix the error path: they implicitly ensures that the module is properly destroyed if something goes wrong. Moreover, it will ease the work to fix the other issues that I listed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 09:32:06 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 13:32:06 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585143126.17.0.457004063272.issue39689@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18515 pull_request: https://github.com/python/cpython/pull/19154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 09:32:14 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 13:32:14 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585143134.65.0.159014953646.issue39689@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18516 pull_request: https://github.com/python/cpython/pull/19155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 10:09:34 2020 From: report at bugs.python.org (shaw_koike) Date: Wed, 25 Mar 2020 14:09:34 +0000 Subject: [issue40062] islapha method returns True when the word is japanese Message-ID: <1585145374.17.0.909964771668.issue40062@roundup.psfhosted.org> New submission from shaw_koike : When I use isalpha method with Japanese, I got it True whenever. For example, ``` >>> "???".isalpha() True ``` Is it the correct behavior? Thanks for readning. ---------- components: Unicode messages: 364988 nosy: ezio.melotti, shaw_koike, vstinner priority: normal severity: normal status: open title: islapha method returns True when the word is japanese type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 10:24:34 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 25 Mar 2020 14:24:34 +0000 Subject: [issue40062] islapha method returns True when the word is japanese In-Reply-To: <1585145374.17.0.909964771668.issue40062@roundup.psfhosted.org> Message-ID: <1585146274.57.0.368373988151.issue40062@roundup.psfhosted.org> Eric V. Smith added the comment: >From the documentation: https://docs.python.org/3/library/stdtypes.html#str.isalpha Alphabetic characters are those characters defined in the Unicode character database as ?Letter?, i.e., those with general category property being one of ?Lm?, ?Lt?, ?Lu?, ?Ll?, or ?Lo?. I'm assuming those characters all have these properties. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 10:27:25 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 25 Mar 2020 14:27:25 +0000 Subject: [issue40062] islapha method returns True when the word is japanese In-Reply-To: <1585145374.17.0.909964771668.issue40062@roundup.psfhosted.org> Message-ID: <1585146445.56.0.0422414975799.issue40062@roundup.psfhosted.org> Eric V. Smith added the comment: That last line should have been "I'm assuming those characters all have one of these properties." I'm going to close this issue. If you still think there's a bug here, you can let us know why and reopen this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 10:41:28 2020 From: report at bugs.python.org (Jason Madden) Date: Wed, 25 Mar 2020 14:41:28 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585147288.48.0.598686829409.issue40018@roundup.psfhosted.org> Change by Jason Madden : ---------- nosy: +jmadden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 10:46:30 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 14:46:30 +0000 Subject: [issue40062] islapha method returns True when the word is japanese In-Reply-To: <1585145374.17.0.909964771668.issue40062@roundup.psfhosted.org> Message-ID: <1585147590.23.0.0688034812395.issue40062@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: unicodedata.category can be used here I guess to validate this. >>> [unicodedata.category(c) for c in "???"] ['Lo', 'Lo', 'Lo'] ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 11:24:24 2020 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 25 Mar 2020 15:24:24 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585149864.17.0.930467519322.issue36144@roundup.psfhosted.org> Brandt Bucher added the comment: And... that's it! Big thanks to everybody who had a part in making this happen. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 11:42:13 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Mar 2020 15:42:13 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585150933.53.0.109307770432.issue40058@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 11:44:41 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 15:44:41 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585151081.24.0.315169013869.issue40058@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 11:52:39 2020 From: report at bugs.python.org (hai shi) Date: Wed, 25 Mar 2020 15:52:39 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585151559.16.0.862827193355.issue40058@roundup.psfhosted.org> hai shi added the comment: `_divide_and_round()` would be deleted in https://github.com/python/cpython/blob/master/Lib/datetime.py#L2516. if it's removed L2516 of datetime.py, `test_name_cleanup()` would be failed.Looks like it's a planed behavior~ ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 11:55:14 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 25 Mar 2020 15:55:14 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585151714.25.0.0268218513983.issue40018@roundup.psfhosted.org> Charalampos Stratakis added the comment: This behavior change is considered being reverted upstream. PR: https://github.com/openssl/openssl/pull/11400 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:19:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 16:19:39 +0000 Subject: [issue38826] Regular Expression Denial of Service in urllib.request.AbstractBasicAuthHandler In-Reply-To: <1573955142.95.0.285133152076.issue38826@roundup.psfhosted.org> Message-ID: <1585153179.8.0.0264408659903.issue38826@roundup.psfhosted.org> STINNER Victor added the comment: This issue is a duplicate of bpo-39503 which has a PR. Thanks Ben Caller for the report, I credited you in my fix ;-) ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:19:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 16:19:57 +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: <1585153197.14.0.245261366902.issue39503@roundup.psfhosted.org> STINNER Victor added the comment: > Isn't this a duplicate of bpo-38826 ? Oh right. I marked it as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:28:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 16:28:32 +0000 Subject: [issue39873] Debug mode: check if objects are valid In-Reply-To: <1583486690.53.0.82859773355.issue39873@roundup.psfhosted.org> Message-ID: <1585153712.51.0.783562424137.issue39873@roundup.psfhosted.org> STINNER Victor added the comment: This change was mostly an experimentation. But I'm not sure that it does solve any issue. The change is more intrusive than what I expected. I prefer to abandon PR 18803 and this issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:31:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 16:31:27 +0000 Subject: [issue39541] distutils: Remove bdist_wininst (Windows .exe installers) in favor of bdist_wheel (.whl) In-Reply-To: <1580735997.04.0.997914254478.issue39541@roundup.psfhosted.org> Message-ID: <1585153887.14.0.608528220063.issue39541@roundup.psfhosted.org> STINNER Victor added the comment: There is no clear consensus towards removing distutils bdist_wininst command. I close this PR for now, it's too late for Python 3.9 (feature freeze is coming soon). We can reconsider removing it once setuptools will be more ready for this removal. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:33:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 16:33:26 +0000 Subject: [issue39352] Remove the formatter module, deprecated since Python 3.4 In-Reply-To: <1579164481.25.0.406270516611.issue39352@roundup.psfhosted.org> Message-ID: <1585154006.06.0.499536014041.issue39352@roundup.psfhosted.org> STINNER Victor added the comment: I'm no longer sure that it's a good idea to remove a module from the stdlib without providing a solution for the few people relying on it. I removed dummy_threading module in Python 3.9 and obviously it broke an application (bodhi): https://bugzilla.redhat.com/show_bug.cgi?id=1814243 I should think about a way to move removed stdlib modules to PyPI, but I would prefer to have a formal PEP process for that. In the meanwhile, I close this PR. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:53:21 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 25 Mar 2020 16:53:21 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1585155201.24.0.781241226149.issue40059@roundup.psfhosted.org> Brett Cannon added the comment: The plan is to start discussing adding a TOML parser once the spec reaches 1.0 (which we will know about as one of the pip contributors also manages TOML). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 12:57:23 2020 From: report at bugs.python.org (Amit Moghe) Date: Wed, 25 Mar 2020 16:57:23 +0000 Subject: [issue40063] Fatal python error:PyEval_RestoreThread NULL tstate Message-ID: <1585155443.15.0.196815788014.issue40063@roundup.psfhosted.org> New submission from Amit Moghe : Hi Team, I am writting an application in python flask. I this when flask application is establishing Sybase DB connection through normal python SybaseConnector. In this process I am getting below error, could you please suggest on this ? Error :Fatal python error:PyEval_RestoreThread NULL tstate flask/1.0.2/lib/flask/app.py line 1815 in full_dispatch_request Memory fault(Coredump) Could you please suggest on this? ---------- components: Tests messages: 365001 nosy: amitrutvij priority: normal severity: normal status: open title: Fatal python error:PyEval_RestoreThread NULL tstate type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:01:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 17:01:33 +0000 Subject: [issue40063] Fatal python error:PyEval_RestoreThread NULL tstate In-Reply-To: <1585155443.15.0.196815788014.issue40063@roundup.psfhosted.org> Message-ID: <1585155693.49.0.975155023431.issue40063@roundup.psfhosted.org> STINNER Victor added the comment: This issue looks like a bug in Flask or a C extension used by your application. You should try to debug it with gdb. Or at least try to get a Python traceback: https://pythondev.readthedocs.io/debug_tools.html#get-a-traceback-on-a-crash You should specify your Python version, OS and OS version, explain how to reproduce the crash, etc. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:16:41 2020 From: report at bugs.python.org (Amit Moghe) Date: Wed, 25 Mar 2020 17:16:41 +0000 Subject: [issue40063] Fatal python error:PyEval_RestoreThread NULL tstate In-Reply-To: <1585155443.15.0.196815788014.issue40063@roundup.psfhosted.org> Message-ID: <1585156601.98.0.146374455974.issue40063@roundup.psfhosted.org> Amit Moghe added the comment: Hi , Please see below trace logger - Failed transaction. Statement: SELECT Col1, Col2, Col3 FROM TABLE where APPLICATION='TEST' ORDER BY UPDATE_TIME DESCFatal Python error: PyEval_RestoreThread: NULL tstate Current thread 0x00007f3e435fe700 (most recent call first): File "/generic_sybase_connector.py", line 175 in _do File "/generic_sybase_connector.py", line 155 in _safe_cursor_operation File "/generic_sybase_connector.py", line 184 in fetch_from_db File "/cva_sybase_connector.py", line 197 in get_smoke_test_name_data File "/db_connector.py", line 197 in get File "/dist/python/PROJ/flask-restful/0.3.6/lib/flask_restful/__init__.py", line 595 in dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/views.py", line 88 in view File "/dist/python/PROJ/flask-restful/0.3.6/lib/flask_restful/__init__.py", line 480 in wrapper File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 1799 in dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 1813 in full_dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 2292 in wsgi_app File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 2309 in __call__ File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/debug/__init__.py", line 288 in debug_application File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 260 in execute File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 270 in run_wsgi File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 328 in handle_one_request File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/http/server.py", line 401 in handle File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 293 in handle File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 673 in __init__ File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 344 in finish_request File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 617 in process_request_thread File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 859 in run File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 911 in _bootstrap_inner File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 879 in _bootstrap Thread 0x00007f3e4924d700 (most recent call first): File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/tokenize.py", line 454 in open File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/linecache.py", line 130 in updatecache File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/linecache.py", line 42 in getlines File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/linecache.py", line 15 in getline File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/traceback.py", line 65 in _extract_tb_or_stack_iter File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/traceback.py", line 18 in _format_list_iter File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/traceback.py", line 153 in _format_exception_iter File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/traceback.py", line 181 in format_exception File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/traceback.py", line 256 in format_exc File "/generic_sybase_connector.py", line 159 in _safe_cursor_operation File "/generic_sybase_connector.py", line 184 in fetch_from_db File "/cva_sybase_connector.py", line 128 in get_dashboard_data File "/db_connector.py", line 50 in get File "/dist/python/PROJ/flask-restful/0.3.6/lib/flask_restful/__init__.py", line 595 in dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/views.py", line 88 in view File "/dist/python/PROJ/flask-restful/0.3.6/lib/flask_restful/__init__.py", line 480 in wrapper File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 1799 in dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 1813 in full_dispatch_request File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 2292 in wsgi_app File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 2309 in __call__ File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/debug/__init__.py", line 288 in debug_application File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 260 in execute File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 270 in run_wsgi File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 328 in handle_one_request File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/http/server.py", line 401 in handle File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 293 in handle File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 673 in __init__ File "/dist/pythTraceback (most recent call last): File "/generic_sybase_connector.py", line 155, in _safe_cursor_operation return fct(cursor) File "/generic_sybase_connector.py", line 175, in _do cursor.execute(query, params) sybpydb.InternalError: ('Error in creating new statement: DBCAPI layer: Error: CT-Lib routine ct_cmd_alloc failed.', 134283521) on/PR OJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 344 in finish_request File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 617 in process_request_thread File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 859 in run File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 911 in _bootstrap_inner File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/threading.py", line 879 in _bootstrap Thread 0x00007f3e5cb02700 (most recent call first): File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 154 in _eintr_retry File "/dist/python/PROJ/core/3.4.4/exec/lib/python3.4/socketserver.py", line 236 in serve_forever File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 612 in serve_forever File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 777 in inner File "/dist/python/PROJ/werkzeug/0.14.1/lib/werkzeug/serving.py", line 814 in run_simple File "/dist/python/PROJ/flask/1.0.2/lib/flask/app.py", line 943 in run File "webapp.py", line 148 in Memory fault(coredump) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:18:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 17:18:19 +0000 Subject: [issue40063] Fatal python error:PyEval_RestoreThread NULL tstate In-Reply-To: <1585155443.15.0.196815788014.issue40063@roundup.psfhosted.org> Message-ID: <1585156699.09.0.914524579287.issue40063@roundup.psfhosted.org> STINNER Victor added the comment: File "/generic_sybase_connector.py", line 175 in _do File "/generic_sybase_connector.py", line 155 in _safe_cursor_operation File "/generic_sybase_connector.py", line 184 in fetch_from_db File "/cva_sybase_connector.py", line 197 in get_smoke_test_name_data File "/db_connector.py", line 197 in get File "/dist/python/PROJ/flask-restful/0.3.6/lib/flask_restful/__init__.py", line 595 in dispatch_request It looks likle a bug in your sybase database connector. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:32:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 17:32:17 +0000 Subject: [issue40050] importlib: module.__spec__ leaks importlib namespaces (test_importlib leaked xxx references) In-Reply-To: <1585003263.45.0.397695046047.issue40050@roundup.psfhosted.org> Message-ID: <1585157537.77.0.643513365274.issue40050@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ace018ca47c03ca699603341b12781b5329d2eaa by Victor Stinner in branch 'master': bpo-40050: Rephrase NEWS entry (GH-19148) https://github.com/python/cpython/commit/ace018ca47c03ca699603341b12781b5329d2eaa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:33:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 17:33:17 +0000 Subject: [issue40010] Inefficient signal handling in multithreaded applications In-Reply-To: <1584579439.15.0.43767534151.issue40010@roundup.psfhosted.org> Message-ID: <1585157597.99.0.356204801805.issue40010@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 13:57:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 17:57:41 +0000 Subject: [issue39984] Move pending calls from _PyRuntime to PyInterpreterState In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1585159061.8.0.706692262675.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: I moved pending calls to PyInterpreterState. There are remaining issues with using pending calls in subinterpreters, but I propose to continue the discussion in bpo-37127. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval -> Move pending calls from _PyRuntime to PyInterpreterState _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:01:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:01:14 +0000 Subject: [issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E In-Reply-To: <1572918956.02.0.914904783167.issue38691@roundup.psfhosted.org> Message-ID: <1585159274.58.0.072239779266.issue38691@roundup.psfhosted.org> STINNER Victor added the comment: FYI importlib leak was fixed in bpo-40050 by: commit 83d46e0622d2efdf5f3bf8bf8904d0dcb55fc322 Author: Victor Stinner Date: Tue Mar 24 18:03:34 2020 +0100 bpo-40050: Fix importlib._bootstrap_external (GH-19135) Remove two unused imports: _thread and _weakref. Avoid creating a new winreg builtin module if it's already available in sys.modules. The winreg module is now stored as "winreg" rather than "_winreg". ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:02:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:02:10 +0000 Subject: [issue38353] Cleanup the path configuration implementation code (getpath.c) In-Reply-To: <1570050763.22.0.787922067096.issue38353@roundup.psfhosted.org> Message-ID: <1585159330.03.0.94178257215.issue38353@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:03:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:03:11 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name In-Reply-To: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> Message-ID: <1585159391.61.0.822407931164.issue39882@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18517 pull_request: https://github.com/python/cpython/pull/19157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:16:51 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 25 Mar 2020 18:16:51 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585160211.33.0.396081809254.issue19698@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +18518 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:17:35 2020 From: report at bugs.python.org (B Sizer) Date: Wed, 25 Mar 2020 18:17:35 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585160255.83.0.100383750426.issue1635741@roundup.psfhosted.org> B Sizer added the comment: Sorry for the noise, but I just wanted to say thanks to the people working on this issue 13 years after I reported it. :) Far too many open-source projects arbitrarily close bugs just because they don't have time to fix them and they never get fixed, so I'm glad this wasn't the case here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:24:08 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 25 Mar 2020 18:24:08 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1585160648.45.0.977645637648.issue40059@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pradyunsg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:27:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:27:43 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name In-Reply-To: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> Message-ID: <1585160863.8.0.350137021462.issue39882@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 87d3b9db4ade1aa100ee6f065082cb7e85b8992f by Victor Stinner in branch 'master': bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157) https://github.com/python/cpython/commit/87d3b9db4ade1aa100ee6f065082cb7e85b8992f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:28:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:28:14 +0000 Subject: [issue39882] Py_FatalError(): log automatically the function name In-Reply-To: <1583535250.38.0.696176637813.issue39882@roundup.psfhosted.org> Message-ID: <1585160894.92.0.35303147326.issue39882@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:29:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:29:50 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585160990.82.0.590455520734.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18519 pull_request: https://github.com/python/cpython/pull/19159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:39:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:39:25 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585161565.7.0.857464256145.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18520 pull_request: https://github.com/python/cpython/pull/19160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:45:01 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 18:45:01 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585161901.46.0.846694689973.issue40016@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18521 pull_request: https://github.com/python/cpython/pull/19161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:44:51 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 25 Mar 2020 18:44:51 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585161891.5.0.524421808579.issue40016@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 89a2209ae6fc5f39868621799730e16f931eb497 by Ram Rachum in branch 'master': bpo-40016: re docstring: Clarify relationship of inline and argument flags (#19078) https://github.com/python/cpython/commit/89a2209ae6fc5f39868621799730e16f931eb497 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:45:09 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 18:45:09 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585161909.25.0.197723807711.issue40016@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18522 pull_request: https://github.com/python/cpython/pull/19162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:47:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:47:40 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585162060.33.0.175758128347.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18523 pull_request: https://github.com/python/cpython/pull/19163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:52:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 18:52:08 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585162328.94.0.955401080682.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3072338642156a5edfa2deef2557288fff73c22a by Victor Stinner in branch 'master': bpo-39947: Use PyThreadState_GetFrame() (GH-19159) https://github.com/python/cpython/commit/3072338642156a5edfa2deef2557288fff73c22a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:54:40 2020 From: report at bugs.python.org (hai shi) Date: Wed, 25 Mar 2020 18:54:40 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585162480.52.0.133438045334.issue40058@roundup.psfhosted.org> hai shi added the comment: add a pdb point in L11 of test_datetime.py 8 try: 9 pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'], 10 blocked=['_datetime']) 11 import pdb;pdb.set_trace() 12 -> fast_tests = import_fresh_module(TESTS, fresh=['datetime', 13 '_datetime', '_strptime']) and run `./python -m test test_datetime test_datetime`: the first iteration: (Pdb) pure_tests.datetime_module._divide_and_round the second iteration(`_datetime` not blocked?): (Pdb) pure_tests.datetime_module._divide_and_round *** AttributeError: module 'datetime' has no attribute '_divide_and_round' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:57:54 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 25 Mar 2020 18:57:54 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585162674.27.0.665921169203.issue19698@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 302e5a8f79514fd84bafbc44b7c97ec636302322 by Brett Cannon in branch 'master': bpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related methods (GH-19158) https://github.com/python/cpython/commit/302e5a8f79514fd84bafbc44b7c97ec636302322 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:58:00 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 18:58:00 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585162680.39.0.456666509424.issue19698@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +18524 pull_request: https://github.com/python/cpython/pull/19164 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:58:07 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 18:58:07 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585162687.73.0.532988364908.issue19698@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18525 pull_request: https://github.com/python/cpython/pull/19165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 14:59:21 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 25 Mar 2020 18:59:21 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585162761.95.0.568420675954.issue19698@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: -patch resolution: -> fixed stage: patch review -> needs patch status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:01:38 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 19:01:38 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585162898.81.0.100471652926.issue40016@roundup.psfhosted.org> miss-islington added the comment: New changeset 686d508c26fafb57dfe463c4f55b20013dad1441 by Miss Islington (bot) in branch '3.8': bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078) https://github.com/python/cpython/commit/686d508c26fafb57dfe463c4f55b20013dad1441 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:03:38 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 19:03:38 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585163018.03.0.122716882551.issue40016@roundup.psfhosted.org> miss-islington added the comment: New changeset 0dad7486e7d7bc2e0f1b0a4f44d9c28064762be5 by Miss Islington (bot) in branch '3.7': bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078) https://github.com/python/cpython/commit/0dad7486e7d7bc2e0f1b0a4f44d9c28064762be5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:07:25 2020 From: report at bugs.python.org (Fred Drake) Date: Wed, 25 Mar 2020 19:07:25 +0000 Subject: [issue40064] py38: document xml.etree.cElementTree will be removed in 3.9 Message-ID: <1585163245.27.0.977723603934.issue40064@roundup.psfhosted.org> Change by Fred Drake : ---------- assignee: docs at python components: Documentation nosy: docs at python, fdrake priority: normal severity: normal status: open title: py38: document xml.etree.cElementTree will be removed in 3.9 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:09:39 2020 From: report at bugs.python.org (Fred Drake) Date: Wed, 25 Mar 2020 19:09:39 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree Message-ID: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> New submission from Fred Drake : Since xml.etree.cElementTree does not exist in Python 3.9, the statement that it's deprecated should be removed from the documentation. ---------- assignee: docs at python components: Documentation keywords: easy messages: 365016 nosy: docs at python, fdrake priority: normal severity: normal status: open title: py39: remove deprecation note for xml.etree.cElementTree versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:09:58 2020 From: report at bugs.python.org (Fred Drake) Date: Wed, 25 Mar 2020 19:09:58 +0000 Subject: [issue40064] py38: document xml.etree.cElementTree will be removed in 3.9 Message-ID: <1585163398.94.0.949298560652.issue40064@roundup.psfhosted.org> Change by Fred Drake : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:22:48 2020 From: report at bugs.python.org (hai shi) Date: Wed, 25 Mar 2020 19:22:48 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585164168.02.0.353817822302.issue1635741@roundup.psfhosted.org> hai shi added the comment: >Sorry for the noise, but I just wanted to say thanks to the people working on this issue 13 years after I reported it. :) Far too many open-source projects arbitrarily close bugs just because they don't have time to fix them and they never get fixed, so I'm glad this wasn't the case here. cpython is a big family ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:25:38 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Mar 2020 19:25:38 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1585164338.6.0.301239772457.issue38250@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:46:14 2020 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 25 Mar 2020 19:46:14 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585165574.49.0.0921051953024.issue40058@roundup.psfhosted.org> Paul Ganssle added the comment: This isn't exactly "working as intended", but I believe it's a known problem with either `import_fresh_module` or `datetime`, as you can see from these comments: https://github.com/python/cpython/blob/302e5a8f79514fd84bafbc44b7c97ec636302322/Lib/test/test_datetime.py#L14-L23 Based on the git blame, those TODO comments are from Georg Brandl, so I'm adding him to the nosy list in case he has some insight. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:48:58 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Mar 2020 19:48:58 +0000 Subject: [issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name Message-ID: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> New submission from Ethan Furman : Serhiy had the idea of having Enum._convert also modify the __str__ and __repr__ of newly created enumerations to display the module name instead of the enumeration name (https://bugs.python.org/msg325007): --> socket.AF_UNIX ==> --> print(socket.AF_UNIX) AddressFamily.AF_UNIX ==> socket.AF_UNIX Thoughts? ---------- assignee: ethan.furman messages: 365019 nosy: barry, eli.bendersky, ethan.furman priority: normal severity: normal status: open title: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:51:53 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Mar 2020 19:51:53 +0000 Subject: [issue34443] enum error messages should use __qualname__ In-Reply-To: <1534782868.03.0.56676864532.issue34443@psf.upfronthosting.co.za> Message-ID: <1585165913.48.0.888125135819.issue34443@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: enum repr should use __qualname__ -> enum error messages should use __qualname__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:54:02 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Mar 2020 19:54:02 +0000 Subject: [issue34443] enum error messages should use __qualname__ In-Reply-To: <1534782868.03.0.56676864532.issue34443@psf.upfronthosting.co.za> Message-ID: <1585166042.51.0.898406982941.issue34443@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +18526 pull_request: https://github.com/python/cpython/pull/19166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 15:59:50 2020 From: report at bugs.python.org (Georg Brandl) Date: Wed, 25 Mar 2020 19:59:50 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585166390.04.0.248377571507.issue40058@roundup.psfhosted.org> Georg Brandl added the comment: Sorry, it seems that was far too long ago for me to remember anything :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 16:23:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 20:23:03 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585167783.09.0.724844520438.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0e427c6d159e86f17270770cd8dc37372e3c4004 by Victor Stinner in branch 'master': bpo-39947: Add _PyThreadState_GetDict() function (GH-19160) https://github.com/python/cpython/commit/0e427c6d159e86f17270770cd8dc37372e3c4004 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 16:23:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 20:23:56 +0000 Subject: [issue39947] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1585167836.6.0.822350850101.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5c3cda0d1a850a1a9b43892f48376b8876bd5863 by Victor Stinner in branch 'master': bpo-39947: Add PyThreadState_GetID() function (GH-19163) https://github.com/python/cpython/commit/5c3cda0d1a850a1a9b43892f48376b8876bd5863 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 16:26:27 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Wed, 25 Mar 2020 20:26:27 +0000 Subject: [issue40067] Improve error messages for multiple star expressions in assignment Message-ID: <1585167987.52.0.347925597304.issue40067@roundup.psfhosted.org> New submission from Furkan ?nder : Hello everyone, >>> a,*b,*c,*d = range(4) File "", line 1 SyntaxError: two starred expressions in assignment >>> >>> a,*b,*c,*d,*e = range(5) File "", line 1 SyntaxError: two starred expressions in assignment >>> I think this error message is incomplete. It states that there are two starred assignments but there are more. It might be better if we change it to something less vague like "SyntaxError: more than one starred expressions in assignment." ---------- components: Interpreter Core messages: 365023 nosy: BTaskaya, furkanonder priority: normal severity: normal status: open title: Improve error messages for multiple star expressions in assignment type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 16:30:12 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Wed, 25 Mar 2020 20:30:12 +0000 Subject: [issue40067] Improve error messages for multiple star expressions in assignment In-Reply-To: <1585167987.52.0.347925597304.issue40067@roundup.psfhosted.org> Message-ID: <1585168212.21.0.859324301012.issue40067@roundup.psfhosted.org> Change by Furkan ?nder : ---------- keywords: +patch pull_requests: +18527 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 17:34:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 21:34:50 +0000 Subject: [issue39321] AMD64 FreeBSD Non-Debug 3.x: out of swap space (test process killed by signal 9) In-Reply-To: <1578925087.43.0.642221025557.issue39321@roundup.psfhosted.org> Message-ID: <1585172090.13.0.883280415997.issue39321@roundup.psfhosted.org> STINNER Victor added the comment: New failure: https://buildbot.python.org/all/#/builders/214/builds/512 test.pythoninfo says: datetime.datetime.now: 2020-03-25 18:59:08.424147 socket.hostname: 121-RELEASE-p2-amd64 /var/log/messages says: Mar 25 18:41:13 121-RELEASE-p2-amd64 kernel: pid 65447 (python), jid 0, uid 1002, was killed: out of swap space 121-RELEASE-p2-amd64% sysctl hw | egrep 'hw.(phys|user|real)' hw.physmem: 1033416704 hw.usermem: 745279488 hw.realmem: 1073676288 => 985.5 MB of memory 121-RELEASE-p2-amd64% sysctl vm|grep swap vm.swap_enabled: 1 vm.domain.0.stats.unswappable: 0 vm.swap_idle_threshold2: 10 vm.swap_idle_threshold1: 2 vm.swap_idle_enabled: 0 vm.disable_swapspace_pageouts: 0 vm.stats.vm.v_swappgsout: 5793651 vm.stats.vm.v_swappgsin: 3322252 vm.stats.vm.v_swapout: 1390626 vm.stats.vm.v_swapin: 875591 vm.nswapdev: 1 vm.swap_fragmentation: vm.swap_async_max: 4 vm.swap_maxpages: 1964112 vm.swap_total: 4294864896 vm.swap_reserved: 7942307840 => 4095.9 MB of swap (total) 121-RELEASE-p2-amd64% swapinfo -h Device 1K-blocks Used Avail Capacity /dev/da0p3 4194204 70M 3.9G 2% 121-RELEASE-p2-amd64% swapinfo Device 1K-blocks Used Avail Capacity /dev/da0p3 4194204 72164 4122040 2% ---------- title: AMD64 FreeBSD Non-Debug 3.x: main regrtest process killed by SIGKILL (Signal 9) -> AMD64 FreeBSD Non-Debug 3.x: out of swap space (test process killed by signal 9) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 17:59:24 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Mar 2020 21:59:24 +0000 Subject: [issue37062] `AutoNumber` class in enum documentation: support *args in constructor In-Reply-To: <1558936980.63.0.0585299344314.issue37062@roundup.psfhosted.org> Message-ID: <1585173564.14.0.0625918778033.issue37062@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: docs at python -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 17:59:43 2020 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Mar 2020 21:59:43 +0000 Subject: [issue37062] `AutoNumber` class in enum documentation: support *args in constructor In-Reply-To: <1558936980.63.0.0585299344314.issue37062@roundup.psfhosted.org> Message-ID: <1585173583.05.0.183520281733.issue37062@roundup.psfhosted.org> Change by Ethan Furman : ---------- versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 17:59:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 25 Mar 2020 21:59:45 +0000 Subject: [issue40016] Clarify flag case in `re` module docstring In-Reply-To: <1584639650.79.0.177965379054.issue40016@roundup.psfhosted.org> Message-ID: <1585173585.37.0.371070971065.issue40016@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- assignee: docs at python -> terry.reedy resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 18:15:12 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Mar 2020 22:15:12 +0000 Subject: [issue19462] Add remove_argument() method to argparse.ArgumentParser In-Reply-To: <1383240778.45.0.779487488351.issue19462@psf.upfronthosting.co.za> Message-ID: <1585174512.35.0.937972038461.issue19462@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 18:34:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 22:34:11 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX Message-ID: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/73/builds/208 --- Warning -- files was modified by test_threading Before: [] After: ['core'] 1 test altered the execution environment: test_threading --- The bug can be reproduced with: $ ./configure --with-pydebug CC=gcc CFLAGS=-O0 $ make (... $ ./python -m test test_threading --fail-env-changed -m test.test_threading.ThreadJoinOnShutdown.test_reinit_tls_after_fork -F -j 20 0:00:00 Run tests in parallel using 20 child processes 0:00:01 [ 1] test_threading passed 0:00:01 [ 2] test_threading passed (...) 0:00:03 [ 17] test_threading passed 0:00:03 [ 18/1] test_threading failed (env changed) Warning -- files was modified by test_threading Before: [] After: ['core'] Kill (...) Tests result: ENV CHANGED ---------- components: Tests messages: 365025 nosy: vstinner priority: normal severity: normal status: open title: test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 18:51:43 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 25 Mar 2020 22:51:43 +0000 Subject: [issue40069] Clear .lst files for AIX Message-ID: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> New submission from Batuhan Taskaya : AIX files stay even if we run make clean on the directory, I think they should be cleared ---------- components: Build messages: 365026 nosy: BTaskaya, David.Edelsohn priority: normal severity: normal status: open title: Clear .lst files for AIX type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 18:54:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 22:54:48 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585176888.28.0.947744131353.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: The master branch is also affected. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:00:00 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 25 Mar 2020 23:00:00 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585177200.75.0.0297096614873.issue40069@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:00:31 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 25 Mar 2020 23:00:31 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585177231.17.0.293224512931.issue40069@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19169 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:02:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 23:02:19 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585177339.63.0.649345561784.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: Example of crash in master in a child process after os.fork(). The crash occurred in logging._releaseLock() called by logging._after_at_fork_child_reinit_locks(). Old issues about logging + fork * bpo-36533 (closed): logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) * bpo-37429 (open): Python hangs on fork when a logger is in use in a background thread * bpo-6721 (open): Locks in the standard library should be sanitized on fork -- (gdb) where #0 0xd0563e00 in _internal_error () from /usr/lib/libpthreads.a(shr_xpg5.o) #1 0xd0573270 in _event_notify_locked at AF34_24 () from /usr/lib/libpthreads.a(shr_xpg5.o) #2 0xd057247c in _event_notify () from /usr/lib/libpthreads.a(shr_xpg5.o) #3 0xd0582b2c in _cond_broadcast () from /usr/lib/libpthreads.a(shr_xpg5.o) #4 0xd0584b0c in pthread_cond_signal at AF29_12 () from /usr/lib/libpthreads.a(shr_xpg5.o) #5 0xd058320c in pthread_cond_signal () from /usr/lib/libpthreads.a(shr_xpg5.o) #6 0x100a7568 in PyThread_release_lock (lock=0x200848f0) at Python/thread_pthread.h:687 #7 0x10249d38 in rlock_release (self=0x30295758, _unused_ignored=0xffffffff) at ./Modules/_threadmodule.c:357 #8 0x102109dc in method_vectorcall_NOARGS (func=0x0, args=0x302cdd80, nargsf=4294967295, kwnames=0x0) at Objects/descrobject.c:20 #9 0x10109d84 in call_function (tstate=0x200d5ca0, pp_stack=0x20e82aec, oparg=24, kwnames=0x0) at ./Include/cpython/abstract.h:118 #10 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x302cdc48, throwflag=537746592) at Python/ceval.c:2586 #11 0x1011bd10 in function_code_fastcall (tstate=0x3027c972, co=0x3027d820, args=0x3052cef0, nargs=808246660, globals=0x302cdc48) at ./Include/internal/pycore_ceval.h:40 #12 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302bd030, stack=0x3027c968, nargsf=0, kwnames=0x0) at Objects/call.c:366 #13 0x10109d84 in call_function (tstate=0x200d5ca0, pp_stack=0x20e82d08, oparg=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #14 0x1011662c in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x3052cdb0, throwflag=537746592) at Python/ceval.c:2600 #15 0x1011bd10 in function_code_fastcall (tstate=0x3027d9ec, co=0x3027da00, args=0x0, nargs=810733296, globals=0x3052cdb0) at ./Include/internal/pycore_ceval.h:40 #16 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302bd120, stack=0x3027d998, nargsf=0, kwnames=0x0) at Objects/call.c:366 #17 0x1015c848 in run_at_forkers (lst=0x302bd120, reverse=-1) at ./Include/cpython/abstract.h:118 #18 0x101682e8 in PyOS_AfterFork_Child () at ./Modules/posixmodule.c:479 #19 0x10168384 in os_fork (module=0x0, _unused_ignored=0xffffffff) at ./Modules/posixmodule.c:6264 #20 0x101e7644 in cfunction_vectorcall_NOARGS (func=0x38, args=0xffffffff, nargsf=806606368, kwnames=0x1) at Objects/methodobject.c:20 #21 0x10109d84 in call_function (tstate=0x200d5ca0, pp_stack=0x20e8304c, oparg=24, kwnames=0x0) at ./Include/cpython/abstract.h:118 #22 0x101165a8 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x306b39d0, throwflag=537746592) at Python/ceval.c:2569 #23 0x10119f80 in _PyEval_EvalCode (tstate=0x306b3b04, _co=0x306b65c8, globals=0x306a47b8, locals=0x306b3b10, args=0x306b3b08, argcount=-1, kwnames=0x30280030, kwargs=0xffffffff, kwcount=805326908, kwstep=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x20e831f0, qualname=0x28000282) at ./Include/internal/pycore_ceval.h:40 #24 0x1011cb84 in _PyFunction_Vectorcall (func=0x0, stack=0x306a47b8, nargsf=0, kwnames=0x8) at Objects/call.c:395 #25 0x1011c270 in PyVectorcall_Call (callable=0x30625440, tuple=0x30005030, kwargs=0x306b5180) at Objects/call.c:230 #26 0x1011c510 in _PyObject_Call (tstate=0x30005030, callable=0x2003a67c <_ccCGOhKO.rw_+21820>, args=0x306b5180, kwargs=0x30625440) at Objects/call.c:265 #27 0x1011c71c in PyObject_Call (callable=0x0, args=0xffffffff, kwargs=0xffffffff) at Objects/call.c:292 #28 0x10116ad4 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x306d5760, throwflag=0) at Python/ceval.c:4198 #29 0x1011bd10 in function_code_fastcall (tstate=0x3029a7d2, co=0x302c07a8, args=0x3066edac, nargs=812472476, globals=0x306d5760) at ./Include/internal/pycore_ceval.h:40 #30 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c93a0, stack=0x3029a7b8, nargsf=1, kwnames=0x0) at Objects/call.c:366 #31 0x10109d84 in call_function (tstate=0x200d5ca0, pp_stack=0x20e8357c, oparg=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #32 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x3066ec70, throwflag=537746592) at Python/ceval.c:2586 #33 0x1011bd10 in function_code_fastcall (tstate=0x302ac200, co=0x302c0a00, args=0x306cb16c, nargs=812051888, globals=0x3066ec70) at ./Include/internal/pycore_ceval.h:40 #34 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c9530, stack=0x302ac180, nargsf=1, kwnames=0x0) at Objects/call.c:366 #35 0x10109d84 in call_function (tstate=0x200d5ca0, pp_stack=0x20e8379c, oparg=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #36 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x306cb030, throwflag=537746592) at Python/ceval.c:2586 #37 0x1011bd10 in function_code_fastcall (tstate=0x302a4930, co=0x302c0820, args=0x20e83928, nargs=812429680, globals=0x306cb030) at ./Include/internal/pycore_ceval.h:40 #38 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c93f0, stack=0x302a4928, nargsf=1, kwnames=0x0) at Objects/call.c:366 #39 0x10220394 in method_vectorcall (method=0x302c93f0, args=0x3000503c, nargsf=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #40 0x1011c270 in PyVectorcall_Call (callable=0x301e3ed0, tuple=0x30005030, kwargs=0x0) at Objects/call.c:230 #41 0x1011c510 in _PyObject_Call (tstate=0x30005030, callable=0x2003878c <_ccCGOhKO.rw_+13900>, args=0x0, kwargs=0x301e3ed0) at Objects/call.c:265 #42 0x1011c71c in PyObject_Call (callable=0x0, args=0xffffffff, kwargs=0xffffffff) at Objects/call.c:292 #43 0x1024a158 in t_bootstrap (boot_raw=0x301df820) at ./Modules/_threadmodule.c:1011 #44 0x100a683c in pythread_wrapper (arg=0xffffffff) at Python/thread_pthread.h:235 #45 0xd055df68 in _pthread_body () from /usr/lib/libpthreads.a(shr_xpg5.o) #46 0x00000000 in ?? () (gdb) frame 10 #10 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x302cdc48, throwflag=537746592) at Python/ceval.c:2586 2586 PyObject *v = GETLOCAL(oparg); (gdb) p (char*)( ((PyASCIIObject*)f->f_code->co_name) + 1) $16 = 0x3027ad28 "_releaseLock" (gdb) p (char*)( ((PyASCIIObject*)f->f_code->co_filename) + 1) $17 = 0x3026d4c0 "/home/vstinner/python/master/Lib/logging/__init__.py" (gdb) frame 14 #14 0x1011662c in _PyEval_EvalFrameDefault (tstate=0x200d5ca0, f=0x3052cdb0, throwflag=537746592) at Python/ceval.c:2600 2600 PyObject *cell = freevars[oparg]; (gdb) p (char*)( ((PyASCIIObject*)f->f_code->co_name) + 1) $18 = 0x30278af0 "_after_at_fork_child_reinit_locks" (gdb) p (char*)( ((PyASCIIObject*)f->f_code->co_filename) + 1) $19 = 0x3026d4c0 "/home/vstinner/python/master/Lib/logging/__init__.py" (gdb) info threads Id Target Id Frame 2 Thread 1745 (tid 70975785, running) aix-thread: ptrace (52, 70975785) returned -1 (errno = 3 The process does not exist.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:06:06 2020 From: report at bugs.python.org (Kyle Stanley) Date: Wed, 25 Mar 2020 23:06:06 +0000 Subject: [issue40061] Possible refleak in _asynciomodule.c future_add_done_callback() In-Reply-To: <1585129013.48.0.185605805596.issue40061@roundup.psfhosted.org> Message-ID: <1585177566.4.0.695039219141.issue40061@roundup.psfhosted.org> Kyle Stanley added the comment: > When using the `test-with-buildbots` label in GH-19149 (which involved no C changes), a failure occurred in test_asyncio for several of the refleak buildbots. To clarify, the refleak failures occurred when i applied the label to the following commit: https://github.com/python/cpython/pull/19149/commits/21a12e9340644c81e758ddf20fc9034f265d1930 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:15:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 23:15:51 +0000 Subject: [issue36273] test_thread leaks a core dump on PPC64 AIX 3.x In-Reply-To: <1552407244.81.0.665825370239.issue36273@roundup.psfhosted.org> Message-ID: <1585178151.39.0.137894660358.issue36273@roundup.psfhosted.org> STINNER Victor added the comment: """ OK (skipped=1) Warning -- files was modified by test_threading Before: [] After: ['core'] """ That's maybe bpo-40068 "test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:23:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 23:23:17 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585178597.62.0.251004534287.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: I worked around the logging crash. Then I got a second crash in _PyThreadState_DeleteExcept() called in the child process after a fork. PyThreadState_Clear() calls tstate->on_delete() which is release_sentinel() of Modules/_threadmodule.c. Problem: lock objects are left in an inconsistent state after a fork: bpo-6721. This lock object should be replaced with a new lock object, or release_sentinel() should not be called. (gdb) where #0 0xd0563e00 in _internal_error () from /usr/lib/libpthreads.a(shr_xpg5.o) #1 0xd0573270 in _event_notify_locked at AF34_24 () from /usr/lib/libpthreads.a(shr_xpg5.o) #2 0xd057247c in _event_notify () from /usr/lib/libpthreads.a(shr_xpg5.o) #3 0xd0582b2c in _cond_broadcast () from /usr/lib/libpthreads.a(shr_xpg5.o) #4 0xd0584b0c in pthread_cond_signal at AF29_12 () from /usr/lib/libpthreads.a(shr_xpg5.o) #5 0xd058320c in pthread_cond_signal () from /usr/lib/libpthreads.a(shr_xpg5.o) #6 0x100a755c in PyThread_release_lock (lock=0x200bd4d0) at Python/thread_pthread.h:687 #7 0x1024add0 in release_sentinel (wr_raw=0x306c0bd0) at ./Modules/_threadmodule.c:1213 #8 0x100a406c in PyThreadState_Clear (tstate=0x200c0970) at Python/pystate.c:810 #9 0x100a4b90 in _PyThreadState_DeleteExcept (runtime=0x20000200 <_PyRuntime>, tstate=0x20068870) at Python/pystate.c:924 #10 0x1010ad8c in _PyEval_ReInitThreads (runtime=0x20000200 <_PyRuntime>) at Python/ceval.c:434 #11 0x101682a8 in PyOS_AfterFork_Child () at ./Modules/posixmodule.c:473 #12 0x10168384 in os_fork (module=0x0, _unused_ignored=0xffffffff) at ./Modules/posixmodule.c:6264 #13 0x101e7644 in cfunction_vectorcall_NOARGS (func=0x3008b4b0, args=0xffffffff, nargsf=0, kwnames=0x20067800) at Objects/methodobject.c:20 #14 0x10109d84 in call_function (tstate=0x200c9b00, pp_stack=0x2046f04c, oparg=24, kwnames=0x0) at ./Include/cpython/abstract.h:118 #15 0x101165a8 in _PyEval_EvalFrameDefault (tstate=0x200c9b00, f=0x306ce2f0, throwflag=537697024) at Python/ceval.c:2569 #16 0x10119f80 in _PyEval_EvalCode (tstate=0x306ce424, _co=0x3066ca00, globals=0x3066d0d8, locals=0x306ce430, args=0x306ce428, argcount=-1, kwnames=0x30670030, kwargs=0xffffffff, kwcount=805326908, kwstep=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x2046f1f0, qualname=0x28000282) at ./Include/internal/pycore_ceval.h:40 #17 0x1011cb84 in _PyFunction_Vectorcall (func=0x0, stack=0x3066d0d8, nargsf=0, kwnames=0x8) at Objects/call.c:395 #18 0x1011c270 in PyVectorcall_Call (callable=0x3065f710, tuple=0x30005030, kwargs=0x306b6068) at Objects/call.c:230 #19 0x1011c510 in _PyObject_Call (tstate=0x30005030, callable=0x2003a64c <_cc37zUOE.rw_+21820>, args=0x306b6068, kwargs=0x3065f710) at Objects/call.c:265 #20 0x1011c71c in PyObject_Call (callable=0x0, args=0xffffffff, kwargs=0xffffffff) at Objects/call.c:292 #21 0x10116ad4 in _PyEval_EvalFrameDefault (tstate=0x200c9b00, f=0x306cba40, throwflag=0) at Python/ceval.c:4198 #22 0x1011bd10 in function_code_fastcall (tstate=0x3029d6b2, co=0x302bc0a0, args=0x30681914, nargs=812432252, globals=0x306cba40) at ./Include/internal/pycore_ceval.h:40 #23 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c7210, stack=0x3029d698, nargsf=1, kwnames=0x0) at Objects/call.c:366 #24 0x10109d84 in call_function (tstate=0x200c9b00, pp_stack=0x2046f57c, oparg=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #25 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200c9b00, f=0x306817d8, throwflag=537697024) at Python/ceval.c:2586 #26 0x1011bd10 in function_code_fastcall (tstate=0x302aa200, co=0x302bc2f8, args=0x306cc5a4, nargs=812128536, globals=0x306817d8) at ./Include/internal/pycore_ceval.h:40 #27 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c73a0, stack=0x302aa180, nargsf=1, kwnames=0x0) at Objects/call.c:366 #28 0x10109d84 in call_function (tstate=0x200c9b00, pp_stack=0x2046f79c, oparg=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #29 0x101164f4 in _PyEval_EvalFrameDefault (tstate=0x200c9b00, f=0x306cc468, throwflag=537697024) at Python/ceval.c:2586 #30 0x1011bd10 in function_code_fastcall (tstate=0x302a4828, co=0x302bc118, args=0x2046f928, nargs=812434856, globals=0x306cc468) at ./Include/internal/pycore_ceval.h:40 #31 0x1011c9a0 in _PyFunction_Vectorcall (func=0x302c7260, stack=0x302a4820, nargsf=1, kwnames=0x0) at Objects/call.c:366 #32 0x10220394 in method_vectorcall (method=0x302c7260, args=0x3000503c, nargsf=56, kwnames=0x0) at ./Include/cpython/abstract.h:118 #33 0x1011c270 in PyVectorcall_Call (callable=0x306c0ea0, tuple=0x30005030, kwargs=0x0) at Objects/call.c:230 #34 0x1011c510 in _PyObject_Call (tstate=0x30005030, callable=0x2003875c <_cc37zUOE.rw_+13900>, args=0x0, kwargs=0x306c0ea0) at Objects/call.c:265 #35 0x1011c71c in PyObject_Call (callable=0x0, args=0xffffffff, kwargs=0xffffffff) at Objects/call.c:292 #36 0x1024a158 in t_bootstrap (boot_raw=0x306bf7a8) at ./Modules/_threadmodule.c:1011 #37 0x100a6830 in pythread_wrapper (arg=0xffffffff) at Python/thread_pthread.h:235 #38 0xd055df68 in _pthread_body () from /usr/lib/libpthreads.a(shr_xpg5.o) #39 0x00000000 in ?? () ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 19:47:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Mar 2020 23:47:42 +0000 Subject: [issue40070] GCC crashed on AMD64 RHEL7 LTO + PGO 3.7 (compiler bug) Message-ID: <1585180062.41.0.685376297211.issue40070@roundup.psfhosted.org> New submission from STINNER Victor : GCC crashed on AMD64 RHEL7 LTO + PGO 3.7: https://buildbot.python.org/all/#/builders/190/builds/131 It crashed at the second stage of the PGO compilation (-fprofile-use). --- (...) gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/asdl.o Python/asdl.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/ast.o Python/ast.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/ast_opt.o Python/ast_opt.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/ast_unparse.o Python/ast_unparse.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/bltinmodule.o Python/bltinmodule.c In file included from ./Include/pytime.h:6:0, from ./Include/Python.h:87, from Python/bltinmodule.c:3: Python/bltinmodule.c: In function ?builtin_any?: ./Include/object.h:790:31: note: correcting inconsistent value profile: ic profiler overall count (78) does not match BB count (78) (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op))) ^ Python/bltinmodule.c:411:1: note: Inconsistent profile: indirect call target (0) does not exist builtin_any(PyObject *module, PyObject *iterable) ^ In file included from ./Include/pytime.h:6:0, from ./Include/Python.h:87, from Python/bltinmodule.c:3: ./Include/object.h:790:31: note: correcting inconsistent value profile: ic profiler overall count (0) does not match BB count (0) (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op))) ^ ./Include/object.h:790:31: note: correcting inconsistent value profile: ic profiler overall count (0) does not match BB count (0) Python/bltinmodule.c:2868:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/ceval.o Python/ceval.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o Python/compile.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Python/codecs.o Python/codecs.c Preprocessed source stored into /tmp/ccsdRI8K.out file, please attach this to your bugreport. make[1]: *** [Python/bltinmodule.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/home/buildbot/buildarea/3.7.cstratak-RHEL7-x86_64.lto-pgo/build' make: *** [profile-opt] Error 2 --- That's RHEL 7.7 with gcc-4.8.5-39.el7.x86_64. The previous build was successful: https://buildbot.python.org/all/#/builders/190/builds/130 CC.version: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) datetime.datetime.now: 2020-03-24 16:20:36.900720 According to /var/log/yum.log, the latest package update was done at Mar 18 (05:13:07). So GCC wasn't update between build 130 and 131. ---------- components: Build, Tests messages: 365032 nosy: vstinner priority: normal severity: normal status: open title: GCC crashed on AMD64 RHEL7 LTO + PGO 3.7 (compiler bug) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:03:35 2020 From: report at bugs.python.org (ppperry) Date: Thu, 26 Mar 2020 00:03:35 +0000 Subject: [issue39665] Cryptic error message when creating types that don't include themselves in their MRO In-Reply-To: <1581958826.66.0.0275141327571.issue39665@roundup.psfhosted.org> Message-ID: <1585181015.09.0.540313848575.issue39665@roundup.psfhosted.org> Change by ppperry : ---------- components: -Build versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:15:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:15:55 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585181755.19.0.536959860956.issue40069@roundup.psfhosted.org> STINNER Victor added the comment: What are these .lst files? What creates them? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:17:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:17:42 +0000 Subject: [issue40063] Bug in 3rd party sybase database connector (Fatal python error:PyEval_RestoreThread NULL tstate) In-Reply-To: <1585155443.15.0.196815788014.issue40063@roundup.psfhosted.org> Message-ID: <1585181862.54.0.631422229914.issue40063@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. It's a bug in a third-party project, not in Python itself. If you can reproduce the bug with a simple script which only uses the stdlib, please reopen the issue. ---------- resolution: -> third party stage: -> resolved status: open -> closed title: Fatal python error:PyEval_RestoreThread NULL tstate -> Bug in 3rd party sybase database connector (Fatal python error:PyEval_RestoreThread NULL tstate) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:21:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:21:54 +0000 Subject: [issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information In-Reply-To: <1580703962.85.0.294314145935.issue39533@roundup.psfhosted.org> Message-ID: <1585182114.54.0.510796241186.issue39533@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Library (Lib) nosy: +vstinner versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:24:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:24:53 +0000 Subject: [issue39853] Segmentation fault with urllib.request.urlopen and threads In-Reply-To: <1583347102.97.0.749597726143.issue39853@roundup.psfhosted.org> Message-ID: <1585182293.45.0.314484053214.issue39853@roundup.psfhosted.org> STINNER Victor added the comment: If someone manages to reproduce the bug, please provide *at least* the Python traceback. You can use faulthandler to get it. It would also be very useful to get the C call stack using gdb (where command in gdb). In the meanwhile, I close the issue since only the reporter reproduced the crashed. Please provide more information about your OS, OS version, how you installed Python, Python package version, etc. if you want to reopen the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:25:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:25:59 +0000 Subject: [issue39939] PEP 616: Add str methods to remove prefix or suffix In-Reply-To: <1583953898.19.0.613718077904.issue39939@roundup.psfhosted.org> Message-ID: <1585182359.75.0.719347798377.issue39939@roundup.psfhosted.org> STINNER Victor added the comment: Dennis Sweeney wrote https://www.python.org/dev/peps/pep-0616/ ---------- title: Add str methods to remove prefixes or suffixes -> PEP 616: Add str methods to remove prefix or suffix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:32:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:32:48 +0000 Subject: [issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1585182768.47.0.90438519777.issue38865@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-37776: Test Py_Finalize() from a subinterpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:36:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:36:49 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1585183009.57.0.470538306462.issue39091@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: CPython Segfault in 5 lines of code -> _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:38:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:38:21 +0000 Subject: [issue31521] segfault in PyBytes_AsString In-Reply-To: <1505845145.85.0.99143388289.issue31521@psf.upfronthosting.co.za> Message-ID: <1585183101.55.0.288471622082.issue31521@roundup.psfhosted.org> STINNER Victor added the comment: That's very likely a crash in third party project. Since no reproducer was provided that the last message of the reporter was 3 years ago, I close the issue. ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:41:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:41:14 +0000 Subject: [issue38044] unittest causing segfaults with string malloc in c++ module In-Reply-To: <1567764678.03.0.448906028899.issue38044@roundup.psfhosted.org> Message-ID: <1585183274.36.0.627689937656.issue38044@roundup.psfhosted.org> STINNER Victor added the comment: The issue looks like a bug in third party code, rather than a bug in Python itself. You can try to set PYTHONMALLOC=debug environment variable, it might help to detect a memory corruption. I strongly advice you to test a debug build of Python. Since Python 3.8, the ABI is now compatible in debug and release builds. See also https://pythondev.readthedocs.io/debug_tools.html to debug a crash. I close the issue. ---------- nosy: +vstinner resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 20:41:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 00:41:45 +0000 Subject: [issue21983] segfault in ctypes.cast In-Reply-To: <1405374806.18.0.56272254378.issue21983@psf.upfronthosting.co.za> Message-ID: <1585183305.52.0.747861022135.issue21983@roundup.psfhosted.org> STINNER Victor added the comment: > Still needs a backport to 2.7 No longer needed, I close the issue. ---------- nosy: +vstinner resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:18:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 01:18:45 +0000 Subject: [issue37434] Segfault in typeobject.c at _PyObject_GC_UNTRACK(type) In-Reply-To: <1561660257.77.0.368654180349.issue37434@roundup.psfhosted.org> Message-ID: <1585185525.28.0.497112578827.issue37434@roundup.psfhosted.org> STINNER Victor added the comment: I'm unable to reproduce the crash on Fedora 31. A crash during a garbage collection usually means that there is a corrupted object somewhere, and suddenly, we discover the inconsistent. The crash can be far from where the inconsistency was created. You may try python3.7 -X dev which might provide more information. The best would be to test a Python 3.9 compiled in debug mode. The setup.py file of Python binding of protobuf has an optional --cpp_implementation option to build C++ extension modules. It seems like they are not built by default. I'm not sure if this bug requires these C++ extension modules, or if they must miss. It seems like "pip install protobuf" installs protobuf without these C++ extension modules. See also https://pythondev.readthedocs.io/debug_tools.html to debug a crash. It's likely a bug in protobuf, rather than a bug in Python itself. I close the issue. ---------- nosy: +vstinner resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:25:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 01:25:25 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() Message-ID: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> New submission from STINNER Victor : $ ./python -m test -R 3:3 test__xxsubinterpreters -m test_ids_global 0:00:00 load avg: 0.80 Run tests sequentially 0:00:00 load avg: 0.80 [1/1] test__xxsubinterpreters beginning 6 repetitions 123456 ...... test__xxsubinterpreters leaked [1, 1, 1] references, sum=3 test__xxsubinterpreters leaked [1, 1, 1] memory blocks, sum=3 test__xxsubinterpreters failed == Tests result: FAILURE == 1 test failed: test__xxsubinterpreters Total duration: 819 ms Tests result: FAILURE It started to leak since: commit 7dd549eb08939e1927fba818116f5202e76f8d73 Author: Paulo Henrique Silva Date: Tue Mar 24 23:19:58 2020 -0300 bpo-1635741: Port _functools module to multiphase initialization (PEP 489) (GH-19151) ---------- components: Interpreter Core messages: 365042 nosy: vstinner priority: normal severity: normal status: open title: test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:26:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 01:26:13 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585185973.03.0.780115840863.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-1635741: Port _functools module to multiphase initialization (PEP 489) (GH-19151) > https://github.com/python/cpython/commit/7dd549eb08939e1927fba818116f5202e76f8d73 This change introduced a regression: bpo-40071 "test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:26:28 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Thu, 26 Mar 2020 01:26:28 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585185988.47.0.724628619855.issue40071@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- keywords: +patch nosy: +phsilva nosy_count: 1.0 -> 2.0 pull_requests: +18529 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19151 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:36:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 01:36:23 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585186583.46.0.874084932961.issue40071@roundup.psfhosted.org> STINNER Victor added the comment: The folowing test is enough to reproduce the leak: def test_ids_global(self): interp1 = interpreters.create() script, rpipe = _captured_script("pass") interpreters.run_string(interp1, script) rpipe.close() interp2 = interpreters.create() script, rpipe = _captured_script("pass") interpreters.run_string(interp2, script) rpipe.close() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:42:38 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 01:42:38 +0000 Subject: [issue40072] UDP Echo Server raise OSError when recved packet Message-ID: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> New submission from honglei jiang : Env: Win7/Python3.8.2 x64/ Output: Starting UDP server Traceback (most recent call last): File "d:\ProgramData\Python38\lib\asyncio\proactor_events.py", line 548, in _loop_reading res = fut.result() File "d:\ProgramData\Python38\lib\asyncio\windows_events.py", line 808, in _poll value = callback(transferred, key, ov) File "d:\ProgramData\Python38\lib\asyncio\windows_events.py", line 496, in finish_recv return ov.getresult() OSError: [WinError 87] ????? [WinError 87] ????? ---------- components: asyncio files: asyncio_udp_ipv6_server.py messages: 365045 nosy: asvetlov, honglei.jiang, yselivanov priority: normal severity: normal status: open title: UDP Echo Server raise OSError when recved packet type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49000/asyncio_udp_ipv6_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:44:08 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 01:44:08 +0000 Subject: [issue40072] UDP Echo Server raise OSError when recved packet In-Reply-To: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> Message-ID: <1585187048.88.0.864591609612.issue40072@roundup.psfhosted.org> Change by honglei jiang : Added file: https://bugs.python.org/file49001/udp_ipv6_client.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:44:51 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 01:44:51 +0000 Subject: [issue40072] IPUDP Echo Server raise OSError when recved packet In-Reply-To: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> Message-ID: <1585187091.08.0.746668050868.issue40072@roundup.psfhosted.org> Change by honglei jiang : ---------- title: UDP Echo Server raise OSError when recved packet -> IPUDP Echo Server raise OSError when recved packet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:45:58 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 01:45:58 +0000 Subject: [issue40072] Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved packet In-Reply-To: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> Message-ID: <1585187158.89.0.857327079068.issue40072@roundup.psfhosted.org> Change by honglei jiang : ---------- title: IPUDP Echo Server raise OSError when recved packet -> Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved packet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:46:27 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 01:46:27 +0000 Subject: [issue40072] Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved any packet In-Reply-To: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> Message-ID: <1585187187.07.0.208020831019.issue40072@roundup.psfhosted.org> Change by honglei jiang : ---------- title: Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved packet -> Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved any packet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:54:51 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Mar 2020 01:54:51 +0000 Subject: [issue40067] Improve error messages for multiple star expressions in assignment In-Reply-To: <1585167987.52.0.347925597304.issue40067@roundup.psfhosted.org> Message-ID: <1585187691.2.0.84248999966.issue40067@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the quick fix, Furkan! :) ---------- nosy: +pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 21:54:54 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Mar 2020 01:54:54 +0000 Subject: [issue40067] Improve error messages for multiple star expressions in assignment In-Reply-To: <1585167987.52.0.347925597304.issue40067@roundup.psfhosted.org> Message-ID: <1585187694.31.0.245932459399.issue40067@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset cb6534e1a8833b3f20bd88f52cf62a003426e855 by Furkan ?nder in branch 'master': bpo-40067: Improve error messages for multiple star expressions in assignments (GH-19168) https://github.com/python/cpython/commit/cb6534e1a8833b3f20bd88f52cf62a003426e855 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 22:24:34 2020 From: report at bugs.python.org (honglei jiang) Date: Thu, 26 Mar 2020 02:24:34 +0000 Subject: [issue40072] Win7/Python3.8/asyncio IPv6 UDP Server raise OSError when recved any packet In-Reply-To: <1585186958.06.0.811123062641.issue40072@roundup.psfhosted.org> Message-ID: <1585189474.21.0.653238976452.issue40072@roundup.psfhosted.org> honglei jiang added the comment: It works under asyncio.WindowsSelectorEventLoopPolicy(), but failed under Python3.8 default policy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 22:50:12 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 26 Mar 2020 02:50:12 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585191012.37.0.476039653776.issue40065@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 25 23:43:50 2020 From: report at bugs.python.org (Andy Lester) Date: Thu, 26 Mar 2020 03:43:50 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585194230.18.0.879405983291.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18530 pull_request: https://github.com/python/cpython/pull/19170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 00:13:09 2020 From: report at bugs.python.org (Inada Naoki) Date: Thu, 26 Mar 2020 04:13:09 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585195989.3.0.472127791917.issue39943@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 62d21c9d900664b2ca30c2d7edd80b6628abdf62 by Andy Lester in branch 'master': bpo-39943: Properly const the pointers in dictkeys_get_index (GH-19170) https://github.com/python/cpython/commit/62d21c9d900664b2ca30c2d7edd80b6628abdf62 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 00:44:31 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 26 Mar 2020 04:44:31 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1585197871.12.0.623174432051.issue40012@roundup.psfhosted.org> Ammar Askar added the comment: Instead of noindex maybe the 3.x documentation can be marked as the canonical one: https://support.google.com/webmasters/answer/139066 This should still allow the old docs to be crawled but emphasize the latest docs on the website: > Google Search result usually points to the canonical page, unless one of the duplicates is explicitly better suited for a user: for example, the search result will probably point to the mobile page if the user is on a mobile device, even if the desktop page is marked as canonical. Presumably the "better suited" means that if you search for "python2 timeit" you'd still find the py2 docs. Terry Reedy, could you link the earlier issue so this information can be posted there, or are you referring to the issue Karthik linked? ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 00:47:33 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 26 Mar 2020 04:47:33 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1585198053.62.0.0676766834105.issue38250@roundup.psfhosted.org> Vedran ?a?i? added the comment: 1. +0 _if_ the implementation is easy to explain. If backward compatibility is an issue, we can always add a property: for flag in flags.set: (though set might imply unorderedness:) 2. -1. Guido said long ago that all lens should be O(1). (Of course, if you do make it O(1), I have no objection.) 3. +1, absolutely. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 00:48:15 2020 From: report at bugs.python.org (Leon Hampton) Date: Thu, 26 Mar 2020 04:48:15 +0000 Subject: [issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem In-Reply-To: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> Message-ID: <1585198095.59.0.378560667014.issue40043@roundup.psfhosted.org> Leon Hampton added the comment: Matthew Barnett & SilentGhost, Thank you for your prompt responses. (Really prompt. Amazing!) SilentGhost, Regarding your response, I used re.search, not re.match. When I used re.match, the regex failed. When I used re.search, it matched. Here are my tests. Your example (cut-and-pasted): x = re.match(r'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)', '|$)', ' I understand the re.match failing, since it always starts at the beginning of the string, but why did re.search succeed? After failing with the yes-pattern, when the regex engine backtracked to the (<)? did it decide not to match the '<' at all and skip the character? Seems like it. What do you think? I am running Python 3.7 via Spyder 4.1.1 on Windows 10. Respectfully, Leon ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 01:38:59 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 26 Mar 2020 05:38:59 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1585201139.46.0.517114250153.issue38237@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +18531 pull_request: https://github.com/python/cpython/pull/19171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 02:19:33 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Thu, 26 Mar 2020 06:19:33 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585203573.07.0.112602549973.issue40071@roundup.psfhosted.org> Paulo Henrique Silva added the comment: I've got it, will investigate asap. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 03:11:23 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Thu, 26 Mar 2020 07:11:23 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585206683.77.0.521258976745.issue40071@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18532 pull_request: https://github.com/python/cpython/pull/19172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 03:13:34 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Thu, 26 Mar 2020 07:13:34 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585206814.92.0.0248120409364.issue40071@roundup.psfhosted.org> Paulo Henrique Silva added the comment: The module still uses static state. Fixed the leak and will convert it to use per-module state in a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 05:34:29 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 09:34:29 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585215269.9.0.0505652013265.issue40069@roundup.psfhosted.org> Michael Felt added the comment: the XLC compiler has an option to create "listing" files. The content depends on the arguments passed to the xlc compilers. >From memory (as I always need to look them up) these include -qinfo and -qsource (plus arguments) FYI: besides showing info such as macro substitution these are also the files that would include the generate assembly/machine instructions. .lst files are not created by default (by Python configure and make). If they are there, there are a user generated file. As .lst files are created in the cwd (current working directory) I keep myself 'clean' by building out of tree. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 05:42:37 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 09:42:37 +0000 Subject: [issue39502] test_zipfile fails on AIX due to time.localtime In-Reply-To: <1581098238.71.0.874788336167.issue39502@roundup.psfhosted.org> Message-ID: <9ff70077-4de6-47dc-724d-a4c9a65e1678@felt.demon.nl> Michael Felt added the comment: My apologies for the late reply - Here is 3.6.10: Python 3.6.10 (default, Mar 24 2020, 14:12:31) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.gmtime(4386268800) time.struct_time(tm_year=2108, tm_mon=12, tm_mday=30, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=365, tm_isdst=0) And, a patched 3.9: root at x064:[/data/prj/python/python-3.9]./python Python 3.9.0a4+ (default, Mar 13 2020, 08:03:36) [C] on aix Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.gmtime(4386268800) Traceback (most recent call last): ? File "", line 1, in OverflowError: timestamp out of range for platform time_t So, it should be working - but is not after the patches. I'll work on an update asap. On 07/02/2020 18:57, STINNER Victor wrote: > STINNER Victor added the comment: > > Does time.gmtime() accept year after 2038 on 64-bit AIX? Example on Linux: > >>>> time.gmtime(4386268800) > time.struct_time(tm_year=2108, tm_mon=12, tm_mday=30, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=365, tm_isdst=0) > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 05:51:12 2020 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 26 Mar 2020 09:51:12 +0000 Subject: [issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}() In-Reply-To: <1570543574.99.0.942798410146.issue38410@roundup.psfhosted.org> Message-ID: <1585216272.87.0.569180257234.issue38410@roundup.psfhosted.org> Zackery Spytz added the comment: I had pinged Steve Dower on the PR, but I didn't realize they weren't notified. The merge conflicts have been fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 06:41:22 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 10:41:22 +0000 Subject: [issue40073] AIX: python3 points to "air" Message-ID: <1585219282.6.0.683445147878.issue40073@roundup.psfhosted.org> New submission from Michael Felt : This is a regression in v3.6.10 and v3.7.6 `make install` creates a symbolic link `python3` that points to the executable python3.X In versions v3.6.10 and v3.7.6 the executable is created as python3.Xm while the symbolic link still points to python3.X Note: v3.8.2 and v3.9 (master) do not appear to be affected) ---------- components: Build messages: 365058 nosy: Michael.Felt priority: normal severity: normal status: open title: AIX: python3 points to "air" type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 06:50:56 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 26 Mar 2020 10:50:56 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585219856.5.0.453733447141.issue40069@roundup.psfhosted.org> Batuhan Taskaya added the comment: > .lst files are not created by default (by Python configure and make). They are an artifact when I configure with xlc (CC=xlc ./configure && make -j24), and as far as I know we already have some compiler-specific clear conditions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 06:52:57 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 10:52:57 +0000 Subject: [issue40073] AIX: python3 points to "air" In-Reply-To: <1585219282.6.0.683445147878.issue40073@roundup.psfhosted.org> Message-ID: <1585219977.53.0.32123985522.issue40073@roundup.psfhosted.org> Michael Felt added the comment: I tried looking at the blurbs to get an idea of what might have been the change - but nothing to indicate a change to the install process in any of "next" NEWS blurbs that are currently in branch 3.7 NEWS.d/next/Build/README.rst NEWS.d/next/C API/2020-03-08-22-56-22.bpo-38643.k2ixx6.rst NEWS.d/next/C API/2020-03-12-00-27-26.bpo-39884.CGOJBO.rst NEWS.d/next/C API/README.rst NEWS.d/next/Core and Builtins/2018-09-23-16-32-58.bpo-22490.8e0YDf.rst NEWS.d/next/Core and Builtins/2020-02-02-00-12-07.bpo-39520.uicBq6.rst NEWS.d/next/Core and Builtins/2020-03-06-06-12-37.bpo-39871.dCAj_2.rst NEWS.d/next/Core and Builtins/2020-03-06-21-04-39.bpo-38894.nfcGKv.rst NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526.NHNZIv.rst NEWS.d/next/Core and Builtins/README.rst NEWS.d/next/Documentation/2020-02-18-14-28-31.bpo-39677.vNHqoX.rst NEWS.d/next/Documentation/README.rst NEWS.d/next/IDLE/2020-03-06-01-55-14.bpo-39852.QjA1qF.rst NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst NEWS.d/next/IDLE/2020-03-09-02-45-12.bpo-27115.8hSHMo.rst NEWS.d/next/IDLE/README.rst NEWS.d/next/Library/2020-03-05-00-57-49.bpo-39828.yWq9NJ.rst NEWS.d/next/Library/2020-03-09-01-45-06.bpo-39850.eaJNIE.rst NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst NEWS.d/next/Library/2020-03-09-18-56-27.bpo-39916.BHHyp3.rst NEWS.d/next/Library/2020-03-10-15-32-31.bpo-38662.o1DMXj.rst NEWS.d/next/Library/2020-03-11-23-08-25.bpo-39652.gbasrk.rst NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst NEWS.d/next/Library/README.rst NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst NEWS.d/next/Security/README.rst NEWS.d/next/Tests/2020-03-18-16-04-33.bpo-27807.9gKjET.rst NEWS.d/next/Tests/README.rst NEWS.d/next/Tools-Demos/2020-03-07-18-01-30.bpo-39889.l1czT6.rst NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst NEWS.d/next/Tools-Demos/README.rst NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst NEWS.d/next/Windows/README.rst NEWS.d/next/macOS/README.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 06:55:02 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 26 Mar 2020 10:55:02 +0000 Subject: [issue40073] AIX: python3 points to "air" In-Reply-To: <1585219282.6.0.683445147878.issue40073@roundup.psfhosted.org> Message-ID: <1585220102.17.0.247393020799.issue40073@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 07:25:16 2020 From: report at bugs.python.org (Diego Palacios) Date: Thu, 26 Mar 2020 11:25:16 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names Message-ID: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> New submission from Diego Palacios : The pickle functions dump and load are often used in the following lines: ```python import pickle fname = '/path/to/file.pickle' with open(fname, 'rb') as f: object = pickle.load(f) ``` The load function should also accept a file name (string) as input and automatically open and load the object. The same should happen for the dump function. This would allow a simple use of the functions: ```python object = pickle.load(fname) ``` This is what many users need when reading and storing and object from/to a file. ---------- components: Library (Lib) messages: 365061 nosy: Diego Palacios priority: normal severity: normal status: open title: pickle module dump and load: add support for string file names type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:11:00 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Mar 2020 12:11:00 +0000 Subject: [issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}() In-Reply-To: <1570543574.99.0.942798410146.issue38410@roundup.psfhosted.org> Message-ID: <1585224660.79.0.175597338124.issue38410@roundup.psfhosted.org> Steve Dower added the comment: Sorry for missing the pings! My GitHub notifications are a bit of a black hole. I'll merge it now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:11:39 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Mar 2020 12:11:39 +0000 Subject: [issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}() In-Reply-To: <1570543574.99.0.942798410146.issue38410@roundup.psfhosted.org> Message-ID: <1585224699.44.0.211332320142.issue38410@roundup.psfhosted.org> Steve Dower added the comment: New changeset 79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d by Zackery Spytz in branch 'master': bpo-38410: Properly handle PySys_Audit() failures (GH-16657) https://github.com/python/cpython/commit/79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:12:21 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Mar 2020 12:12:21 +0000 Subject: [issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}() In-Reply-To: <1570543574.99.0.942798410146.issue38410@roundup.psfhosted.org> Message-ID: <1585224741.39.0.47763187275.issue38410@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:16:09 2020 From: report at bugs.python.org (Thomas Holder) Date: Thu, 26 Mar 2020 12:16:09 +0000 Subject: [issue40075] _tkinter PythonCmd fails to acquire GIL Message-ID: <1585224969.87.0.649895216825.issue40075@roundup.psfhosted.org> New submission from Thomas Holder : The attached demo application runs a Tkinter GUI and a PyQt GUI in the same thread. PyQt owns the main loop and keeps updating the Tkinter instance by calling `update()`. On Windows, when binding a "" event, resizing the Tk window will lead to a crash: ``` Fatal Python error: PyEval_RestoreThread: NULL tstate Current thread 0x00001f1c (most recent call first): File "qt_tk_demo.py", line 50 in ``` This crash happens in `_tkinter.c` in `PythonCmd` inside the `ENTER_PYTHON` macro. The issue can be fixed by using `PyGILState_Ensure` and `PyGILState_Release` instead of the `ENTER_PYTHON` macro inside the `PythonCmd` function. ---------- components: Tkinter, Windows files: qt_tk_demo.py messages: 365064 nosy: Thomas Holder, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: _tkinter PythonCmd fails to acquire GIL type: crash Added file: https://bugs.python.org/file49002/qt_tk_demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:42:15 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 26 Mar 2020 12:42:15 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names In-Reply-To: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> Message-ID: <1585226535.92.0.604315123816.issue40074@roundup.psfhosted.org> Eric V. Smith added the comment: I think it's a bad design to overload a function based on the type of am argument. I realize the stdlib does this in a number of places, for older functions. I don't think we'd add such a function today. I might not object to a new pickle API to do this, but I think the best approach is to have your own wrapper function. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 08:47:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 12:47:54 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585226874.29.0.184927709587.issue40071@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b09ae3ff43111a336c0b706ea32fa07f88c992d9 by Paulo Henrique Silva in branch 'master': bpo-40071: Fix refleak in _functools module (GH19172) https://github.com/python/cpython/commit/b09ae3ff43111a336c0b706ea32fa07f88c992d9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:06:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 13:06:49 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585228009.08.0.791582374744.issue40071@roundup.psfhosted.org> STINNER Victor added the comment: > (...) will convert it to use per-module state in a separate issue. Great! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:10:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 13:10:10 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585228210.38.0.582953339398.issue40069@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1b6b0e78fef2549cc9b447cbededb638f7388e02 by Batuhan Ta?kaya in branch 'master': bpo-40069: Clear out .lst files on make clean (GH-19169) https://github.com/python/cpython/commit/1b6b0e78fef2549cc9b447cbededb638f7388e02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:11:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 13:11:01 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585228260.99.0.650592219578.issue40069@roundup.psfhosted.org> STINNER Victor added the comment: Ok. I merged your PR. I don't think that it's worth it to backport to 3.7 and 3.8. "git clean -fdx" can be used for stable branches to remove *all* files not tracked by Git (not only .lst files). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:19:13 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 13:19:13 +0000 Subject: [issue40073] AIX: python3 points to "air" In-Reply-To: <1585219282.6.0.683445147878.issue40073@roundup.psfhosted.org> Message-ID: <1585228753.4.0.564895251796.issue40073@roundup.psfhosted.org> Michael Felt added the comment: I see that it is also incorrect for v3.5.9 What is surprising - is that the logic is okay for python-config -> python-config3.X -> python-config-3.Xm root at x065:[/data/prj/python/python3-3.5.9/X32]ls -l opt/bin total 8728 lrwxrwxrwx 1 root system 8 Mar 26 13:14 2to3 -> 2to3-3.5 -rwxr-xr-x 1 bin bin 95 Mar 26 10:47 2to3-3.5 -rwxr-xr-x 1 bin bin 236 Mar 26 10:47 easy_install-3.5 lrwxrwxrwx 1 root system 7 Mar 26 13:14 idle3 -> idle3.5 -rwxr-xr-x 1 bin bin 93 Mar 26 10:47 idle3.5 -rwxr-xr-x 1 bin bin 208 Mar 26 10:47 pip3 -rwxr-xr-x 1 bin bin 208 Mar 26 10:47 pip3.5 lrwxrwxrwx 1 root system 8 Mar 26 13:14 pydoc3 -> pydoc3.5 -rwxr-xr-x 1 bin bin 78 Mar 26 10:47 pydoc3.5 lrwxrwxrwx 1 root system 9 Mar 26 13:14 python3 -> python3.5 lrwxrwxrwx 1 root system 16 Mar 26 13:14 python3-config -> python3.5-config lrwxrwxrwx 1 root system 17 Mar 26 13:14 python3.5-config -> python3.5m-config -rwxr-xr-x 1 bin bin 4429283 Mar 26 10:45 python3.5m -rwxr-xr-x 1 bin bin 3005 Mar 26 10:47 python3.5m-config lrwxrwxrwx 1 root system 10 Mar 26 13:14 pyvenv -> pyvenv-3.5 -rwxr-xr-x 1 bin bin 230 Mar 26 10:47 pyvenv-3.5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:19:28 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 13:19:28 +0000 Subject: [issue40073] AIX: python3 points to "air" In-Reply-To: <1585219282.6.0.683445147878.issue40073@roundup.psfhosted.org> Message-ID: <1585228768.81.0.630064659434.issue40073@roundup.psfhosted.org> Change by Michael Felt : ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:34:48 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 26 Mar 2020 13:34:48 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1585229688.11.0.711755325755.issue36054@roundup.psfhosted.org> Manjusaka added the comment: Hello guys, I some ideas about this issue First, maybe we should add a new API named cpu_usable_count(). I think it's more meaningful than the os.sched_getaffinity(0) Second, more and more people use docker to run their app today. So people need an official way to get the environment info, not just cpu, but the memory, the network traffic limit. Because the docker is based on the CGroup in Linux, maybe we can add a cgroup lib as an official supported lib. but I'm not sure about this idea, because there are some problem. 1. the CGroup is only supported on Linux. I'm not sure that adding a platform-specific lib is a good idea 2. Many languages are not adding cgroup official yet. Maybe there are some languages are optimized for the cgroup (such as Java in JVM) ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:49:48 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 26 Mar 2020 13:49:48 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1585230588.16.0.028219185054.issue38250@roundup.psfhosted.org> Manjusaka added the comment: 1. not sure I gett the Point 2. not sure 3. absolutely yes ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:51:19 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 26 Mar 2020 13:51:19 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585230679.71.0.922208605637.issue40065@roundup.psfhosted.org> Manjusaka added the comment: I will clean this This issue looks like the same with https://bugs.python.org/issue40064 ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:52:43 2020 From: report at bugs.python.org (Michael Felt) Date: Thu, 26 Mar 2020 13:52:43 +0000 Subject: [issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine In-Reply-To: <1378731781.77.0.0136191125302.issue18987@psf.upfronthosting.co.za> Message-ID: <1585230763.48.0.239117796763.issue18987@roundup.psfhosted.org> Michael Felt added the comment: Back again - I understood a lot less then, maybe more now.. iirc, get_platform() asin sysconfig.get_platform() and distutils.util.get_platform() are suppposed to return a suitable PEP425 tag that identifies the ABI of the running interpreter - eg.g, 32-bit even though operating on 64-bot OS and hardware. As far as AIX goes, for years this was not the case. More recently (for Python 3.9) the logic has been added so that the bitness of the interpreter can be identified. i.e., on AIX `get_platform()` now returns: 'aix-5307-0747-64' - where the 64 (or 32) identifies the bitness of the interpreter. So, my question now - are the PEP425 tags returned by other platforms adequate? If yes, then I see little reason to not close this issue as resolved (elsewhere). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 09:53:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 13:53:43 +0000 Subject: [issue36054] On Linux, os.count() should read cgroup cpu.shares and cpu.cfs (CPU count inside docker container) In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1585230823.46.0.952160877953.issue36054@roundup.psfhosted.org> STINNER Victor added the comment: > Hello guys, Please try to find a more inclusive way to say hello: https://heyguys.cc/ ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:04:23 2020 From: report at bugs.python.org (Fred Drake) Date: Thu, 26 Mar 2020 14:04:23 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585231463.58.0.0426495148233.issue40065@roundup.psfhosted.org> Fred Drake added the comment: Same core problem (module removed with insufficient document update), but a different action is needed for 3.8 and 3.9. When I started testing an application with 3.9 and found one of the dependencies broken because it was relying directly on xml.etree.cElementTree, I had to dig into the history to determine that it was removed intentionally. Updated documentation would have helped. I did file an issue on the dependency as well: https://github.com/boto/botocore/issues/2002 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:14:48 2020 From: report at bugs.python.org (Alexander Bolshakov) Date: Thu, 26 Mar 2020 14:14:48 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 Message-ID: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> New submission from Alexander Bolshakov : isoformat function does not conform to the ISO 8601 and drops microseconds part if its value is 000000. The issue can be reproduced using the following code snippet: for i in range(1,10000000): timestamp=datetime.datetime.utcnow().isoformat() if len(timestamp)!=26: print(timestamp) ---------- components: Library (Lib) messages: 365077 nosy: Alexander Bolshakov priority: normal severity: normal status: open title: isoformat function drops microseconds part if its value is 000000 type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:40:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Mar 2020 14:40:57 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585233657.7.0.202691311727.issue40065@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for catching this Fred. I am surprised that some code uses xml.etree.cElementTree without falling back to xml.etree.ElementTree. In Python 3 you can just use xml.etree.ElementTree, in Python 2 you have to fallback to the Python implementation because the C implementation was optional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:43:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Mar 2020 14:43:16 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585233796.1.0.637829667012.issue40065@roundup.psfhosted.org> Serhiy Storchaka added the comment: The common idiom is try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:54:11 2020 From: report at bugs.python.org (Zachary Ware) Date: Thu, 26 Mar 2020 14:54:11 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234451.33.0.0317589243817.issue39879@roundup.psfhosted.org> Zachary Ware added the comment: New changeset 59c644eaa72b0cc48302f59d66852c4ea8332eba by Lahfa Samy in branch 'master': bpo-39879: Update datamodel docs to include dict ordering (GH-19006) https://github.com/python/cpython/commit/59c644eaa72b0cc48302f59d66852c4ea8332eba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:54:37 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 14:54:37 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234477.68.0.100935886861.issue39879@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +18533 pull_request: https://github.com/python/cpython/pull/19173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:54:45 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 14:54:45 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234485.17.0.256092717621.issue39879@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18534 pull_request: https://github.com/python/cpython/pull/19174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 10:59:46 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 14:59:46 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234786.96.0.243739431127.issue39879@roundup.psfhosted.org> miss-islington added the comment: New changeset ea0eeb8d3a0544334f8836c98a761b2e3df2bd94 by Miss Islington (bot) in branch '3.7': bpo-39879: Update datamodel docs to include dict ordering (GH-19006) https://github.com/python/cpython/commit/ea0eeb8d3a0544334f8836c98a761b2e3df2bd94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:00:50 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 15:00:50 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234850.47.0.304410400411.issue39879@roundup.psfhosted.org> miss-islington added the comment: New changeset 96686c761d0587080effc113367431a0d396eb45 by Miss Islington (bot) in branch '3.8': bpo-39879: Update datamodel docs to include dict ordering (GH-19006) https://github.com/python/cpython/commit/96686c761d0587080effc113367431a0d396eb45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:01:56 2020 From: report at bugs.python.org (Zachary Ware) Date: Thu, 26 Mar 2020 15:01:56 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585234916.51.0.936753768693.issue39879@roundup.psfhosted.org> Zachary Ware added the comment: Thanks for the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:16:07 2020 From: report at bugs.python.org (Fred Drake) Date: Thu, 26 Mar 2020 15:16:07 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1585235767.23.0.700578095478.issue40065@roundup.psfhosted.org> Fred Drake added the comment: The Python 2.7 documentation was not clear that xml.etree.cElementTree was optional, so users who didn't dive into the implementation or build process could easily not have known unless someone with a more limited installation used their code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:19:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 15:19:26 +0000 Subject: [issue39879] Update language reference to specify that dict is insertion-ordered. In-Reply-To: <1583519628.32.0.541192808872.issue39879@roundup.psfhosted.org> Message-ID: <1585235966.34.0.448642914445.issue39879@roundup.psfhosted.org> STINNER Victor added the comment: What's New in Python 3.7 says: > the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec. Reference: https://mail.python.org/pipermail/python-dev/2017-December/151283.html I just wanted to add a reference for this change. I wanted to check if it is ok to modify the doc: yes, it is :-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:53:24 2020 From: report at bugs.python.org (Zachary Ware) Date: Thu, 26 Mar 2020 15:53:24 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585238004.21.0.300562613385.issue1812@roundup.psfhosted.org> Zachary Ware added the comment: New changeset e0b8101492f6c61dee831425b4d3dae39a953599 by Peter Donis in branch 'master': bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385) https://github.com/python/cpython/commit/e0b8101492f6c61dee831425b4d3dae39a953599 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:53:40 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 15:53:40 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585238020.17.0.162549168679.issue1812@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18536 pull_request: https://github.com/python/cpython/pull/19176 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 11:53:32 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 15:53:32 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585238012.08.0.674266320708.issue1812@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18535 pull_request: https://github.com/python/cpython/pull/19175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:03:51 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 26 Mar 2020 16:03:51 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 In-Reply-To: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> Message-ID: <1585238631.38.0.932409353886.issue40076@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:04:44 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 26 Mar 2020 16:04:44 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() Message-ID: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> New submission from Dong-hee Na : Some of modules is not using PyType_FromSpec. We need to convert them. This changes can bring - allow to destroy types at exit! - allow subinterpreters to have their own "isolated" typ ---------- messages: 365087 nosy: corona10, vstinner priority: normal severity: normal status: open title: Convert static types to PyType_FromSpec() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:08:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 16:08:39 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585238919.31.0.993885710702.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: > We need to convert them. Let me elaborate. Static types have multiple issues: * Their lifetime is not well defined. * It is not obvious when they are ready to be used. * They are not destroyed at exit. * They are incompatible with subinterpreters: each interpreter should have its own copy of a type, rather than static types are shared by all interpreters which cause problems with reference counting (require GIL or atomic operation). * They are causing issues with stable ABI (limited C API): PEP 384. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:14:20 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 26 Mar 2020 16:14:20 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 In-Reply-To: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> Message-ID: <1585239260.31.0.0638513344466.issue40076@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Does timespec fulfill this use case to always return microseconds? https://docs.python.org/3/library/datetime.html#datetime.datetime.isoformat Return a string representing the date and time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS.ffffff, if microsecond is not 0 YYYY-MM-DDTHH:MM:SS, if microsecond is 0 The optional argument timespec specifies the number of additional components of the time to include (the default is 'auto'). It can be one of the following: 'auto': Same as 'seconds' if microsecond is 0, same as 'microseconds' otherwise. 'hours': Include the hour in the two-digit HH format. 'minutes': Include hour and minute in HH:MM format. 'seconds': Include hour, minute, and second in HH:MM:SS format. 'milliseconds': Include full time, but truncate fractional second part to milliseconds. HH:MM:SS.sss format. 'microseconds': Include full time in HH:MM:SS.ffffff format. ./python Python 3.9.0a4+ (heads/master:6723e933c4, Mar 21 2020, 06:54:01) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime(1, 1, 1).isoformat(timespec='auto') '0001-01-01T00:00:00' >>> datetime.datetime(1, 1, 1).isoformat(timespec='microseconds') '0001-01-01T00:00:00.000000' ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:14:23 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 26 Mar 2020 16:14:23 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585239263.71.0.62447752509.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +18537 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:18:11 2020 From: report at bugs.python.org (Thomas Holder) Date: Thu, 26 Mar 2020 16:18:11 +0000 Subject: [issue40075] _tkinter PythonCmd fails to acquire GIL In-Reply-To: <1585224969.87.0.649895216825.issue40075@roundup.psfhosted.org> Message-ID: <1585239491.92.0.342234210045.issue40075@roundup.psfhosted.org> Change by Thomas Holder : ---------- keywords: +patch pull_requests: +18538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:18:59 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 16:18:59 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585239539.4.0.534435253682.issue1812@roundup.psfhosted.org> miss-islington added the comment: New changeset 9387678f8a580726aca5f836b2c50456f236ecbb by Miss Islington (bot) in branch '3.7': bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385) https://github.com/python/cpython/commit/9387678f8a580726aca5f836b2c50456f236ecbb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:18:56 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Mar 2020 16:18:56 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585239536.01.0.244495665237.issue1812@roundup.psfhosted.org> miss-islington added the comment: New changeset b05fbe9f374bc660af3c589a1146b2026606d442 by Miss Islington (bot) in branch '3.8': bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385) https://github.com/python/cpython/commit/b05fbe9f374bc660af3c589a1146b2026606d442 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:26:07 2020 From: report at bugs.python.org (Zachary Ware) Date: Thu, 26 Mar 2020 16:26:07 +0000 Subject: [issue1812] doctest _load_testfile function -- newline handling seems incorrect In-Reply-To: <1200117455.4.0.563963262174.issue1812@psf.upfronthosting.co.za> Message-ID: <1585239967.38.0.221134227539.issue1812@roundup.psfhosted.org> Zachary Ware added the comment: 12 years later, we finally landed your fix :). Thanks for the patch, and for bearing with us (and me in particular for the past couple months). As mentioned in the PR, there is probably opportunity to clean up the cleanup code in the new test a bit, and as ?ric and Ammar mentioned here and in review, it could be interesting to use TextIOWrapper instead (though we'd probably only make that change in 3.9). If you're interesting in doing a follow-up PR, it can either be attached to this issue (in spite of it being closed) or a new issue opened. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 12:38:52 2020 From: report at bugs.python.org (Manjusaka) Date: Thu, 26 Mar 2020 16:38:52 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585240732.72.0.578537572448.issue40049@roundup.psfhosted.org> Manjusaka added the comment: Hello I can't reproduce this issue on my Laptop from 3.8.1 to 3.9.0a4 I think maybe it depends on the file you use would you mind to upload the file with the problem? ---------- nosy: +Manjusaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:01:40 2020 From: report at bugs.python.org (Matthew Barnett) Date: Thu, 26 Mar 2020 17:01:40 +0000 Subject: [issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem In-Reply-To: <1584899079.21.0.403850143741.issue40043@roundup.psfhosted.org> Message-ID: <1585242100.63.0.574118492384.issue40043@roundup.psfhosted.org> Matthew Barnett added the comment: That's what searching does! Does the pattern match here? If not, advance by one character and try again. Repeat until a match is found or you've reached the end. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:05:29 2020 From: report at bugs.python.org (Matej Cepl) Date: Thu, 26 Mar 2020 17:05:29 +0000 Subject: [issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h In-Reply-To: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org> Message-ID: <1585242329.87.0.339347658695.issue40052@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl nosy_count: 3.0 -> 4.0 pull_requests: +18539 pull_request: https://github.com/python/cpython/pull/19179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:06:33 2020 From: report at bugs.python.org (Justin Lebar) Date: Thu, 26 Mar 2020 17:06:33 +0000 Subject: [issue40078] asyncio subprocesses allow pids to be reaped, different behavior than regular subprocesses Message-ID: <1585242393.56.0.193315651182.issue40078@roundup.psfhosted.org> New submission from Justin Lebar : >From https://bugs.python.org/issue1187312 about regular subprocesses: > So as long as the application keeps a reference to the > subprocess object, it can wait for it; auto-reaping only > starts when the last reference was dropped [in Popen.__del__]. asyncio subprocesses seem to behave differently. When we notice the process has exited in BaseSubprocessTransport._process_exited, we call _try_finish(), which -- if all pipes are closed -- calls _call_connection_lost and sets self._proc to None. At this point, my understanding is that once self._proc is GC'ed, we'll run Popen.__del__ and may reap the pid. I would expect asyncio subprocesses to behave the same way as regular Popen objects wrt pid reaping. ---------- components: asyncio messages: 365095 nosy: Justin.Lebar, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio subprocesses allow pids to be reaped, different behavior than regular subprocesses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:08:48 2020 From: report at bugs.python.org (Justin Lebar) Date: Thu, 26 Mar 2020 17:08:48 +0000 Subject: [issue1187312] subprocess: optional auto-reaping fixing os.wait() lossage Message-ID: <1585242528.17.0.119849598281.issue1187312@roundup.psfhosted.org> Justin Lebar added the comment: 15 years later, it seems asyncio subprocesses may have the same issue. :) https://bugs.python.org/issue40078 ---------- nosy: +Justin.Lebar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:09:42 2020 From: report at bugs.python.org (Justin Lebar) Date: Thu, 26 Mar 2020 17:09:42 +0000 Subject: [issue40078] asyncio subprocesses allow pids to be reaped, different behavior than regular subprocesses In-Reply-To: <1585242393.56.0.193315651182.issue40078@roundup.psfhosted.org> Message-ID: <1585242582.87.0.359832114798.issue40078@roundup.psfhosted.org> Change by Justin Lebar : ---------- type: -> behavior versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:09:50 2020 From: report at bugs.python.org (Justin Lebar) Date: Thu, 26 Mar 2020 17:09:50 +0000 Subject: [issue40078] asyncio subprocesses allow pids to be reaped, different behavior than regular subprocesses In-Reply-To: <1585242393.56.0.193315651182.issue40078@roundup.psfhosted.org> Message-ID: <1585242590.99.0.764238042862.issue40078@roundup.psfhosted.org> Change by Justin Lebar : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:14:56 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Thu, 26 Mar 2020 17:14:56 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1585242896.25.0.437279307983.issue33608@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- nosy: +phsilva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:15:10 2020 From: report at bugs.python.org (Brett Cannon) Date: Thu, 26 Mar 2020 17:15:10 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585242910.01.0.403216161857.issue19698@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 8dad09a2242194a4101374b91ce87bb47a487cf7 by Miss Islington (bot) in branch '3.8': bpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related methods (GH-19158) (#19164) https://github.com/python/cpython/commit/8dad09a2242194a4101374b91ce87bb47a487cf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:15:25 2020 From: report at bugs.python.org (Brett Cannon) Date: Thu, 26 Mar 2020 17:15:25 +0000 Subject: [issue19698] Implement _imp.exec_builtin and exec_dynamic In-Reply-To: <1385137675.64.0.235823443194.issue19698@psf.upfronthosting.co.za> Message-ID: <1585242925.13.0.981452406449.issue19698@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 2929bfb973da249ed4f056c88a69bcc48e5a4843 by Miss Islington (bot) in branch '3.7': bpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related methods (GH-19158) (GH-19165) https://github.com/python/cpython/commit/2929bfb973da249ed4f056c88a69bcc48e5a4843 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:17:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 17:17:50 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585243070.1.0.714615571661.issue38644@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18540 pull_request: https://github.com/python/cpython/pull/19180 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:23:14 2020 From: report at bugs.python.org (Nan Hua) Date: Thu, 26 Mar 2020 17:23:14 +0000 Subject: [issue40053] Document the behavior that no interplotation is applied when no *args are passed in for logging statements In-Reply-To: <1585034477.86.0.546029969231.issue40053@roundup.psfhosted.org> Message-ID: <1585243394.17.0.0130111798094.issue40053@roundup.psfhosted.org> Nan Hua added the comment: Note that this issue has already been mostly addressed by https://github.com/python/cpython/pull/19132. I think we can close this issue now. Thanks Eric, Gregory and Vinay! ---------- stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:37:23 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 26 Mar 2020 17:37:23 +0000 Subject: [issue40053] Document the behavior that no interplotation is applied when no *args are passed in for logging statements In-Reply-To: <1585034477.86.0.546029969231.issue40053@roundup.psfhosted.org> Message-ID: <1585244243.78.0.520180506216.issue40053@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for the bug report! I'll mark it "fixed". If there's more to do, let us know. ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:41:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 17:41:48 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1585244508.33.0.918303225542.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: Ok, we got the confirmation that it's a regression in the FreeBSD kernel in FreeBSD CURRENT. The following commit reverts a change which introduced the race condition: https://svnweb.freebsd.org/base?view=revision&revision=359302 I suggest to wait until this change lands on FreeBSD CURRENT buildbots (not workaround the bug in Python, since CURRENT is not released yet). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:46:41 2020 From: report at bugs.python.org (Danijel) Date: Thu, 26 Mar 2020 17:46:41 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585244801.67.0.340365519167.issue40049@roundup.psfhosted.org> Danijel added the comment: Hi, well, it says entity too large. I've attached a smaller one, that throws a similar but slightly different error. (Note: only on the _second_ extraction, it looks like problems with symlinks) You can find larger ones here: https://data.rbfh.de/issue40049/ The typescript*.txt are showing a shell session with two different python versions. (3.4.2 and 3.8.2) ---------- Added file: https://bugs.python.org/file49003/test.tar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:49:55 2020 From: report at bugs.python.org (Mauro S. M. Rodrigues) Date: Thu, 26 Mar 2020 17:49:55 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585244995.39.0.773765288168.issue25024@roundup.psfhosted.org> Mauro S. M. Rodrigues added the comment: So per Serhiy comment can I assume the patch is not necessary? If so I believe the issue should be closed as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:57:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 17:57:36 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585245456.14.0.0703067715641.issue38644@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 08faf0016e1ee590c78f64ddb244767c7801866a by Victor Stinner in branch 'master': bpo-38644: Add _PySys_Audit() which takes tstate (GH-19180) https://github.com/python/cpython/commit/08faf0016e1ee590c78f64ddb244767c7801866a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 13:59:10 2020 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 26 Mar 2020 17:59:10 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585245550.98.0.979385152006.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: Serhiy's comment provides workarounds but are still (imo) inferior to supporting this. I would really like for this api to match that of NamedTemporaryFile which has the same `delete=...` option ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 14:16:33 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Mar 2020 18:16:33 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585246593.7.0.605343495298.issue25024@roundup.psfhosted.org> Serhiy Storchaka added the comment: Could you please explain the difference between hypothetical TemporaryDirectory(delete=False) and simple mkdtemp()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 14:16:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 18:16:47 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585246607.13.0.277392484278.issue38644@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18541 pull_request: https://github.com/python/cpython/pull/19182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 14:20:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 18:20:25 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585246825.9.0.370073519972.issue38644@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18542 pull_request: https://github.com/python/cpython/pull/19183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 14:25:01 2020 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 26 Mar 2020 18:25:01 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585247101.67.0.172965628556.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: the differences are api compatibility with context manager protocol and equivalence with NamedTemporaryFile NamedTemporaryFile(delete=False) is just `mkstemp` afaict and the api is there ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 14:26:24 2020 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 26 Mar 2020 18:26:24 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585247184.74.0.557092519155.issue25024@roundup.psfhosted.org> Anthony Sottile added the comment: you are right though, the effect is the same as just using mkdtemp ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 15:12:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 19:12:02 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585249922.87.0.130245517075.issue38644@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18543 pull_request: https://github.com/python/cpython/pull/19184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 15:32:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Mar 2020 19:32:11 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1585251131.89.0.686902912058.issue25024@roundup.psfhosted.org> Serhiy Storchaka added the comment: Well, then I think there is nothing to do this. Compatibility with context manager protocol is not a goal if it does nothing on exit. In any case you can easy to make it in three lines: @contextmanager def mymkdtemp(): yield mkdtemp() NamedTemporaryFile is more complex than mkstemp(). It creates a file object and closes a file descriptor even if leave the file on the filesystem. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 15:46:58 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 26 Mar 2020 19:46:58 +0000 Subject: [issue40012] Avoid Python 2 documentation to appear in Web search results In-Reply-To: <1584610559.01.0.880804484155.issue40012@roundup.psfhosted.org> Message-ID: <1585252018.42.0.50525247465.issue40012@roundup.psfhosted.org> Terry J. Reedy added the comment: Sorry, the 'previous issue' is a vague memory which I cannot find. For some reason, searching this tracker for 'Google' return 1500+ hits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:03:20 2020 From: report at bugs.python.org (SilentGhost) Date: Thu, 26 Mar 2020 21:03:20 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 In-Reply-To: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> Message-ID: <1585256600.01.0.039112877257.issue40076@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:07:35 2020 From: report at bugs.python.org (Alexander Bolshakov) Date: Thu, 26 Mar 2020 21:07:35 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 In-Reply-To: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> Message-ID: <1585256855.86.0.764340453453.issue40076@roundup.psfhosted.org> Change by Alexander Bolshakov : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:11:20 2020 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 26 Mar 2020 21:11:20 +0000 Subject: [issue40076] isoformat function drops microseconds part if its value is 000000 In-Reply-To: <1585232088.22.0.568073689149.issue40076@roundup.psfhosted.org> Message-ID: <1585257080.76.0.796374349747.issue40076@roundup.psfhosted.org> Paul Ganssle added the comment: > isoformat function does not conform to the ISO 8601 and drops microseconds part if its value is 000000. I'm not sure why you think that this does not conform to ISO 8601 - ISO 8601 is a sprawling beast of a spec and allows some crazy formats. Some examples of perfectly valid ISO 8601 strings: --03-26 2020-W13-4T03 2020-03-26T03.5 2020-03-26T03,5 2020-03-26T03:30:40.334 There are *hundreds* of valid formats encompassed by ISO 8601. Anyway, that's an aside. The behavior of .isoformat() is pretty clearly documented. These are the first three line of the documentation: Return a string representing the date and time in ISO 8601 format: - YYYY-MM-DDTHH:MM:SS.ffffff, if microsecond is not 0 - YYYY-MM-DDTHH:MM:SS, if microsecond is 0 I believe Karthikeyan has adequately explained how to get the behavior you want, so I am going to go ahead and close this as working as intended. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:28:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 21:28:19 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585258099.15.0.600664995095.issue38644@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 728189884e0e128c4ffc57b785b04584d57a90c0 by Victor Stinner in branch 'master': bpo-38644: Pass tstate explicitly in signalmodule.c (GH-19184) https://github.com/python/cpython/commit/728189884e0e128c4ffc57b785b04584d57a90c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:46:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 21:46:21 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585259181.95.0.405179449862.issue38644@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 71a3522ef85df06a3acc718107360e37e4116a15 by Victor Stinner in branch 'master': bpo-38644: Make tstate more explicit inside pystate.c (GH-19182) https://github.com/python/cpython/commit/71a3522ef85df06a3acc718107360e37e4116a15 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 17:56:53 2020 From: report at bugs.python.org (Alexander Riccio) Date: Thu, 26 Mar 2020 21:56:53 +0000 Subject: [issue40079] NULL pointer deref on error path in _ssl debughelpers.c Message-ID: <1585259813.8.0.527414757133.issue40079@roundup.psfhosted.org> New submission from Alexander Riccio : At line 138 in debughelpers.c, ssl_obj, which was set to NULL on line 122, is dereferenced. I think the original intent was to actually bubble the error up through the ssl object. Full function: static void _PySSL_keylog_callback(const SSL *ssl, const char *line) { PyGILState_STATE threadstate; PySSLSocket *ssl_obj = NULL; /* ssl._SSLSocket, borrowed ref */ int res, e; static PyThread_type_lock *lock = NULL; threadstate = PyGILState_Ensure(); /* Allocate a static lock to synchronize writes to keylog file. * The lock is neither released on exit nor on fork(). The lock is * also shared between all SSLContexts although contexts may write to * their own files. IMHO that's good enough for a non-performance * critical debug helper. */ if (lock == NULL) { lock = PyThread_allocate_lock(); if (lock == NULL) { PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock"); PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb); return; } } ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl); assert(PySSLSocket_Check(ssl_obj)); if (ssl_obj->ctx->keylog_bio == NULL) { return; } PySSL_BEGIN_ALLOW_THREADS PyThread_acquire_lock(lock, 1); res = BIO_printf(ssl_obj->ctx->keylog_bio, "%s\n", line); e = errno; (void)BIO_flush(ssl_obj->ctx->keylog_bio); PyThread_release_lock(lock); PySSL_END_ALLOW_THREADS if (res == -1) { errno = e; PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, ssl_obj->ctx->keylog_filename); PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb); } PyGILState_Release(threadstate); } ---------- assignee: christian.heimes components: SSL messages: 365114 nosy: Alexander Riccio, christian.heimes priority: normal severity: normal status: open title: NULL pointer deref on error path in _ssl debughelpers.c versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 18:31:43 2020 From: report at bugs.python.org (Diego Palacios) Date: Thu, 26 Mar 2020 22:31:43 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names In-Reply-To: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> Message-ID: <1585261903.19.0.349433662126.issue40074@roundup.psfhosted.org> Diego Palacios added the comment: In this case two new functions should be added to the pickle function. I think they would be very useful and many users would make use of them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 18:55:53 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Mar 2020 22:55:53 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585263353.82.0.59666327951.issue40077@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg365116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 18:55:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Mar 2020 22:55:46 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585263346.27.0.962802965829.issue40077@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Wouldn't having more static types slow down startup time? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 18:55:59 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Mar 2020 22:55:59 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585263359.67.0.0900729398691.issue40077@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Wouldn't having less static types slow down startup time? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 19:03:00 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 26 Mar 2020 23:03:00 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode Message-ID: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> New submission from Batuhan Taskaya : Just like docstrings, annotations do nothing at runtime for the majority of the time. We can just strip out them and gain as much as the docstring optimization in bytecode size on a fully annotated repo. For comparing these two optimizations, I calculated the bytecode weight (marshal dumped size of) of each optimization (with a similar implementation to the compiler but not exact) over a project which both rich in docstrings and annotations. Project: https://github.com/Instagram/LibCST $ python simple_tester.py LibCST Total bytes: 1820086 Total bytes after 629 docstrings (total length of 180333) removed: 1643315 Total bytes after 8859 type annotations removed: 1641594 (I've submitted the script I used to calculate these results.) ---------- components: Interpreter Core files: simple_tester.py messages: 365118 nosy: BTaskaya priority: normal severity: normal status: open title: Stripping annotations out as a new optimization mode type: enhancement versions: Python 3.9 Added file: https://bugs.python.org/file49004/simple_tester.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 19:03:50 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 26 Mar 2020 23:03:50 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1585263830.16.0.524789481039.issue40080@roundup.psfhosted.org> Batuhan Taskaya added the comment: As an addition, I need to clarify that each optimization applied by its own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 19:04:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 23:04:48 +0000 Subject: [issue1193099] Embedded python thread crashes Message-ID: <1585263888.32.0.273593882016.issue1193099@roundup.psfhosted.org> Change by STINNER Victor : ---------- superseder: -> Embedded python thread crashes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 19:05:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Mar 2020 23:05:06 +0000 Subject: [issue1856] shutdown (exit) can hang or segfault with daemon threads running In-Reply-To: <1200535276.53.0.276618350299.issue1856@psf.upfronthosting.co.za> Message-ID: <1585263906.91.0.021010987933.issue1856@roundup.psfhosted.org> STINNER Victor added the comment: bpo-1193099 was marked as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:03:43 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 27 Mar 2020 00:03:43 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1585267423.4.0.574578052811.issue40080@roundup.psfhosted.org> Eric V. Smith added the comment: Note that dataclasses will break without annotations. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:18:55 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 27 Mar 2020 00:18:55 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1585268335.61.0.11686342913.issue40080@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Note that dataclasses will break without annotations. Yes, that is also affecting this simple tester script. There is no alternative to value-less annotated assignment. I don't think this is preferable but just for information, these are the results for keeping AnnAssign nodes but just removing their annotation def visit_AnnAssign(self, node): self.stats += 1 node.annotation = ast.copy_location(ast.Constant(value=None), node.annotation) return node Total bytes: 1820086 Total bytes after 629 docstrings (total length of 180333) removed: 1643315 Total bytes after 8859 type annotations removed: 1664649 This way we can still support dataclasses but still gain as close as before ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:19:52 2020 From: report at bugs.python.org (John Andersen) Date: Fri, 27 Mar 2020 00:19:52 +0000 Subject: [issue37247] swap distutils build_ext and build_py commands to allow proper SWIG extension installation In-Reply-To: <1560341496.09.0.819646109086.issue37247@roundup.psfhosted.org> Message-ID: <1585268392.9.0.152366529945.issue37247@roundup.psfhosted.org> Change by John Andersen : ---------- nosy: +pdxjohnny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:26:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 00:26:31 +0000 Subject: [issue36989] test_thread fails because symbol is (no longer) exported In-Reply-To: <1558438553.77.0.394995800321.issue36989@roundup.psfhosted.org> Message-ID: <1585268791.44.0.367285745272.issue36989@roundup.psfhosted.org> STINNER Victor added the comment: > Fatal Python error: Py_EndInterpreter: not the last thread That's the bug bpo-36402 which I fixed with commit 468e5fec8a2f534f1685d59da3ca4fad425c38dd in master. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> threading._shutdown() race condition: test_threading test_threads_join_2() fails randomly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:46:32 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 27 Mar 2020 00:46:32 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585269992.87.0.365306697482.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18544 pull_request: https://github.com/python/cpython/pull/19185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:49:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 27 Mar 2020 00:49:46 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1585270186.52.0.532809305916.issue40080@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am -1 to this feature because compared with other optimization levels this can have unknown effects on the runtime, especially on dependencies you do not control. dataclasses is an example, but much more exist. To support this feature we would need also another extension for pyc files (like pyo) but (pyo) cannot be used to preserve backwards compatibility. Also, the feature will mainly serve to reduce file size, not much to speed up the runtime as any gain will be constant at definition time. IMHO the maintenance cost is too high for what the value is and it also has some potentially unintended dangerous consequences. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 20:51:47 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 27 Mar 2020 00:51:47 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585270307.75.0.601226190445.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18545 pull_request: https://github.com/python/cpython/pull/19186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:15:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 01:15:29 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585271729.91.0.351507381492.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: Pablo: > Wouldn't having less static types slow down startup time? That's possible, even if I only expect a minor or non significant overhead. But before starting talking about performances, we should focus on the correctness. Static types are causing issues with subinterpreters and the Python finalization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:18:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 01:18:41 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585271921.82.0.393763834672.issue39943@roundup.psfhosted.org> STINNER Victor added the comment: What is the rationale for adding const? For example, does the PR 19185 fix any compiler warning or any bug? While PR 19185 is correct, I am not sure that we should modify the 607K lines of C code of CPython to add const everywhere. I'm fine with using const for new code, but I'm not sure that it's worth it to modify exiting code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:19:29 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Fri, 27 Mar 2020 01:19:29 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585271969.81.0.940487989361.issue40077@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- nosy: +phsilva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:35:20 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 27 Mar 2020 01:35:20 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585272920.68.0.975964989453.issue40049@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +18546 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:41:11 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 27 Mar 2020 01:41:11 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585273271.24.0.31611792071.issue39943@roundup.psfhosted.org> Andy Lester added the comment: It doesn't quiet any compiler warnings given the default compiler warnings that ./configure sets. However, it does quiet the -Wcast-qual compiler warning that could be a helpful addition some time in the future. I think it would be great, for example, if it were made impossible to send a pointer that points at a string literal into a function that would modify its contents. Consting pointers also helps static analyzers like splint by letting it know the intent of the API. It makes it possible for the analyzer to detect uninitialized buffers, for example. All of the 20 or so patches that I've submitted, like BPO 39770 that you merged, have come about from my cranking up the warning options on both GCC and clang and sifting through the warnings. My hope is that by making more things const, we can detect existing bugs and prevent new ones. You say "I'm not sure that it's worth it to modify exiting code." Is your concern the amount of work it would take to find the problems? If so, it's not that much work when you let the compiler find the problems, which I've done. I've already spent the time digging and validating. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:43:12 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 27 Mar 2020 01:43:12 +0000 Subject: [issue39908] Remove unused args from init_set_builtins_open and _Py_FatalError_PrintExc in Python/pylifecycle.c In-Reply-To: <1583726399.05.0.763626668846.issue39908@roundup.psfhosted.org> Message-ID: <1585273392.82.0.328496158388.issue39908@roundup.psfhosted.org> Change by Andy Lester : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 21:49:28 2020 From: report at bugs.python.org (Jonathan Hsu) Date: Fri, 27 Mar 2020 01:49:28 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585273768.41.0.47836927567.issue40049@roundup.psfhosted.org> Jonathan Hsu added the comment: This is caused when tarfile tries to write a symlink that already exists. Any exceptions to os.symlink() as handled as if the platform doesn't support symlinks, so it scans the entire tar to try and find the linked files. When it resumes extraction, it needs to do a negative seek to pick up where it left off, which causes the exception. I've reproduced the error on both Windows 10 and Ubuntu running on WSL. Python 2.7 handled this situation by checking if the symlink exists, but it looks like the entire tarfile library was replaced with an alternate implementation that doesn't check if the symlink exists. I've created a pull request to address this issue. ---------- nosy: +Jonathan Hsu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 22:26:02 2020 From: report at bugs.python.org (Sivasundar Nagarajan) Date: Fri, 27 Mar 2020 02:26:02 +0000 Subject: [issue40081] List sorting Message-ID: <1585275962.0.0.0714871727825.issue40081@roundup.psfhosted.org> New submission from Sivasundar Nagarajan : Good day. Hope you are safe and wish the same with the present situation. Need you help please in understanding the below function of Python. Steps - 1. tried assigning the below values in the list and named it as a 2.if I print, it prints in the same sequence. 3.Tried assigning it to b by the command a.sort() 4.Tried printing b and it gave null. 5.But printed a now, and the values were sorted. Please help me understand if we have any logic with in a list to sort the values after an iteration. Please apologize if I had missed some basics and uncovered it. >>> a = [1,4,3,2,4,5,3,2] >>> a [1, 4, 3, 2, 4, 5, 3, 2] >>> print (a) [1, 4, 3, 2, 4, 5, 3, 2] >>> b = a.sort() >>> b >>> print (a) [1, 2, 2, 3, 3, 4, 4, 5] >>> ---------- assignee: terry.reedy components: IDLE messages: 365129 nosy: Sivasundar Nagarajan, terry.reedy priority: normal severity: normal status: open title: List sorting type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 22:48:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 27 Mar 2020 02:48:40 +0000 Subject: [issue40080] Stripping annotations out as a new optimization mode In-Reply-To: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org> Message-ID: <1585277320.44.0.804537540848.issue40080@roundup.psfhosted.org> Raymond Hettinger added the comment: Duplicate of https://bugs.python.org/issue3646 This was rejected because it breaks functools.singledispatch(), typing.NamedTuple(), and dataclasses.dataclass(). Also the space savings was negligible -- typically take much less space than for docstrings because the annotations dict consists of pointers to existing objects. ---------- nosy: +rhettinger resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 22:52:16 2020 From: report at bugs.python.org (=?utf-8?b?5pyx6IGW6buO?=) Date: Fri, 27 Mar 2020 02:52:16 +0000 Subject: [issue40081] List sorting In-Reply-To: <1585275962.0.0.0714871727825.issue40081@roundup.psfhosted.org> Message-ID: <1585277536.64.0.375186261186.issue40081@roundup.psfhosted.org> ??? added the comment: I think it's an expected behavior. `a.sort()` sorts the list itself in place, so it returns None. If you want a sorted list returned, you need to use `sorted` function. https://docs.python.org/3/library/functions.html#sorted ---------- nosy: +akarei _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 22:58:23 2020 From: report at bugs.python.org (Zhu Sheng Li) Date: Fri, 27 Mar 2020 02:58:23 +0000 Subject: [issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows In-Reply-To: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> Message-ID: <1585277903.17.0.251241279763.issue28859@roundup.psfhosted.org> Zhu Sheng Li added the comment: I submitted a PR and get reviewed by @lazka. Is there anything I should do for pushing it to next step? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 23:17:47 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 27 Mar 2020 03:17:47 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585279067.38.0.0336438462374.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- components: +C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 26 23:17:41 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 27 Mar 2020 03:17:41 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585279061.39.0.490299419646.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 00:52:15 2020 From: report at bugs.python.org (Andrea Bergonzo) Date: Fri, 27 Mar 2020 04:52:15 +0000 Subject: [issue38246] pathlib.resolve and .absolute leave trailing tilde in home expansion In-Reply-To: <1569103281.1.0.00418386254379.issue38246@roundup.psfhosted.org> Message-ID: <1585284735.39.0.727984984439.issue38246@roundup.psfhosted.org> Change by Andrea Bergonzo : ---------- nosy: +andybergon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 01:19:54 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 27 Mar 2020 05:19:54 +0000 Subject: [issue40081] List sorting In-Reply-To: <1585275962.0.0.0714871727825.issue40081@roundup.psfhosted.org> Message-ID: <1585286394.24.0.572140257008.issue40081@roundup.psfhosted.org> Eric V. Smith added the comment: In the future, please use the python-tutor or python-list mailing lists if you need help. If you still think you've found a bug in python, then open an issue here. https://mail.python.org/mailman/listinfo/tutor https://mail.python.org/mailman/listinfo/python-list ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: resource usage -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 02:00:53 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 06:00:53 +0000 Subject: [issue40081] List sorting In-Reply-To: <1585275962.0.0.0714871727825.issue40081@roundup.psfhosted.org> Message-ID: <1585288853.29.0.279611311933.issue40081@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- assignee: terry.reedy -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 02:01:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 06:01:06 +0000 Subject: [issue40081] List sorting In-Reply-To: <1585275962.0.0.0714871727825.issue40081@roundup.psfhosted.org> Message-ID: <1585288866.03.0.146969146041.issue40081@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 02:07:12 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 27 Mar 2020 06:07:12 +0000 Subject: [issue40082] Assertion failure in trip_signal Message-ID: <1585289232.05.0.154553792707.issue40082@roundup.psfhosted.org> New submission from Alexander Riccio : While trying to make sense of some static analysis warnings for the Windows console IO module, I Ctrl+C'd in the middle of an intentionally absurd __repr__ output, and on proceeding in the debugger (which treated it as an exception), I immediately hit the assertion right here: /* Get the Python thread state using PyGILState API, since _PyThreadState_GET() returns NULL if the GIL is released. For example, signal.raise_signal() releases the GIL. */ PyThreadState *tstate = PyGILState_GetThisThreadState(); assert(tstate != NULL); ...With the stacktrace: ucrtbased.dll!issue_debug_notification(const wchar_t * const message) Line 28 C++ ucrtbased.dll!__acrt_report_runtime_error(const wchar_t * message) Line 154 C++ ucrtbased.dll!abort() Line 51 C++ ucrtbased.dll!common_assert_to_stderr_direct(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 161 C++ ucrtbased.dll!common_assert_to_stderr(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 175 C++ ucrtbased.dll!common_assert(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 420 C++ ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 443 C++ > python39_d.dll!trip_signal(int sig_num) Line 266 C python39_d.dll!signal_handler(int sig_num) Line 342 C ucrtbased.dll!ctrlevent_capture(const unsigned long ctrl_type) Line 206 C++ KernelBase.dll!_CtrlRoutine at 4 () Unknown kernel32.dll!@BaseThreadInitThunk at 12 () Unknown ntdll.dll!__RtlUserThreadStart() Unknown ntdll.dll!__RtlUserThreadStart at 8 () Unknown ...I'm not entirely sure why this happened, but I can tell a few things. _PyRuntime.gilstate.autoInterpreterState is NOT null, in fact the gilstate object is as displayed in my watch window: - _PyRuntime.gilstate {check_enabled=1 tstate_current={_value=0 } getframe=0x79e3a570 {python39_d.dll!threadstate_getframe(_ts *)} ...} _gilstate_runtime_state check_enabled 1 int + tstate_current {_value=0 } _Py_atomic_address getframe 0x79e3a570 {python39_d.dll!threadstate_getframe(_ts *)} _frame *(*)(_ts *) - autoInterpreterState 0x00e5eff8 {next=0x00000000 tstate_head=0x00e601c0 {prev=0x00000000 next=0x00000000 ...} ...} _is * + next 0x00000000 _is * + tstate_head 0x00e601c0 {prev=0x00000000 next=0x00000000 interp=0x00e5eff8 {next=0x00000000 ...} ...} _ts * + runtime 0x7a0e2118 {python39_d.dll!pyruntimestate _PyRuntime} {preinitializing=0 preinitialized=1 core_initialized=...} pyruntimestate * id 0 __int64 id_refcount -1 __int64 requires_idref 0 int id_mutex 0x00000000 void * finalizing 0 int + ceval {tracing_possible=0 eval_breaker={_value=0 } pending={finishing=0 lock=0x00e59390 calls_to_do={_value=...} ...} } _ceval_state + gc {trash_delete_later=0x00000000 trash_delete_nesting=0 enabled=1 ...} _gc_runtime_state + modules 0x00bf1228 {ob_refcnt=3 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * + modules_by_index 0x00750058 {ob_refcnt=1 ob_type=0x7a0b8210 {python39_d.dll!_typeobject PyList_Type} {ob_base={ob_base=...} ...} } _object * + sysdict 0x00bf1298 {ob_refcnt=2 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * + builtins 0x00bf1f48 {ob_refcnt=88 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * + importlib 0x00c0df60 {ob_refcnt=28 ob_type=0x7a0b92d0 {python39_d.dll!_typeobject PyModule_Type} {ob_base={ob_base=...} ...} } _object * num_threads 0 long pythread_stacksize 0 unsigned int + codec_search_path 0x00c4a260 {ob_refcnt=1 ob_type=0x7a0b8210 {python39_d.dll!_typeobject PyList_Type} {ob_base={ob_base=...} ...} } _object * + codec_search_cache 0x00c1f0d8 {ob_refcnt=1 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * + codec_error_registry 0x00c14f10 {ob_refcnt=1 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * codecs_initialized 1 int + fs_codec {encoding=0x00e5aa40 "utf-8" utf8=1 errors=0x00e89ea8 "surrogatepass" ...} + config {_config_init=2 isolated=0 use_environment=1 ...} PyConfig + dict 0x00000000 _object * + builtins_copy 0x00c00a08 {ob_refcnt=1 ob_type=0x7a0b1178 {python39_d.dll!_typeobject PyDict_Type} {ob_base={ob_base=...} ...} } _object * + import_func 0x00bfd900 {ob_refcnt=4 ob_type=0x7a0b90d0 {python39_d.dll!_typeobject PyCFunction_Type} {ob_base={ob_base=...} ...} } _object * eval_frame 0x79a52577 {python39_d.dll!__PyEval_EvalFrameDefault} _object *(*)(_ts *, _frame *, int) co_extra_user_count 0 int + co_extra_freefuncs 0x00e5f308 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, ...} void(*)(void *)[255] pyexitfunc 0x79af7320 {python39_d.dll!atexit_callfuncs(_object *)} void(*)(_object *) + pyexitmodule 0x00f5d690 {ob_refcnt=16 ob_type=0x7a0b92d0 {python39_d.dll!_typeobject PyModule_Type} {ob_base={ob_base=...} ...} } _object * tstate_next_unique_id 1 unsigned __int64 + warnings {filters=0x0078edc8 {ob_refcnt=3 ob_type=0x7a0b8210 {python39_d.dll!_typeobject PyList_Type} {ob_base=...} } ...} _warnings_runtime_state + audit_hooks 0x00000000 _object * + parser {listnode={level=0 atbol=0 } } + small_ints 0x00e5f734 {0x00755868 {ob_base={ob_base={ob_refcnt=2 ob_type=0x7a0b8738 {python39_d.dll!_typeobject PyLong_Type} {...} } ...} ...}, ...} _longobject *[262] + autoTSSkey {_is_initialized=1 _key=5 } _Py_tss_t This looks to me like there's some kind of race condition in the thread local storage. Later, when TlsGetValue is called in PyThread_tss_get with the value of 5, the error code is lost, so I don't even know the exact reported error, and apparently 0 (nullptr) is a valid return anyways *shrug*. If I'm correctly decoding the address of the TLS slot in the TEB (I think *(unsigned int*)(void*)((@fs+0xe10)+ (20)) is the correct address for the 5th item? 4 bytes, key=5?), then there is actually a null tstate there. Not sure why. This is in a relatively recent (<1wk old) branch of the code, with some non-behavioral tweaks to add annotations in while I'm bug hunting, so it shouldn't matter. I'm not sure if I can reproduce this, but it happened, so there's a bug somewhere. What else? The signal number that tripped this was 2, sig interrupt, which makes sense. There are other threads active, so maybe that's why? The TLS was never initialized for that thread? Here's the dump from the visual studio threads window, 22316 is the active thread. Not Flagged 10360 0 Main Thread Main Thread python39_d.dll!_PyOS_WindowsConsoleReadline ntdll.dll!_NtDeviceIoControlFile at 40 () KernelBase.dll!ConsoleCallServerGeneric() KernelBase.dll!_ReadConsoleInternal at 24 () KernelBase.dll!_ReadConsoleW at 20 () python39_d.dll!_PyOS_WindowsConsoleReadline(void * hStdIn) Line 120 python39_d.dll!PyOS_StdioReadline(_iobuf * sys_stdin, _iobuf * sys_stdout, const char * prompt) Line 253 python39_d.dll!PyOS_Readline(_iobuf * sys_stdin, _iobuf * sys_stdout, const char * prompt) Line 358 python39_d.dll!tok_nextc(tok_state * tok) Line 856 python39_d.dll!tok_get(tok_state * tok, const char * * p_start, const char * * p_end) Line 1166 python39_d.dll!PyTokenizer_Get(tok_state * tok, const char * * p_start, const char * * p_end) Line 1813 python39_d.dll!parsetok(tok_state * tok, grammar * g, int start, perrdetail * err_ret, int * flags) Line 253 python39_d.dll!PyParser_ParseFileObject(_iobuf * fp, _object * filename, const char * enc, grammar * g, int start, const char * ps1, const char * ps2, perrdetail * err_ret, int * flags) Line 188 python39_d.dll!PyParser_ASTFromFileObject(_iobuf * fp, _object * filename, const char * enc, int start, const char * ps1, const char * ps2, PyCompilerFlags * flags, int * errcode, _arena * arena) Line 1388 python39_d.dll!PyRun_InteractiveOneObjectEx(_iobuf * fp, _object * filename, PyCompilerFlags * flags) Line 240 python39_d.dll!PyRun_InteractiveLoopFlags(_iobuf * fp, const char * filename_str, PyCompilerFlags * flags) Line 122 python39_d.dll!PyRun_AnyFileExFlags(_iobuf * fp, const char * filename, int closeit, PyCompilerFlags * flags) Line 81 python39_d.dll!pymain_run_stdin(PyConfig * config, PyCompilerFlags * cf) Line 467 python39_d.dll!pymain_run_python(int * exitcode) Line 556 python39_d.dll!Py_RunMain() Line 632 python39_d.dll!pymain_main(_PyArgv * args) Line 663 python39_d.dll!Py_Main(int argc, wchar_t * * argv) Line 674 python_d.exe!wmain(int argc, wchar_t * * argv) Line 10 python_d.exe!invoke_main() Line 90 python_d.exe!__scrt_common_main_seh() Line 288 python_d.exe!__scrt_common_main() Line 331 python_d.exe!wmainCRTStartup() Line 17 kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged 14944 0 Worker Thread ntdll.dll!_TppWorkerThread at 4 () ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 () ntdll.dll!_TppWorkerThread at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged > 22316 0 Worker Thread KernelBase.dll!_CtrlRoutine at 4 () ucrtbased.dll!issue_debug_notification ucrtbased.dll!issue_debug_notification(const wchar_t * const message) Line 28 ucrtbased.dll!__acrt_report_runtime_error(const wchar_t * message) Line 154 ucrtbased.dll!abort() Line 51 ucrtbased.dll!common_assert_to_stderr_direct(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 161 ucrtbased.dll!common_assert_to_stderr(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 175 ucrtbased.dll!common_assert(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 420 ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 443 python39_d.dll!trip_signal(int sig_num) Line 266 python39_d.dll!signal_handler(int sig_num) Line 342 ucrtbased.dll!ctrlevent_capture(const unsigned long ctrl_type) Line 206 KernelBase.dll!_CtrlRoutine at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged 10180 0 Worker Thread ntdll.dll!_TppWorkerThread at 4 () ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 () ntdll.dll!_TppWorkerThread at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged 28940 0 Worker Thread ntdll.dll!_TppWorkerThread at 4 () ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 () ntdll.dll!_TppWorkerThread at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged 9396 0 Worker Thread ntdll.dll!_TppWorkerThread at 4 () ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 () ntdll.dll!_TppWorkerThread at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Not Flagged 28960 0 Worker Thread ntdll.dll!_TppWorkerThread at 4 () ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 ntdll.dll!_NtWaitForWorkViaWorkerFactory at 20 () ntdll.dll!_TppWorkerThread at 4 () kernel32.dll!@BaseThreadInitThunk at 12 () ntdll.dll!__RtlUserThreadStart() ntdll.dll!__RtlUserThreadStart at 8 () Anyways, I hope that's a useful report for an obscure bug. ---------- components: Interpreter Core messages: 365134 nosy: Alexander Riccio priority: normal severity: normal status: open title: Assertion failure in trip_signal type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 02:08:22 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 27 Mar 2020 06:08:22 +0000 Subject: [issue40082] Assertion failure in trip_signal In-Reply-To: <1585289232.05.0.154553792707.issue40082@roundup.psfhosted.org> Message-ID: <1585289302.75.0.874009195806.issue40082@roundup.psfhosted.org> Alexander Riccio added the comment: Lmao the name mangling comes up as a mailto. That's interesting. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 02:13:03 2020 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 27 Mar 2020 06:13:03 +0000 Subject: [issue40082] Assertion failure in trip_signal In-Reply-To: <1585289232.05.0.154553792707.issue40082@roundup.psfhosted.org> Message-ID: <1585289583.15.0.114345147525.issue40082@roundup.psfhosted.org> Alexander Riccio added the comment: Hmmm, happens every time I interrupt while attached. Is there some obvious gotcha in the docs that I'm missing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 03:04:44 2020 From: report at bugs.python.org (Rajesh R Naik) Date: Fri, 27 Mar 2020 07:04:44 +0000 Subject: [issue40083] No run option available in python idle in version 3.8.2 Message-ID: <1585292684.98.0.176532437082.issue40083@roundup.psfhosted.org> New submission from Rajesh R Naik : i using pyhton 3.8.2 latest version in that there no run option available in python idle. so please help also iam using windows 10 home ---------- assignee: terry.reedy components: IDLE messages: 365137 nosy: Raj_110, terry.reedy, twouters priority: normal severity: normal status: open title: No run option available in python idle in version 3.8.2 type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 03:16:45 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 27 Mar 2020 07:16:45 +0000 Subject: [issue40084] HTTPStatus has incomplete dir() listing Message-ID: <1585293405.13.0.478935860244.issue40084@roundup.psfhosted.org> New submission from Raymond Hettinger : The dir() listing omits the attributes "description" and "phrase": >>> import http >>> from pprint import pp >>> r = http.HTTPStatus(404) >>> pp(vars(r)) {'_value_': 404, 'phrase': 'Not Found', 'description': 'Nothing matches the given URI', '_name_': 'NOT_FOUND', '__objclass__': } >>> r.value 404 >>> r.name 'NOT_FOUND' >>> r.description 'Nothing matches the given URI' >>> r.phrase 'Not Found' >>> dir(r) ['__class__', '__doc__', '__module__', 'as_integer_ratio', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'name', 'numerator', 'real', 'to_bytes', 'value'] One fix would be to teach IntEnum.__dir__() to include entries in the instance dict. Another fix would be to provide a way for a IntEnum subclass to add to the known members list. ---------- components: Library (Lib) messages: 365138 nosy: ethan.furman, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: HTTPStatus has incomplete dir() listing type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 03:45:42 2020 From: report at bugs.python.org (tzickel) Date: Fri, 27 Mar 2020 07:45:42 +0000 Subject: [issue40085] Argument parsing option c should accept int between -128 to 255 ? Message-ID: <1585295142.15.0.400379676659.issue40085@roundup.psfhosted.org> New submission from tzickel : I converted some code from python to c-api and was surprised that a code stopped working. Basically the "c" parsing option allows for 1 char bytes or bytearray inputs and converts them to a C char. But just as indexing a bytes array returns an int, so should this option support it. i.e. b't'[0] = 116 Not sure if it should limit between 0 to 255 or -128 to 127. ---------- components: C API messages: 365139 nosy: tzickel priority: normal severity: normal status: open title: Argument parsing option c should accept int between -128 to 255 ? type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 05:07:12 2020 From: report at bugs.python.org (Windson Yang) Date: Fri, 27 Mar 2020 09:07:12 +0000 Subject: [issue36093] UnicodeEncodeError raise from smtplib.verify() method In-Reply-To: <1550908758.26.0.552141628876.issue36093@roundup.psfhosted.org> Message-ID: <1585300032.17.0.916509803002.issue36093@roundup.psfhosted.org> Windson Yang added the comment: Any update? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 05:07:28 2020 From: report at bugs.python.org (Windson Yang) Date: Fri, 27 Mar 2020 09:07:28 +0000 Subject: [issue36453] pkgutil.get_importer only return the first valid path_hook(importer) In-Reply-To: <1553731868.7.0.689003457524.issue36453@roundup.psfhosted.org> Message-ID: <1585300048.23.0.871720898018.issue36453@roundup.psfhosted.org> Windson Yang added the comment: Any update? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 06:39:35 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 27 Mar 2020 10:39:35 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1585305575.72.0.922557706386.issue36543@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: +hroncok nosy_count: 4.0 -> 5.0 pull_requests: +18547 pull_request: https://github.com/python/cpython/pull/19188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:00:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 11:00:12 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585306812.69.0.951478061732.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 33f15a16d40cb8010a8c758952cbf88d7912ee2d by Dong-hee Na in branch 'master': bpo-40077: Convert _json module to use PyType_FromSpec() (GH-19177) https://github.com/python/cpython/commit/33f15a16d40cb8010a8c758952cbf88d7912ee2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:16:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 11:16:23 +0000 Subject: [issue36093] UnicodeEncodeError raise from smtplib.verify() method In-Reply-To: <1550908758.26.0.552141628876.issue36093@roundup.psfhosted.org> Message-ID: <1585307783.5.0.18439792209.issue36093@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:27:47 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Mar 2020 11:27:47 +0000 Subject: [issue40084] HTTPStatus has incomplete dir() listing In-Reply-To: <1585293405.13.0.478935860244.issue40084@roundup.psfhosted.org> Message-ID: <1585308467.47.0.377195253241.issue40084@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:36:55 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Mar 2020 11:36:55 +0000 Subject: [issue40086] test_etree is skipped in test_typing due to cElementTree removal Message-ID: <1585309015.87.0.51128301072.issue40086@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Currently, test_etree has a Python 2 shim importing cElementTree and skipping the test on ImportError. Since cElementTree was deprecated and removed in Python 3 with 36543. So this test is now skipped. The fix would be to remove the shim and import Element from xml.etree.ElementTree. This is a good beginner issue. Test log as below : ./python -m test test_typing -m test_etree -vvv == CPython 3.9.0a5+ (heads/master:33f15a16d4, Mar 27 2020, 11:15:48) [GCC 7.5.0] == Linux-4.15.0-66-generic-x86_64-with-glibc2.27 little-endian == cwd: /root/cpython/build/test_python_24162 == CPU count: 1 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.07 Run tests sequentially 0:00:00 load avg: 0.07 [1/1] test_typing test_etree (test.test_typing.UnionTests) ... skipped 'cElementTree not found' ---------------------------------------------------------------------- Ran 1 test in 0.001s OK (skipped=1) == Tests result: SUCCESS == 1 test OK. Total duration: 150 ms Tests result: SUCCESS ---------- components: Tests, XML messages: 365143 nosy: serhiy.storchaka, xtreak priority: normal severity: normal stage: needs patch status: open title: test_etree is skipped in test_typing due to cElementTree removal type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:43:55 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Mar 2020 11:43:55 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585309435.37.0.0933351696984.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: On thinking more about this the wraps argument provides a way to wrap the calls for the mock to a given object. So when an attribute not present in the wrapped object is being accessed then it should act like the attribute is not present. Falling back to the default value like previous case would help but that will pose the question over whether the value is from the wrapped object's attribute or from the default value for the magic method that the user could never know. This could be better clarified in the docs I suppose which I missed in the previous issue. Thoughts on this fallback behavior? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 07:46:53 2020 From: report at bugs.python.org (Stefan Krah) Date: Fri, 27 Mar 2020 11:46:53 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585309613.36.0.628110760271.issue40077@roundup.psfhosted.org> Stefan Krah added the comment: > Wouldn't having less static types slow down startup time? Yes, and not only startup time: https://bugs.python.org/issue15722 ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 08:17:11 2020 From: report at bugs.python.org (Deepalee Khare) Date: Fri, 27 Mar 2020 12:17:11 +0000 Subject: [issue40087] How to Uninstall Python3.7.3 using cmd? Message-ID: <1585311431.71.0.879589746848.issue40087@roundup.psfhosted.org> New submission from Deepalee Khare : How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it giver me an error: "This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package." how do i uninstall it ? ---------- components: Windows messages: 365146 nosy: deepaleedotkhare at gmail.com, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: How to Uninstall Python3.7.3 using cmd? type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 08:35:37 2020 From: report at bugs.python.org (Yury Norov) Date: Fri, 27 Mar 2020 12:35:37 +0000 Subject: [issue40088] list.reverse(): slow sublist reverse Message-ID: <1585312537.41.0.422024804139.issue40088@roundup.psfhosted.org> New submission from Yury Norov : Hi all, In Python, I need a tool to reverse part of a list (tail) quickly. I expected that nums[start:end].reverse() would do it inplace with the performance similar to nums.reverse(). However, it doesn't work at all. The fastest way to reverse a part of the list that I found is like this: nums[start:end] = nums[end:start-1:-1] But it is 30 times slower than pure reverse(). The patch below adds a region support for the reverse(). It works as fast as I expect. The test results and script are like this: exec(open('test.py').read()) nums.reverse() 0.006764888763427734 nums = nums[::-1] 0.10066413879394531 nums.reverse(-L/2) 0.003548145294189453 nums.reverse(L/2, L) 0.003538370132446289 nums = nums[:L/2] + nums[L:L/2-1:-1] 0.19934582710266113 nums[L/2:L] = nums[L:L/2-1:-1] 0.11419057846069336 import time nums = list(range(10000000)) L = len(nums) LL = int(L/2) t = time.time() nums.reverse() print('nums.reverse()\t\t\t\t', str(time.time() - t)) t = time.time() nums = nums[::-1] print('nums = nums[::-1]\t\t\t', str(time.time() - t)) t = time.time() nums.reverse(-LL) print('nums.reverse(-L/2)\t\t\t', time.time() - t) t = time.time() nums.reverse(LL, L) print('nums.reverse(L/2, L)\t\t\t', time.time() - t) t = time.time() nums = nums[:LL] + nums[L : LL - 1 : -1] print('nums = nums[:L/2] + nums[L:L/2-1:-1]\t', time.time() - t) t = time.time() nums[LL:L] = nums[L:LL-1:-1] print('nums[L/2:L] = nums[L:L/2-1:-1]\t\t', time.time() - t) If there is better way to reverse lists, can someone point me at the right direction? If not, I'll be happy to fix all existing issues and upstream this approach. PR: https://github.com/python/cpython/pull/19181 Thanks, Yury ---------- components: C API, Interpreter Core messages: 365147 nosy: Yury priority: normal pull_requests: 18548 severity: normal status: open title: list.reverse(): slow sublist reverse versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 08:51:21 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 27 Mar 2020 12:51:21 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585313481.02.0.375070553729.issue40018@roundup.psfhosted.org> Charalampos Stratakis added the comment: The change has been reverted upstream. Also on the rawhide buildbots, we have an updated build with the commit reverted, so they returned back to green. Now the revertion will be included at a new release of the 1.1.1 branch, however it will still be on the 3.0.0 branch when it will be released, so at that point a possible rewrite of the ssl module will be required, as is the case with every major openssl update. I'd suggest to close this issue and open a new one for compatibility with openssl 3.0.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 09:21:59 2020 From: report at bugs.python.org (=?utf-8?q?Furkan_=C3=96nder?=) Date: Fri, 27 Mar 2020 13:21:59 +0000 Subject: [issue40086] test_etree is skipped in test_typing due to cElementTree removal In-Reply-To: <1585309015.87.0.51128301072.issue40086@roundup.psfhosted.org> Message-ID: <1585315319.66.0.386697358898.issue40086@roundup.psfhosted.org> Change by Furkan ?nder : ---------- keywords: +patch nosy: +furkanonder nosy_count: 2.0 -> 3.0 pull_requests: +18549 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 09:58:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 13:58:10 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585317490.83.0.626240635949.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: In the _json module, PyModule_GetState() (called by get_json_state()) is only used by the garbage collector (traverse function) and to unload the module (clear and free functions). It's not used in "hot code" (let me consider that the GC is not part of the usual "hot code" :-)). But maybe we should measure the overhead of future changes if PyModule_GetState() starts to be used in "hot code" by running a few microbenchmarks. -- Stefan Krah: > Yes, and not only startup time: > https://bugs.python.org/issue15722 Aha, that's interesting. I didn't know that it could have an impact on runtime performance as well. _decimal_pep3121-384_v1.patch attached to bpo-15722 seems to use: #define _decimal_state_global ((_decimal_state *)PyModule_GetState(PyState_FindModule(&_decimal_module))) whereas the commit 33f15a16d40cb8010a8c758952cbf88d7912ee2d only uses: static inline _jsonmodulestate* get_json_state(PyObject *module) { void *state = PyModule_GetState(module); assert(state != NULL); return (_jsonmodulestate *)state; } Maybe PyState_FindModule() adds a little overhead, even if this function is simple: in short, it gets the i-th item of a list (from PyInterpreterState.modules_by_index). PyModule_GetState() function is really simple: it only reads PyModuleObject.md_state attribute. Or maybe _decimal_state_global was used in "hot code". If PyState_FindModule() or PyModule_GetState() is the source of the overhead, maybe we could try to optimise these functions, or pass directly the module state to inner functions. -- PyState_FindModule() doesn't work for a module using PyModuleDef_Init(). The PEP 573 is going to give access to the module state in functions which didn't access to it previsouly. The commit 33f15a16d40cb8010a8c758952cbf88d7912ee2d removed a few assertions checking that "self" has the expected type. It wasn't possible to get the module state to get the types, because PEP 573 is not implemented yet and PyState_FindModule() doesn't work in _json (which uses PyModuleDef_Init()). I decided that it's ok to remove these assertions: it should not be possible to call these functions with another type in practice. -- In his PR 19177, Dong-hee started by replacing direct access to PyTypeObject fields, like replacing: type->free(self); with: freefunc free_func = PyType_GetSlot(tp, Py_tp_free); free_func(self); I asked him to revert these changes. I'm interested to experiment a few C extension modules of the stdlib using the limited C API (PEP 384, stable ABI), but I don't think that it should done while converting modules to PyType_FromSpec(). We should separate the two changes. And I would prefer to first see the overhead of PyType_FromSpec(), and discuss the advantages and drawbacks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:08:35 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Mar 2020 14:08:35 +0000 Subject: [issue40088] list.reverse(): slow sublist reverse In-Reply-To: <1585312537.41.0.422024804139.issue40088@roundup.psfhosted.org> Message-ID: <1585318115.91.0.00379157856499.issue40088@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This looks like a duplicate of https://bugs.python.org/issue1491804 ---------- nosy: +rhettinger, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:08:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 14:08:55 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585318135.56.0.0205655590706.issue39943@roundup.psfhosted.org> STINNER Victor added the comment: > However, it does quiet the -Wcast-qual compiler warning that could be a helpful addition some time in the future. Aha, that's intesting. It helps me if I can see that your change fix a compiler warning that I can reproduce. If I build Objects/obmalloc.c with -Wcast-qual using GCC 9.2.1 (on Fedora 31), I get: Objects/obmalloc.c:2455:66: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] 2455 | fprintf(stderr, " The %d pad bytes at tail=%p are ", SST, (void *)tail); | ^ But I get no warning for pymemallocator_eq(). About the (void *) cast, it was added by Zackery Spytz in bpo-36594: commit 1a2252ed39bc1b71cdaa935d7726d82909af93ab Author: Zackery Spytz Date: Mon May 6 10:56:51 2019 -0600 bpo-36594: Fix incorrect use of %p in format strings (GH-12769) In addition, fix some other minor violations of C99. (...) - fprintf(stderr, " The %d pad bytes at tail=%p are ", SST, tail); + fprintf(stderr, " The %d pad bytes at tail=%p are ", SST, (void *)tail); (...) Extract of the issue: """ gcc warns with -pedantic: ptr.c: In function ?main?: ptr.c:5:13: warning: format ?%p? expects argument of type ?void *?, but argument 2 has type ?int *? [-Wformat=] printf ("%p", &i); """ We should check that GCC doesn't emit warning with -pedantic nor -Wcast-qual, and when both flags are combined :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:12:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 14:12:10 +0000 Subject: [issue38644] Pass explicitly tstate to function calls In-Reply-To: <1572445884.39.0.966254854932.issue38644@roundup.psfhosted.org> Message-ID: <1585318330.03.0.929088099953.issue38644@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1c1e68cf3e3a2a19a0edca9a105273e11ddddc6e by Victor Stinner in branch 'master': bpo-38644: Use _PySys_Audit(): pass tstate explicitly (GH-19183) https://github.com/python/cpython/commit/1c1e68cf3e3a2a19a0edca9a105273e11ddddc6e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:19:55 2020 From: report at bugs.python.org (Deep Sukhwani) Date: Fri, 27 Mar 2020 14:19:55 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1585318795.6.0.0695359992449.issue8978@roundup.psfhosted.org> Deep Sukhwani added the comment: Hello, I just observed this issue on Python 3.8.2 while running tests for Django project. Example error ====================================================================== ERROR: test_extract_function (utils_tests.test_archive.TestArchive) [foobar.tar.xz] ---------------------------------------------------------------------- Traceback (most recent call last): ... raise ReadError("file could not be opened successfully") tarfile.ReadError: file could not be opened successfully Python version: 3.8.2 OS: macOS Catalina 10.15.4 This should be reopened? ---------- nosy: +Deep Sukhwani _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:48:11 2020 From: report at bugs.python.org (Stefan Krah) Date: Fri, 27 Mar 2020 14:48:11 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585320491.06.0.698476704577.issue40077@roundup.psfhosted.org> Stefan Krah added the comment: > Or maybe _decimal_state_global was used in "hot code". Yes, _decimal has problems here that most modules don't have. Modules like atexit are obviously fine. :) I just posted it as an example why one should be a bit cautious. > The PEP 573 is going to give access to the module state in functions which didn't access to it previously. That could help, we'll see. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 10:59:40 2020 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 27 Mar 2020 14:59:40 +0000 Subject: [issue25780] Add support for CAN_RAW_JOIN_FILTERS In-Reply-To: <1449074447.29.0.213464499345.issue25780@psf.upfronthosting.co.za> Message-ID: <1585321180.03.0.813712865363.issue25780@roundup.psfhosted.org> Change by Zackery Spytz : ---------- nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +18550 pull_request: https://github.com/python/cpython/pull/19190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 11:14:42 2020 From: report at bugs.python.org (Andy Lester) Date: Fri, 27 Mar 2020 15:14:42 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585322082.4.0.956504910176.issue39943@roundup.psfhosted.org> Andy Lester added the comment: Casting tail to (void *)tail was the correct thing to do. The problem is that casting to void* casts away the constness of tail. The even more correct thing to do is what my patch does, which is cast it to (const void *)tail. There is no functional difference between sending a const void * and a void * to fprintf. However, it's one more bit of noise for -Wcast-qual to gripe about. My hope is to clear up the noise to find the real problems. For example, if you had this very bad code: const char *msg = "literal"; strcpy(msg, "another string"); then the compiler would complain you're passing a non-const char * to the first arg of strcpy that wants a const char *. That's a good thing. However, you could naively change that to: strcpy((char *)msg, "another string"); and that would compile just fine, but the code would still be a big problem. It would require -Wcast-qual to warn you that you're casting away the constness of a pointer. ... For pymemallocator_eq, changing the arguments to const doesn't quiet any warnings in this case with this one function. However, it's good to make them const because the arguments are not getting modified. They're getting passed to memcmp(), which properly takes const void *. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 11:46:39 2020 From: report at bugs.python.org (John Andersen) Date: Fri, 27 Mar 2020 15:46:39 +0000 Subject: [issue37247] swap distutils build_ext and build_py commands to allow proper SWIG extension installation In-Reply-To: <1560341496.09.0.819646109086.issue37247@roundup.psfhosted.org> Message-ID: <1585323999.15.0.521628312803.issue37247@roundup.psfhosted.org> John Andersen added the comment: I'm going to take a stab at this by adding build_swig which will run if the list of files only contains .i files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 11:51:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 15:51:37 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks Message-ID: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> New submission from STINNER Victor : Using a lock after fork() is unsafe and can crash. Example of a crash in logging after a fork on AIX: https://bugs.python.org/issue40068#msg365028 This problem is explained in length in bpo-6721: "Locks in the standard library should be sanitized on fork". The threading module registers an "at fork" callback: Thread._reset_internal_locks() is called to reset self._started (threading.Event) and self._tstate_lock. The current implementation creates new Python lock objects and forgets about the old ones. I propose to add a new _at_fork_reinit() method to Python lock objects which reinitializes the native lock internally without having to create a new Python object. Currently, my implementation basically creates a new native lock object and forgets about the old new (don't call PyThread_free_lock()). Tomorrow, we can imagine a more efficient impementation using platform specific function to handle this case without having to forget about the old lock. ---------- components: Library (Lib) messages: 365157 nosy: vstinner priority: normal severity: normal status: open title: Add _at_fork_reinit() method to locks versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 11:57:32 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 27 Mar 2020 15:57:32 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585324652.61.0.91888846823.issue40089@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +Batuhan Taskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:00:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 16:00:27 +0000 Subject: [issue38966] List similarity relationship In-Reply-To: <1575448780.55.0.278075875702.issue38966@roundup.psfhosted.org> Message-ID: <1585324827.87.0.103098193856.issue38966@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +Interpreter Core -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:07:39 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 16:07:39 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1585325259.77.0.976341553244.issue40031@roundup.psfhosted.org> Terry J. Reedy added the comment: Upgrading to bugfix releases is usually a good idea. Aside from everything else, there is usually some change to IDLE. Again, how are you installing python? From the python.org installer (which one)? From the Window store? From a 3rd party installer? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:09:40 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 16:09:40 +0000 Subject: [issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work. In-Reply-To: <1584783754.51.0.582471420619.issue40031@roundup.psfhosted.org> Message-ID: <1585325380.81.0.512782593755.issue40031@roundup.psfhosted.org> Terry J. Reedy added the comment: What does Help => About IDLE say about the tk version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:10:06 2020 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Mar 2020 16:10:06 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1585325406.96.0.620304746398.issue33608@roundup.psfhosted.org> Mark Shannon added the comment: Just to add my 2 cents. I think this a bad idea and is likely to be unsafe. Having interpreters interfering with each other's objects is almost certain to lead to race conditions. IMO, objects should *never* be shared across interpreters (once interpreters are expected to be able to run in parallel). Any channel between two interpreters should consist of two objects, one per interpreter. The shared memory they use to communicated can be managed by the runtime. Likewise for inter-interpreter locks. The lock itself should be managed by the runtime, with each interpreter having its own lock object with a handle on the shared lock. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:21:32 2020 From: report at bugs.python.org (Eric Snow) Date: Fri, 27 Mar 2020 16:21:32 +0000 Subject: [issue39984] Move pending calls from _PyRuntime to PyInterpreterState In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1585326092.12.0.166234884717.issue39984@roundup.psfhosted.org> Eric Snow added the comment: Awesome! Thanks for doing this, Victor. I'll take a look when I can and adjust the changes for bpo-33608. If you'll recall, I made a similar change as part of the solution for that issue, which we later reverted due to problems we discovered with daemon threads during runtime finalization. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:23:40 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Fri, 27 Mar 2020 16:23:40 +0000 Subject: [issue40090] The referenced RFC for the json module should be corrected to rfc8259 Message-ID: <1585326220.2.0.0601154076392.issue40090@roundup.psfhosted.org> New submission from Ama Aje My Fren : Currently the Documentation of the json library module refers to :rfc:`7159` . That RFC has however been obsoleted by :rfc:`8259`. The Documentation for :mod:`json` should be changed to indicate this. ---------- assignee: docs at python components: Documentation messages: 365162 nosy: amaajemyfren, docs at python priority: normal severity: normal status: open title: The referenced RFC for the json module should be corrected to rfc8259 type: enhancement versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:24:44 2020 From: report at bugs.python.org (Eric Snow) Date: Fri, 27 Mar 2020 16:24:44 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1585326284.99.0.140917103792.issue33608@roundup.psfhosted.org> Eric Snow added the comment: FYI, in bpo-39984 Victor moved pending calls to PyInterpreterState, which was part of my reverted change. However, there are a few other pieces of that change that need to be applied before this issue is resolved. I'm not sure when I'll get to it, but hopefully soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:24:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 16:24:45 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585326285.45.0.286896433187.issue40089@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18551 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:25:11 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 16:25:11 +0000 Subject: [issue40083] No run option available in python idle in version 3.8.2 In-Reply-To: <1585292684.98.0.176532437082.issue40083@roundup.psfhosted.org> Message-ID: <1585326311.4.0.678333530361.issue40083@roundup.psfhosted.org> Terry J. Reedy added the comment: Run only appears on the main menu of editor windows, not Shell or Output windows. If it does not appear, that would be a major bug. But I have no problem with 3.8.2 on Win10 Pro. If you do not have Run in an editor, or do but do not have Run Module or Run Customized on the Run menu, please supply much more detailed information. 1. How are you installing python? From the python.org installer (which one)? From the Window store? From a 3rd party installer (which one)? 2. How do you start IDLE? 3. What does Help => About IDLE say about the tk version? 4. How do you get an editor window? What do you see on the menu? If Run appears, what happens when you click it? 5. Start IDLE from Command Prompt with "py -3.8 -m idlelib". Do you ever see any error messages? 6. Have you touched any files in Lib/idlelib? ---------- nosy: -twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:29:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 16:29:48 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585326588.57.0.914054012686.issue40089@roundup.psfhosted.org> STINNER Victor added the comment: _at_fork() has a bug: it creates a _DummyThread instead of a _MainThread. Example: --- import os, _thread, threading, time def fork_in_thread(): pid = os.fork() if pid: # parent os._exit(0) # child process print(f"child process: {threading.current_thread()=}") print(f"child process: {threading._main_thread=}") print(f"parent process: {threading.current_thread()=}") print(f"parent process: {threading._main_thread=}") _thread.start_new_thread(fork_in_thread, ()) # block the main thread: fork_in_thread() exit the process time.sleep(60) --- Output: --- parent process: threading.current_thread()=<_MainThread(MainThread, started 139879200077632)> parent process: threading._main_thread=<_MainThread(MainThread, started 139879200077632)> child process: threading.current_thread()=<_DummyThread(Dummy-1, started daemon 139878980245248)> child process: threading._main_thread=<_DummyThread(Dummy-1, started daemon 139878980245248)> --- My PR 19191 fix the issue: --- parent process: threading.current_thread()=<_MainThread(MainThread, started 140583665170240)> parent process: threading._main_thread=<_MainThread(MainThread, started 140583665170240)> child process: threading.current_thread()=<_MainThread(MainThread, started 140583445075712)> child process: threading._main_thread=<_MainThread(MainThread, started 140583445075712)> --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:37:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 27 Mar 2020 16:37:50 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1585327070.36.0.080866008244.issue38237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5a58c5280b8df4ca5d6a19892b24fff96e9ea868 by Ammar Askar in branch 'master': bpo-38237: Use divmod for positional arguments whatsnew example (GH-19171) https://github.com/python/cpython/commit/5a58c5280b8df4ca5d6a19892b24fff96e9ea868 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:38:14 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 16:38:14 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1585327094.66.0.991093279422.issue38237@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18552 pull_request: https://github.com/python/cpython/pull/19192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:45:09 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 16:45:09 +0000 Subject: [issue38237] Expose meaningful keyword arguments for pow() In-Reply-To: <1569000102.29.0.506926854512.issue38237@roundup.psfhosted.org> Message-ID: <1585327509.01.0.134875281144.issue38237@roundup.psfhosted.org> miss-islington added the comment: New changeset 9c5c497ac167b843089553f6f62437d263382e97 by Miss Islington (bot) in branch '3.8': bpo-38237: Use divmod for positional arguments whatsnew example (GH-19171) https://github.com/python/cpython/commit/9c5c497ac167b843089553f6f62437d263382e97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:50:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 16:50:45 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585327845.62.0.0602987065118.issue40089@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d8ff44ce4cd6f3ec0fab5fccda6bf14afcb25c30 by Victor Stinner in branch 'master': bpo-40089: Fix threading._after_fork() (GH-19191) https://github.com/python/cpython/commit/d8ff44ce4cd6f3ec0fab5fccda6bf14afcb25c30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:51:10 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 16:51:10 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585327870.35.0.0201471569827.issue40089@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18553 pull_request: https://github.com/python/cpython/pull/19193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:52:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 16:52:14 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585327934.7.0.422762442396.issue40089@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18555 pull_request: https://github.com/python/cpython/pull/19195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:51:18 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 16:51:18 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585327878.5.0.115252757468.issue40089@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18554 pull_request: https://github.com/python/cpython/pull/19194 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 12:53:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 16:53:39 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1585328019.96.0.488320743776.issue6721@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-40089: Add _at_fork_reinit() method to locks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:02:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:02:43 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() Message-ID: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> New submission from STINNER Victor : test_threading.ThreadJoinOnShutdown.test_reinit_tls_after_fork() does crash randomly on AIX in logging._after_at_fork_child_reinit_locks(): https://bugs.python.org/issue40068#msg365028 This function ends by releasing a lock: _releaseLock() # Acquired by os.register_at_fork(before=. But it is not safe to use a lock after fork (see bpo-6721 and bpo-40089). The purpose of _after_at_fork_child_reinit_locks() is already to fix locks used by logging handles: see bpo-36533 and commit 64aa6d2000665efb1a2eccae176df9520bf5f5e6. But the global logging._lock is not reset after fork. Attached PR fix the issue. ---------- components: Library (Lib) messages: 365170 nosy: vstinner priority: normal severity: normal status: open title: Crash in logging._after_at_fork_child_reinit_locks() versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:04:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:04:23 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() In-Reply-To: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> Message-ID: <1585328663.24.0.111748319346.issue40091@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18556 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:05:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:05:12 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() In-Reply-To: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> Message-ID: <1585328712.99.0.594030836436.issue40091@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +gregory.p.smith, vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:06:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:06:31 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585328791.12.0.440330186148.issue40089@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18557 pull_request: https://github.com/python/cpython/pull/19196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:07:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:07:09 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585328829.41.0.6149862431.issue40089@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-40091 "Crash in logging._after_at_fork_child_reinit_locks()" that I just created. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:07:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:07:35 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() In-Reply-To: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> Message-ID: <1585328855.67.0.639997905041.issue40091@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-40089 "Add _at_fork_reinit() method to locks". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:16:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:16:55 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child Message-ID: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> New submission from STINNER Victor : At fork, Python calls PyOS_AfterFork_Child() in the child process which indirectly calls _PyThreadState_DeleteExcept() whichs calls release_sentinel() of the thread which releases the thread state lock (threading.Thread._tstate_lock). Problem: using a lock after fork is unsafe and can crash. That's exactly what happens randomly on AIX when stressing ThreadJoinOnShutdown.test_reinit_tls_after_fork() of test_threading: https://bugs.python.org/issue40068#msg365031 There are different options to solve this issue: * Reset _tstate_lock before using it... not sure that it's worth it, since we are going to delete the threading.Thread object with its _tstate_lock object anymore. After calling fork, the child process has exactly 1 thread: all other threads have been removed. * Modify release_sentinel() to not use the lock: avoid PyThread_release_lock() call. ---------- components: Interpreter Core messages: 365173 nosy: vstinner priority: normal severity: normal status: open title: Crash in _PyThreadState_DeleteExcept() at fork in the process child versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:17:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:17:50 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585329470.2.0.608956238577.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: I created 3 follow-up issues: * bpo-40089: Add _at_fork_reinit() method to locks * bpo-40091: Crash in logging._after_at_fork_child_reinit_locks() * bpo-40092: Crash in _PyThreadState_DeleteExcept() at fork in the process child ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:18:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:18:10 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1585329490.84.0.174076959617.issue40092@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-40089: "Add _at_fork_reinit() method to locks". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:18:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:18:23 +0000 Subject: [issue40089] Add _at_fork_reinit() method to locks In-Reply-To: <1585324297.97.0.65509955463.issue40089@roundup.psfhosted.org> Message-ID: <1585329503.96.0.542636338695.issue40089@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-40092: "Crash in _PyThreadState_DeleteExcept() at fork in the process child". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:23:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:23:19 +0000 Subject: [issue39984] Move pending calls from _PyRuntime to PyInterpreterState In-Reply-To: <1584406401.63.0.604728519645.issue39984@roundup.psfhosted.org> Message-ID: <1585329799.56.0.735161181096.issue39984@roundup.psfhosted.org> STINNER Victor added the comment: > Awesome! Thanks for doing this, Victor. I'll take a look when I can and adjust the changes for bpo-33608. If you'll recall, I made a similar change as part of the solution for that issue, which we later reverted due to problems we discovered with daemon threads during runtime finalization. I recall the revert dance, yeah. It took one year to fix the daemon threads and related issues! So far, buildbots look happy. I also ran many manual tests which makes me confident that the code is now reliable even with all recent changes done for isolating thread states. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:31:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 17:31:30 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1585330290.42.0.544757974959.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: > Having interpreters interfering with each other's objects is almost certain to lead to race conditions. To be honest, I don't understand the purpose of this issue. Some messages are talking about pending calls, some others are talking about channels, and a few are talking about "shared" objects. Can someone either clarify the exact intent of this issue, or close this one and create a new issue with a clear explanation of what should be done and why? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 13:47:46 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Fri, 27 Mar 2020 17:47:46 +0000 Subject: [issue40090] The referenced RFC for the json module should be corrected to rfc8259 In-Reply-To: <1585326220.2.0.0601154076392.issue40090@roundup.psfhosted.org> Message-ID: <1585331266.74.0.463698304587.issue40090@roundup.psfhosted.org> Change by Ama Aje My Fren : ---------- keywords: +patch pull_requests: +18558 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 14:00:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 18:00:32 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() In-Reply-To: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> Message-ID: <1585332032.99.0.485876941409.issue40091@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18559 pull_request: https://github.com/python/cpython/pull/19195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 14:14:42 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 27 Mar 2020 18:14:42 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585332882.8.0.998513474662.issue40018@roundup.psfhosted.org> Charalampos Stratakis added the comment: And there is already a meta-issue created by cheimes for 3.0.0: https://bugs.python.org/issue38820 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 14:15:47 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 27 Mar 2020 18:15:47 +0000 Subject: [issue40084] HTTPStatus has incomplete dir() listing In-Reply-To: <1585293405.13.0.478935860244.issue40084@roundup.psfhosted.org> Message-ID: <1585332947.04.0.803826052243.issue40084@roundup.psfhosted.org> Ethan Furman added the comment: Adding to the existing dir() is as easy as writing one's own __dir__. I think using the instance dict and omitting any keys with a leading underscore will do the right thing most of the time. The fix should into `Enum` and not just `IntEnum` as other enumerations could also have extra attributes. ---------- assignee: -> ethan.furman keywords: +newcomer friendly stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 14:53:19 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 18:53:19 +0000 Subject: [issue39325] Original window focus when opening IDLE by double clicking Python file Mac In-Reply-To: <1578965041.32.0.467720102462.issue39325@roundup.psfhosted.org> Message-ID: <1585335199.58.0.0880389192383.issue39325@roundup.psfhosted.org> Terry J. Reedy added the comment: Ned, I believe that this issue results from peculiarities of how macOS runs apps. Insight from you would be appreciated. macOS Sierra 10.2.8?, Python 3.7.3 (Did you use python.org installer?) On my Win10, multiple IDLE windows are cascaded to the right and down. Each window opened gets the focus until the focus is moved. So on startup, the last window opened ends up with the focus. 'python -m idlelib tem tem2' opens tem and then tem2. 'python -m idlelib -i tem' opens tem then a shell. The order is set in pyshell.main(), where sys.args is parsed to set boolean enable_edit and enable_shell. Then 'if enable_edit: ...' and 'if enable_shell: ...' execute. I presume that the logic is that if one wants to immediately edit and run an existing file, there is little reason pass args to cause a shell opened also. I watched your video a couple of times. It appears to show Shell being opened first (with the focus) and then an editor being opened on top of it, but without getting the focus. AFAIK, both are impossible. One possible interpretation: editor and shell are opened in the normal order, with the editor somehow not appearing. Then macOS intervenes to lift the editor above the shell, but without shifting the focus. Or macOS intervenes some other way. Or the specific tk in use on macOS has some undocumented macOS-specific behavior. (The tcl/tk folk claim that 8.6.10 follows the doc better.) In all these cases, IDLE's code is not responsible. If you want to chase down the details, add some logging to pyshell.main. The root problem is asking IDLE to open a shell. For me, 'python -m idlelib tem' only opens tem without a shell. Ditto for right-click 'Edit with IDLE'. Can you tell what command is used to start IDLE with double clicks? Can you change it to not open Shell? Also, does updating to 3.7.7 (recommended) change anything? I am inclined to close this as a 3rd party or non-bug issue, but will wait a bit for Ned to comment. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:00:00 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 19:00:00 +0000 Subject: [issue39133] threading lib. working improperly on idle window In-Reply-To: <1577295685.26.0.995462727475.issue39133@roundup.psfhosted.org> Message-ID: <1585335600.55.0.372094722827.issue39133@roundup.psfhosted.org> Terry J. Reedy added the comment: Insufficient information to determine even if there is a bug. ---------- resolution: -> later stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:02:57 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 27 Mar 2020 19:02:57 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585335777.8.0.225859333764.issue40045@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset 5f9c131c099d6675d1a9d0228497865488afd548 by Javad Mokhtari in branch 'master': bpo-40045: Make "dunder" method documentation easier to locate (#19153) https://github.com/python/cpython/commit/5f9c131c099d6675d1a9d0228497865488afd548 ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:03:06 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 19:03:06 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585335786.8.0.913290300164.issue40045@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +18560 pull_request: https://github.com/python/cpython/pull/19198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:03:14 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Mar 2020 19:03:14 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585335794.66.0.626679605695.issue40045@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18561 pull_request: https://github.com/python/cpython/pull/19199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:15:17 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 27 Mar 2020 19:15:17 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585336517.84.0.17976363527.issue40045@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset bb852266b77ffeeb09a42847c907829eec6d5cb5 by Miss Islington (bot) in branch '3.8': bpo-40045: Make "dunder" method documentation easier to locate (GH-19153) (GH-19198) https://github.com/python/cpython/commit/bb852266b77ffeeb09a42847c907829eec6d5cb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:17:18 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 19:17:18 +0000 Subject: [issue39325] Original window focus when opening IDLE by double clicking Python file Mac In-Reply-To: <1578965041.32.0.467720102462.issue39325@roundup.psfhosted.org> Message-ID: <1585336638.8.0.664231364205.issue39325@roundup.psfhosted.org> Terry J. Reedy added the comment: Double clicking in finder with current Mohave (10.14.6?) does same as described here. See Ned's comment (msg357667) for #38946. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:17:57 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 27 Mar 2020 19:17:57 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585336677.48.0.817274813885.issue40045@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset c3622b2dcc9278900a7e3cbef12edfa83a8728ed by Miss Islington (bot) in branch '3.7': bpo-40045: Make "dunder" method documentation easier to locate (GH-19153) (GH-19199) https://github.com/python/cpython/commit/c3622b2dcc9278900a7e3cbef12edfa83a8728ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:22:40 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 27 Mar 2020 19:22:40 +0000 Subject: [issue40045] Make "dunder" method documentation easier to locate In-Reply-To: <1584924633.15.0.655954011008.issue40045@roundup.psfhosted.org> Message-ID: <1585336960.07.0.49666183006.issue40045@roundup.psfhosted.org> Joannah Nanjekye added the comment: I think this is resolved. Someone can re-open if they feel discontent. Thanks @javadmokhtari for the patch. ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:23:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 19:23:20 +0000 Subject: [issue39325] Original window focus when opening IDLE by double clicking Python file Mac In-Reply-To: <1578965041.32.0.467720102462.issue39325@roundup.psfhosted.org> Message-ID: <1585337000.13.0.307616495359.issue39325@roundup.psfhosted.org> Terry J. Reedy added the comment: In mac Terminal, 'python3 -m idlelib tem.py' opens tem.py without shell, just as on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:24:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 19:24:52 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585337092.06.0.640035453222.issue40068@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:26:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 19:26:20 +0000 Subject: [issue38636] IDLE regression: toggle tabs and change indent width functions In-Reply-To: <1572383648.52.0.228001978432.issue38636@roundup.psfhosted.org> Message-ID: <1585337180.46.0.975652549027.issue38636@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 Mar 27 15:28:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 19:28:31 +0000 Subject: [issue38819] Redirecting stdout In-Reply-To: <1573882153.73.0.0661856769758.issue38819@roundup.psfhosted.org> Message-ID: <1585337311.13.0.501357042991.issue38819@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +Interpreter Core -IDLE title: The redirect -> Redirecting stdout _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:31:29 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 27 Mar 2020 19:31:29 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585337489.1.0.520640390324.issue39812@roundup.psfhosted.org> Antoine Pitrou added the comment: New changeset b61b818d916942aad1f8f3e33181801c4a1ed14b by Kyle Stanley in branch 'master': bpo-39812: Remove daemon threads in concurrent.futures (GH-19149) https://github.com/python/cpython/commit/b61b818d916942aad1f8f3e33181801c4a1ed14b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:31:42 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 27 Mar 2020 19:31:42 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585337502.33.0.0487796251166.issue39812@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 15:59:06 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Mar 2020 19:59:06 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1585339146.21.0.797682315094.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6467134307cf01802c9f1c0384d8acbebecbd400 by Miro Hron?ok in branch 'master': bpo-36543: What's new: Document how to replace xml.etree.cElementTree (GH-19188) https://github.com/python/cpython/commit/6467134307cf01802c9f1c0384d8acbebecbd400 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 16:01:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Mar 2020 20:01:59 +0000 Subject: [issue38804] Regular Expression Denial of Service in http.cookiejar In-Reply-To: <1573774680.03.0.864081161145.issue38804@roundup.psfhosted.org> Message-ID: <1585339319.85.0.0220710430508.issue38804@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +larry priority: normal -> release blocker versions: -Python 2.7, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 16:19:14 2020 From: report at bugs.python.org (David Miguel Susano Pinto) Date: Fri, 27 Mar 2020 20:19:14 +0000 Subject: [issue36085] Enable better DLL resolution In-Reply-To: <1550881737.58.0.129017089721.issue36085@roundup.psfhosted.org> Message-ID: <1585340354.11.0.162316970536.issue36085@roundup.psfhosted.org> David Miguel Susano Pinto added the comment: I have just found out that commit 2438cdf0e93 which added the winmode argument and the documentation for it disagree. Documentation states that default is zero while the real default in code is None. I have opened PR 19167 on github to address it ---------- message_count: 60.0 -> 61.0 nosy: +carandraug nosy_count: 14.0 -> 15.0 pull_requests: +18563 pull_request: https://github.com/python/cpython/pull/19167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 17:04:33 2020 From: report at bugs.python.org (Danijel) Date: Fri, 27 Mar 2020 21:04:33 +0000 Subject: [issue40049] tarfile cannot extract from stdin In-Reply-To: <1584978858.02.0.829307540722.issue40049@roundup.psfhosted.org> Message-ID: <1585343073.62.0.424863372091.issue40049@roundup.psfhosted.org> Danijel added the comment: For me, this patch solves my problems. Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 17:17:46 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Mar 2020 21:17:46 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585343866.6.0.969802902899.issue38002@roundup.psfhosted.org> Terry J. Reedy added the comment: You tried to run editor code and ran into a uncaught idle-process bug, which causes an exit. pyshell.ModifiedInterpreter.runcode: 760-1 if self.tkconsole.executing: self.interp.restart_subprocess() The immediate bug is that 'self' *is* the interpreter with the restart_subprocess method, so '.interp' needs to be deleted. An easy fix in itself. Puzzle 1 is that I expect that 'executing' should be true whenever Shell is not waiting for a response to '>>>', so that we should be seeing this often. But it is false when running tkinter code, when sleeping, and when waiting for input(prompt) response, so I don't know how it was ever true for you. I don't remember ever seeing this exception. I will look at the code that sets and resets it. Maybe the former is not being called when it should be. Puzzle 2 is that the subprocess *is* being restarted even with this code being (normally) skipped. Is it ever needed, even in the (unknown) circumstance that 'executing' is true? Or would that cause two restarts? This would be a new buglet, though preferable to the current exception exit. The easy fix may not be enough. 'executing' and other shell booleans are still set as 0 and 1. I may update these first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 19:21:42 2020 From: report at bugs.python.org (fireattack) Date: Fri, 27 Mar 2020 23:21:42 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early Message-ID: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> New submission from fireattack : Example ``` from concurrent.futures import ThreadPoolExecutor from time import sleep def wait_on_future(): sleep(1) print(f.done()) # f is not done obviously f2 = executor.submit(pow, 5, 2) print(f2.result()) sleep(1) executor = ThreadPoolExecutor(max_workers=100) f = executor.submit(wait_on_future) executor.shutdown(wait=True) ``` When debugging, it shows "cannot schedule new futures after shutdown": Exception has occurred: RuntimeError cannot schedule new futures after shutdown File "test2.py", line 7, in wait_on_future f2 = executor.submit(pow, 5, 2) According to https://docs.python.org/3/library/concurrent.futures.html, `shutdown(wait=True)` "[s]ignal the executor that it should free any resources that it is using when the currently pending futures are done executing". But when f2 is being submitted, f is not done yet, so executor shouldn't be shut down. ---------- components: Library (Lib) messages: 365194 nosy: fireattack priority: normal severity: normal status: open title: ThreadPoolExecutor with wait=True shuts down too early versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 19:29:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 23:29:47 +0000 Subject: [issue40094] Add os._wait_status_to_returncode() helper function Message-ID: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> New submission from STINNER Victor : os.wait() and os.waitpid() returns a "status" number which is not easy to return. It's made of two information: (how the process completed, value). The usual way to handle it is to use a code which looks like: if os.WIFSIGNALED(status): self.returncode = -os.WTERMSIG(status) elif os.WIFEXITED(status): self.returncode = os.WEXITSTATUS(status) elif os.WIFSTOPPED(status): self.returncode = -os.WSTOPSIG(status) else: raise Exception("... put your favorite error message here ...") It's not convenient to have to duplicate this code each time we have to handle a wait status. Moreover, WIFSTOPPED() is commonly treated as "the process was killed by a signal", whereas the process is still alive but was only stopped. WIFSTOPPED() should only happen when the process is traced (by ptrace), or if waitpid() was called with WUNTRACED option. The common case is not to trace a process or to use WUNTRACED. Moreover, if WIFSTOPPED() is true, the process is still alive and can continue its execution. It's bad to consider it as completed. The subprocess module has such bug: Popen._handle_exitstatus() returns -os.WSTOPSIG(sts) if os.WIFSTOPPED(sts) is true. On the other side, the pure Python implementation os._spawnvef() calls again waitpid() if WIFSTOPPED() is true. That sounds like a better behavior. while 1: wpid, sts = waitpid(pid, 0) if WIFSTOPPED(sts): continue elif WIFSIGNALED(sts): return -WTERMSIG(sts) elif WIFEXITED(sts): return WEXITSTATUS(sts) else: raise OSError("Not stopped, signaled or exited???") But I'm not sure how WIFSTOPPED() can be true, since this function creates a child process using os.fork() and it doesn't use os.WUNTRACED flag. I propose to add a private os._wait_status_to_returncode(status) helper function: --- os._wait_status_to_returncode(status) -> int Convert a wait() or waitpid() status to a returncode. If WIFEXITED(status) is true, return WEXITSTATUS(status). If WIFSIGNALED(status) is true, return -WTERMSIG(status). Otherwise, raise a ValueError. If the process is being traced or if waitpid() was called with WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true. This function must not be called if WIFSTOPPED(status) is true. --- I'm not sure if it's a good idea to add the helper as a private function. Someone may discover it and starts to use it. If we decide to make it public tomorrow, removing os._wait_status_to_returncode() would break code. Maybe it's better to directly a public function? But I'm not sure if it's useful, nor if the function name is good, nor if good to helper an function function directly in the os module. Maybe such helper should be added to shutil instead which is more the "high-level" flavor of the os module? I chose to add it to the os module for different reasons: * Existing code using os.WEXITSTATUS() and friends usually only uses the os module. * It's convenient to be able to use os._wait_status_to_returncode(status) in the subprocess module without adding a dependency (import) on the shutil module. * os.wait() and os.waitpid() live in the os module: it's convenient to have an helper functon in the same module. What do you think? * Is it worth it to add os._wait_status_to_returncode() helper function? * If you like the idea, propose a better name! * Should it remain private first? ---------- components: Library (Lib) messages: 365195 nosy: vstinner priority: normal severity: normal status: open title: Add os._wait_status_to_returncode() helper function versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 19:37:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Mar 2020 23:37:41 +0000 Subject: [issue40094] Add os._wait_status_to_returncode() helper function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585352261.69.0.0689794427342.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18564 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 19:56:39 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 27 Mar 2020 23:56:39 +0000 Subject: [issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows In-Reply-To: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> Message-ID: <1585353399.03.0.413425679789.issue28859@roundup.psfhosted.org> Steve Dower added the comment: Reminding us on here is helpful (for me, anyway). I just left a couple of suggestions to make sure we handle all the cases. It's important when you change or add tests that you make sure the test fails without your fix - otherwise it might not be testing the fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 20:09:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 28 Mar 2020 00:09:08 +0000 Subject: [issue40091] Crash in logging._after_at_fork_child_reinit_locks() In-Reply-To: <1585328563.49.0.978667613959.issue40091@roundup.psfhosted.org> Message-ID: <1585354148.79.0.932092133964.issue40091@roundup.psfhosted.org> STINNER Victor added the comment: By the way, I'm not sure about the error handling code path: for handler in _at_fork_reinit_lock_weakset: try: handler.createLock() except Exception as err: # Similar to what PyErr_WriteUnraisable does. print("Ignoring exception from logging atfork", instance, "._reinit_lock() method:", err, file=sys.stderr) Is it really a good idea to ignore such error? By the way, there is an obvious typo: "instance" name doesn't exist, it should be "handler" :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 20:39:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 28 Mar 2020 00:39:54 +0000 Subject: [issue36085] Enable better DLL resolution In-Reply-To: <1550881737.58.0.129017089721.issue36085@roundup.psfhosted.org> Message-ID: <1585355994.82.0.955371630842.issue36085@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 23:25:23 2020 From: report at bugs.python.org (Avram) Date: Sat, 28 Mar 2020 03:25:23 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585365923.73.0.603876474001.issue39966@roundup.psfhosted.org> Avram added the comment: They are documented. That said, the subsection section could use a header. https://docs.python.org/3/library/unittest.mock.html#magic-mock Patch looks good! Can't think of any other test scenarios right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 23:31:18 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 28 Mar 2020 03:31:18 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585366278.46.0.801675094924.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: It's supposed to raise an AttributeError if the attribute is not present. The previous case was that magicmethods were not wrapped returning configured values. So this conflicts with the documentation returning a default value when not present instead of raising an AttributeError. wraps: Item for the mock object to wrap. If wraps is not None then calling the Mock will pass the call through to the wrapped object (returning the real result). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped object (so attempting to access an attribute that doesn?t exist will raise an AttributeError). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 27 23:55:16 2020 From: report at bugs.python.org (Avram) Date: Sat, 28 Mar 2020 03:55:16 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585367716.37.0.028732170713.issue39966@roundup.psfhosted.org> Avram added the comment: Ah, I see, yes, the documentation is a bit inconsistent. What may make more sense for some magic methods is to call the underlying object and use the return value or raise any exception that occurs. For example: __bool__ return value is bool(mock._mock_wraps) __int__ return value is int(mock._mock_wraps) __lt__ return value is operator.lt(mock._mock_wraps, other) This would take care of several of them and provide more consistent behavior with the wrapped object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 00:00:02 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 28 Mar 2020 04:00:02 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585368002.85.0.813588630332.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > What may make more sense for some magic methods is to call the underlying object and use the return value or raise any exception that occurs. Sorry, isn't that what the previous issue did? It tries to return the wrapped object attribute and raises exception if attribute is not present. Using wrapped object attribute and falling back to default value means that it will always return a value but the user can't figure out if it's from wrapped object or the default value for the magic method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 00:18:49 2020 From: report at bugs.python.org (Avram) Date: Sat, 28 Mar 2020 04:18:49 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585369129.85.0.0666732056622.issue39966@roundup.psfhosted.org> Avram added the comment: That is not necessarily the same thing, hence why there was a bug. >>> hasattr(object, '__bool__') False >>> bool(object) True I think you may be right that magic methods shouldn't magically appear for wrapped objects, except those that do magically appear, like __bool__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 00:27:03 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 28 Mar 2020 04:27:03 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585369623.63.0.741138589485.issue39966@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the example I didn't know hasattr can return False to return a value when the magicmethod was accessed. I will wait for others opinion on this then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 01:31:04 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 05:31:04 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585373464.67.0.657467081158.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18565 pull_request: https://github.com/python/cpython/pull/19202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 01:39:16 2020 From: report at bugs.python.org (Avram) Date: Sat, 28 Mar 2020 05:39:16 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585373956.91.0.549691686903.issue39966@roundup.psfhosted.org> Avram added the comment: Honestly, I'm not sure if any of the other magic methods behave this way. It would take a little research or someone more familiar with it. Here's more info about how __bool__ behaves. https://docs.python.org/3/reference/datamodel.html#object.__bool__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 01:54:13 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 05:54:13 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585374853.03.0.660266334518.issue40077@roundup.psfhosted.org> Dong-hee Na added the comment: > And I would prefer to first see the overhead of PyType_FromSpec(), and discuss the advantages and drawbacks. Should we stop the work until the overhead is measured? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 01:56:09 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 05:56:09 +0000 Subject: [issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots In-Reply-To: <1584546495.72.0.913336015216.issue40003@roundup.psfhosted.org> Message-ID: <1585374969.42.0.940889944243.issue40003@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 02:18:05 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 06:18:05 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585376285.37.0.712577088987.issue38002@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +18566 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 04:27:27 2020 From: report at bugs.python.org (Martynas Brijunas) Date: Sat, 28 Mar 2020 08:27:27 +0000 Subject: [issue40095] Incorrect st_ino returned for ReFS on Windows 10 Message-ID: <1585384047.06.0.773958986435.issue40095@roundup.psfhosted.org> New submission from Martynas Brijunas : On a Windows 10 volume formatted with ReFS, pathlib.Path.stat() returns an incorrect value for "st_ino". The correct value returned by the OS: C:\Users>fsutil file queryfileid u:\test\test.jpg File ID is 0x00000000000029d500000000000004ae An incorrect value obtained with pathlib.Path.stat(): Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from pathlib import Path >>> hex(Path('U:/test/test.jpg').stat().st_ino) '0x4000000004ae29d5' The problem does *not* exist on an NTFS volume: C:\Users>fsutil file queryfileid o:\OneDrive\test\test.jpg File ID is 0x0000000000000000000300000001be39 >>> hex(Path('O:/OneDrive/test/test.jpg').stat().st_ino) '0x300000001be39' ---------- components: Library (Lib) messages: 365206 nosy: mbrijun at gmail.com priority: normal severity: normal status: open title: Incorrect st_ino returned for ReFS on Windows 10 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 05:39:22 2020 From: report at bugs.python.org (Eryk Sun) Date: Sat, 28 Mar 2020 09:39:22 +0000 Subject: [issue40095] Incorrect st_ino returned for ReFS on Windows 10 In-Reply-To: <1585384047.06.0.773958986435.issue40095@roundup.psfhosted.org> Message-ID: <1585388362.42.0.277825105207.issue40095@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:14:47 2020 From: report at bugs.python.org (Steve Dower) Date: Sat, 28 Mar 2020 12:14:47 +0000 Subject: [issue40095] Incorrect st_ino returned for ReFS on Windows 10 In-Reply-To: <1585384047.06.0.773958986435.issue40095@roundup.psfhosted.org> Message-ID: <1585397687.32.0.755940175621.issue40095@roundup.psfhosted.org> Steve Dower added the comment: There's no guarantee that st_ino will be the same as any other queryable value. Only that it will (hopefully) be unique on that disk. stat() on Windows is just an approximation of stat() from POSIX - it's not a reliable way of reading Windows-specific filesystems. If you can generate a collision, it may be worth investing in a solution. Otherwise, if you have a specific need to get the same file ID as fsutil, you should probably go to the native API yourself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:19:57 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 28 Mar 2020 12:19:57 +0000 Subject: [issue40096] Support _Py_NO_RETURN on XLC Message-ID: <1585397997.42.0.0757475150087.issue40096@roundup.psfhosted.org> New submission from Batuhan Taskaya : Like clang and gcc, __attribute__(noreturn) can be used in xlc too for AIX. ---------- messages: 365208 nosy: BTaskaya priority: normal severity: normal status: open title: Support _Py_NO_RETURN on XLC type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:23:29 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 28 Mar 2020 12:23:29 +0000 Subject: [issue40096] Support _Py_NO_RETURN on XLC In-Reply-To: <1585397997.42.0.0757475150087.issue40096@roundup.psfhosted.org> Message-ID: <1585398209.5.0.490095473893.issue40096@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:23:45 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 28 Mar 2020 12:23:45 +0000 Subject: [issue40096] Support _Py_NO_RETURN on XLC In-Reply-To: <1585397997.42.0.0757475150087.issue40096@roundup.psfhosted.org> Message-ID: <1585398225.88.0.17426077663.issue40096@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18567 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:32:39 2020 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 28 Mar 2020 12:32:39 +0000 Subject: [issue40086] test_etree is skipped in test_typing due to cElementTree removal In-Reply-To: <1585309015.87.0.51128301072.issue40086@roundup.psfhosted.org> Message-ID: <1585398759.92.0.101746289237.issue40086@roundup.psfhosted.org> Ivan Levkivskyi added the comment: New changeset 34b0598295284e3ff6cedf5c05e159ce1fa54d60 by Furkan ?nder in branch 'master': bpo-40086: Update/fix test_etree test case in test_typing (GH-19189) https://github.com/python/cpython/commit/34b0598295284e3ff6cedf5c05e159ce1fa54d60 ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 08:53:05 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 28 Mar 2020 12:53:05 +0000 Subject: [issue40086] test_etree is skipped in test_typing due to cElementTree removal In-Reply-To: <1585309015.87.0.51128301072.issue40086@roundup.psfhosted.org> Message-ID: <1585399985.44.0.503470307535.issue40086@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks @furkanonder for the patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 09:39:27 2020 From: report at bugs.python.org (R. David Murray) Date: Sat, 28 Mar 2020 13:39:27 +0000 Subject: [issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception In-Reply-To: <1584254384.28.0.0187140133308.issue39966@roundup.psfhosted.org> Message-ID: <1585402767.4.0.329329407853.issue39966@roundup.psfhosted.org> R. David Murray added the comment: My guess is that it isn't so much that __bool__ is special, as that the evaluation of values in a boolean context is special. What you have to do to make a mock behave "correctly" in the face that I'm not sure (I haven't investigated). And I might be wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 10:12:28 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 28 Mar 2020 14:12:28 +0000 Subject: [issue8901] Windows registry path not ignored with -E option In-Reply-To: <1275705565.03.0.753930892849.issue8901@psf.upfronthosting.co.za> Message-ID: <1585404748.8.0.119610463229.issue8901@roundup.psfhosted.org> Zackery Spytz added the comment: Steve, I've updated the pull request with the requested change. Please take a look. ---------- nosy: +ZackerySpytz versions: +Python 3.9 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 10:46:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Mar 2020 14:46:54 +0000 Subject: [issue15987] Provide a way to compare AST nodes for equality recursively In-Reply-To: <1348166637.22.0.281544835659.issue15987@psf.upfronthosting.co.za> Message-ID: <1585406814.54.0.821955725136.issue15987@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am not sure that implementing a rich comparison of AST nodes is the right way. There are too much options (compare attributes or not, compare recursively or not, compare types or not) and __eq__ does not support options. In addition, it requires implementing compatible __hash__, but how do you implement a hash of mutable object? In addition, recursive comparison can introduce a regression in existing code -- instead of fast returning False the comparison will spent a nontrivial amount of time. If implement a comparison of AST nodes, it should be a separate function which support multiple options. Would be nice also to have examples where this feature can be used before implementing it. See also issue37792. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 10:57:07 2020 From: report at bugs.python.org (Eryk Sun) Date: Sat, 28 Mar 2020 14:57:07 +0000 Subject: [issue40095] Incorrect st_ino returned for ReFS on Windows 10 In-Reply-To: <1585384047.06.0.773958986435.issue40095@roundup.psfhosted.org> Message-ID: <1585407427.66.0.678568192152.issue40095@roundup.psfhosted.org> Eryk Sun added the comment: > C:\Users>fsutil file queryfileid u:\test\test.jpg > File ID is 0x00000000000029d500000000000004ae ReFS uses a 128-bit file ID, which I gather consists of a 64-bit directory ID and a 64-bit relative ID. (Take this with a grain of salt. AFAIK, Microsoft hasn't published a spec for ReFS.) The latter is 0 for the directory itself and increments by 1 for each file created in the directory, with no reuse of previous values if a file is deleted or moved. If that's correct, and if "test.jpg" was created in "\test", then the directory ID of "\test" is 0x29d5, and the relative file ID is 0x4ae. > >>> from pathlib import Path > >>> hex(Path('U:/test/test.jpg').stat().st_ino) > '0x4000000004ae29d5' os.stat calls WINAPI GetFileInformationByHandle, which returns a 64-bit file ID. It appears that ReFS generates this ID by concatenating the relative ID and directory ID in a way that is "not guaranteed to be unique" according to the BY_HANDLE_FILE_INFORMATION [1] docs. I haven't checked whether this 64-bit file ID can even be used successfully with OpenFileById [2]. It could be that ReFS simply fails an open-by-ID request unless it includes the full 128-bit ID (i.e. ExtendedFileIdType). You can request the 128-bit ID as a FILE_ID_128 record (an array of 16 bytes) via GetFileInformationByHandleEx: FileIdInfo [3][4]. Maybe os.stat should try to query the 128-bit ID and use it as st_ino (or st_ino_128) if it's available. However, looking into my crystal ball, I don't see this happening, unless someone makes a strong case in its favor. > The problem does *not* exist on an NTFS volume: > > C:\Users>fsutil file queryfileid o:\OneDrive\test\test.jpg > File ID is 0x0000000000000000000300000001be39 NTFS uses a 64-bit file ID, which consists of a 48-bit MFT record number and a 16-bit sequence number. The latter gets incremented when an MFT record is reused in order to detect stale references. In the above case, the 48-bit record number is 0x00000001be39, and the sequence number is 0x0003. [1]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information [2]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-openfilebyid [3]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex [4]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_info ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 11:24:16 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 28 Mar 2020 15:24:16 +0000 Subject: [issue15987] Provide a way to compare AST nodes for equality recursively In-Reply-To: <1348166637.22.0.281544835659.issue15987@psf.upfronthosting.co.za> Message-ID: <1585409056.79.0.392769612041.issue15987@roundup.psfhosted.org> Batuhan Taskaya added the comment: The solution to hashing used in PR 14970 was just using the default hashing function which is kind of a workaround to the real problem. I now concur with your comments. Will try to draft out an `ast.compare` function. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 11:24:32 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 15:24:32 +0000 Subject: [issue40024] Add _PyModule_AddType private helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585409072.19.0.963785434486.issue40024@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18568 pull_request: https://github.com/python/cpython/pull/19205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 11:31:06 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 15:31:06 +0000 Subject: [issue40024] Add PyModule_AddType helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585409466.33.0.678091842792.issue40024@roundup.psfhosted.org> Change by Dong-hee Na : ---------- title: Add _PyModule_AddType private helper function -> Add PyModule_AddType helper function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 11:31:30 2020 From: report at bugs.python.org (Furkan Onder) Date: Sat, 28 Mar 2020 15:31:30 +0000 Subject: [issue40086] test_etree is skipped in test_typing due to cElementTree removal In-Reply-To: <1585309015.87.0.51128301072.issue40086@roundup.psfhosted.org> Message-ID: <1585409490.24.0.705271895856.issue40086@roundup.psfhosted.org> Furkan Onder added the comment: @xtreak You're welcome :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:14:25 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Mar 2020 16:14:25 +0000 Subject: [issue40024] Add PyModule_AddType helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585412065.46.0.221194677031.issue40024@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner IMHO, we can close this issue after PR 19205 is merged. Most of use cases are replaced to PyModule_AddType. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:45:39 2020 From: report at bugs.python.org (Michael Lee) Date: Sat, 28 Mar 2020 16:45:39 +0000 Subject: [issue33129] Add kwarg-only option to dataclass In-Reply-To: <1521847997.9.0.467229070634.issue33129@psf.upfronthosting.co.za> Message-ID: <1585413939.46.0.59853309153.issue33129@roundup.psfhosted.org> Change by Michael Lee : ---------- nosy: +michael.lee nosy_count: 5.0 -> 6.0 pull_requests: +18569 pull_request: https://github.com/python/cpython/pull/19206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:46:51 2020 From: report at bugs.python.org (Michael Lee) Date: Sat, 28 Mar 2020 16:46:51 +0000 Subject: [issue33129] Add kwarg-only option to dataclass In-Reply-To: <1521847997.9.0.467229070634.issue33129@psf.upfronthosting.co.za> Message-ID: <1585414011.73.0.812014328184.issue33129@roundup.psfhosted.org> Michael Lee added the comment: Hello! I've submitted a PR based on this issue, since it seemed the most relevant from my searching of the backlog. Here's a link: https://github.com/python/cpython/pull/19206 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:51:28 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 16:51:28 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585414288.08.0.16647715446.issue38002@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 34a49aa3e4d023b5f9e9029f4f1ec68f1a8a8120 by Terry Jan Reedy in branch 'master': bpo-38002: Use False/True for IDLE pyshell bools (GH-19203) https://github.com/python/cpython/commit/34a49aa3e4d023b5f9e9029f4f1ec68f1a8a8120 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:51:59 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Mar 2020 16:51:59 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585414319.03.0.737428483093.issue38002@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18570 pull_request: https://github.com/python/cpython/pull/19207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 12:52:06 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Mar 2020 16:52:06 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585414326.51.0.876988061552.issue38002@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18571 pull_request: https://github.com/python/cpython/pull/19208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:13:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 28 Mar 2020 17:13:18 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585415598.27.0.337796590719.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: > Should we stop the work until the overhead is measured? Can you try to measure the _abc._abc_instancecheck() and _abc._abc_subclasscheck() functions performance before/after your change? Functions like register() are rarely call, so I don't care much of their performance (I expect a small overhead or no overhead). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:16:09 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Mar 2020 17:16:09 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585415769.63.0.59187683541.issue38002@roundup.psfhosted.org> miss-islington added the comment: New changeset 8c3ab189ae552401581ecf0b260a96d80dcdae28 by Miss Islington (bot) in branch '3.8': bpo-38002: Use False/True for IDLE pyshell bools (GH-19203) https://github.com/python/cpython/commit/8c3ab189ae552401581ecf0b260a96d80dcdae28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:18:16 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Mar 2020 17:18:16 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585415896.07.0.0243387000186.issue38002@roundup.psfhosted.org> miss-islington added the comment: New changeset cb758011ce39678fb03e8ac3e924d9084252e1ad by Miss Islington (bot) in branch '3.7': bpo-38002: Use False/True for IDLE pyshell bools (GH-19203) https://github.com/python/cpython/commit/cb758011ce39678fb03e8ac3e924d9084252e1ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:35:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 28 Mar 2020 17:35:28 +0000 Subject: [issue40094] Add os.status_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585416928.4.0.501687791386.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: Hum, I changed my mind and I think that it's worth it to make the function public. Moreover, I prefer "exitcode", since it is closer to "WEXITSTATUS" name than "returncode". So I renamed the function os.status_to_exitcode(). Advantages of the new new function compared to exiting code: * the function guarantee that result >= 0 means that the process exited and result < 0 means that the process exited due to a signal (was killed by a signal) * the function raises a well defined exception (ValueError) if the WIFSTOPPED() is true or if the status is unknown: it prevents to misuse WIFSTOPPED() ---------- title: Add os._wait_status_to_returncode() helper function -> Add os.status_to_exitcode() function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:44:18 2020 From: report at bugs.python.org (Andy Lester) Date: Sat, 28 Mar 2020 17:44:18 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585417458.59.0.576851158472.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18572 pull_request: https://github.com/python/cpython/pull/19209 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 13:50:49 2020 From: report at bugs.python.org (Andy Lester) Date: Sat, 28 Mar 2020 17:50:49 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585417849.67.0.569963149126.issue39943@roundup.psfhosted.org> Change by Andy Lester : ---------- pull_requests: +18573 pull_request: https://github.com/python/cpython/pull/19210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 14:12:54 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 28 Mar 2020 18:12:54 +0000 Subject: [issue15987] Provide a way to compare AST nodes for equality recursively In-Reply-To: <1348166637.22.0.281544835659.issue15987@psf.upfronthosting.co.za> Message-ID: <1585419174.16.0.550760288117.issue15987@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +18574 pull_request: https://github.com/python/cpython/pull/19211 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 14:42:57 2020 From: report at bugs.python.org (=?utf-8?q?Maximilian_N=C3=B6the?=) Date: Sat, 28 Mar 2020 18:42:57 +0000 Subject: [issue23574] datetime: support leap seconds In-Reply-To: <1425393743.39.0.519990063132.issue23574@psf.upfronthosting.co.za> Message-ID: <1585420977.18.0.809026080165.issue23574@roundup.psfhosted.org> Maximilian N?the added the comment: Could this be revisited? Especially now that datetime supports `fromisoformat`, as there are valid ISO8601 timestamps in UTC out there, that contain the leap seconds, e.g. files describing when those occured or will occur. E.g. the NTP Leap second file: https://kb.meinbergglobal.com/kb/time_sync/ntp/configuration/ntp_leap_second_file This get's synced on linux to `/usr/share/zoneinfo/leapseconds` and could even be used by python to lookup when leap seconds occured. The datetime also gained a fold argument, which if it is not wanted to support second values of 60 to at least be able to parse those. The 60th second of a minute is a reality with our current civil time keeping, so python should be able to handle it. ---------- nosy: +maxnoe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 14:51:42 2020 From: report at bugs.python.org (Guy Kogan) Date: Sat, 28 Mar 2020 18:51:42 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 Message-ID: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> New submission from Guy Kogan : Python 3.8 Queue module is unable to handle the expection: error: Exception in thread Thread-5: Traceback (most recent call last): File "FTP_multithreading.py", line 17, in run new_connection = self.queue.get(timeout=2) File "/usr/local/lib/python3.8/queue.py", line 178, in get raise Empty _queue.Empty During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "FTP_multithreading.py", line 18, in run except queue.Empty: AttributeError: 'Queue' object has no attribute 'Empty' b'220 ns.iren.ru FTP server (Version wu-2.6.2(1) Fri Sep 12 08:50:43 IRKST 2008) ready.\r\n' Exception in thread Thread-4: Traceback (most recent call last): File "FTP_multithreading.py", line 17, in run new_connection = self.queue.get(timeout=2) File "/usr/local/lib/python3.8/queue.py", line 178, in get raise Empty _queue.Empty When the Last task is done the exception queue.Empty should occur while handling the exception another exception is occurred. ---------- files: FTP_Code_queue.py messages: 365225 nosy: Python_dev_IL priority: normal severity: normal status: open title: Queue.Empty issue - Python3.8 type: crash versions: Python 3.8 Added file: https://bugs.python.org/file49005/FTP_Code_queue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 15:12:33 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 28 Mar 2020 19:12:33 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 In-Reply-To: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> Message-ID: <1585422753.94.0.174490087621.issue40097@roundup.psfhosted.org> Raymond Hettinger added the comment: There's an error in your code: import queue # loads the standard library queue module ... queue = queue.Queue() # reassign queue to an instance of Queue ... except queue.Empty: # expects "queue" the module, not the instance ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 15:47:28 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Mar 2020 19:47:28 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object Message-ID: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> New submission from Serhiy Storchaka : Due to the difference in the code of __getattr__ and __dir__ for object and type dir() does not return the list of valid attributes for the object. It can return a name which is not a valid attribute and miss a name of the valid attribute. 1. It does not support metaclasses. class M(type): x = 1 class A(metaclass=M): pass assert hasattr(A, 'x') assert 'x' not in dir(A) 2. It does not use __mro__, but uses __bases__ recursively. class M(type): def mro(cls): if cls.__name__ == 'A': return cls, B return cls, class B(metaclass=M): x = 1 class A(metaclass=M): pass assert hasattr(A, 'x') assert 'x' not in dir(A) 3. It uses the __dict__ attribute instead of the instance dict (they can be different). class A: @property def __dict__(self): return {'x': 1} assert not hasattr(A(), 'x') assert 'x' in dir(A()) 4. It uses the __class__ attribute instead of type(). class B: y = 2 class A: x = 1 @property def __class__(self): return B assert hasattr(A, 'x') assert not hasattr(A, 'y') assert hasattr(A(), 'x') assert not hasattr(A(), 'y') assert 'x' in dir(A) assert 'y' not in dir(A) assert 'x' not in dir(A()) assert 'y' in dir(A()) 4.1. As a side effect dir() creates an instance dictionary if it was not initialized yet (for memory saving). It is possible to make these implementations of __dir__() returning exactly what the corresponding __getattr__() accepts, not more and not less. The code will even be much simpler. But is it what we want? ---------- components: Interpreter Core messages: 365227 nosy: gvanrossum, serhiy.storchaka, tim.peters priority: normal severity: normal status: open title: dir() does not return the list of valid attributes for the object type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 16:13:28 2020 From: report at bugs.python.org (Martynas Brijunas) Date: Sat, 28 Mar 2020 20:13:28 +0000 Subject: [issue40095] Incorrect st_ino returned for ReFS on Windows 10 In-Reply-To: <1585407427.66.0.678568192152.issue40095@roundup.psfhosted.org> Message-ID: Martynas Brijunas added the comment: Hi Steve, Eryk, thank you very much for looking into this. I was looking into "st_ino" as a potential substitute of a full path of a file when it comes to uniquely identifying that file in a database. > ReFS uses a 128-bit file ID, which I gather consists of a 64-bit directory ID and a 64-bit relative ID. (Take this with a grain of salt. AFAIK, Microsoft hasn't published a spec for ReFS.) The latter is 0 for the directory itself and increments by 1 for each file created in the directory, with no reuse of previous values if a file is deleted or moved. If that's correct, and if "test.jpg" was created in "\test", then the directory ID of "\test" is 0x29d5, and the relative file ID is 0x4ae. This assumption seems to be correct. All files within the same directory have identical first half of their ID, as reported by "fsutil". U:\test>fsutil file queryfileid test.jpg File ID is 0x00000000000029d500000000000004ae U:\test>fsutil file queryfileid test.nef File ID is 0x00000000000029d50000000000000483 U:\test>fsutil file queryfileid test.ARW File ID is 0x00000000000029d50000000000000484 U:\test>fsutil file queryfileid test.db File ID is 0x00000000000029d50000000000000495 > > > >>> from pathlib import Path > > >>> hex(Path('U:/test/test.jpg').stat().st_ino) > > '0x4000000004ae29d5' > > os.stat calls WINAPI GetFileInformationByHandle, which returns a 64-bit file ID. It appears that ReFS generates this ID by concatenating the relative ID and directory ID in a way that is "not guaranteed to be unique" according to the BY_HANDLE_FILE_INFORMATION [1] docs. The feedack from "st_ino" appears to be in total sync with "fsutil". The only real difference (apart for the for the missing leading zeros in each half) is the inclusion of a hex "4" at the very beginning of the hex sequence. But even that is consistent as the "4" is present in all cases. >>> hex(Path('U:/test/test.jpg').stat().st_ino) '0x4000000004ae29d5' >>> hex(Path('U:/test/test.nef').stat().st_ino) '0x40000000048329d5' >>> hex(Path('U:/test/test.arw').stat().st_ino) '0x40000000048429d5' >>> hex(Path('U:/test/test.db').stat().st_ino) '0x40000000049529d5' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 16:27:02 2020 From: report at bugs.python.org (Guy Kogan) Date: Sat, 28 Mar 2020 20:27:02 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 In-Reply-To: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> Message-ID: <1585427222.65.0.531665514084.issue40097@roundup.psfhosted.org> Guy Kogan added the comment: I still dont understand what do you mean? Can you please elaborate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 16:35:34 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 28 Mar 2020 20:35:34 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 In-Reply-To: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> Message-ID: <1585427734.12.0.415999313772.issue40097@roundup.psfhosted.org> Tim Peters added the comment: Raymond is talking about the cause of this error in what you showed: AttributeError: 'Queue' object has no attribute 'Empty' The exception you're _trying_ to catch is "queue.Empty", where "queue" is the queue _module_. But you rebound the name "queue" to an instance of the queue.Queue class. As the AttributeError message says, an instance of that class has no "Empty" attribute. You need to change this line: queue = queue.Queue() Pick a different name, so the _intended_ "queue.Queue" still works. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 16:36:46 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 28 Mar 2020 20:36:46 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 In-Reply-To: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> Message-ID: <1585427806.32.0.780049452602.issue40097@roundup.psfhosted.org> Tim Peters added the comment: > ... so the _intended_ "queue.Queue" still works. Oops. Of course that should have said: > ... so the _intended_ "queue.Empty" still works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 17:18:46 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 21:18:46 +0000 Subject: [issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) In-Reply-To: <1585026386.04.0.352572849659.issue40051@roundup.psfhosted.org> Message-ID: <1585430326.69.0.566997856874.issue40051@roundup.psfhosted.org> Terry J. Reedy added the comment: Lib/lib2to3 is a directory with __init__.py containing ### empty Unlike most python-coded modules, there is no Doc/library/lib2to3.rst and hence no generated lib2to3.html. Instead, there is a 2to3.rst and 2to3.html. In the module index, module xyz is usually linked to .../library/xyz.html#module-xyz. But lib2to3 is somewhere linked instead to .../library/2to3.html#module-lib2to3. As implied by the changed title, this issue is not at all unique to lib2to3. Just as lib2to3 implements the command line app 2to3, with 2to3.rst, idlelib implements IDLE with idle.rst. Turtle demo is domumented within turtle.rst. Most tkinter submodule have no doc other than a mention within tkinter.rst. These could perhaps have a # module-tkinter.xyz target added. (I am not familiar with exactly how.) But there are also the numerous test modules that have no doc, and the generated doc for these is less useful than the code itself. Possible solutions framed in terms of lib2to3: 1. Manual redirection: add lib2to3.rst and hence lib2to3.html with the correct url, possibly with additional text. But this is not the only module documented within a file with another name, and would not work for things like test files that should not be documented. 2. Auto redirection: persuade whoever manages docs.python.org to add a redirection for lib2to3. Fragile. 3. Hardcode the exception in the help output generation. The latter is generated by pydoc.help. The module doc location under MODULE REFERENCE is generated by pydoc.Doc.getdocloc. This function already has a couple of (probably obsolete) tuples of exceptions, so adding more seems OK. The oddity is that .html is added if and only if the doc location does not start with 'http'. lines 414-417.I think that this is backwards. It only works because docs.python.org adds missing .html, even to "https://docs.python.org/3.8/library/2to3#module-lib2to3", which is why the bug? has not been noticed. Note that by default, docloc starts with 'https://', so by default, .html is omitted. Skip, David, and Martin, you have all modified this part of the code. Do any of you disagree that there is a bug? ---------- components: -2to3 (2.x to 3.x conversion tool) nosy: +martin.panter, r.david.murray, skip.montanaro, terry.reedy stage: -> needs patch title: Dead link in help(lib2to3) -> Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) type: performance -> behavior versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 18:00:45 2020 From: report at bugs.python.org (Guy Kogan) Date: Sat, 28 Mar 2020 22:00:45 +0000 Subject: [issue40097] Queue.Empty issue - Python3.8 In-Reply-To: <1585421502.46.0.860098534769.issue40097@roundup.psfhosted.org> Message-ID: <1585432845.91.0.208306026205.issue40097@roundup.psfhosted.org> Guy Kogan added the comment: Thanks Tim Peters and Raymond Hettinger, the issue has been resolved. Have a nice day! ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 18:37:37 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 22:37:37 +0000 Subject: [issue40056] more user-friendly turtledemo In-Reply-To: <1585080915.97.0.255153547178.issue40056@roundup.psfhosted.org> Message-ID: <1585435057.72.0.48017801689.issue40056@roundup.psfhosted.org> Terry J. Reedy added the comment: Enhancements are not usually backported. 1. The underscores are in entries such as 'minimal_hanoi' in the Examples drop-down submenu. Changing to spaces should not hurt anything. 2. Already possible (maybe): Help => Turtledemo help has (2) How to add your own demos to the demo repository which discusses requirements for turtle code run in the demo framework. (However, users may not be able to add files to the turtledemo directory -- Demo/turtle in 2.x, Lib/turtledemo in 3.x.) Any alternative should direct users to these requirements. What is your proposed alternative mechanism? Why is it better than a user copying __main__.py and turtle.cfg into their own directory of turtle scripts? (Perhaps this option should also be mentioned as (3) How to add turtledemo to your directory.) ---------- nosy: +terry.reedy versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 18:46:44 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 22:46:44 +0000 Subject: [issue40075] _tkinter PythonCmd fails to acquire GIL In-Reply-To: <1585224969.87.0.649895216825.issue40075@roundup.psfhosted.org> Message-ID: <1585435604.89.0.00513556737107.issue40075@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 18:51:21 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 22:51:21 +0000 Subject: [issue40087] How to Uninstall Python3.7.3 using cmd? In-Reply-To: <1585311431.71.0.879589746848.issue40087@roundup.psfhosted.org> Message-ID: <1585435881.65.0.504987574291.issue40087@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is for improving future releases of CPython. Questions about using current python should be directed elsewhere, such as python-list. You already did that and got Windows-specific answers. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 19:02:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 23:02:10 +0000 Subject: [issue40088] list.reverse(): slow sublist reverse In-Reply-To: <1585312537.41.0.422024804139.issue40088@roundup.psfhosted.org> Message-ID: <1585436530.21.0.81920390331.issue40088@roundup.psfhosted.org> Terry J. Reedy added the comment: The previous issue was also about .sort and Raymond's rejection was mostly about .sort. I will let him comment about whether the speedup moves him at all. Yury, please say something about your use case. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 19:09:49 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Mar 2020 23:09:49 +0000 Subject: [issue40090] The referenced RFC for the json module should be corrected to rfc8259 In-Reply-To: <1585326220.2.0.0601154076392.issue40090@roundup.psfhosted.org> Message-ID: <1585436989.78.0.0985203900739.issue40090@roundup.psfhosted.org> Terry J. Reedy added the comment: The header for 8259 says "Obsoletes: 7159" (December 2017) and the header for 7159 agrees: "Obsoleted by: 8259". But... to the extent that there is any difference, which document better describes the behavior of our json module? Does it need to be updated along with a doc change? ---------- nosy: +ezio.melotti, rhettinger, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 20:02:38 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Sun, 29 Mar 2020 00:02:38 +0000 Subject: [issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI In-Reply-To: <1517129650.59.0.467229070634.issue32692@psf.upfronthosting.co.za> Message-ID: <1585440158.4.0.724174314068.issue32692@roundup.psfhosted.org> Kubilay Kocak added the comment: Seeing the following on the freebsd CURRENT bb: ====================================================================== FAIL: test_set_and_clear (test.test_threading.EventTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.8.koobs-freebsd-9e36.nondebug/build/Lib/test/lock_tests.py", line 418, in test_set_and_clear self.assertEqual(results, [True] * N) AssertionError: Lists differ: [False, False, False, True, True] != [True, True, True, True, True] First differing element 0: False True - [False, False, False, True, True] + [True, True, True, True, True] ---------------------------------------------------------------------- Ran 168 tests in 29.254s FAILED (failures=1) test test_threading failed Full log attached ---------- nosy: +koobs Added file: https://bugs.python.org/file49006/freebsd-current-non-debug-3.8-build-176.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 20:43:04 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 00:43:04 +0000 Subject: [issue39780] Add HTTP Response code 103 In-Reply-To: <1582850553.98.0.0461428688103.issue39780@roundup.psfhosted.org> Message-ID: <1585442584.93.0.71969005282.issue39780@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 21:49:38 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Sun, 29 Mar 2020 01:49:38 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1585446578.9.0.276335884884.issue39982@roundup.psfhosted.org> Kubilay Kocak added the comment: koobs-freebsd-564d (CURRENT) BB has been updated past https://svnweb.freebsd.org/base?view=revision&revision=359302 test_socket is no longer failing ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 21:57:43 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 29 Mar 2020 01:57:43 +0000 Subject: [issue40088] list.reverse(): slow sublist reverse In-Reply-To: <1585312537.41.0.422024804139.issue40088@roundup.psfhosted.org> Message-ID: <1585447063.15.0.622898741254.issue40088@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion, but the need isn't common enough to warrant an API expansion. If this were a popular operation, it might be worth optimizing, the need almost never arises. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:05:45 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 02:05:45 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585447545.82.0.280168847591.issue40077@roundup.psfhosted.org> Dong-hee Na added the comment: It shown 1% slower for performance. +--------------------------+-----------------+----------------------------+ | Benchmark | master-subclass | bpo-40077-subclass | +==========================+=================+============================+ | bench _abc_subclasscheck | 295 ns | 300 ns: 1.01x slower (+1%) | +--------------------------+-----------------+----------------------------+ +--------------------------+-------------------+----------------------------+ | Benchmark | master-isinstance | bpo-40077-isinstance | +==========================+===================+============================+ | bench _abc_instancecheck | 229 ns | 232 ns: 1.01x slower (+1%) | +--------------------------+-------------------+----------------------------+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:06:38 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 02:06:38 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585447598.96.0.157620600144.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : Added file: https://bugs.python.org/file49007/bench_isinstance_check.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:06:47 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 02:06:47 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585447607.13.0.450089093997.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : Added file: https://bugs.python.org/file49008/bench_subclass_check.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:07:21 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 02:07:21 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585447641.22.0.303707434426.issue40077@roundup.psfhosted.org> Dong-hee Na added the comment: > Can you try to measure the _abc._abc_instancecheck() and _abc._abc_subclasscheck() I 've submitted the benchmark :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:26:49 2020 From: report at bugs.python.org (gaoxinge) Date: Sun, 29 Mar 2020 02:26:49 +0000 Subject: [issue40099] modify code format of json library for pep7,8 Message-ID: <1585448809.29.0.0599404433077.issue40099@roundup.psfhosted.org> Change by gaoxinge : ---------- components: Library (Lib) nosy: gaoxinge priority: normal pull_requests: 18575 severity: normal status: open title: modify code format of json library for pep7,8 type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 22:59:42 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 29 Mar 2020 02:59:42 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585450782.56.0.0872814417547.issue40018@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 23:31:23 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 29 Mar 2020 03:31:23 +0000 Subject: [issue40099] modify code format of json library for pep7,8 Message-ID: <1585452683.63.0.725365336087.issue40099@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : PEP 8 changes and cosmetic changes PR are discouraged since they will make git history less useful. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 28 23:32:06 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 29 Mar 2020 03:32:06 +0000 Subject: [issue40099] modify code format of json library for pep7,8 In-Reply-To: <1585452683.63.0.725365336087.issue40099@roundup.psfhosted.org> Message-ID: <1585452726.26.0.49132447607.issue40099@roundup.psfhosted.org> Raymond Hettinger added the comment: Sorry, we usually don't accept these kinds of changes. Minor pep 7 and 8 updates cause code churn, aren't substantive, and are sometimes upto the judgment of the original implementer (for example, whether to add blank lines or whether to put parentheses around an expression. We usually make little improvements while actually doing substantive work on a module. Please do continue to contribute and aim your efforts towards fixing real bugs or implementing feature requests. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 00:56:12 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 29 Mar 2020 04:56:12 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585457772.21.0.0462879174888.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: I'm guessing this can be closed? ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 03:40:15 2020 From: report at bugs.python.org (wyz23x2) Date: Sun, 29 Mar 2020 07:40:15 +0000 Subject: [issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) In-Reply-To: <1585026386.04.0.352572849659.issue40051@roundup.psfhosted.org> Message-ID: <1585467615.61.0.330643852992.issue40051@roundup.psfhosted.org> wyz23x2 added the comment: My opinion: I think No.2 makes more sense to users that visit the docs directly by https://docs.python.org/3.8/library/lib2to3.html; they will copy the "docs.python.org/version/library/modulename.html" format from other modules. But I also agree it's fragile. No.3 is good too, according to me. Can use it if No.2 is too fragile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 04:29:07 2020 From: report at bugs.python.org (Alex) Date: Sun, 29 Mar 2020 08:29:07 +0000 Subject: [issue40100] Unexpected behavior when handling emoji under codec cp936 Message-ID: <1585470547.47.0.79695308507.issue40100@roundup.psfhosted.org> New submission from Alex <2423067593 at qq.com>: Python 3.8.2 IDLE has an unexpected behavior. When I insert an emoji into IDLE like '?'. Then I found I can't delete it(by typing backspace). When I type the left arrow then it became '??'(U+FFFD). Then I type the left arrow again, then it is '?' again! (When I use the delete button, or type the right button there aren't any bugs.) What's wrong? Also, when I have two emojis like '??', I press delete button between them, nothing happens; when I delete on the right, both of them disappear! (This bug seems not appears on plain 0.) ---------- assignee: terry.reedy components: IDLE messages: 365247 nosy: Alex-Python-Programmer, terry.reedy priority: normal severity: normal status: open title: Unexpected behavior when handling emoji under codec cp936 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 04:47:39 2020 From: report at bugs.python.org (hai shi) Date: Sun, 29 Mar 2020 08:47:39 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585471659.39.0.616118318136.issue40058@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +18576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 04:58:40 2020 From: report at bugs.python.org (hai shi) Date: Sun, 29 Mar 2020 08:58:40 +0000 Subject: [issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round' In-Reply-To: <1585101280.02.0.657415835319.issue40058@roundup.psfhosted.org> Message-ID: <1585472320.24.0.381834817702.issue40058@roundup.psfhosted.org> hai shi added the comment: > I believe it's a known problem with either `import_fresh_module` or `datetime` after removed the cleanup operation of `sys.modules` in PR19213, the testcases is successed in my local vm(I am not sure there have any other potential risks). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 05:03:10 2020 From: report at bugs.python.org (hai shi) Date: Sun, 29 Mar 2020 09:03:10 +0000 Subject: [issue40024] Add PyModule_AddType helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585472590.73.0.434951809492.issue40024@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 05:05:42 2020 From: report at bugs.python.org (hai shi) Date: Sun, 29 Mar 2020 09:05:42 +0000 Subject: [issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots In-Reply-To: <1584546495.72.0.913336015216.issue40003@roundup.psfhosted.org> Message-ID: <1585472742.73.0.584303615112.issue40003@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 06:42:25 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 10:42:25 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585478545.75.0.00410545402563.issue33725@roundup.psfhosted.org> Mouse added the comment: The fix applied for this problem actually broke multiprocessing on MacOS. The change to the new default 'spawn' from 'fork' causes program to crash in spawn.py with `FileNotFoundError: [Errno 2] No such file or directory`. I've tested this on MacOS Catalina 10.15.3 and 10.15.4, with Python-3.8.2 and Python-3.7.7. With Python-3.7.7 everything works as expected. Here's the output: {{{ $ python3.8 multi1.py Traceback (most recent call last): File "", line 1, in File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 126, in _main self = reduction.pickle.load(from_parent) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/synchronize.py", line 110, in __setstate__ self._semlock = _multiprocessing.SemLock._rebuild(*state) FileNotFoundError: [Errno 2] No such file or directory }}} Here's the program: {{{ #!/usr/bin/env python3 # # Test "multiprocessing" package included with Python-3.6+ # # Usage: # ./mylti1.py [nElements [nProcesses [tSleep]]] # # nElements - total number of integers to put in the queue # default: 100 # nProcesses - total number of parallel processes/threads # default: number of physical cores available # tSleep - number of milliseconds for a thread to sleep # after it retrieved an element from the queue # default: 17 # # Algorithm: # 1. Creates a queue and adds nElements integers to it, # 2. Creates nProcesses threads # 3. Each thread extracts an element from the queue and sleeps for tSleep milliseconds # import sys, queue, time import multiprocessing as mp def getElements(q, tSleep, idx): l = [] # list of pulled numbers while True: try: l.append(q.get(True, .001)) time.sleep(tSleep) except queue.Empty: if q.empty(): print(f'worker {idx} done, got {len(l)} numbers') return if __name__ == '__main__': nElements = int(sys.argv[1]) if len(sys.argv) > 1 else 100 nProcesses = int(sys.argv[2]) if len(sys.argv) > 2 else mp.cpu_count() tSleep = float(sys.argv[3]) if len(sys.argv) > 3 else 17 # Uncomment the following line to make it working with Python-3.8+ #mp.set_start_method('fork') # Fill the queue with numbers from 0 to nElements q = mp.Queue() for k in range(nElements): q.put(k) # Start worker processes for m in range(nProcesses): p = mp.Process(target=getElements, args=(q, tSleep / 1000, m)) p.start() }}} ---------- nosy: +mouse07410 type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 07:02:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 29 Mar 2020 11:02:24 +0000 Subject: [issue40100] IDLE: Undesired behavior of emoji in editor. In-Reply-To: <1585470547.47.0.79695308507.issue40100@roundup.psfhosted.org> Message-ID: <1585479744.93.0.215024224541.issue40100@roundup.psfhosted.org> Terry J. Reedy added the comment: Terminal codepages are irrelevant in the IDLE tk based gui. The problem is that windows codes astral chars as two surrogates. While tkinter can display them, after recent changes to _tkinter, the text widget cannot handle then properly when editing. This was explained in more detail on an earlier issue, but I will have to check if there is already an issue for fixing it. For editing, one should use unicode escapes, as in >>> print('\U0001f60d') ? Python in a Windows console prints the surrogates separately. and in IDLE, one will see a black-and_white version of the smiley. ---------- title: Unexpected behavior when handling emoji under codec cp936 -> IDLE: Undesired behavior of emoji in editor. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 07:11:15 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 11:11:15 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585480275.92.0.806613942126.issue33725@roundup.psfhosted.org> Mouse added the comment: Tried 'spawn', 'fork', 'forkserver'. - 'spawn' causes consistent `FileNotFoundError: [Errno 2] No such file or directory`; - 'fork' consistently works (tested on machines with 4 and 20 cores); - 'forkserver' causes roughly half of the processes to crash with `FileNotFoundError`, the other half succeeds (weird!). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 08:59:13 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 29 Mar 2020 12:59:13 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585486753.34.0.674418009401.issue33725@roundup.psfhosted.org> Mark Dickinson added the comment: @Mouse: see #28965. The fix for the code you show is to join the child processes before the main process starts exiting. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 10:12:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 14:12:19 +0000 Subject: [issue40024] Add PyModule_AddType helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585491139.85.0.02361313204.issue40024@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 016bdd519d76c282bbe0220c67a49226b6262638 by Dong-hee Na in branch 'master': bpo-40024: Update _elementtree to use PyModule_AddType() (GH-19205) https://github.com/python/cpython/commit/016bdd519d76c282bbe0220c67a49226b6262638 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 10:13:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 14:13:27 +0000 Subject: [issue40024] Add PyModule_AddType helper function In-Reply-To: <1584697189.32.0.684240851627.issue40024@roundup.psfhosted.org> Message-ID: <1585491207.06.0.508308622932.issue40024@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Dong-hee Na for fixing many reference leaks! I like the new PyModule_AddType() helper function. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 10:17:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 14:17:02 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585491422.71.0.959760650224.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: IMO 1.01x slower on a *microbenchmark* is not significant so it's ok. Thanks for checking. You pass a *type to isinstance() in bench_isinstance_check.py. You should pass *an instance* instead. Like (complete the (...) ;-)): runner.timeit(name="bench _abc_instancecheck", stmt="isinstance(obj, T)", setup = """from abc import ABC (...) obj = (1, 2, 3)""") Would you mind to fix your microbenchmark and re-run it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 10:23:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 14:23:53 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1585491833.97.0.0708556748164.issue39982@roundup.psfhosted.org> STINNER Victor added the comment: Wow wow wow, that's huge. Python helps to detect FreeBSD kernel bugs :-) Thanks a lot Kubilay Kocak! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 10:40:48 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Mar 2020 14:40:48 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585492848.02.0.978725816034.issue40077@roundup.psfhosted.org> Dong-hee Na added the comment: > You pass a *type to isinstance() in bench_isinstance_check.py. Thanks for the catch my mistake. The result is showing: Not significant (1): bench _abc_instancecheck ---------- Added file: https://bugs.python.org/file49009/bench_isinstance_check.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:02:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 15:02:17 +0000 Subject: [issue40094] Add os.status_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585494137.75.0.618531869318.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: I modified my PR to add Windows support. On Windows, os.waitpid() status also requires an operation (shif right by 8 bits) to get an exitcode from the waitpid status. So IMO it's worth it to add it to Windows as well, which makes the function even more useful ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:18:22 2020 From: report at bugs.python.org (gaoxinge) Date: Sun, 29 Mar 2020 15:18:22 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early In-Reply-To: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> Message-ID: <1585495102.16.0.626178232921.issue40093@roundup.psfhosted.org> gaoxinge added the comment: ``` from concurrent.futures import ThreadPoolExecutor from time import sleep def wait_on_future(): sleep(1) print(f.done()) # f is not done obviously f2 = executor.submit(pow, 5, 2) print(f2.result()) sleep(1) executor = ThreadPoolExecutor(max_workers=100) f = executor.submit(wait_on_future) executor.shutdown(wait=True) print(f.done()) # True print(f.result()) # raise errror: cannot schedule new futures after shutdown # print(f.exception()) ``` Actually `executor.shutdown(wait=True)` works, it really wait f to be done. ---------- nosy: +gaoxinge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:24:48 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 15:24:48 +0000 Subject: [issue40101] lib2to3 fails on default convert functionality Message-ID: <1585495488.9.0.817562542084.issue40101@roundup.psfhosted.org> New submission from Batuhan Taskaya : When using driver/parser without a custom convert function (like pyconvert.convert), it tries to assign used_names to the root node, which can be anything depending on the given convert function. If none given, it will be a tuple. >>> from lib2to3.pygram import python_grammar >>> from lib2to3.pgen2.driver import Driver >>> >>> d = Driver(grammar=python_grammar) >>> d.parse_string("test\n") Traceback (most recent call la Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/usr/local/lib/python3.9/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/usr/local/lib/python3.9/lib2to3/pgen2/parse.py", line 136, in addtoken self.pop() File "/usr/local/lib/python3.9/lib2to3/pgen2/parse.py", line 204, in pop self.rootnode.used_names = self.used_names AttributeError: 'tuple' object has no attribute 'used_names' ---------- components: Library (Lib) messages: 365260 nosy: BTaskaya priority: normal severity: normal status: open title: lib2to3 fails on default convert functionality versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:25:36 2020 From: report at bugs.python.org (gaoxinge) Date: Sun, 29 Mar 2020 15:25:36 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early In-Reply-To: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> Message-ID: <1585495536.96.9.43992032201e-05.issue40093@roundup.psfhosted.org> gaoxinge added the comment: The workflow is like below: - executor submit wait_on_future, and return the future f - executor call shutdown - executor submit pow (because executor already call shutdown, this submit will fail and raise a runtime error) - then fail above will cause work thread fail when running wait_on_future - then work thread will set both done singal and exception to f, which is the future of wait_on_future ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:29:48 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 15:29:48 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585495788.96.0.753477487527.issue33725@roundup.psfhosted.org> Mouse added the comment: @mark.dickinson, the issue you referred to did not show a working sample. Could you demonstrate on my example how it should be applied? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:30:23 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 15:30:23 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1585495823.76.0.77006271447.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya nosy_count: 2.0 -> 3.0 pull_requests: +18577 pull_request: https://github.com/python/cpython/pull/19214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:30:56 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 15:30:56 +0000 Subject: [issue40101] lib2to3 fails on default convert functionality In-Reply-To: <1585495488.9.0.817562542084.issue40101@roundup.psfhosted.org> Message-ID: <1585495856.18.0.0221156737299.issue40101@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18578 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:32:00 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 15:32:00 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1585495920.78.0.688893396768.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: -18577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:32:12 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 15:32:12 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1585495932.71.0.980537615008.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: -BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:34:58 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 15:34:58 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585496098.39.0.0229469686974.issue33725@roundup.psfhosted.org> Mouse added the comment: Also, adding `p.join()` immediately after `p.start()` in my sample code showed this timing: ``` $ time python3.8 multi1.py worker 0 done, got 100 numbers worker 1 done, got 0 numbers worker 2 done, got 0 numbers worker 3 done, got 0 numbers real 0m2.342s user 0m0.227s sys 0m0.111s $ ``` Setting instead start to `fork` showed this timing: ``` $ time python3.8 multi1.py worker 2 done, got 25 numbers worker 0 done, got 25 numbers worker 1 done, got 25 numbers worker 3 done, got 25 numbers real 0m0.537s user 0m0.064s sys 0m0.040s $ ``` The proposed fix is roughly four times slower, compared to reverting start to `fork`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:52:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 29 Mar 2020 15:52:50 +0000 Subject: [issue40096] Support _Py_NO_RETURN on XLC In-Reply-To: <1585397997.42.0.0757475150087.issue40096@roundup.psfhosted.org> Message-ID: <1585497170.29.0.835693876853.issue40096@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:52:36 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 29 Mar 2020 15:52:36 +0000 Subject: [issue40096] Support _Py_NO_RETURN on XLC In-Reply-To: <1585397997.42.0.0757475150087.issue40096@roundup.psfhosted.org> Message-ID: <1585497156.25.0.371609509039.issue40096@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0003c2dc1d4cf5b122e73e83177fd274fa9a9913 by Batuhan Ta?kaya in branch 'master': bpo-40096: Support __attribute__((__noreturn__)) on xlc (GH-19204) https://github.com/python/cpython/commit/0003c2dc1d4cf5b122e73e83177fd274fa9a9913 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 11:56:02 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Sun, 29 Mar 2020 15:56:02 +0000 Subject: [issue40090] The referenced RFC for the json module should be corrected to rfc8259 In-Reply-To: <1585436989.78.0.0985203900739.issue40090@roundup.psfhosted.org> Message-ID: Ama Aje My Fren added the comment: I am not the expert on this but I did a swift check of the two documents before doing the documentation PR . >From my reading of the two, RFC8259 seems that: This document's goal is to apply the errata, remove inconsistencies with other specifications of JSON, and highlight practices that can lead to interoperability problems. When one reads a diff of the two RFCs together , the only place that seems to have changed from a protocol point of view is in Section 8.1 (RFC 7159 , RFC 8259 ) which now (RFC 8259) requires that all data should be encoded using UTF-8. The security section in the current (RFC 8259) standard states: certain characters such as U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR are legal in JSON but not JavaScript (This has changed in the latest ECMAScript Edition) Therefore from my understanding: 1. which document better describes the behavior of our json module? The json module allows for utf-16 and utf-32 encoding in the loads method. It does not appear to enforce the utf-8 encoding - so closer to RFC 7159. 2. Does it need to be updated along with a doc change? Maybe. I defer to the maintainers of the module. On Sun, Mar 29, 2020 at 2:09 AM Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > The header for 8259 says "Obsoletes: 7159" (December 2017) and the header > for 7159 agrees: "Obsoleted by: 8259". But... to the extent that there is > any difference, which document better describes the behavior of our json > module? Does it need to be updated along with a doc change? > > ---------- > nosy: +ezio.melotti, rhettinger, terry.reedy > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 12:08:15 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 29 Mar 2020 16:08:15 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585498095.49.0.709878255733.issue33725@roundup.psfhosted.org> Mark Dickinson added the comment: @Mouse: replace the last block of your code with something like this: # Start worker processes workers = [] for m in range(nProcesses): p = mp.Process(target=getElements, args=(q, tSleep / 1000, m)) workers.append(p) p.start() # Wait for all workers to complete for p in workers: p.join() But I don't think this tracker issue is the right place to have this conversation. It's highly unlikely that this change will be reverted - there are strong reasons to avoid fork on macOS, and the issue you're reporting isn't directly related to this one: it's an issue with using "spawn" on any OS. However, there may be scope for improving the documentation so that fewer users fall into this trap. I'd suggest opening another issue for that, or continuing the conversation on #28965. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 12:31:31 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 16:31:31 +0000 Subject: [issue40102] Improve XLC support for function attributes Message-ID: <1585499491.65.0.60964453841.issue40102@roundup.psfhosted.org> New submission from Batuhan Taskaya : XLC supports visibility, deprecated and aligned attributes (can be seen in this language reference https://www.ibm.com/support/pages/sites/default/files/support/swg/swgdocs.nsf/0/18b50c3c2309a37585257daf004d373e/%24FILE/langref.pdf) ---------- messages: 365267 nosy: BTaskaya, pablogsal priority: normal severity: normal status: open title: Improve XLC support for function attributes type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 12:33:07 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 16:33:07 +0000 Subject: [issue40102] Improve XLC support for function attributes In-Reply-To: <1585499491.65.0.60964453841.issue40102@roundup.psfhosted.org> Message-ID: <1585499587.21.0.879428057714.issue40102@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- assignee: -> BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 12:33:47 2020 From: report at bugs.python.org (Nathan Silberman) Date: Sun, 29 Mar 2020 16:33:47 +0000 Subject: [issue40103] ZipFile.extractall is not multiprocess safe with regard to directory creation. Message-ID: <1585499627.5.0.740021279333.issue40103@roundup.psfhosted.org> New submission from Nathan Silberman : When extracting multiple zip files, each from a separate process, if the files being extracted are in nested directories and files across zips contain the same parent directories, the extraction process fails as one zip attempts to create a directory that was already created by the extraction call in another process. ---------- components: Library (Lib) messages: 365268 nosy: nathansilberman priority: normal severity: normal status: open title: ZipFile.extractall is not multiprocess safe with regard to directory creation. type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 12:45:15 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 29 Mar 2020 16:45:15 +0000 Subject: [issue40102] Improve XLC support for function attributes In-Reply-To: <1585499491.65.0.60964453841.issue40102@roundup.psfhosted.org> Message-ID: <1585500315.25.0.260173339559.issue40102@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +18579 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 13:29:10 2020 From: report at bugs.python.org (fireattack) Date: Sun, 29 Mar 2020 17:29:10 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early In-Reply-To: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> Message-ID: <1585502950.24.0.0842540924765.issue40093@roundup.psfhosted.org> fireattack added the comment: Hi gaoxinge, thanks for the reply. I assume what you mean is that while shutdown will wait, it won't accept any new job/future after it is called. That makes sense, but this still doesn't work: ``` from concurrent.futures import ThreadPoolExecutor from time import sleep def wait_on_future(): sleep(1) f2 = executor.submit(pow, 5, 2) print(f2.result()) executor.shutdown(wait=True) #Uncomment/comment this makes no difference executor = ThreadPoolExecutor(max_workers=100) f = executor.submit(wait_on_future) ``` This shows no error, but f2.result() is still not printed (`result()` has built-in wait). Actually, f2 is not executed at all (you can change pow to other func to see that). Please notice this example is modified from an example from the official documentation: https://docs.python.org/3/library/concurrent.futures.html In that example, the comment says "This will never complete because there is only one worker thread and it is executing this function.", which is correct. But this is kinda misleading because it implies it will work if you increase the number of the worker. However, it will NOT work if you increase the number of worker, but also add a small delay, like shown above. The point is, I failed to find a way to keep executor from main thread alive to accept future/job from a child thread if there is a delay. I tried shutdown/nothing/with/as_completed they all fail in similar fashion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 13:44:29 2020 From: report at bugs.python.org (fireattack) Date: Sun, 29 Mar 2020 17:44:29 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early In-Reply-To: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> Message-ID: <1585503869.26.0.938879243107.issue40093@roundup.psfhosted.org> fireattack added the comment: Here is another more bizarre showcase of the issue I come up with. If you do: ``` import concurrent.futures import time def test(): time.sleep(3) print('test') ex = concurrent.futures.ThreadPoolExecutor(max_workers=10) ex.submit(test) ``` This will print "test" after 3 seconds just fine. Now, if you do: ``` import concurrent.futures import time def test(): time.sleep(3) ex.submit(print, 'ex-print') print('test') #this is not printed ex = concurrent.futures.ThreadPoolExecutor(max_workers=10) ex.submit(test) ``` Not only it doesn't print "ex-print", it does NOT even print "test" any more. And this is no error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 14:02:58 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 29 Mar 2020 18:02:58 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585504978.52.0.339748774021.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: I think you're going too far for some of these. > 1. metaclasses This is reasonable. > 2. __mro__ This is also reasonable. (I wonder if that part of the dir() implementation predates __mro__?) I'm not sure about honoring mro() in the metaclass, but it may be useful. > 3. __dict__ I think this is probably a feature -- I can't think of a reason to override __dict__ as a property except when implementing some sort of proxy class, and then it's likely that there's a matching overrid of __getattr__. > 4. __class__ Again, I think this is a feature. For example, PEP 585 overrides __class__: >>> t = list[int] >>> type(t) >>> t.__class__ > 4.1 auto-creation of instance dict This seems an accident of implementation, and if you can avoid it, that's better. (Though what use case of dir() currently suffers from memory overhead due to this?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 14:06:38 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 29 Mar 2020 18:06:38 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585505198.65.0.714086885029.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: FWIW it might be a good idea to look into how PEP 585 could benefit from the improvements to dir(). Currently, dir(list) and dir(list[int]) are quite different -- only the former shows list methods like append and insert. See https://github.com/gvanrossum/cpython/tree/pep585 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 15:13:13 2020 From: report at bugs.python.org (Myron Walker) Date: Sun, 29 Mar 2020 19:13:13 +0000 Subject: [issue40104] ElementTree does not find elements in a default namespace with namespaces Message-ID: <1585509193.56.0.500211737175.issue40104@roundup.psfhosted.org> New submission from Myron Walker : When you have an xml document like the one with a default namespace below. When you try to lookup nodes in the document they are not found. ``` docTree.find("specVersion") None ``` If you add a namespaces map with the '' key and the default namespaces like: { '': 'urn:schemas-upnp-org:device-1-0' } then the nodes are still not found. The issue is that there is a case missing from xpath_tokenizer that does not yield a pair with the default namespace when one is specified. Here is a fix. https://github.com/myronww/cpython/commit/0fc65daca239624139f2a018a83f0b0ec04a8068 ``` from xml.etree.ElementTree import fromstring as parse_xml_fromstring from xml.etree.ElementTree import ElementTree SAMPLEXML = """ 10 urn:schemas-wifialliance-org:device:WFADevice:1 R7400 (Wireless AP) rootNode = parse_xml_fromstring(SAMPLEXML) # Create a namespaces map like { '': 'urn:schemas-upnp-org:device-1-0' } defaultns = {"": docNode.tag.split("}")[0][1:]} specVerNode = docNode.find("specVersion", namespaces=defaultns) ``` Results should look like this ``` docNode.find("specVersion", namespaces=defaultns) ``` ---------- components: Library (Lib) messages: 365273 nosy: Myron Walker priority: normal severity: normal status: open title: ElementTree does not find elements in a default namespace with namespaces type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 15:22:40 2020 From: report at bugs.python.org (Jonas Drotleff) Date: Sun, 29 Mar 2020 19:22:40 +0000 Subject: [issue38337] inspect: getmembers calls properties In-Reply-To: <1569931319.11.0.161787180553.issue38337@roundup.psfhosted.org> Message-ID: <1585509760.73.0.583521912467.issue38337@roundup.psfhosted.org> Jonas Drotleff added the comment: I'm still thinking about this bug/issue/undefined behaviour. Today I wanted to test its behaviour with async: import inspect class Foo: def __init__(self, bar): self._bar = bar @property async def spam(self): print('Called spam') return self._bar if __name__ == '__main__': instance = Foo('eggs') members = inspect.getmembers(instance) ## This will result in a RuntimeWarning: RuntimeWarning: coroutine 'Foo.spam' was never awaited members = inspect.getmembers(instance) RuntimeWarning: Enable tracemalloc to get the object allocation traceback Sure, async properties might not be particularly beautiful or best-practice, but I frequently stumble upon code where getmembers would fail ? just like this example. However, I am still clueless about what to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 15:52:43 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 29 Mar 2020 19:52:43 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1585511563.12.0.927860721191.issue39950@roundup.psfhosted.org> Barney Gale added the comment: A question: For my patch, I need to include a Python version where `Path.link_to()` will become unavailable. I'm not entirely sure how this should be determined. Some factors in play: - `link_to()` was added in Python 3.8 - On github, I found these three repos which use `link_to()`: - https://github.com/akubera/pion-analysis - https://github.com/DailyDreaming/load-project - https://github.com/eight04/vpip Can anyone suggest in which version of Python this function should be removed? Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 15:55:45 2020 From: report at bugs.python.org (Myron Walker) Date: Sun, 29 Mar 2020 19:55:45 +0000 Subject: [issue40104] ElementTree does not find elements in a default namespace with namespaces In-Reply-To: <1585509193.56.0.500211737175.issue40104@roundup.psfhosted.org> Message-ID: <1585511745.69.0.00472663645447.issue40104@roundup.psfhosted.org> Myron Walker added the comment: Looks like this is fixed in the latest source code. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 16:13:15 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 29 Mar 2020 20:13:15 +0000 Subject: [issue37973] improve docstrings of sys.float_info In-Reply-To: <1567048617.81.0.748558704563.issue37973@roundup.psfhosted.org> Message-ID: <1585512795.54.0.328121544878.issue37973@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 4.0 -> 5.0 pull_requests: +18580 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 16:31:26 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 29 Mar 2020 20:31:26 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1585513886.35.0.389846084449.issue24132@roundup.psfhosted.org> Barney Gale added the comment: I'm taking another look at making `pathlib` extensible. There's some discussion here: https://discuss.python.org/t/make-pathlib-extensible/3428 List or preparatory bugfixes and tidy-ups: https://docs.google.com/spreadsheets/d/1TicFDMudKKA6CZcrscg1Xq9kt5Q8To8y0hADGw9u11I/edit#gid=0 ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 16:48:23 2020 From: report at bugs.python.org (Yudi) Date: Sun, 29 Mar 2020 20:48:23 +0000 Subject: [issue40105] Updating zip comment doesn't truncate the zip file Message-ID: <1585514903.71.0.609611507951.issue40105@roundup.psfhosted.org> New submission from Yudi : Updating the zip file comment to a shorter comment should truncate the zip file at the end of the new comment. Instead, the new comment is written to the zip file but the file length stays the same. For example, for a zip file that has the following zip comment: b'This is my old amazing comment, I bet you really like it!' # 57 character long Executing the following code: zipFile = ZipFile(filePath, 'a') zipFile.comment = b'My new shorter comment' # 22 character long zipFile.close() Will actually update the comment length in the zip header to the correct new length (22), but the bytecode will still have the following data: b'My new shorter comment comment, I bet you really like it!' Python reads the comment correctly since it relies on the comment length from the metadata (as far as I can tell), but the file is corrupt. This is similar to the following old issue - https://bugs.python.org/issue9239 But I wasn't sure whether to try and re-open that old one or create a new one. Tested on version 3.8.2 (Windows 10). Thanks! ---------- components: Library (Lib) messages: 365278 nosy: yudilevi priority: normal severity: normal status: open title: Updating zip comment doesn't truncate the zip file type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 16:56:08 2020 From: report at bugs.python.org (Angelin BOOZ) Date: Sun, 29 Mar 2020 20:56:08 +0000 Subject: [issue40084] HTTPStatus has incomplete dir() listing In-Reply-To: <1585293405.13.0.478935860244.issue40084@roundup.psfhosted.org> Message-ID: <1585515368.71.0.0342426964613.issue40084@roundup.psfhosted.org> Change by Angelin BOOZ : ---------- keywords: +patch nosy: +lem nosy_count: 4.0 -> 5.0 pull_requests: +18581 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 17:26:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 21:26:41 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585517201.81.0.800097558217.issue33725@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 17:49:38 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 21:49:38 +0000 Subject: [issue40106] multiprocessor spawn Message-ID: <1585518578.2.0.0489480686513.issue40106@roundup.psfhosted.org> New submission from Mouse : MacOS Catalina 10.15.3 and 10.15.4. Python-3.8.2 (also tested with 3.7.7, which confirmed the problem being in the fix described in https://bugs.python.org/issue33725. Trying to use "multiprocessor" with Python-3.8 and with the new default of `set_start_method('spawn')` is nothing but a disaster. Not doing join() leads to consistent crashes, like described here https://bugs.python.org/issue33725#msg365249 Adding p.join() immediately after p.start() seems to work, but increases the total run-time by factor between two and four, user time by factor of five, and system time by factor of ten. Occasionally even with p.join() I'm getting some processes crashing like shown in https://bugs.python.org/issue33725#msg365249. I found two workarounds: 1. Switch back to 'fork' by explicitly adding `set_start_method('fork') to the __main__. 2. Drop the messy "multiprocessing" package and use "multiprocess" instead, which turns out to be a good and reliable fork of "multiprocessing". If anybody cares to dig deeper into this problem, I'd be happy to provide whatever information that could be helpful. Here's the sample code (again): ``` #!/usr/bin/env python3 # # Test "multiprocessing" package included with Python-3.6+ # # Usage: # ./mylti1.py [nElements [nProcesses [tSleep]]] # # nElements - total number of integers to put in the queue # default: 100 # nProcesses - total number of parallel processes/threads # default: number of physical cores available # tSleep - number of milliseconds for a thread to sleep # after it retrieved an element from the queue # default: 17 # # Algorithm: # 1. Creates a queue and adds nElements integers to it, # 2. Creates nProcesses threads # 3. Each thread extracts an element from the queue and sleeps for tSleep milliseconds # import sys, queue, time import multiprocessing as mp def getElements(q, tSleep, idx): l = [] # list of pulled numbers while True: try: l.append(q.get(True, .001)) time.sleep(tSleep) except queue.Empty: if q.empty(): print(f'worker {idx} done, got {len(l)} numbers') return if __name__ == '__main__': nElements = int(sys.argv[1]) if len(sys.argv) > 1 else 100 nProcesses = int(sys.argv[2]) if len(sys.argv) > 2 else mp.cpu_count() tSleep = float(sys.argv[3]) if len(sys.argv) > 3 else 17 # To make this sample code work reliably and fast, uncomment following line #mp.set_start_method('fork') # Fill the queue with numbers from 0 to nElements q = mp.Queue() for k in range(nElements): q.put(k) # Keep track of worker processes workers = [] # Start worker processes for m in range(nProcesses): p = mp.Process(target=getElements, args=(q, tSleep / 1000, m)) workers.append(p) p.start() # Now do the joining for p in workers: p.join() ``` Here's the timing: ``` $ time python3 multi1.py worker 9 done, got 5 numbers worker 16 done, got 5 numbers worker 6 done, got 5 numbers worker 8 done, got 5 numbers worker 17 done, got 5 numbers worker 3 done, got 5 numbers worker 14 done, got 5 numbers worker 0 done, got 5 numbers worker 15 done, got 4 numbers worker 7 done, got 5 numbers worker 5 done, got 5 numbers worker 12 done, got 5 numbers worker 4 done, got 5 numbers worker 19 done, got 5 numbers worker 18 done, got 5 numbers worker 1 done, got 5 numbers worker 10 done, got 5 numbers worker 2 done, got 5 numbers worker 11 done, got 6 numbers worker 13 done, got 5 numbers real 0m0.325s user 0m1.375s sys 0m0.692s ``` If I comment out the join() and uncomment set_start_method('fork'), the timing is ``` $ time python3 multi1.py worker 0 done, got 5 numbers worker 3 done, got 5 numbers worker 2 done, got 5 numbers worker 1 done, got 5 numbers worker 5 done, got 5 numbers worker 10 done, got 5 numbers worker 6 done, got 5 numbers worker 4 done, got 5 numbers worker 7 done, got 5 numbers worker 9 done, got 5 numbers worker 8 done, got 5 numbers worker 14 done, got 5 numbers worker 11 done, got 5 numbers worker 12 done, got 5 numbers worker 13 done, got 5 numbers worker 16 done, got 5 numbers worker 15 done, got 5 numbers worker 17 done, got 5 numbers worker 18 done, got 5 numbers worker 19 done, got 5 numbers real 0m0.175s user 0m0.073s sys 0m0.070s ``` You can observe the difference. Here's the timing if I don't bother with either join() or set_start_method(), but import "multiprocess" instead: ``` $ time python3 multi2.py worker 0 done, got 5 numbers worker 1 done, got 5 numbers worker 2 done, got 5 numbers worker 4 done, got 5 numbers worker 3 done, got 5 numbers worker 5 done, got 5 numbers worker 6 done, got 5 numbers worker 8 done, got 5 numbers worker 9 done, got 5 numbers worker 7 done, got 5 numbers worker 14 done, got 5 numbers worker 11 done, got 5 numbers worker 13 done, got 5 numbers worker 16 done, got 5 numbers worker 12 done, got 5 numbers worker 10 done, got 5 numbers worker 15 done, got 5 numbers worker 17 done, got 5 numbers worker 18 done, got 5 numbers worker 19 done, got 5 numbers real 0m0.192s user 0m0.089s sys 0m0.076s ``` Also, on a weaker machine with only 4 cores (rather than 20 that ran the above example), the instability of the "multiprocessor"-based code shows: ``` $ time python3.8 multi1.py worker 3 done, got 33 numbers worker 2 done, got 33 numbers worker 1 done, got 34 numbers worker 0 done, got 0 numbers real 0m5.448s user 0m0.339s sys 0m0.196s ``` Observe how one process out of four got nothing from the queue. With "multiprocess" the code runs like a clockwork - each process gets exactly 1/N of the queue: ``` $ time python3.8 multi2.py worker 0 done, got 25 numbers worker 1 done, got 25 numbers worker 2 done, got 25 numbers worker 3 done, got 25 numbers real 0m0.551s user 0m0.082s sys 0m0.044s ``` I think that the best course for "multiprocessor" would be reverting the default to 'fork'. It also looks like for the users the best course would be switching to "multiprocess". ---------- components: macOS messages: 365279 nosy: mouse07410, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: multiprocessor spawn type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 17:52:57 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 21:52:57 +0000 Subject: [issue28965] Multiprocessing spawn/forkserver fails to pass Queues In-Reply-To: <1481676708.34.0.90034781132.issue28965@psf.upfronthosting.co.za> Message-ID: <1585518777.59.0.511433139812.issue28965@roundup.psfhosted.org> Mouse added the comment: On MacOS Catalina 10.15.4, I still see this problem occasionally even with p.join() added. See https://bugs.python.org/msg365251 and subsequent messages. Also, see https://bugs.python.org/issue40106. ---------- nosy: +mouse07410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 17:56:21 2020 From: report at bugs.python.org (Mouse) Date: Sun, 29 Mar 2020 21:56:21 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585518981.93.0.570719701241.issue33725@roundup.psfhosted.org> Mouse added the comment: @mark.dickinson, thank you. Following your suggestion, I've added a comment in #28965, and created a new issue https://bugs.python.org/issue40106. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 18:25:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 22:25:37 +0000 Subject: [issue40094] Add os.status_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585520737.37.0.277206694197.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: Interesting information about process "exit status code": https://en.wikipedia.org/wiki/Exit_status ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 18:37:39 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 29 Mar 2020 22:37:39 +0000 Subject: [issue40107] pathlib: make `_Accessor.open()` return a file object and not a file descriptor Message-ID: <1585521459.52.0.94031195769.issue40107@roundup.psfhosted.org> New submission from Barney Gale : This is one of a series of bug reports / PRs that lay the groundwork for making pathlib extensible. See here for detail: https://discuss.python.org/t/make-pathlib-extensible/3428 Currently `_Accessor.open()` is expected to function like `os.open()` and return a file descriptor. I'd suggest this interface is too low-level if our eventual aim is to allow users to implement their own accessor. It would be better is `_Accessor.open()` is expected to function like `io.open()` and return a file object. That way, accessors don't need to deal with file descriptors at all, which is important if they're working with remote filesystems. I'm planning to wait for bpo-39895 / gh-18838 to land before starting work on this. ---------- components: Library (Lib) messages: 365283 nosy: barneygale priority: normal severity: normal status: open title: pathlib: make `_Accessor.open()` return a file object and not a file descriptor type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 18:55:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 22:55:11 +0000 Subject: [issue40094] Add os.status_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585522511.63.0.814771862386.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: The function can be used to convert the result of the following functions: * os.system() (on Unix) * os.wait() * os.waitpid() * os.wait3() * os.wait4() * pty.spawn() Note: waitid() has a different API, si_status can be used directly, its meaning depends on si_code. -- First, I proposed os._wait_status_to_returncode() name. I renamed it to os.status_to_exitcode(). Maybe the "status" term used alone is too general. I'm not sure neither if it's correct to write "exitcode" a single word. For example, Windows uses GetExitCodeProcess() name: "Exit Code" means that they are two separated words. The Python os documentation uses "exit code" and "exit status", but never "exitcode" or "exitstatus". The system() function manual page says: """ RETURN VALUE (...) In the last two cases, the return value is a "wait status" that can be examined using the macros described in waitpid(2). (i.e., WIFEXITED(), WEXITSTATUS(), and so on). """ Python pty.spawn() documentation says: "(...) returns the status value from os.waitpid() on the child process". -- In my current PR, the function documentation is: "Convert an exit status to an exit code" Other name ideas: * exit_status_to_code() * exit_status_to_exit_code() * wait_status_to_exit_code() The Wikipedia article is called "Exit status" and then tells about "exit status code" :-) So it can be surprising to have a function supposed to convert an "exit status" into an "exit code". It seems like "Convert a waitpid() wait status to an exit code" is the best documentation and so that wait_status_to_exit_code() is the most correct and least confusing name, even if it's longer than other name candidates. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 19:15:52 2020 From: report at bugs.python.org (Barney Gale) Date: Sun, 29 Mar 2020 23:15:52 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1585523752.42.0.112618318356.issue39924@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +18582 pull_request: https://github.com/python/cpython/pull/19220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 19:19:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 23:19:02 +0000 Subject: [issue33725] Python crashes on macOS after fork with no exec In-Reply-To: <1527814386.62.0.682650639539.issue33725@psf.upfronthosting.co.za> Message-ID: <1585523942.58.0.614973538654.issue33725@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 19:25:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Sun, 29 Mar 2020 23:25:48 +0000 Subject: [issue23574] datetime: support leap seconds In-Reply-To: <1425393743.39.0.519990063132.issue23574@psf.upfronthosting.co.za> Message-ID: <1585524348.18.0.920470579425.issue23574@roundup.psfhosted.org> STINNER Victor added the comment: One option to explore is to add a "leap seconds" field to datetime.datetime which can be negative (just in case someone decides to add negative leap seconds in the future). It can use in operations which involve time zones, it can be serialized/deserialized, but datetime.datetime.timestamp() would ignore this field ("drop" leap seconds on purpose). ---------- nosy: +p-ganssle resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:02:03 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Mar 2020 00:02:03 +0000 Subject: [issue40108] Improve error message for -m option when .py is present Message-ID: <1585526523.79.0.240338395586.issue40108@roundup.psfhosted.org> New submission from Raymond Hettinger : I think we can do better than the following: $ python3.8 -m unicode_math_symbols.py /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8: Error while finding module specification for 'unicode_math_symbols.py' (ModuleNotFoundError: __path__ attribute not found on 'unicode_math_symbols' while trying to find 'unicode_math_symbols.py') It is a reasonably common mistake to add .py to the module name for module names loaded by the -m command-line launcher. The error mess is somewhat opaque and not suggestive of what the actual problem is or how to fix it. ---------- messages: 365286 nosy: rhettinger priority: normal severity: normal status: open title: Improve error message for -m option when .py is present versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:12:40 2020 From: report at bugs.python.org (Curtis Bucher) Date: Mon, 30 Mar 2020 00:12:40 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585527160.72.0.669723624688.issue36144@roundup.psfhosted.org> Change by Curtis Bucher : ---------- pull_requests: +18583 pull_request: https://github.com/python/cpython/pull/19221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:38:47 2020 From: report at bugs.python.org (R. David Murray) Date: Mon, 30 Mar 2020 00:38:47 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528727.28.0.400984773218.issue39073@roundup.psfhosted.org> R. David Murray added the comment: New changeset 614f17211c5fc0e5b828be1d3320661d1038fe8f by Ashwin Ramaswami in branch 'master': bpo-39073: validate Address parts to disallow CRLF (#19007) https://github.com/python/cpython/commit/614f17211c5fc0e5b828be1d3320661d1038fe8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:39:12 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Mar 2020 00:39:12 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528752.5.0.749803158954.issue39073@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18584 pull_request: https://github.com/python/cpython/pull/19222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:39:21 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Mar 2020 00:39:21 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528761.96.0.275067306267.issue39073@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18585 pull_request: https://github.com/python/cpython/pull/19223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:39:30 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Mar 2020 00:39:30 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528770.3.0.46158853145.issue39073@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18586 pull_request: https://github.com/python/cpython/pull/19224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:40:01 2020 From: report at bugs.python.org (R. David Murray) Date: Mon, 30 Mar 2020 00:40:01 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528801.67.0.432149051184.issue39073@roundup.psfhosted.org> R. David Murray added the comment: Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 20:40:26 2020 From: report at bugs.python.org (R. David Murray) Date: Mon, 30 Mar 2020 00:40:26 +0000 Subject: [issue39073] email incorrect handling of crlf in Address objects. In-Reply-To: <1576586803.42.0.942657577592.issue39073@roundup.psfhosted.org> Message-ID: <1585528826.01.0.988874316109.issue39073@roundup.psfhosted.org> Change by R. David Murray : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 21:22:35 2020 From: report at bugs.python.org (Nathan Brooks) Date: Mon, 30 Mar 2020 01:22:35 +0000 Subject: [issue40109] List index doesn't work with multiple assignment Message-ID: <1585531355.78.0.895999484391.issue40109@roundup.psfhosted.org> New submission from Nathan Brooks : Faulty example: x = [1,2,3,4,5,6,7] # this should replace items 3 and 6 with each other x[2], x[x.index(6)] = 6, x[2] print(x) [1,2,3,4,5,6,7] Workaround: x = [1,2,3,4,5,6,7] i = x.index(6) # this replaces items 3 and 6 in the list. x[2], x[i] = 6, x[2] print(x) [1,2,6,4,5,3,7] ---------- messages: 365289 nosy: Nathan Brooks priority: normal severity: normal status: open title: List index doesn't work with multiple assignment _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 21:37:54 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 30 Mar 2020 01:37:54 +0000 Subject: [issue40109] List index doesn't work with multiple assignment In-Reply-To: <1585531355.78.0.895999484391.issue40109@roundup.psfhosted.org> Message-ID: <1585532274.06.0.24660148134.issue40109@roundup.psfhosted.org> Benjamin Peterson added the comment: Python doesn't have multiple assignment, just tuple unpacking. Consider the order of evaluation here: 1. tmp = (6, x[2]) (i.e., (6, 2)) 2. x[2] = tmp[0] 3. tmp2 = x.index(6) (= 2) 4. x[tmp2] = tmp[1] (i.e., x[2] = 2) ---------- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 22:10:02 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 30 Mar 2020 02:10:02 +0000 Subject: [issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers In-Reply-To: <1578087844.56.0.81762061225.issue39207@roundup.psfhosted.org> Message-ID: <1585534202.33.0.407953287333.issue39207@roundup.psfhosted.org> Kyle Stanley added the comment: So, I think a potential approach to this issue with ProcessPoolExecutor would be making it a bit more similar to ThreadPoolExecutor: instead of spawning *max_workers* processes on startup (see `_adjust_process_count()`), spawn each new process in submit() (see `_adjust_thread_count()`), and only do so when there are no idle processes (and the current count is below max_workers, of course). This wouldn't reap the idle processes, but I think re-using them is a behavior we want to retain. It seems like it would be quite costly to constantly close and start new processes each time a work item is completed. >From my perspective, the main issue is that the processes are being spawned all at once instead of being spawned as needed. This can result in a substantial amount of extra cumulative idle time throughout the lifespan of the ProcessPoolExecutor. I should have some time to work on this in the next month or sooner, so I'll assign myself to this issue. (I also changed the version to just Python 3.9, as this seems like too significant of a behavioral change to backport to 3.8. Let me know if anyone disagrees.) ---------- assignee: -> aeros stage: -> needs patch versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 22:56:56 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 30 Mar 2020 02:56:56 +0000 Subject: [issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584395966.63.0.545981270163.issue39982@roundup.psfhosted.org> Message-ID: <1585537016.93.0.110533485831.issue39982@roundup.psfhosted.org> Kubilay Kocak added the comment: +1 to mutually beneficial relationships :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 23:02:32 2020 From: report at bugs.python.org (Dima Tisnek) Date: Mon, 30 Mar 2020 03:02:32 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1585537352.88.0.232499828401.issue39951@roundup.psfhosted.org> Dima Tisnek added the comment: Let's close this in favour of https://bugs.python.org/issue39953 which has a pending pull request https://github.com/python/cpython/pull/19082 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 29 23:52:48 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 30 Mar 2020 03:52:48 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585540368.95.0.881658725547.issue40018@roundup.psfhosted.org> Kubilay Kocak added the comment: Updating the koobs-freebsd-564d buildbots FreBSD openssl port now which has had the 1.1.1e EOF change reverted. Will run the last 3.x build again and report here whether it passes (it should) or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 00:06:27 2020 From: report at bugs.python.org (Nick Guenther) Date: Mon, 30 Mar 2020 04:06:27 +0000 Subject: [issue40110] multiprocessing.Pool.imap() should be lazy Message-ID: <1585541187.46.0.606629490552.issue40110@roundup.psfhosted.org> New submission from Nick Guenther : multiprocessing.Pool.imap() is supposed to be a lazy version of map. But it's not: it submits work to its workers eagerly. As a consequence, in a pipeline, all the work from earlier steps is queued, performed, and finished first, before starting later steps. If you use python3's built-in map() -- aka the old itertools.imap() -- the operations are on-demand, so it surprised me that Pool.imap() doesn't. It's basically no better than using Pool.map(). Maybe it saves memory by not materializing large iterables in every worker process? But it still materializes the CPU time from the iterables even if unneeded. This can be partially worked around by giving each step of the pipeline its own Pool -- then, at least the earlier steps of the pipeline don't block the later steps -- but the jobs are still done eagerly instead of waiting for their results to actually be requested. ---------- files: multiprocessing-eager-imap.py messages: 365295 nosy: kousu priority: normal severity: normal status: open title: multiprocessing.Pool.imap() should be lazy versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file49010/multiprocessing-eager-imap.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 00:17:00 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Mar 2020 04:17:00 +0000 Subject: [issue39089] Update IDLE's credits In-Reply-To: <1576691089.83.0.499008805758.issue39089@roundup.psfhosted.org> Message-ID: <1585541820.2.0.566086753766.issue39089@roundup.psfhosted.org> Terry J. Reedy added the comment: I have thought about everything from deleting the file to a detailed update. If we keep it, anything would be an improvement. Perhap something in the middle, starting in 2013. I just decided I don't need be be responsible for anything earlier, even this I actually started in Fall 2010. 2013 Roger Serwy (and perhaps GSOC Phil Webster -- I need to look more at News log.) 2014 Saimadhav Heblikar 2015 Mark Roseman 2017 Louie Lu, Cheryl Sabella, Serhiy Storchaka, the latter two to date. 201?, 2019 Tal Einat Can you make a suggested addition? ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 01:26:27 2020 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 30 Mar 2020 05:26:27 +0000 Subject: [issue40018] test_ssl fails with OpenSSL 1.1.1e In-Reply-To: <1584651346.13.0.299383361269.issue40018@roundup.psfhosted.org> Message-ID: <1585545987.62.0.280817742811.issue40018@roundup.psfhosted.org> Kubilay Kocak added the comment: Confirming: test_ssl passes with 1.1.1e + reverted EOF change ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 01:27:21 2020 From: report at bugs.python.org (gaoxinge) Date: Mon, 30 Mar 2020 05:27:21 +0000 Subject: [issue40093] ThreadPoolExecutor with wait=True shuts down too early In-Reply-To: <1585351302.94.0.0578585326748.issue40093@roundup.psfhosted.org> Message-ID: <1585546041.16.0.615128037721.issue40093@roundup.psfhosted.org> gaoxinge added the comment: > I assume what you mean is that while shutdown will wait, it won't accept any new job/future after it is called. Yes, you are right. This is a feature of the ThreadPoolExecutor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 01:29:51 2020 From: report at bugs.python.org (Dima Tisnek) Date: Mon, 30 Mar 2020 05:29:51 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1585546191.87.0.827844800411.issue39951@roundup.psfhosted.org> Dima Tisnek added the comment: Sorry I was too fast to close this. 39953 is about error codes. This bug is about having an error at all. I believe that the code in question should pass without error, even in the presence of network delays. ---------- resolution: duplicate -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 01:46:11 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Mar 2020 05:46:11 +0000 Subject: =?utf-8?q?=5Bissue37614=5D_Pasteing_=F0=9F=8C=B9into_idle_makes_it_exit?= In-Reply-To: <1563424849.97.0.321788763811.issue37614@roundup.psfhosted.org> Message-ID: <1585547171.39.0.308916003377.issue37614@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: Pasteing ?into idle makes it crash -> Pasteing ?into idle makes it exit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 01:51:59 2020 From: report at bugs.python.org (Dima Tisnek) Date: Mon, 30 Mar 2020 05:51:59 +0000 Subject: [issue40111] Introspect ssl context: read ALPN and NPN protocols Message-ID: <1585547519.26.0.563091445054.issue40111@roundup.psfhosted.org> New submission from Dima Tisnek : It's quite easy to create new or modify existing ssl context: ssl_context = ssl.create_default_context() ssl_context.set_alpn_protocols(["h2"]) I'm writing a library where the context may be passed by the caller (useful if the caller wants to set custom CA path, or client cert auth, share TLS session tickets, etc.). I'd love to be able to check that the context I get has correct ALPN and/or NPN protocols specified. I'd love to be able to do something like this: assert "h2" in ssl_context.alpn_protocols or assert "h2" in ssl_context.get_alpn_protocols() There's sortof precedent for this, I use following code to set and check TLS version flags: ssl_context.options |= ssl.OP_NO_TLSv1 assert ssl.OP_NO_TLSv1 in ssl_context.options ---------- components: Extension Modules messages: 365300 nosy: Dima.Tisnek priority: normal severity: normal status: open title: Introspect ssl context: read ALPN and NPN protocols versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:09:52 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 30 Mar 2020 11:09:52 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585566592.34.0.866722051942.issue40069@roundup.psfhosted.org> Michael Felt added the comment: FYI: IMHO it is artifact of the way an xlc compiler is setup. Maybe this is a new default (I see they changed the names of config files). On my server (with xlc v11) I do not get them, but on a different server (with xlc v13) I do get .lst files. So, seems it is now a good idea to have this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:16:18 2020 From: report at bugs.python.org (=?utf-8?q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Mon, 30 Mar 2020 11:16:18 +0000 Subject: [issue30744] Local variable assignment is broken when combined with threads + tracing + closures In-Reply-To: <1498277129.07.0.940069687434.issue30744@psf.upfronthosting.co.za> Message-ID: <1585566978.78.0.523085171885.issue30744@roundup.psfhosted.org> Change by Ionel Cristian M?rie? : ---------- nosy: +ionelmc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:18:15 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 30 Mar 2020 11:18:15 +0000 Subject: [issue40112] AIX: xlc - default path changed and no longer recognized Message-ID: <1585567095.85.0.705098258477.issue40112@roundup.psfhosted.org> New submission from Michael Felt : The is a check if compiler is xlc, and skips a test if it is. XLC no longer installs in /usr/vac, and the test_search_cpp fails (again) ---------- components: Distutils messages: 365302 nosy: Michael.Felt, dstufft, eric.araujo priority: normal severity: normal status: open title: AIX: xlc - default path changed and no longer recognized type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:22:40 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 30 Mar 2020 11:22:40 +0000 Subject: [issue40112] AIX: xlc - default path changed and no longer recognized In-Reply-To: <1585567095.85.0.705098258477.issue40112@roundup.psfhosted.org> Message-ID: <1585567360.54.0.131045338327.issue40112@roundup.psfhosted.org> Change by Michael Felt : ---------- keywords: +patch pull_requests: +18587 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:32:25 2020 From: report at bugs.python.org (Davide Golinelli) Date: Mon, 30 Mar 2020 11:32:25 +0000 Subject: [issue40113] Turtle demo Message-ID: <1585567945.94.0.599224677.issue40113@roundup.psfhosted.org> New submission from Davide Golinelli : running the attacched simple program the turtle go backwards even if not asked. i added a sleep command in order to view the bug more easly ---------- components: Tests files: spike.py messages: 365303 nosy: Davide Golinelli priority: normal severity: normal status: open title: Turtle demo type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49011/spike.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:37:25 2020 From: report at bugs.python.org (brendon zhang) Date: Mon, 30 Mar 2020 11:37:25 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option Message-ID: <1585568245.56.0.943686007567.issue40114@roundup.psfhosted.org> Change by brendon zhang : ---------- components: Library (Lib) nosy: brendon-zhang at hotmail.com, rhettinger priority: normal severity: normal status: open title: support maxsize argument for lru_cache's user_function option type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:38:50 2020 From: report at bugs.python.org (brendon zhang) Date: Mon, 30 Mar 2020 11:38:50 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option Message-ID: <1585568330.2.0.695195877424.issue40114@roundup.psfhosted.org> Change by brendon zhang : ---------- keywords: +patch pull_requests: +18588 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:52:54 2020 From: report at bugs.python.org (brendon zhang) Date: Mon, 30 Mar 2020 11:52:54 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option Message-ID: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> New submission from brendon zhang : Existing implementation of lru_cache user_function option supports typed_code argument, but does not support maxsize argument, because when we pass in the user function as a positional argument, it gets assigned to the maxsize parameter, and therefore there is no way to pass the actual maxsize value. The PR implementation supports both signatures lru_cache(maxsize=128, typed=False) lru_cache(user_function, maxsize=128, typed=False) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 07:57:05 2020 From: report at bugs.python.org (brendon zhang) Date: Mon, 30 Mar 2020 11:57:05 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585569425.32.0.275395505602.issue40114@roundup.psfhosted.org> brendon zhang added the comment: Two concerns is 1. the method signature (inspect.signature(lru_cache)) is not (maxsize=128, typed=False) anymore, and so it is poor documentation. 2. not good reuse of TypeErrors related to incorrect number of inputs / type of inputs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 08:05:55 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 30 Mar 2020 12:05:55 +0000 Subject: [issue40113] Turtle demo In-Reply-To: <1585567945.94.0.599224677.issue40113@roundup.psfhosted.org> Message-ID: <1585569955.22.0.142435677563.issue40113@roundup.psfhosted.org> Steven D'Aprano added the comment: Perhaps this is just my old eyes, but I can't see where the turtle is going backwards. I can see it spinning, but it's not clear that the turtle position is moving backwards or if it is an illusion caused by the turtle spinning around. If your eyes are better and can see the backward motion, perhaps you could adjust the drawing to make it more obvious. Hide the turtle and change the pen colour perhaps? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 08:16:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 12:16:25 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1585570585.18.0.0390873580777.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ce105541f8ebcf2dffcadedfdeffdb698a0edb44 by Petr Viktorin in branch 'master': bpo-37207: Use vectorcall for list() (GH-18928) https://github.com/python/cpython/commit/ce105541f8ebcf2dffcadedfdeffdb698a0edb44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 08:16:39 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 30 Mar 2020 12:16:39 +0000 Subject: [issue40113] Turtle demo In-Reply-To: <1585567945.94.0.599224677.issue40113@roundup.psfhosted.org> Message-ID: <1585570599.34.0.148179811396.issue40113@roundup.psfhosted.org> Steven D'Aprano added the comment: Try changing the turtle to the arrow pointer and see if you can still see backwards movement. james.shape('arrow') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 08:18:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 12:18:57 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1585570737.24.0.325515254196.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: All PRs are now merged. Thanks to everybody who was involved in this issue. It's a nice speedup which is always good to take ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> performance versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:11:47 2020 From: report at bugs.python.org (Davide Golinelli) Date: Mon, 30 Mar 2020 13:11:47 +0000 Subject: [issue40113] Turtle demo In-Reply-To: <1585567945.94.0.599224677.issue40113@roundup.psfhosted.org> Message-ID: <1585573907.04.0.624777728159.issue40113@roundup.psfhosted.org> Davide Golinelli added the comment: I attacched a picture where you can see the cursor drawing backwars. the program is supposed to draw a function like y=sin(x) but is drawing y=abs(sin(x)). ---------- Added file: https://bugs.python.org/file49012/backwards.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:17:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 13:17:19 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585574239.6.0.634264671022.issue39562@roundup.psfhosted.org> STINNER Victor added the comment: This change caused python-gmpy2 tests to fail: https://bugzilla.redhat.com/show_bug.cgi?id=1817710 Reproducer: --- from __future__ import print_function, division import doctest filename = "doctest.txt" with open(filename, "w") as fp: print(""" Test ==== >>> all(x == 1 for x in [1, 1, 1]) True """.strip(), file=fp) result = doctest.testfile(filename, globs=globals()) print("result:", result) --- ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:20:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 13:20:31 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585574431.97.0.289624545218.issue39562@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +lukasz.langa priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:28:22 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 30 Mar 2020 13:28:22 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585574902.64.0.454079955077.issue39562@roundup.psfhosted.org> Batuhan Taskaya added the comment: Both PyCF_ALLOW_TOP_LEVEL_AWAIT and CO_FUTURE_DIVISION has same value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:39:45 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 30 Mar 2020 13:39:45 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585575585.78.0.864333214188.issue39562@roundup.psfhosted.org> Batuhan Taskaya added the comment: Sending a patch that would prevent this collision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:42:56 2020 From: report at bugs.python.org (brendon zhang) Date: Mon, 30 Mar 2020 13:42:56 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585575776.82.0.164806752419.issue40114@roundup.psfhosted.org> brendon zhang added the comment: update: ignore concern #1. I used __text_signature__ attribute to reset the inspect signature to something useful https://github.com/python/cpython/pull/19226/commits/eea367f64d2a83d0987a3f7a155ac015306e960b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 09:51:26 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 30 Mar 2020 13:51:26 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585576286.17.0.408392823246.issue39562@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +18590 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/19230 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:16:58 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 30 Mar 2020 14:16:58 +0000 Subject: [issue37881] __text_signature__ parser doesn't handle globals in extension module In-Reply-To: <1566135236.59.0.315734223996.issue37881@roundup.psfhosted.org> Message-ID: <1585577818.95.0.639485008529.issue37881@roundup.psfhosted.org> Change by Eric Wieser : ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:17:14 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 30 Mar 2020 14:17:14 +0000 Subject: [issue23967] Make inspect.signature expression evaluation more powerful In-Reply-To: <1429123957.6.0.780975142449.issue23967@psf.upfronthosting.co.za> Message-ID: <1585577834.08.0.63313266588.issue23967@roundup.psfhosted.org> Change by Eric Wieser : ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:20:17 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 30 Mar 2020 14:20:17 +0000 Subject: [issue23967] Make inspect.signature expression evaluation more powerful In-Reply-To: <1429123957.6.0.780975142449.issue23967@psf.upfronthosting.co.za> Message-ID: <1585578017.0.0.487993250404.issue23967@roundup.psfhosted.org> Eric Wieser added the comment: > To make this work I had to write an ast printer that produces evaluatable Python code. Note that it's not complete, I know it's not complete, it's missing loads of operators. Assume that if this is a good idea I will add all the missing operators. Now that `ast.unparse` is in (bpo-38870), can this patch be simplified? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:29:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 14:29:37 +0000 Subject: [issue40094] Add os.status_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585578577.66.0.275776619974.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: > Other name ideas: > * wait_status_to_exit_code() Well, anothe option is: * waitstatus_to_exitcode() While the documentation uses "exit code", the code commonly uses "exitcode" or "returncode". Moreover, in the os module, underscore is not used to separated words in function names. Examples: "getenv" not "get_env", "setpriority" not "set_priority", etc. Using "_to_" in the function name reduces the risk of conflict with a future addition to the libc. It's rare that libc function names use "_". One of the few exception: get_current_dir_name() which is a glibc extension. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:35:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 14:35:44 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585578944.9.0.598959824545.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 53e4c91725083975598350877e2ed8e2d0194114 by Dong-hee Na in branch 'master': bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202) https://github.com/python/cpython/commit/53e4c91725083975598350877e2ed8e2d0194114 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:38:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 14:38:30 +0000 Subject: [issue40115] test_asyncio leaked [3, 3, 3] references, sum=9 Message-ID: <1585579110.73.0.577311644063.issue40115@roundup.psfhosted.org> New submission from STINNER Victor : x86 Gentoo Refleaks 3.x: https://buildbot.python.org/all/#/builders/16/builds/128 test_asyncio leaked [3, 3, 3] references, sum=9 test_asyncio leaked [3, 5, 3] memory blocks, sum=11 3:26:23 load avg: 3.78 Re-running test_asyncio in verbose mode test_asyncio leaked [3, 3, 24] references, sum=30 test_asyncio leaked [3, 3, 26] memory blocks, sum=32 ---------- components: Tests, asyncio messages: 365318 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio leaked [3, 3, 3] references, sum=9 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 10:52:13 2020 From: report at bugs.python.org (hai shi) Date: Mon, 30 Mar 2020 14:52:13 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1585579933.42.0.0808553811131.issue40077@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:13:56 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 30 Mar 2020 15:13:56 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" Message-ID: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> New submission from Mark Shannon : The current implementation of dicts prevents keys from being shared when the order of attribute differs from the first instance created. This can potentially use a considerably larger amount of memory than expected. Consider the class: class C: opt = DEFAULT def __init__(self, attr, optional=None): if optional: self.opt = optional self.attr = attr This is a reasonable way to write a class, but has unpredictable memory use. In the attached example, per-instance dict size goes from 104 bytes to 232 bytes when sharing is prevented. The language specification says that the dicts maintain insertion order, but the wording implies that this only to explicit dictionaries, not instance attribute or other namespace dicts. Either we should allow key sharing in these cases, or clarify the documentation. ---------- components: Interpreter Core files: compact_dict_prevents_key_sharing.py messages: 365319 nosy: Mark.Shannon, inada.naoki priority: normal severity: normal stage: test needed status: open title: Regression in memory use of shared key dictionaries for "compact dicts" type: behavior Added file: https://bugs.python.org/file49013/compact_dict_prevents_key_sharing.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:23:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 15:23:07 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1585581787.02.0.925294798639.issue40116@roundup.psfhosted.org> Serhiy Storchaka added the comment: But the following class should not lead to unlimited memory consumption when create new instances: class C: count = 0 def __init__(self): count = self.__class__.count self.__class__.count = count + 1 setattr(self, f'a{count}', count) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:23:41 2020 From: report at bugs.python.org (Ankesh Saha) Date: Mon, 30 Mar 2020 15:23:41 +0000 Subject: [issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto() In-Reply-To: <1584703504.0.0.0724934497115.issue40025@roundup.psfhosted.org> Message-ID: <1585581821.89.0.662483857584.issue40025@roundup.psfhosted.org> Ankesh Saha added the comment: Hi, I have ran the code with with _generate_next_value_ method at the bottom of the class and didn't run into any exceptions. Please refer my python file. Please let me know if I am missing something. from enum import Enum, auto class E(Enum): A = auto() B = auto() def _generate_next_value_(name, *args): return name for l in (E): print(l.name) print(l.value) ---------- nosy: +ankeshsaha Added file: https://bugs.python.org/file49014/Issue40025.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:24:34 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 30 Mar 2020 15:24:34 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1585581874.31.0.947681945115.issue40116@roundup.psfhosted.org> Mark Shannon added the comment: Indeed it shouldn't. How is that relevant? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:31:16 2020 From: report at bugs.python.org (Hameer Abbasi) Date: Mon, 30 Mar 2020 15:31:16 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented Message-ID: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> New submission from Hameer Abbasi : Minimal reproducer: >>> class A: ... def __round__(self): ... return NotImplemented ... >>> round(A()) NotImplemented Should give a TypeError. This can be useful when deciding, for example, if a given a.dtype implements round based on the dtype ---------- components: Interpreter Core messages: 365323 nosy: Hameer Abbasi priority: normal severity: normal status: open title: __round__ doesn't behave well with return NotImplemented versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:33:38 2020 From: report at bugs.python.org (Hameer Abbasi) Date: Mon, 30 Mar 2020 15:33:38 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented In-Reply-To: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> Message-ID: <1585582418.29.0.18663906703.issue40117@roundup.psfhosted.org> Change by Hameer Abbasi : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:35:28 2020 From: report at bugs.python.org (omer sela) Date: Mon, 30 Mar 2020 15:35:28 +0000 Subject: [issue40118] os.stat in linux shows the wrong inode Message-ID: <1585582528.02.0.848256815415.issue40118@roundup.psfhosted.org> New submission from omer sela : when calling os.stat(fd).st_ino on with a file descriptor of a symbolic link it returns the inode of the original file and not of the link (picture attached) ---------- components: Library (Lib) files: python_bug.png messages: 365324 nosy: omer sela priority: normal severity: normal status: open title: os.stat in linux shows the wrong inode type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49015/python_bug.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:39:15 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 30 Mar 2020 15:39:15 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1585582755.02.0.0261914803681.issue40116@roundup.psfhosted.org> Mark Shannon added the comment: Just to clarify. class AlwaysShared: opt = DEFAULT def __init__(self, attr, optional=None): self.attr = attr if optional: self.opt = optional class SometimesShared: opt = DEFAULT def __init__(self, attr, optional=None): if optional: self.opt = optional self.attr = attr The class AlwaysShared always has shared keys, whereas the class SometimesShared is not shared if `optional` is True for first instantiation, but False for a later instantiation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:39:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 15:39:34 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1585582774.45.0.0696836321017.issue40116@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think the current behavior is a guard against such pitfall. If you allow to add new keys when not all other keys are set, you can end with sharing growing set of keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:43:44 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 30 Mar 2020 15:43:44 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented In-Reply-To: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> Message-ID: <1585583024.25.0.831646321873.issue40117@roundup.psfhosted.org> Eric V. Smith added the comment: NotImplemented is documented as only being used for binary operators: https://docs.python.org/3/library/constants.html#NotImplemented Changing that seems like a pretty large issue. I'd suggest discussing this on python-ideas. Maybe better for your situation is to actually raise NotImplementedError yourself, or ValaueError if that's what you really want to see. Changing version numbers, since this feature could only go in to 3.9. ---------- nosy: +eric.smith type: behavior -> enhancement versions: +Python 3.9 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 11:49:31 2020 From: report at bugs.python.org (Tapas Kundu) Date: Mon, 30 Mar 2020 15:49:31 +0000 Subject: [issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen() In-Reply-To: <1571903478.88.0.753943817426.issue38576@roundup.psfhosted.org> Message-ID: <1585583371.9.0.74326345386.issue38576@roundup.psfhosted.org> Change by Tapas Kundu : ---------- nosy: +tapakund nosy_count: 14.0 -> 15.0 pull_requests: +18591 pull_request: https://github.com/python/cpython/pull/19231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:04:51 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 16:04:51 +0000 Subject: [issue8901] Windows registry path not ignored with -E option In-Reply-To: <1275705565.03.0.753930892849.issue8901@psf.upfronthosting.co.za> Message-ID: <1585584291.71.0.446852677754.issue8901@roundup.psfhosted.org> Steve Dower added the comment: New changeset 676b105111e2399ed400cd13ab113f9aa891760d by Zackery Spytz in branch 'master': bpo-8901: Windows registry path is now ignored with the -E option (GH-18169) https://github.com/python/cpython/commit/676b105111e2399ed400cd13ab113f9aa891760d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:06:33 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 16:06:33 +0000 Subject: [issue8901] Windows registry path not ignored with -E option In-Reply-To: <1275705565.03.0.753930892849.issue8901@psf.upfronthosting.co.za> Message-ID: <1585584393.23.0.109348218038.issue8901@roundup.psfhosted.org> Steve Dower added the comment: I'm 99% satisfied that this change is the right approach (rather than adding a new option), but we'll have to wait to hear from beta feedback I think. My main concern is users who pass -E on the command line to avoid environment variables, but are relying on a Python install and not an embedded version. But for a regular install it should still find all the (site) libraries, so I think it'll be fine in basically every case. ---------- resolution: -> fixed stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:15:11 2020 From: report at bugs.python.org (David Edelsohn) Date: Mon, 30 Mar 2020 16:15:11 +0000 Subject: [issue40069] Clear .lst files for AIX In-Reply-To: <1585176703.22.0.6311195608.issue40069@roundup.psfhosted.org> Message-ID: <1585584911.68.0.650672983367.issue40069@roundup.psfhosted.org> David Edelsohn added the comment: Likely somewhere in the Python configuration process it is probing a command line option that emits a .lst file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:18:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 16:18:35 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented In-Reply-To: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> Message-ID: <1585585115.0.0.659492785422.issue40117@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you want to get a TypeError, raise a TypeError. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:53:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 16:53:46 +0000 Subject: [issue40115] test_asyncio leaked [3, 3, 3] references, sum=9 In-Reply-To: <1585579110.73.0.577311644063.issue40115@roundup.psfhosted.org> Message-ID: <1585587226.15.0.984363791765.issue40115@roundup.psfhosted.org> STINNER Victor added the comment: The leak was introduced by: commit b61b818d916942aad1f8f3e33181801c4a1ed14b (HEAD, refs/bisect/bad) Author: Kyle Stanley Date: Fri Mar 27 15:31:22 2020 -0400 bpo-39812: Remove daemon threads in concurrent.futures (GH-19149) Remove daemon threads from :mod:`concurrent.futures` by adding an internal `threading._register_atexit()`, which calls registered functions prior to joining all non-daemon threads. This allows for compatibility with subinterpreters, which don't support daemon threads. The leaking test is: $ ./python -m test --fail-env-changed -R 3:3 test_asyncio -m test.test_asyncio.test_events.EPollEventLoopTests.test_run_in_executor_cancel 0:00:00 load avg: 0.56 Run tests sequentially 0:00:00 load avg: 0.56 [1/1] test_asyncio beginning 6 repetitions 123456 ...... test_asyncio leaked [1, 1, 1] references, sum=3 test_asyncio leaked [2, 1, 1] memory blocks, sum=4 test_asyncio failed == Tests result: FAILURE == 1 test failed: test_asyncio Total duration: 4.2 sec Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:54:02 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Mar 2020 16:54:02 +0000 Subject: [issue36144] Dictionary union. (PEP 584) In-Reply-To: <1551327538.36.0.964853059958.issue36144@roundup.psfhosted.org> Message-ID: <1585587242.82.0.539910329852.issue36144@roundup.psfhosted.org> Guido van Rossum added the comment: I guess we should keep this open until Raymond Hettinger has given feedback on https://github.com/python/cpython/pull/18832 (where we have the option of changing to Brandt's proposal from https://github.com/python/cpython/pull/18832#issuecomment-596910350). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 12:55:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 16:55:17 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585587317.54.0.589492058247.issue39812@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-39812: Remove daemon threads in concurrent.futures (GH-19149) This change introduced a leak in test_asyncio: bpo-40115. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 13:12:30 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 30 Mar 2020 17:12:30 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented In-Reply-To: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> Message-ID: <1585588350.7.0.453781781727.issue40117@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 13:21:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 17:21: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: <1585588865.58.0.0326482712554.issue39503@roundup.psfhosted.org> STINNER Victor added the comment: bench_parser.py: Benchmark for AbstractBasicAuthHandler.http_error_auth_reqed(). ---------- Added file: https://bugs.python.org/file49016/bench_parser.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 13:36:23 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Mar 2020 17:36:23 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585589783.88.0.697057924885.issue40114@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:01:45 2020 From: report at bugs.python.org (Carol Willing) Date: Mon, 30 Mar 2020 18:01:45 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1585591305.46.0.528400426128.issue40046@roundup.psfhosted.org> Carol Willing added the comment: Hi Raymond and Serhiy, Serhiy, Was there a specific use case or regression that you felt the tests would be helpful? ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:48:21 2020 From: report at bugs.python.org (Georgy Kibardin) Date: Mon, 30 Mar 2020 18:48:21 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1585594101.81.0.574965985617.issue40037@roundup.psfhosted.org> Georgy Kibardin added the comment: This is not a duplicate of https://bugs.python.org/issue38731. quiet is is still undefined in main() ---------- nosy: +Georgy Kibardin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:49:22 2020 From: report at bugs.python.org (Georgy Kibardin) Date: Mon, 30 Mar 2020 18:49:22 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1585594162.45.0.503869377152.issue40037@roundup.psfhosted.org> Georgy Kibardin added the comment: Please, reopen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:51:09 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Mar 2020 18:51:09 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585594269.41.0.406302360088.issue40114@roundup.psfhosted.org> Raymond Hettinger added the comment: Since the current signature allows *maxsize* and *typed* to be either positional or keyword arguments, we couldn't do this cleanly the way dataclasses did. The code in the PR is valiant attempt but is way too tricky for my tastes -- we would likely regret going down this path. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:53:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 18:53:10 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1585594389.99.0.435254403455.issue40046@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, of course. The PR adds new tests for different types of arguments which currently are accepted (so it would be a regression if they will no accepted in new releases or in alternate implementations) and for types which currently are not accepted for reasons, so unexpected accepting may signal about using inefficient or incorrect algorithm. For example, choice() works not only with lists, but with other sequences, so the implementation which works only with lists (for example the C implementation which uses the concrete C API) will fail with new tests. If we fix this hypothetical implementation by converting the argument to list (which would be inefficient for large collections), other new tests (which check that sets and iterators are not accepted) will fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 14:59:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 18:59:03 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585594743.67.0.4416767458.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: Ok, I chose os.waitstatus_to_exitcode() name. I updated my PR. ---------- title: Add os.status_to_exitcode() function -> Add os.waitstatus_to_exitcode() function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:02:36 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 19:02:36 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585594956.79.0.00799401244127.issue40114@roundup.psfhosted.org> Serhiy Storchaka added the comment: You can use lru_cache(maxsize=128, typed=False)(user_function). lru_cache should support a function as an argument on if it is a single positional argument, this is the purpose. So you can write @lru_cache def func(...): ... instead of @lru_cache() def func(...): ... When you pass maxsize and typed you do not pass a function as an argument of lru_cache, you pass it as an argument of the decorator created by the lru_cache() call. @lru_cache(maxsize=128, typed=False) def func(...): ... ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:07:58 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Mar 2020 19:07:58 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585595278.33.0.730002324782.issue38002@roundup.psfhosted.org> Terry J. Reedy added the comment: Reproducer: In Shell, run "input('prompt'), Without giving a response, so that input is left 'executing', switch to editor with valid code, select "Run... Customized", unselect "Restart shell", and select OK. One will twice see and have to click away a box with The Python Shell window is already executing a command; please wait until it is finished. Then the attribute error error appears. Explanation: Run Module first compiles the editor code to check for syntax errors. If successful, it 1. restarts the execution process, which *resets executing to False*; 2. runs internal commands with runcommand (called twice) to change working directory, augment sys.path, and possibly change sys.args. 3. runs the compiled user code with runcode. Thus, the buggy 'executing' clause cannot be triggered. Run Customized with "Restart shell" unchecked skips the restart and 'executing' may be left True. If so, runcommand displays the message above and returns False, instead of running the command and returning True. The runscript code currently ignores the return and calls runcode anyway. Guiding principle: The effect of running with run customized with given settings should not depend on whether executable happens to be true when the first runcommand is called. I verified with time.sleep(15) that a statement can finish executing and executable reset to False while a user is reading the first 'executing' message. Since setting args has be skipped, the run should be stopped. Fixes: 1. Only display one 'executing' message. Either make the 2nd runcommand conditioned on the first succeeding, or combine the two partial duplicate runcommand calls into one. I will start with the first. 2. Improve the error message. The user should only run without restart when there is a waiting '>>>' prompt and may need to take action (respond to input(), close a tkinter window, restart a hung execution). The message should say 'Try again' since execution will not happen. 3. Don't run the users code after the message is given. 4. Fix the AttributeError as specified in my previous message. For running editor code, runcode will again not ever be called with executing True, and it may be that the clause could be deleted. But I am not sure what is possible is IDLE is started with both -s (run IDLESTARTUP or PYTHONSTARTUP) and -r file (run file), both of which also call runcode. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:09:41 2020 From: report at bugs.python.org (Anthon van der Neut) Date: Mon, 30 Mar 2020 19:09:41 +0000 Subject: [issue40119] ensurepip should use ifferent pattern for pip/setuptool wheel files Message-ID: <1585595381.19.0.00980598804085.issue40119@roundup.psfhosted.org> New submission from Anthon van der Neut : Setuptools, starting with minor version 45.1.0 no longer is a -py2.py3-none-any.whl file, but a -py3-none-any.whl file. In ensurepip's __init__.py the former is hard-coded, so the setuptools shipping with python (for 3.9.0a5 this is 41.2.0) cannot be upgraded beyond 45.0.0 I can provide a PR that fixes this, (either by using glob.glob() to find the exact .whl available. or by extending the tuple in _PROJECTS.) ---------- messages: 365344 nosy: anthon priority: normal severity: normal status: open title: ensurepip should use ifferent pattern for pip/setuptool wheel files type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:10:18 2020 From: report at bugs.python.org (Anthon van der Neut) Date: Mon, 30 Mar 2020 19:10:18 +0000 Subject: [issue40119] ensurepip should use different pattern for pip/setuptool wheel files In-Reply-To: <1585595381.19.0.00980598804085.issue40119@roundup.psfhosted.org> Message-ID: <1585595418.92.0.101185559965.issue40119@roundup.psfhosted.org> Change by Anthon van der Neut : ---------- title: ensurepip should use ifferent pattern for pip/setuptool wheel files -> ensurepip should use different pattern for pip/setuptool wheel files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:12:04 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Mar 2020 19:12:04 +0000 Subject: [issue38002] 'ModifiedInterpreter' object has no attribute 'interp' In-Reply-To: <1567368533.85.0.101387822612.issue38002@roundup.psfhosted.org> Message-ID: <1585595524.72.0.785647423495.issue38002@roundup.psfhosted.org> Raymond Hettinger added the comment: Thank you for investigating this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 15:13:08 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Mar 2020 19:13:08 +0000 Subject: [issue40108] Improve error message for -m option when .py is present In-Reply-To: <1585526523.79.0.240338395586.issue40108@roundup.psfhosted.org> Message-ID: <1585595588.56.0.798396105588.issue40108@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 16:19:18 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 30 Mar 2020 20:19:18 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585599558.61.0.102210234331.issue39943@roundup.psfhosted.org> Brett Cannon added the comment: New changeset fc2d8d62af25be90f5fd490df141a775d9619b23 by Andy Lester in branch 'master': bpo-39943: Remove unnecessary casts in import.c that remove constness (GH-19209) https://github.com/python/cpython/commit/fc2d8d62af25be90f5fd490df141a775d9619b23 ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 16:23:37 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 20:23:37 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1585599817.11.0.547436468056.issue39562@roundup.psfhosted.org> Serhiy Storchaka added the comment: If CO_FUTURE_DIVISION conflicts with PyCF_ALLOW_TOP_LEVEL_AWAIT, does not CO_ITERABLE_COROUTINE conflict with PyCF_SOURCE_IS_UTF8 and CO_ASYNC_GENERATOR with PyCF_DONT_IMPLY_DEDENT? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 16:39:49 2020 From: report at bugs.python.org (Carol Willing) Date: Mon, 30 Mar 2020 20:39:49 +0000 Subject: [issue40046] Increase test coverage of the random module In-Reply-To: <1584954071.53.0.240057665768.issue40046@roundup.psfhosted.org> Message-ID: <1585600789.89.0.273082583294.issue40046@roundup.psfhosted.org> Carol Willing added the comment: Thanks Serhiy for the explanation. I agree with Raymond about the doc change. Raymond, These tests, after reading Serihy's response, make sense to me. Let's revisit and reconsider the PR on the tests without the doc change. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:04:23 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 30 Mar 2020 21:04:23 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. Message-ID: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> New submission from Gregory P. Smith : The correct C99 way to do this is using a char[]. PyBytesObject and unicode's struct encoding_map both do this. Unclear to me if we should backport this to earlier versions or not (because PyBytesObject may be exposed?) Probably, but I also doubt it is a big deal as compilers are generally not _yet_ making use of this detail AFAIK. ---------- assignee: gregory.p.smith components: Interpreter Core messages: 365349 nosy: gregory.p.smith priority: normal severity: normal stage: patch review status: open title: Undefined C behavior going beyond end of struct via a char[1]. type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:07:36 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 30 Mar 2020 21:07:36 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585602456.08.0.0952506302234.issue40120@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +18592 pull_request: https://github.com/python/cpython/pull/19232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:13:10 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 30 Mar 2020 21:13:10 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585602790.24.0.94321459352.issue40120@roundup.psfhosted.org> Gregory P. Smith added the comment: >From the PR comment thread (as I opened that first): """Well, there was no other choice in ISO C89 than using char ob_sval[1];, no? Is char ob_sval[]; supported by the C compiler supported by CPython? Like Visual Studio, GCC, clang and xlc (AIX)? (I don't think that we officially support xlc, but it's more "best effort" support.) You can use the new buildbot label to test you change on more platforms.""" - vstinner Per https://www.python.org/dev/peps/pep-0007/ we require some C99 features as of CPython 3.6. It does not currently list Flexible array member. I'll be very surprised if we find any compiler that does not support this. I'll run this through the buildbot testing as you suggested and assuming nothing important falls out, see that we add this to the C99 required feature list. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:13:18 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 30 Mar 2020 21:13:18 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585602798.58.0.294807116235.issue40120@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:16:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 21:16:06 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1585602966.57.0.744848842589.issue40020@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 51e3e450fbed46198d9be92add1a5dee6a1f7f41 by Alexander Riccio in branch 'master': bpo-40020: Fix realloc leak on failure in growable_comment_array_add (GH-19083) https://github.com/python/cpython/commit/51e3e450fbed46198d9be92add1a5dee6a1f7f41 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:23:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 21:23:29 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1585603409.07.0.139014815589.issue40020@roundup.psfhosted.org> STINNER Victor added the comment: Alexander Riccio: Do you know want to propose a change to replace direct usage of malloc/realloc/free with PyMem_Malloc, PyMem_Realloc and PyMem_RawFree? It would add their builtin debug feature for free, and also detect most obvious buffer overflow (reject size larger than PY_SSIZE_T_MAX). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:26:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 21:26:03 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585603563.86.0.449757947417.issue39812@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue since it introduced a regression on buildbots. If no fix is found soon (let's say in 1 or 2 days), I will revert the change to get more time to investigate. If buildbots remain red, we will be other regressions which would make the situation even worse. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:26:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 21:26:46 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585603606.59.0.450264495968.issue39812@roundup.psfhosted.org> STINNER Victor added the comment: (Oops typo) If buildbots remain red, we will *miss* other regressions which would make the situation even worse. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:27:52 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 21:27:52 +0000 Subject: [issue37390] Generate table of audit events for docs In-Reply-To: <1561391164.88.0.923938823513.issue37390@roundup.psfhosted.org> Message-ID: <1585603672.91.0.804215236105.issue37390@roundup.psfhosted.org> Steve Dower added the comment: All seems to be fine now. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:31:39 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 21:31:39 +0000 Subject: [issue40121] socket module missing audit events Message-ID: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> New submission from Steve Dower : Some of the events it was supposed to raise are not being raised. This is likely my fault for not adding the thorough testing in the test suite at the time (I'm uncovering them now with a different test suite...) I'll do a thorough review of this module and post a PR with the fixes. This shouldn't require any new events, as far as I can tell. ---------- assignee: steve.dower messages: 365356 nosy: steve.dower priority: normal severity: normal stage: needs patch status: open title: socket module missing audit events type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 17:38:01 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Mar 2020 21:38:01 +0000 Subject: [issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections) In-Reply-To: <1580231817.93.0.47144630055.issue39481@roundup.psfhosted.org> Message-ID: <1585604281.85.0.464844773882.issue39481@roundup.psfhosted.org> Guido van Rossum added the comment: The SC approved the PEP! ?ukasz, do you want to submit the PR to update the PEP status? We should get the implementation reviewed (e.g. by Serhiy) and land it before alpha 6 goes out, April 22 (we should aim for a week before at least). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 18:03:46 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Mar 2020 22:03:46 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585605826.91.0.0652629320996.issue39943@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +18593 pull_request: https://github.com/python/cpython/pull/19236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 18:10:26 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 30 Mar 2020 22:10:26 +0000 Subject: [issue39734] Deprecate readinto() fallback path in _pickle.c In-Reply-To: <1582498028.39.0.0123392152586.issue39734@roundup.psfhosted.org> Message-ID: <1585606226.41.0.273760516588.issue39734@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +18594 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 18:17:24 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 22:17:24 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585606644.62.0.829469224471.issue40121@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +18595 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19238 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:21:51 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 30 Mar 2020 23:21:51 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585610511.16.0.305419064175.issue39812@roundup.psfhosted.org> Kyle Stanley added the comment: > This change introduced a leak in test_asyncio: bpo-40115. Thanks for bringing attention to it Victor. It seems like a rather odd side effect, considering that PR-19149 had no C code and was internal to concurrent.futures and threading. I did not expect asyncio to be dependent on the executors using atexit and daemon threads. I'll see if I can figure it out, but this one might be a bit tricky to troubleshoot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:27:22 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 30 Mar 2020 23:27:22 +0000 Subject: [issue37009] Threading and THREAD_SAFE for AIX In-Reply-To: <1558526469.21.0.552690908728.issue37009@roundup.psfhosted.org> Message-ID: <1585610842.39.0.707037683839.issue37009@roundup.psfhosted.org> Batuhan Taskaya added the comment: > this patch assures that the define is added to BASECFLAGS for AIX - and will not be forgotten during builds. @Micheal.Felt I can't see an attached patch or PR, FYI. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:30:38 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 30 Mar 2020 23:30:38 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585611038.94.0.238194570199.issue40121@roundup.psfhosted.org> Steve Dower added the comment: In my defense(?), it was working fine everywhere except Windows. And I'm pretty sure I was working in WSL for this change *shrug* With the PR, it will match the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:31:18 2020 From: report at bugs.python.org (Ido Michael) Date: Mon, 30 Mar 2020 23:31:18 +0000 Subject: [issue35885] configparser: indentation In-Reply-To: <1549061954.1.0.734541407213.issue35885@roundup.psfhosted.org> Message-ID: <1585611078.79.0.891659491838.issue35885@roundup.psfhosted.org> Ido Michael added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:45:47 2020 From: report at bugs.python.org (Ido Michael) Date: Mon, 30 Mar 2020 23:45:47 +0000 Subject: [issue39725] unrelated `from None` exceptions hide prior exception information In-Reply-To: <1582405503.93.0.737085396902.issue39725@roundup.psfhosted.org> Message-ID: <1585611947.18.0.496525002355.issue39725@roundup.psfhosted.org> Change by Ido Michael : ---------- nosy: -Ido Michael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 19:51:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Mar 2020 23:51:07 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585612267.11.0.133241803536.issue39812@roundup.psfhosted.org> STINNER Victor added the comment: > I'll see if I can figure it out, but this one might be a bit tricky to troubleshoot. Oh yes, I know that fixing such issue can be very tricky. For example, there is no threading._unregister_atexit() function. Maybe the callback stays alive after the test completes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 20:31:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Mar 2020 00:31:00 +0000 Subject: [issue40108] Improve error message for -m option when .py is present In-Reply-To: <1585526523.79.0.240338395586.issue40108@roundup.psfhosted.org> Message-ID: <1585614660.99.0.710768362564.issue40108@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch nosy: +pablogsal nosy_count: 2.0 -> 3.0 pull_requests: +18596 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19239 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:13:53 2020 From: report at bugs.python.org (Nathan Silberman) Date: Tue, 31 Mar 2020 02:13:53 +0000 Subject: [issue40103] ZipFile.extractall is not multiprocess safe with regard to directory creation. In-Reply-To: <1585499627.5.0.740021279333.issue40103@roundup.psfhosted.org> Message-ID: <1585620833.97.0.0500332804255.issue40103@roundup.psfhosted.org> Change by Nathan Silberman : ---------- keywords: +patch pull_requests: +18597 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:25:45 2020 From: report at bugs.python.org (brendon zhang) Date: Tue, 31 Mar 2020 02:25:45 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585621545.05.0.440520554938.issue40114@roundup.psfhosted.org> brendon zhang added the comment: "lru_cache(maxsize=128, typed=False)(user_function)" oh ok! I overlooked that you could do this. There isn't really a need then for supporting user_function w/ the maxsize argument in single call. "The code in the PR is valiant attempt but is way too tricky for my tastes" Yeah. I think only after looking back at the code after writing it I see it is too convoluted. I guess the code can remain as some artifact to show why not to down this path (unless some convenient way to implement it is introduced in the future). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:27:52 2020 From: report at bugs.python.org (brendon zhang) Date: Tue, 31 Mar 2020 02:27:52 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585621672.17.0.751392877109.issue40114@roundup.psfhosted.org> Change by brendon zhang : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:28:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Mar 2020 02:28:40 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585621720.07.0.242350190781.issue40114@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for putting some thought into this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:29:32 2020 From: report at bugs.python.org (brendon zhang) Date: Tue, 31 Mar 2020 02:29:32 +0000 Subject: [issue40114] support maxsize argument for lru_cache's user_function option In-Reply-To: <1585569174.2.0.0842447000374.issue40114@roundup.psfhosted.org> Message-ID: <1585621772.74.0.884036725802.issue40114@roundup.psfhosted.org> brendon zhang added the comment: np! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 30 22:59:08 2020 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 31 Mar 2020 02:59:08 +0000 Subject: [issue38976] Add support for HTTP Only flag in MozillaCookieJar In-Reply-To: <1575522823.75.0.720870581486.issue38976@roundup.psfhosted.org> Message-ID: <1585623548.81.0.235792335592.issue38976@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- assignee: -> orsenthil nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 00:55:47 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 31 Mar 2020 04:55:47 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1585630547.92.0.925373117228.issue40037@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I feel it's the same. It also reports about the undeclared variable just being found by bad file used with py_compile. It was also reported at https://bugs.python.org/issue39743. Can you please explain why this is not a duplicate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 02:33:39 2020 From: report at bugs.python.org (laike9m) Date: Tue, 31 Mar 2020 06:33:39 +0000 Subject: [issue40122] The implementation and documentation of "dis.findlables" don't match Message-ID: <1585636419.17.0.745722185034.issue40122@roundup.psfhosted.org> New submission from laike9m : The documentation of dis.findlabels says: > dis.findlabels(code) > Detect all offsets in the code object code which are jump targets, and return a list of these offsets. But the implementation actually expects a raw compiled bytecode. >>> def f():pass >>> dis.findlabels(f.__code__) Traceback (most recent call last): File "", line 1, in File "/Users/laike9m/.pyenv/versions/3.7.4/lib/python3.7/dis.py", line 424, in findlabels for offset, op, arg in _unpack_opargs(code): File "/Users/laike9m/.pyenv/versions/3.7.4/lib/python3.7/dis.py", line 408, in _unpack_opargs for i in range(0, len(code), 2): TypeError: object of type 'code' has no len() >>> dis.findlabels(f.__code__.co_code) [] Since the other functions in the dis module all accept a code object rather than compiled code, I would suggest change the code instead of documentation. Plus, this function does not seem to be tested anywhere. I can make a PR if this issue is confirmed. ---------- components: Library (Lib) messages: 365367 nosy: laike9m, serhiy.storchaka priority: normal severity: normal status: open title: The implementation and documentation of "dis.findlables" don't match versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 02:55:02 2020 From: report at bugs.python.org (Manjusaka) Date: Tue, 31 Mar 2020 06:55:02 +0000 Subject: [issue40122] The implementation and documentation of "dis.findlables" don't match In-Reply-To: <1585636419.17.0.745722185034.issue40122@roundup.psfhosted.org> Message-ID: <1585637702.15.0.238894830179.issue40122@roundup.psfhosted.org> Change by Manjusaka : ---------- nosy: +Manjusaka, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 05:01:09 2020 From: report at bugs.python.org (Georgy Kibardin) Date: Tue, 31 Mar 2020 09:01:09 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1585645269.05.0.291907568086.issue40037@roundup.psfhosted.org> Georgy Kibardin added the comment: https://bugs.python.org/issue39743 is closed as duplicate of https://bugs.python.org/issue38731. https://bugs.python.org/issue38731 fixes undeclared variable "quiet" in function compile(). At the same time variable "quiet" is used in function main() where it is still undeclared and 38731 doesn't fix this problem - it is still there, in python 3.8.2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 05:05:14 2020 From: report at bugs.python.org (Ammar Askar) Date: Tue, 31 Mar 2020 09:05:14 +0000 Subject: [issue39865] getattr silences an unrelated AttributeError In-Reply-To: <1583436241.07.0.803311507701.issue39865@roundup.psfhosted.org> Message-ID: <1585645514.27.0.36111465286.issue39865@roundup.psfhosted.org> Ammar Askar added the comment: As unfortunate as this is, I don't think there's an easy way to solve this while adhering to descriptors and the attribute lookup model. This is a consequence of the following rule: > object.__getattr__(self, name): > Called when the default attribute access fails with an > AttributeError (either __getattribute__() raises an AttributeError > because name is not an instance attribute or an attribute in the > class tree for self; or __get__() of a name property raises > AttributeError) As it notes, if the __get__() raises an AttributeError then a fallback to __getattr__ is initiated. One may think that maybe we can just catch AttributeError in @property to try to fix this problem but a quick search shows that people do intentionally raise AttributeError in @property methods: * https://github.com/kdschlosser/EventGhost-TPLink/blob/a4a642fde8dd4deba66262a36d673cbbf71b8ceb/TPLink/tp_link/rule.py#L148-L152 * https://github.com/ajayau404/sniffer/blob/cd0c813b8b526a3c791735a41b13c7677eb4aa0e/lib/python3.5/site-packages/vpython/vpython.py#L1942-L1944 While this in combination with a __getattr__ is rare, I was able to find one example: * https://github.com/xrg/behave_manners/blob/19a5feb0b67fe73cd902a959f0d038b905a69b38/behave_manners/context.py#L37 I don't think that changing this behavior is acceptable as people might be relying on it and it's well documented. In your case, I think it's really the "catch-all" __getattr__ that's at fault here which really shouldn't be returning None for all attributes blindly. This does bring up a good point though that in the process of this fall-back behavior, the original AttributeError from A's property does get masked. What can be done and might be a good idea is to show the original AttributeError failure as the cause for the second. Something like this: Traceback (most recent call last): File "", line 2, in File "", line 5, in myprop AttributeError: 'int' object has no attribute 'foo' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 7, in File "", line 5, in File "", line 7, in __getattr__ AttributeError: not found in __getattr__ This at least somewhat indicates that the original descriptor __get__ failed and then __getattr__ also raised. As opposed to now where the original exception gets masked: >>> class A: ... @property ... def myprop(self): ... a = 1 ... a.foo ... def __getattr__(self, attr_name): ... raise AttributeError("not found in __getattr__") ... >>> a = A() >>> a.myprop Traceback (most recent call last): File "", line 1, in File "", line 7, in __getattr__ AttributeError: not found in __getattr__ I'm gonna take a stab at implementing this real quick to see if it's actually useful and viable. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 05:06:40 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 31 Mar 2020 09:06:40 +0000 Subject: [issue40037] py_compile.py quiet undefined in main function In-Reply-To: <1584851662.52.0.134936419172.issue40037@roundup.psfhosted.org> Message-ID: <1585645600.7.0.0582708304441.issue40037@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: There is PR https://github.com/python/cpython/pull/17134 which is not merged to fix the exception so this is not fixed for 3.8.2. Once the fix is applied and released you can test the same ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 05:24:14 2020 From: report at bugs.python.org (merli) Date: Tue, 31 Mar 2020 09:24:14 +0000 Subject: [issue40123] append() works not correct Message-ID: <1585646654.92.0.927427440827.issue40123@roundup.psfhosted.org> New submission from merli : Please try out and look bug in this example: Liste = [] StringL = ["Nr.:", "NR", "Bielefeld", "Paderborn", "Lemgo"] for i in range (10): StringL[1] = str(i) Liste.append(StringL) print (StringL) #print (Liste) print () print() for i in range (10): print (Liste[i]) ---------- messages: 365371 nosy: merli priority: normal severity: normal status: open title: append() works not correct type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 05:32:36 2020 From: report at bugs.python.org (merli) Date: Tue, 31 Mar 2020 09:32:36 +0000 Subject: [issue40123] append() works not correct In-Reply-To: <1585646654.92.0.927427440827.issue40123@roundup.psfhosted.org> Message-ID: <1585647156.54.0.545015424042.issue40123@roundup.psfhosted.org> merli added the comment: Output: ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 06:05:20 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 31 Mar 2020 10:05:20 +0000 Subject: [issue40123] append() works not correct In-Reply-To: <1585646654.92.0.927427440827.issue40123@roundup.psfhosted.org> Message-ID: <1585649120.43.0.483153136757.issue40123@roundup.psfhosted.org> R?mi Lapeyre added the comment: Hi merli, there is no bug here, you always append the same list to Liste so when modifying it you override previous values. You could make a copy of it by using `Liste.append(list(StringL))` instead of `Liste.append(StringL)` and you would get the behaviour you expect. Please ask questions in python-help or in StackOverflow for questions related to Python usage. ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 06:11:18 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 31 Mar 2020 10:11:18 +0000 Subject: [issue40123] append() works not correct In-Reply-To: <1585646654.92.0.927427440827.issue40123@roundup.psfhosted.org> Message-ID: <1585649478.48.0.912353677824.issue40123@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 06:43:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 10:43:40 +0000 Subject: [issue40122] The implementation and documentation of "dis.findlables" don't match In-Reply-To: <1585636419.17.0.745722185034.issue40122@roundup.psfhosted.org> Message-ID: <1585651420.89.0.722392352457.issue40122@roundup.psfhosted.org> Serhiy Storchaka added the comment: dis.findlabels() always worked with a byte code. And the docstring correctly describes this. I think this is a documentation issue. The documentation fix should be backported to all maintained Python versions. If you want to make dis.findlabels() accepting a code object, it would be a new feature and it may be only added in future Python release (3.9). It needs a separate issue. In any case the documentation bug should be fixed in maintained versions. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python stage: -> needs patch type: -> behavior versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 06:46:40 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 31 Mar 2020 10:46:40 +0000 Subject: [issue40117] __round__ doesn't behave well with return NotImplemented In-Reply-To: <1585582276.55.0.632143445993.issue40117@roundup.psfhosted.org> Message-ID: <1585651600.94.0.364899543749.issue40117@roundup.psfhosted.org> Mark Dickinson added the comment: Agreed with Eric and Serhiy. This seems to be a misunderstanding about the scope of NotImplemented. @Hameer Abbasi: if you have an example of a problem that would be solved by this behaviour change, and which can't be solved simply by raising TypeError or another exception within __round__, feel free to open a discussion on the python-ideas mailing list. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:12:19 2020 From: report at bugs.python.org (Geoffrey Bache) Date: Tue, 31 Mar 2020 11:12:19 +0000 Subject: [issue38884] __import__ is not thread-safe on Python 3 In-Reply-To: <1574363514.58.0.324753075286.issue38884@roundup.psfhosted.org> Message-ID: <1585653139.98.0.0786476338783.issue38884@roundup.psfhosted.org> Change by Geoffrey Bache : ---------- nosy: +gjb1002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:24:06 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Mar 2020 11:24:06 +0000 Subject: [issue40108] Improve error message for -m option when .py is present In-Reply-To: <1585526523.79.0.240338395586.issue40108@roundup.psfhosted.org> Message-ID: <1585653846.59.0.262916585223.issue40108@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ef67512b40240f765026ad41d60b0c9a6dacd2b9 by Pablo Galindo in branch 'master': bpo-40108: Improve the error message in runpy when importing a module that includes the extension (GH-19239) https://github.com/python/cpython/commit/ef67512b40240f765026ad41d60b0c9a6dacd2b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:24:05 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Mar 2020 11:24:05 +0000 Subject: [issue40108] Improve error message for -m option when .py is present In-Reply-To: <1585526523.79.0.240338395586.issue40108@roundup.psfhosted.org> Message-ID: <1585653845.76.0.309946861554.issue40108@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 Mar 31 07:31:03 2020 From: report at bugs.python.org (Ben Spiller) Date: Tue, 31 Mar 2020 11:31:03 +0000 Subject: [issue38633] shutil.copystat fails with PermissionError in WSL In-Reply-To: <1572359678.82.0.846153471805.issue38633@roundup.psfhosted.org> Message-ID: <1585654263.58.0.972032936505.issue38633@roundup.psfhosted.org> Ben Spiller added the comment: Looks like on WSL the errno is errno.EACCES rather than EPERM, so we just need to change the shutil._copyxattr error handler to also cope with that error code: except OSError as e: - if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA): + if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA, errno.EACCES): raise If anyone needs a workaround until this is fixed in shutil itself, you can do it by monkey-patching _copyxattr: import errno, shutil # have to monkey patch to work with WSL as workaround for https://bugs.python.org/issue38633 orig_copyxattr = shutil._copyxattr def patched_copyxattr(src, dst, *, follow_symlinks=True): try: orig_copyxattr(src, dst, follow_symlinks=follow_symlinks) except OSError as ex: if ex.errno != errno.EACCES: raise shutil._copyxattr = patched_copyxattr ---------- nosy: +benspiller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:34:58 2020 From: report at bugs.python.org (Phil) Date: Tue, 31 Mar 2020 11:34:58 +0000 Subject: [issue40124] Clearer assertion error Message-ID: <1585654498.8.0.880221845215.issue40124@roundup.psfhosted.org> New submission from Phil : https://discuss.python.org/t/assertionerror-asyncio-streams-in-drain-helper/3743/4 I recently came across this error, which I now know how to fix. I think the error can be clearer and I've a PR which I think does so. ---------- components: asyncio messages: 365378 nosy: asvetlov, pgjones, yselivanov priority: normal severity: normal status: open title: Clearer assertion error versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:35:32 2020 From: report at bugs.python.org (Phil) Date: Tue, 31 Mar 2020 11:35:32 +0000 Subject: [issue40124] Clearer assertion error In-Reply-To: <1585654498.8.0.880221845215.issue40124@roundup.psfhosted.org> Message-ID: <1585654532.1.0.298111911791.issue40124@roundup.psfhosted.org> Change by Phil : ---------- keywords: +patch pull_requests: +18598 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:39:01 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 31 Mar 2020 11:39:01 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585654741.12.0.718946183141.issue40121@roundup.psfhosted.org> Steve Dower added the comment: New changeset 63ba5cccf484b9ec23dfbf4cf7ffdc833eda98c3 by Steve Dower in branch 'master': bpo-40121: Fixes audit event raised on creating a new socket (GH-19238) https://github.com/python/cpython/commit/63ba5cccf484b9ec23dfbf4cf7ffdc833eda98c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:39:23 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 11:39:23 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585654763.01.0.291915416417.issue40121@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +18600 pull_request: https://github.com/python/cpython/pull/19241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:47:32 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 31 Mar 2020 11:47:32 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585655252.52.0.437656636973.issue40121@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:57:14 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 11:57:14 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585655834.67.0.294392286792.issue40121@roundup.psfhosted.org> miss-islington added the comment: New changeset 6a0ee60db4cee4a01bae1a2922d21a859e9ea2ed by Miss Islington (bot) in branch '3.8': bpo-40121: Fixes audit event raised on creating a new socket (GH-19238) https://github.com/python/cpython/commit/6a0ee60db4cee4a01bae1a2922d21a859e9ea2ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 07:59:01 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 31 Mar 2020 11:59:01 +0000 Subject: [issue40124] Clearer assertion error In-Reply-To: <1585654498.8.0.880221845215.issue40124@roundup.psfhosted.org> Message-ID: <1585655941.3.0.935599069627.issue40124@roundup.psfhosted.org> Eric V. Smith added the comment: Do we really want this to be just an assert, or do we want to raise another type of exception? I think it's showing a real programming error that we wouldn't want to throw away with -O. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:14:26 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 31 Mar 2020 12:14:26 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585656866.23.0.7156738374.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18601 pull_request: https://github.com/python/cpython/pull/19242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:21:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 12:21:38 +0000 Subject: [issue40122] The implementation and documentation of "dis.findlables" don't match In-Reply-To: <1585636419.17.0.745722185034.issue40122@roundup.psfhosted.org> Message-ID: <1585657298.6.0.628137275005.issue40122@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:24:13 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 12:24:13 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585657453.29.0.435999768263.issue39689@roundup.psfhosted.org> miss-islington added the comment: New changeset 0f9e889cd94c1e86f8ff28733b207c99803ca8a4 by Miss Islington (bot) in branch '3.7': bpo-39689: Do not use native packing for format "?" with standard size (GH-18969) https://github.com/python/cpython/commit/0f9e889cd94c1e86f8ff28733b207c99803ca8a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:26:10 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 12:26:10 +0000 Subject: [issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9) In-Reply-To: <1582124509.96.0.385275594117.issue39689@roundup.psfhosted.org> Message-ID: <1585657570.16.0.264506661974.issue39689@roundup.psfhosted.org> miss-islington added the comment: New changeset 572ef747692055a270a9fbf8eeaf5c4a15c8e332 by Miss Islington (bot) in branch '3.8': bpo-39689: Do not use native packing for format "?" with standard size (GH-18969) https://github.com/python/cpython/commit/572ef747692055a270a9fbf8eeaf5c4a15c8e332 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:30:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 12:30:27 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585657827.17.0.352646003589.issue40121@roundup.psfhosted.org> STINNER Victor added the comment: s390x Fedora 3.x buildbot is unhappy: https://buildbot.python.org/all/#/builders/336/builds/328 ====================================================================== FAIL: test_socket (test.test_audit.AuditTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_audit.py", line 125, in test_socket self.fail(stderr) AssertionError Stderr: Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py", line 345, in test_socket sock.bind(('127.0.0.1', 8080)) OSError: [Errno 98] Address already in use During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py", line 358, in globals()[test]() File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py", line 346, in test_socket except error: NameError: name 'error' is not defined ---------------------------------------------------------------------- ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:43:46 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 31 Mar 2020 12:43:46 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1585658626.9.0.31333119751.issue37207@roundup.psfhosted.org> Petr Viktorin added the comment: The change to dict() was not covered by the smaller PRs. That one will need more thought, but AFAIK it wasn't yet rejected. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:43:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 12:43:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585658633.59.0.910964018461.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1cb763b8808745b9a368c1158fda19d329f63f6f by Dong-hee Na in branch 'master': bpo-1635741: Port _uuid module to multiphase initialization (GH-19242) https://github.com/python/cpython/commit/1cb763b8808745b9a368c1158fda19d329f63f6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 08:44:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 12:44:38 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1585658678.27.0.0767983474663.issue37207@roundup.psfhosted.org> STINNER Victor added the comment: Oh sorry, I missed the dict. ---------- resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 09:20:32 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 31 Mar 2020 13:20:32 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585660832.77.0.572616422085.issue1635741@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +18602 pull_request: https://github.com/python/cpython/pull/19243 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 09:38:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 13:38:08 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585661888.86.0.38130458346.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18603 pull_request: https://github.com/python/cpython/pull/19244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 10:05:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 14:05:49 +0000 Subject: [issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots In-Reply-To: <1584546495.72.0.913336015216.issue40003@roundup.psfhosted.org> Message-ID: <1585663549.87.0.19226572691.issue40003@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +18604 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 10:24:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 14:24:31 +0000 Subject: [issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s) In-Reply-To: <1516259345.01.0.467229070634.issue32591@psf.upfronthosting.co.za> Message-ID: <1585664671.61.0.176719266635.issue32591@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 6.0 -> 7.0 pull_requests: +18605 pull_request: https://github.com/python/cpython/pull/19247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 10:33:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 14:33:29 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585665209.06.0.286684505496.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5be8241392453751beea21d2e32096c15a8d47db by Dong-hee Na in branch 'master': bpo-1635741: Port math module to multiphase initialization (GH-19243) https://github.com/python/cpython/commit/5be8241392453751beea21d2e32096c15a8d47db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:05:15 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 31 Mar 2020 15:05:15 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f Message-ID: <1585667115.02.0.367576519808.issue40125@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- assignee: christian.heimes components: SSL nosy: benjamin.peterson, christian.heimes priority: normal severity: normal status: open title: update OpenSSL 1.1.1 in multissltests.py to 1.1.1f versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:10:17 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 31 Mar 2020 15:10:17 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f Message-ID: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> New submission from Christian Heimes : +1 I usually update all version to latest patch and backport the change to active branches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:11:34 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 31 Mar 2020 15:11:34 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585667494.22.0.418251226393.issue40125@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- versions: +Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:19:49 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 31 Mar 2020 15:19:49 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585667989.05.0.439967465569.issue40125@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- keywords: +patch pull_requests: +18606 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19248 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:25:08 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 31 Mar 2020 15:25:08 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1585668308.31.0.715594217257.issue40116@roundup.psfhosted.org> Mark Shannon added the comment: You can't end up with a growing set of keys. The problem is to do with the *order* of insertion, not the number of keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:25:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 15:25:21 +0000 Subject: [issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s) In-Reply-To: <1516259345.01.0.467229070634.issue32591@psf.upfronthosting.co.za> Message-ID: <1585668321.18.0.61387412073.issue32591@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8d84adcd736619c2ce510dff1e7ffd3ab08df06a by Victor Stinner in branch 'master': bpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247) https://github.com/python/cpython/commit/8d84adcd736619c2ce510dff1e7ffd3ab08df06a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:25:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 15:25:59 +0000 Subject: [issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots In-Reply-To: <1584546495.72.0.913336015216.issue40003@roundup.psfhosted.org> Message-ID: <1585668359.93.0.401455043031.issue40003@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 01e743d704aeefd1c1825a6a96d0c766c5516fb1 by Victor Stinner in branch 'master': bpo-40003: test.bisect_cmd copies Python options (GH-19246) https://github.com/python/cpython/commit/01e743d704aeefd1c1825a6a96d0c766c5516fb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:36:57 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 31 Mar 2020 15:36:57 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585669017.54.0.50979600761.issue40094@roundup.psfhosted.org> Eryk Sun added the comment: > On Windows, os.waitpid() status also requires an operation (shif > right by 8 bits) to get an exitcode from the waitpid status. FWIW, I wouldn't recommend relying on os.waitpid to get the correct process exit status in Windows. Status codes are 32 bits and generally all bits are required. os.waitpid left shifts the exit status by 8 bits in a dubious attempt to return a result that's "more like the POSIX waitpid". In particular, a program may exit abnormally with an NTSTATUS [1] or HRESULT [2] code such as STATUS_DLL_NOT_FOUND (0xC000_0135) or STATUS_CONTROL_C_EXIT (0xC000_013A). [1]: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781 [2]: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:50:02 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 31 Mar 2020 15:50:02 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585669802.69.0.260043705552.issue40125@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset cd16661f903153ecac55f190ed682e576c5deb24 by Benjamin Peterson in branch 'master': closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248) https://github.com/python/cpython/commit/cd16661f903153ecac55f190ed682e576c5deb24 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:50:12 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 15:50:12 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585669812.72.0.116105127776.issue40125@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18607 pull_request: https://github.com/python/cpython/pull/19249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:50:20 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 15:50:20 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585669820.29.0.599133285909.issue40125@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18608 pull_request: https://github.com/python/cpython/pull/19250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 11:51:36 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 31 Mar 2020 15:51:36 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585669896.54.0.835131033799.issue40125@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- pull_requests: +18609 pull_request: https://github.com/python/cpython/pull/19251 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:07:24 2020 From: report at bugs.python.org (Barry McLarnon) Date: Tue, 31 Mar 2020 16:07:24 +0000 Subject: [issue40126] Incorrect error handling in unittest.mock Message-ID: <1585670844.45.0.631660598637.issue40126@roundup.psfhosted.org> New submission from Barry McLarnon : The error handling in mock.decorate_callable (3.5-3.7) and mock.decoration_helper (3.8-3.9) is incorrectly implemented. If the error handler is triggered in the loop, the `patching` variable is out of scope and raises an unhandled `UnboundLocalError` instead. This happened as a result of a 3rd-party library that attempts to clear the `patchings` list of a decorated function. The below code shows a recreation of the incorrect error handling: import functools from unittest import mock def is_valid(): return True def mock_is_valid(): return False def decorate(f): @functools.wraps(f) def decorate_wrapper(*args, **kwargs): # This happens in a 3rd-party library f.patchings = [] return f(*args, **kwargs) return decorate_wrapper @decorate @mock.patch('test.is_valid', new=mock_is_valid) def test_patch(): raise Exception() ---------- components: Tests messages: 365395 nosy: bmclarnon priority: normal severity: normal status: open title: Incorrect error handling in unittest.mock type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:07:30 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 16:07:30 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585670850.77.0.296752345362.issue40125@roundup.psfhosted.org> miss-islington added the comment: New changeset 9073f9272475be620c09b2852c094788b2b7096a by Miss Islington (bot) in branch '3.7': closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248) https://github.com/python/cpython/commit/9073f9272475be620c09b2852c094788b2b7096a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:08:56 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 16:08:56 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585670936.19.0.375684950007.issue40125@roundup.psfhosted.org> miss-islington added the comment: New changeset fb6e04b5f10086194bcc77d571f77cb30873998b by Miss Islington (bot) in branch '3.8': closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248) https://github.com/python/cpython/commit/fb6e04b5f10086194bcc77d571f77cb30873998b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:17:39 2020 From: report at bugs.python.org (hai shi) Date: Tue, 31 Mar 2020 16:17:39 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1585671459.4.0.860522722536.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +18610 pull_request: https://github.com/python/cpython/pull/19252 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:40:25 2020 From: report at bugs.python.org (Christophe Nanteuil) Date: Tue, 31 Mar 2020 16:40:25 +0000 Subject: [issue40127] Documentation of SSL library Message-ID: <1585672825.27.0.231879770193.issue40127@roundup.psfhosted.org> New submission from Christophe Nanteuil : For the ssl.create_default_context() function, it states that, "if cafile, capath and cadata are None, the function *can* choose to trust the system's default CA certificates instead". This statement is not clear as, if the values are None, there is no choice and the only elements available are system's default CA. AFAIK, if the values are not None, it will not fall back to system's default CA even if the given CA does not match. I propose to modify the end of the sentence with "the function trusts the system's default CA certificates instead". ---------- assignee: docs at python components: Documentation messages: 365398 nosy: Christophe Nanteuil, docs at python priority: normal severity: normal status: open title: Documentation of SSL library versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:40:57 2020 From: report at bugs.python.org (Christophe Nanteuil) Date: Tue, 31 Mar 2020 16:40:57 +0000 Subject: [issue40127] Documentation of SSL library In-Reply-To: <1585672825.27.0.231879770193.issue40127@roundup.psfhosted.org> Message-ID: <1585672857.51.0.351689687448.issue40127@roundup.psfhosted.org> Change by Christophe Nanteuil : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:46:56 2020 From: report at bugs.python.org (Sam Gross) Date: Tue, 31 Mar 2020 16:46:56 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585673216.28.0.773022717942.issue40120@roundup.psfhosted.org> Sam Gross added the comment: It may be worth considering C-API extensions written in C++. Flexible array members are not part of the C++ standard, although GCC, Clang, and MSVC support them as an extension. GCC and Clang will issue warnings with `-Wpedantic` and MSVC will issue warnings with `/Wall`. Currently, C++ code that includes `` is warning-free in GCC (g++) even with `-Wpedantic`. That won't be true after this change, unless Py_LIMITED_API is defined. Note that GCC also explicitly supports trailing one-element arrays (the current pattern) as an extension. https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html ---------- nosy: +colesbury _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 12:48:39 2020 From: report at bugs.python.org (Christophe Nanteuil) Date: Tue, 31 Mar 2020 16:48:39 +0000 Subject: [issue40127] Documentation of SSL library In-Reply-To: <1585672825.27.0.231879770193.issue40127@roundup.psfhosted.org> Message-ID: <1585673319.76.0.00481521202207.issue40127@roundup.psfhosted.org> Change by Christophe Nanteuil : ---------- keywords: +patch pull_requests: +18611 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19253 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:05:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 17:05:14 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585674314.05.0.149589739247.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18612 pull_request: https://github.com/python/cpython/pull/19254 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:10:29 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 17:10:29 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585674629.26.0.0162177021665.issue40019@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +18613 pull_request: https://github.com/python/cpython/pull/19255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:10:58 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 17:10:58 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585674658.82.0.0677982245713.issue40019@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +18614 pull_request: https://github.com/python/cpython/pull/19256 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:15:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 17:15:52 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585674952.98.0.578092109305.issue40019@roundup.psfhosted.org> STINNER Victor added the comment: We have this issue in Fedora Rawhide. test_gdb of Python 3.8 fails on s390x and armv7hl architectures with GCC 10: https://bugzilla.redhat.com/show_bug.cgi?id=1818857 I tested manually that my change fix test_gdb: tests are skipped as expected: https://src.fedoraproject.org/rpms/python3/pull-request/182 So I backported the change to 3.7 and 3.8. This change only fix test_gdb. To get a fully working python-gdb.py, IMHO the best is to disable all compiler optimization using -O0 optimization level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:16:48 2020 From: report at bugs.python.org (Arthur) Date: Tue, 31 Mar 2020 17:16:48 +0000 Subject: [issue40128] IDLE Show completions/ autocomplete pop-up not working Message-ID: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> New submission from Arthur : Hi, I am new to python, I am learning it now. In the course the guy is using autocomplete and when he writes "math." he gets an autocomplete menu. on my device for some reason it is not working. I also tried the key combination to force pop-up but nothing happens. I am running macOSx Catalina 10.15.2 and IDLE 3.8.2 P.s. I reinstalled IDLE, nothing changed. ---------- assignee: terry.reedy components: IDLE messages: 365401 nosy: darthur90, terry.reedy priority: normal severity: normal status: open title: IDLE Show completions/ autocomplete pop-up not working type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:18:20 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 31 Mar 2020 17:18:20 +0000 Subject: [issue40127] Documentation of SSL library In-Reply-To: <1585672825.27.0.231879770193.issue40127@roundup.psfhosted.org> Message-ID: <1585675100.1.0.521166908083.issue40127@roundup.psfhosted.org> Christian Heimes added the comment: There are choices beyond our control. For example the operating system may not have a usable trust store. OpenSSL's builtin paths may not be correctly configured to locate the trust store. The user may have configured her/his environment to load other or no CA certs. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:25:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 17:25:15 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585675515.87.0.466599845685.issue40120@roundup.psfhosted.org> STINNER Victor added the comment: > Currently, C++ code that includes `` is warning-free in GCC (g++) even with `-Wpedantic`. That won't be true after this change, unless Py_LIMITED_API is defined. By the way, the current trend is to make more and more structures opaque in the C API. See for example: * bpo-39573: Make PyObject an opaque structure in the limited C API * bpo-39947: Make the PyThreadState structure opaque (move it to the internal C API) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:27:48 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 17:27:48 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585675668.82.0.868039267374.issue40019@roundup.psfhosted.org> miss-islington added the comment: New changeset 4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc by Miss Islington (bot) in branch '3.8': bpo-40019: Skip test_gdb if Python was optimized (GH-19081) https://github.com/python/cpython/commit/4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:28:39 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Mar 2020 17:28:39 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585675719.62.0.409053040791.issue40019@roundup.psfhosted.org> miss-islington added the comment: New changeset a764a1cc663708361300cdf88fcf697633142319 by Miss Islington (bot) in branch '3.7': bpo-40019: Skip test_gdb if Python was optimized (GH-19081) https://github.com/python/cpython/commit/a764a1cc663708361300cdf88fcf697633142319 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:30:04 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 17:30:04 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585675804.34.0.794644945878.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: Eryk: > FWIW, I wouldn't recommend relying on os.waitpid to get the correct process exit status in Windows. Status codes are 32 bits and generally all bits are required. os.waitpid left shifts the exit status by 8 bits in a dubious attempt to return a result that's "more like the POSIX waitpid". In particular, a program may exit abnormally with an NTSTATUS [1] or HRESULT [2] code such as STATUS_DLL_NOT_FOUND (0xC000_0135) or STATUS_CONTROL_C_EXIT (0xC000_013A). os.waitpid() calls _cwait() on Windows and uses "status << 8". The result is a Python object. IMHO it's ok if the shifted result ("status") is larger than 32 bits. But I'm not sure that the current os.waitpid() implementation handles integer overflow correctly... When I look at GetExitCodeProcess() documentation, I don't see any distinction between "normal exit" and a program terminated by TerminateProcess(). The only different is the actual exit code: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess Do you suggest that os.waitstatus_to_exitcode() result should be negative if a process was terminated by TerminateProcess()? -- My PR 19201 is based on the current Python implementation and assumptions used in the current code. But I don't think that what you wrote can be an API issue. It's more the opposite, if tomorrow we want to encode the status of a terminated process differently, it will be easier if os.waitstatus_to_exitcode() is available, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:31:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 17:31:29 +0000 Subject: [issue40019] test_gdb should better detect when Python is optimized In-Reply-To: <1584660034.18.0.372884225596.issue40019@roundup.psfhosted.org> Message-ID: <1585675889.77.0.852637354498.issue40019@roundup.psfhosted.org> STINNER Victor added the comment: Ok, test_gdb should now be more reliable with various compilers and compiler optimization levels. I chose to not skip a test if '' is found in the gdb output. If it becomes an issue, test_gdb can easily be modified to also be skipped in this case. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 13:32:04 2020 From: report at bugs.python.org (Christophe Nanteuil) Date: Tue, 31 Mar 2020 17:32:04 +0000 Subject: [issue40127] Documentation of SSL library In-Reply-To: <1585672825.27.0.231879770193.issue40127@roundup.psfhosted.org> Message-ID: <1585675924.53.0.343492091875.issue40127@roundup.psfhosted.org> Christophe Nanteuil added the comment: Thanks for clarifying the choice. I understand that we could state : " if cafile ... are None, the function falls back to user/system configuration (which is beyond this documentation)." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 14:08:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 18:08:15 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585678095.54.0.834318026078.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 278c1e159c970da6cd6683d18c6211f5118674cc by Victor Stinner in branch 'master': bpo-40094: Add test.support.wait_process() (GH-19254) https://github.com/python/cpython/commit/278c1e159c970da6cd6683d18c6211f5118674cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 14:11:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 18:11:40 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585678300.39.0.134789841977.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18615 pull_request: https://github.com/python/cpython/pull/19259 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 14:15:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 18:15:54 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585678554.27.0.671111718512.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18616 pull_request: https://github.com/python/cpython/pull/19260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:21:23 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 31 Mar 2020 19:21:23 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a char[1]. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585682483.64.0.927583558911.issue40120@roundup.psfhosted.org> Gregory P. Smith added the comment: """ The [1] thing is used in more places: PyObject *f_localsplus[1]; in PyFrameObject PyObject *ob_item[1]; in PyTupleObject void *elements[1]; in asdl_seq and int elements[1];` in asdl_int_seq digit ob_digit[1]; in PyLongObject Py_ssize_t ob_array[1]; in PyMemoryViewObject _tracemalloc.c: frame_t frames[1]; in traceback_t Do we need to update all of them? Do you want to update them all? """ - vstinner I believe we probably do. But I suggest multiple PRs. I'll update the issue title. I'm also going to ask clang/llvm folks that prompted me to look into this for comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:21:53 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 31 Mar 2020 19:21:53 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585682513.67.0.291676526605.issue40120@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- title: Undefined C behavior going beyond end of struct via a char[1]. -> Undefined C behavior going beyond end of struct via a [1] arrays. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:22:00 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 31 Mar 2020 19:22:00 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585682520.01.0.310422362238.issue40120@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:35:51 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 31 Mar 2020 19:35:51 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585683351.26.0.208364388586.issue40098@roundup.psfhosted.org> Vedran ?a?i? added the comment: Guido wrote: >>> t = list[int] A few years ago, I tried to explain to you that it's much more intuitive to use builtin types instead of their alter egos from typing (List etc.) for [] operator, you said it's not important. It's funny that you've implicitly acknowledged what I said through this typo. ;-) ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:46:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 19:46:52 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585684012.76.0.807795767367.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 27c6231f5827fe17c6cb6f097391931f30b511ec by Victor Stinner in branch 'master': bpo-40094: Enhance fork and wait tests (GH-19259) https://github.com/python/cpython/commit/27c6231f5827fe17c6cb6f097391931f30b511ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:49:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 19:49:49 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585684189.86.0.82397390426.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a9f9687a7ce25e7c0c89f88f52db323104668ae0 by Victor Stinner in branch 'master': bpo-40094: Enhance threading tests (GH-19260) https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:53:05 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 19:53:05 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585684385.95.0.308464686444.issue40120@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Sam that we should keep compatibility with C++ in header files. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 15:52:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 19:52:48 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585684368.72.0.0411318927257.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:04:10 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Mar 2020 20:04:10 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585685050.4.0.372155992381.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: > >>> t = list[int] > > A few years ago, I tried to explain to you that it's much more intuitive > to use builtin types instead of their alter egos from typing (List etc.) > for [] operator, you said it's not important. It's funny that you've > implicitly acknowledged what I said through this typo. ;-) It wasn't a typo. See PEPE 585. Its time for this change *now*. It wasn't *then*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:19:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 20:19:01 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585685941.88.0.861132513456.issue40098@roundup.psfhosted.org> Serhiy Storchaka added the comment: 5. dir(module) does not contain module type attributes (in contrary to dir() for regular object). >>> import keyword >>> dir(keyword) ['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'iskeyword', 'kwlist'] >>> sorted(object.__dir__(keyword)) ['__all__', '__builtins__', '__cached__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__file__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__loader__', '__lt__', '__name__', '__ne__', '__new__', '__package__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__spec__', '__str__', '__subclasshook__', 'iskeyword', 'kwlist'] Seems dir() was initially designed for old-style objects and many changes in object model were passed its. On one hand, it would look logical if dir() returned the list of all names that can be used as attributes. But my concerns are that it may add a "noise", names which can be legally used as attribute names, but which are rarely accessed as instance attribute instead of type attributes. This applies to 1 (metaclasses) and 5 (module type). If left out 1 and 5 and implement all other options (and I remind that it simplifies the code), it will only break one test for unittest.mock. I'm exploring what's going on there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:23:27 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 20:23:27 +0000 Subject: [issue39943] Meta: Clean up various issues in C internals In-Reply-To: <1583983387.49.0.277830283994.issue39943@roundup.psfhosted.org> Message-ID: <1585686207.93.0.47734464768.issue39943@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2c003eff8fef430f1876adf88e466bcfcbd0cc9e by Serhiy Storchaka in branch 'master': bpo-39943: Clean up marshal.c. (GH-19236) https://github.com/python/cpython/commit/2c003eff8fef430f1876adf88e466bcfcbd0cc9e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:24:42 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Mar 2020 20:24:42 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585686282.8.0.693175316575.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: For me, one of the most annoying things about dir() is that it gives all the dunders. There are many dunders that are just always there (__class__, mostly __dict__, __doc__, __name__ etc.). I wish it would just not give dunders that are inherited from object or type. Though it's probably too late for that (people's code might break). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:33:08 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 31 Mar 2020 20:33:08 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585686788.96.0.164853891056.issue40098@roundup.psfhosted.org> Vedran ?a?i? added the comment: Guido: First, wow! Second, now it's even more glaring that list[str] has repr 'list[str]', while list doesn't have a repr 'list'. :-( Is it possible that the time for _that_ change will also come some day? :-) Third, my problem with dir is not dunders, but dunders that really shouldn't be there. For example, __le__ when type doesn't support ordering. I understand how that happens, but it doesn't mean it isn't a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:37:00 2020 From: report at bugs.python.org (Hakan) Date: Tue, 31 Mar 2020 20:37:00 +0000 Subject: [issue29418] inspect.isroutine does not return True for some bound builtin methods In-Reply-To: <1486027973.42.0.383629669841.issue29418@psf.upfronthosting.co.za> Message-ID: <1585687020.11.0.21294843694.issue29418@roundup.psfhosted.org> Change by Hakan : ---------- keywords: +patch nosy: +hakancelik nosy_count: 3.0 -> 4.0 pull_requests: +18617 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19261 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:37:15 2020 From: report at bugs.python.org (Alexander Riccio) Date: Tue, 31 Mar 2020 20:37:15 +0000 Subject: [issue40020] growable_comment_array_add leaks, causes crash In-Reply-To: <1584665907.06.0.965824419022.issue40020@roundup.psfhosted.org> Message-ID: <1585687035.75.0.16540236276.issue40020@roundup.psfhosted.org> Alexander Riccio added the comment: Sure, should I open a new issue? ---------- nosy: -vstinner resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:37:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 20:37:44 +0000 Subject: [issue40129] Add test classes for custom __index__, __int__, __float__ and __complex__ Message-ID: <1585687064.58.0.0478382370232.issue40129@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are many tests for int-like objects (which implement custom __index__ or __int__ methods) in different files. There are less tests for float-like objects (with the __float__ method). There are even tests for complex-like (with the __complex__ method) in different files. To simplify maintaining old tests and adding new tests I propose to add general test classes with custom methods __index__, __int__, __float__ or __complex__ which return the specified value or raise an exception. There is already one similar general class: FakePath. It could be done using unittest.mock, but Mock objects are much more complex and has too much magic, so they can have different behavior than simpler classes with a single special method. ---------- components: Tests messages: 365422 nosy: mark.dickinson, serhiy.storchaka priority: normal severity: normal status: open title: Add test classes for custom __index__, __int__, __float__ and __complex__ type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:40:26 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Mar 2020 20:40:26 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585687226.48.0.786501912044.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: Vedran, please stay on topic for this issue. FWIW I agree that it would be best if dir() showed only those dunders that are significant. E.g. __eq__ should only be shown if it is overridden by a subclass. Serhiy did you see my feedback on 3 and 4? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:43:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 20:43:10 +0000 Subject: [issue40129] Add test classes for custom __index__, __int__, __float__ and __complex__ In-Reply-To: <1585687064.58.0.0478382370232.issue40129@roundup.psfhosted.org> Message-ID: <1585687390.02.0.13241916694.issue40129@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18618 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19262 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:53:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 20:53:07 +0000 Subject: [issue31160] Enhance support.reap_children() In-Reply-To: <1502283003.36.0.514915057261.issue31160@psf.upfronthosting.co.za> Message-ID: <1585687987.44.0.332889832218.issue31160@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18619 pull_request: https://github.com/python/cpython/pull/19263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:53:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 20:53:07 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585687987.51.0.360869951884.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18620 pull_request: https://github.com/python/cpython/pull/19263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 16:57:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 20:57:55 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1585688275.62.0.970975240773.issue40068@roundup.psfhosted.org> STINNER Victor added the comment: > Fixed by https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0 Ooops, sorry. Only PR 19200 is fixed by this commit. But this issue is made of 3 bugs. I prefer to leave it open until the 3 bugs are fixed. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:02:49 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 31 Mar 2020 21:02:49 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1585688569.0.0.27874719692.issue40120@roundup.psfhosted.org> Gregory P. Smith added the comment: Isn't the only actual way for a C .h file to be compatible with C++ via extern "C" { } which all of our non-meta include files appear to have already? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:05:18 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 21:05:18 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585688718.88.0.882650098211.issue40098@roundup.psfhosted.org> Serhiy Storchaka added the comment: If using __class__ and __dict__ attribuites is a feature, it does not work for __getattr__(). I think it is confusing if __dir__() and __getattr__() are not consistent. I'll try to deal with unittes.mock and then will look how this will work with other classes that override __class__ or __dict__. Also we need to check all classes with custom __getattr__ for the matter of custom __dir__. I think that it might be better if dir() for instance excluded names which are not accessed as via instance, e.g. non-descriptor class attributes and class methods. But it may be not easy to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:15:43 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 21:15:43 +0000 Subject: [issue40130] Remove _PyUnicode_AsKind from private C API Message-ID: <1585689343.48.0.60884405546.issue40130@roundup.psfhosted.org> New submission from Serhiy Storchaka : _PyUnicode_AsKind is exposed as private C API. It is only used in unicodeobject.c, where it is defined. Its name starts with an underscore, it is not documented and not included in PC/python3.def (therefore is not exported on Windows). Seems it is not used in third party code (I have not found any occurrences on GitHub except CPython clones). Initially it was also used in Python/formatter_unicode.c, and I think it is the only reason of exposing it in the header. I think that now it can be removed. The proposed PR removes _PyUnicode_AsKind from headers, makes it static, rename it, and change its signature (since all the kind, data pointer and length are available at the caller site). It also includes minor cleanup and microoptimizations. ---------- components: C API messages: 365427 nosy: serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Remove _PyUnicode_AsKind from private C API type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:17:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 21:17:02 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585689422.85.0.558317030551.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18621 pull_request: https://github.com/python/cpython/pull/19264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:18:50 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Mar 2020 21:18:50 +0000 Subject: [issue40130] Remove _PyUnicode_AsKind from private C API In-Reply-To: <1585689343.48.0.60884405546.issue40130@roundup.psfhosted.org> Message-ID: <1585689530.61.0.392432093104.issue40130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +18622 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:24:00 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 31 Mar 2020 21:24:00 +0000 Subject: [issue37733] Fail to build _curses module of Python 3.7.4 on AIX 7.1 using gcc In-Reply-To: <1564585726.95.0.247783534499.issue37733@roundup.psfhosted.org> Message-ID: <1585689840.2.0.828910224855.issue37733@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:33:43 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Mar 2020 21:33:43 +0000 Subject: [issue40098] dir() does not return the list of valid attributes for the object In-Reply-To: <1585424848.72.0.725162902614.issue40098@roundup.psfhosted.org> Message-ID: <1585690423.17.0.516330806659.issue40098@roundup.psfhosted.org> Guido van Rossum added the comment: At least for overriding __dict__, I would presume there would be a matching override for __getattribute__ (not __getattr__). Ditto for __class__, e.g. look at GenericAlias in the pep585 implementation PR. (Here __class__ is not in the list of exceptions so it returns the attribute from list.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 17:45:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 21:45:21 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585691121.97.0.504802635972.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 40bfdb1594189f3c0238e5d2098dc3abf114e200 by Victor Stinner in branch 'master': bpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264) https://github.com/python/cpython/commit/40bfdb1594189f3c0238e5d2098dc3abf114e200 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:24:15 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 22:24:15 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585693455.03.0.0513056392665.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18623 pull_request: https://github.com/python/cpython/pull/19266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:27:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 22:27:23 +0000 Subject: [issue31160] Enhance support.reap_children() In-Reply-To: <1502283003.36.0.514915057261.issue31160@psf.upfronthosting.co.za> Message-ID: <1585693643.64.0.364110564088.issue31160@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 16d75675d2ad2454f6dfbf333c94e6237df36018 by Victor Stinner in branch 'master': bpo-31160: Fix race condition in test_os.PtyTests (GH-19263) https://github.com/python/cpython/commit/16d75675d2ad2454f6dfbf333c94e6237df36018 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:27:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 22:27:23 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585693643.74.0.342874060062.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 16d75675d2ad2454f6dfbf333c94e6237df36018 by Victor Stinner in branch 'master': bpo-31160: Fix race condition in test_os.PtyTests (GH-19263) https://github.com/python/cpython/commit/16d75675d2ad2454f6dfbf333c94e6237df36018 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:33:29 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Mar 2020 22:33:29 +0000 Subject: [issue40129] Add test classes for custom __index__, __int__, __float__ and __complex__ In-Reply-To: <1585687064.58.0.0478382370232.issue40129@roundup.psfhosted.org> Message-ID: <1585694009.08.0.905168984325.issue40129@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think this makes the world better. It just makes it more intertwined. Currently, I can read the test code in isolation and understand it. But with the proposed PR, a person now needs to know more of what is in test_support. I really like seeing the classes in-line so I know exactly what they are doing and exactly what a test is doing. Also, I don't like reinventing another alternative to mocks. Ideally, we want to minimize the number of things a person has to know in order to read and write our tests. I understand your desire to factor everything you see, but in so doing you're creating tighter coupling and increasing complexity for the everyday contributor. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:50:18 2020 From: report at bugs.python.org (Ahmad Azizi) Date: Tue, 31 Mar 2020 22:50:18 +0000 Subject: [issue12735] request full Unicode collation support in std python library In-Reply-To: <1313093897.54.0.111250936422.issue12735@psf.upfronthosting.co.za> Message-ID: <1585695018.56.0.025246411262.issue12735@roundup.psfhosted.org> Ahmad Azizi added the comment: Remember, sorting standard Persian(Farsi) characters does not work properly with current implementation of Python 3.x As the result, python is probably unable to sort properly in some other languages. Here is correct order of alphabet in Persian: "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", After sorting using sorted(): ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ---------- nosy: +Ahmad Azizi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 18:59:13 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Mar 2020 22:59:13 +0000 Subject: [issue40110] multiprocessing.Pool.imap() should be lazy In-Reply-To: <1585541187.46.0.606629490552.issue40110@roundup.psfhosted.org> Message-ID: <1585695553.09.0.0969820191808.issue40110@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- components: +Library (Lib) nosy: +rhettinger type: -> enhancement versions: +Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:01:07 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 31 Mar 2020 23:01:07 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1585695667.96.0.493194384955.issue39812@roundup.psfhosted.org> Kyle Stanley added the comment: I'm currently busy today, but I'll have some time to explore a few different potential solutions tomorrow. If I can't find anything to fix it by the end of the day, I'll prepare a PR to revert PR-19149, and re-apply it later (after more thoroughly testing to ensure it doesn't cause refleaks). Since I authored the PR, I'd like to take responsibility for addressing the refleak, whether that's reverting the PR or adding a fix on top of it. Would that be acceptable Victor, or will it need to be reverted sooner than tomorrow? If it needs to be done sooner, I can open a PR to revert it later tonight (in ~4 hours or so, when I'm available to do so). This the first time a patch of mine has introduced a regression, so I wanted to double check that tomorrow was okay. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:10:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Mar 2020 23:10:13 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585696213.79.0.80903418608.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6b982c22e5fdbfecc24e440515b63f7253f695c4 by Victor Stinner in branch 'master': bpo-40094: Add run_command() to setup.py (GH-19266) https://github.com/python/cpython/commit/6b982c22e5fdbfecc24e440515b63f7253f695c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:28:17 2020 From: report at bugs.python.org (Leron Gray) Date: Tue, 31 Mar 2020 23:28:17 +0000 Subject: [issue40131] Zipapp example has parameters in the wrong order Message-ID: <1585697297.66.0.208168236164.issue40131@roundup.psfhosted.org> New submission from Leron Gray : The second example listed here for zipapp has the parameters in the wrong order. https://docs.python.org/3/library/zipapp.html?highlight=zipapp#examples It should be create_archive("myapp", "myapp.pyz") since the parameters are (source, target). The documentation for the function itself is correct though. ---------- assignee: docs at python components: Documentation messages: 365436 nosy: Leron Gray, docs at python priority: normal severity: normal status: open title: Zipapp example has parameters in the wrong order type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:31:49 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 31 Mar 2020 23:31:49 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585697509.22.0.694004936766.issue40121@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +18624 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/19267 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:33:07 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 31 Mar 2020 23:33:07 +0000 Subject: [issue40121] socket module missing audit events In-Reply-To: <1585603899.47.0.326918129099.issue40121@roundup.psfhosted.org> Message-ID: <1585697587.88.0.475956581243.issue40121@roundup.psfhosted.org> Steve Dower added the comment: Thanks, Victor! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:38:15 2020 From: report at bugs.python.org (Alexander Riccio) Date: Tue, 31 Mar 2020 23:38:15 +0000 Subject: [issue25878] CPython on Windows builds with /W3, not /W4 In-Reply-To: <1450224755.83.0.682115702996.issue25878@psf.upfronthosting.co.za> Message-ID: <1585697895.59.0.130281954828.issue25878@roundup.psfhosted.org> Alexander Riccio added the comment: Ok, so a draft of this produces 34 warnings, but makes way more changes to the .vcxproj and .filters files than I think it should: https://github.com/ariccio/cpython/commit/60152aa065a3ad861f0359a8ada7f2fbc83a3933 Before I submit a PR, I think I should figure out how to change the defaults without Visual Studio adding a bunch of noise to the config - is that reasonable? The warnings appear essentially innocuous - mixing signed/unsigned bytes, some benign truncation of constant values, and 3 places where local variables shadow the globals, where it looks like the global should've been used - but should be checked nonetheless. The warnings are in the attached file. ---------- Added file: https://bugs.python.org/file49017/34PythonWarnings.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:42:17 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 31 Mar 2020 23:42:17 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1585698137.91.0.990079126994.issue35815@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- Removed message: https://bugs.python.org/msg334467 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:57:41 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 31 Mar 2020 23:57:41 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1585699061.18.0.812097835593.issue35815@roundup.psfhosted.org> Batuhan Taskaya added the comment: __init_subclass__ is called way before (in the type_new, when type is in the process of getting created) the object's __new__ (object_new) (which raises that TypeError). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 19:58:43 2020 From: report at bugs.python.org (Tim Peters) Date: Tue, 31 Mar 2020 23:58:43 +0000 Subject: [issue40110] multiprocessing.Pool.imap() should be lazy In-Reply-To: <1585541187.46.0.606629490552.issue40110@roundup.psfhosted.org> Message-ID: <1585699123.56.0.555009142308.issue40110@roundup.psfhosted.org> Tim Peters added the comment: "Lazy" has several possible aspects, of which Pool.imap() satisfies some: - Its iterable argument is materialized one object at a time. - It delivers results one at a time. So, for example, if `worker` is a function that takes a single int, then pool = multiprocessing.Pool(4) for i in pool.imap(worker, itertools.count(1)): print(i) works fine, despite that the iterable argument, and the result sequence, are "infinite". You seem to have something more severe in mind, more along the lines of that the iterable isn't advanced unless it absolutely _needs_ to be advanced in order to deliver a result that's being demanded. That's how, e.g., the builtin Python 3 `map()` works. But if the iterable isn't advanced until the main program _demands_ the next result from imap(), then the main program blocks until the machinery peels off the next object from the iterable, picks a worker to send it to, sends it, waits for the worker to deliver the result back on an internal queue, then delivers the result to the main program. There's no parallelism then. The way things are now, imap() consumes the iterable as quickly as possible, keeping all workers as busy as possible, regardless of how quickly (or even whether) results are demanded. And seems to me that's overwhelmingly what people using multiprocessing would want. In any case, that's what they _have_, so that couldn't be changed lightly (if it all). Perhaps it would be more profitable to think about ways to implement your pipelines using other primitives? For example, the first thing I'd try for an N-stage pipeline is a chain of N processes (not in a Pool) connected one to the next by queues. If for some reason I was determined not to let any process "get ahead", easy - specify a max size of 1 for the queues. map-like facilities are inherently SIMD style, but pipelines typically have very different code in different stages. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 20:07:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Apr 2020 00:07:30 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585699650.6.0.0324831709539.issue40094@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +18625 pull_request: https://github.com/python/cpython/pull/19268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 20:17:13 2020 From: report at bugs.python.org (Furkan Onder) Date: Wed, 01 Apr 2020 00:17:13 +0000 Subject: [issue27635] pickle documentation says that unpickling may not call __new__ In-Reply-To: <1469639245.7.0.966654223743.issue27635@psf.upfronthosting.co.za> Message-ID: <1585700233.84.0.251170841049.issue27635@roundup.psfhosted.org> Change by Furkan Onder : ---------- keywords: +patch nosy: +furkanonder nosy_count: 4.0 -> 5.0 pull_requests: +18626 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19269 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 20:21:22 2020 From: report at bugs.python.org (Furkan Onder) Date: Wed, 01 Apr 2020 00:21:22 +0000 Subject: [issue27635] pickle documentation says that unpickling may not call __new__ In-Reply-To: <1469639245.7.0.966654223743.issue27635@psf.upfronthosting.co.za> Message-ID: <1585700482.17.0.561203358659.issue27635@roundup.psfhosted.org> Furkan Onder added the comment: There is still an mistake in the document. I sent a pr to fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 20:26:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Apr 2020 00:26:26 +0000 Subject: [issue40094] Add os.waitstatus_to_exitcode() function In-Reply-To: <1585351787.12.0.917977186474.issue40094@roundup.psfhosted.org> Message-ID: <1585700786.09.0.055904174292.issue40094@roundup.psfhosted.org> STINNER Victor added the comment: New changeset afeaea2d6e346f627b24cc9e84e2986a7266a70e by Victor Stinner in branch 'master': bpo-40094: Add missing import to wait_process() (GH-19268) https://github.com/python/cpython/commit/afeaea2d6e346f627b24cc9e84e2986a7266a70e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 20:47:50 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 01 Apr 2020 00:47:50 +0000 Subject: [issue40113] Turtle demo In-Reply-To: <1585567945.94.0.599224677.issue40113@roundup.psfhosted.org> Message-ID: <1585702070.11.0.657281208684.issue40113@roundup.psfhosted.org> Steven D'Aprano added the comment: > the program is supposed to draw a function like y=sin(x) but is drawing y=abs(sin(x)). It would have been nice if you had described the problem this way from your initial bug report, instead of saying that the turtle was moving backwards. I understood "moving backwards" as it going back over its own path, retracing its steps. I wasted a lot of time peering carefully at the screen trying to see where the turtle was retracing its steps. Now I understand you mean the turtle is moving in the opposite direction from that it is facing. Gotcha. You titled this bug report "Turtle demo", but I can't find it listed in the turtle demo here: https://docs.python.org/3/library/turtle.html#module-turtledemo Where did you get this demo from? If it's not from the standard library, you should report this to the author, as it is a bug in their code, not the turtle module, caused by mishandling of negative numbers. If you move *forward* by a *negative* amount, of course you are going in the opposite direction to that you are facing. So the spike() function is buggy. There are probably many ways to fix it, depending on what you intend it to do, but probably the simplest is to just add a call to abs() before calling forward: james.forward(abs(int(d*100))) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 21:52:27 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 01 Apr 2020 01:52:27 +0000 Subject: [issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f In-Reply-To: <1585667417.42.0.205219366434.issue40125@roundup.psfhosted.org> Message-ID: <1585705947.1.0.0654998375749.issue40125@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset ba8a2bcebfdb41acafea9a195e45e9d177dc216f by Benjamin Peterson in branch '2.7': [2.7] closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19251) https://github.com/python/cpython/commit/ba8a2bcebfdb41acafea9a195e45e9d177dc216f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 23:11:49 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 01 Apr 2020 03:11:49 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585710709.44.0.147337669371.issue40071@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- pull_requests: +18628 pull_request: https://github.com/python/cpython/pull/19273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 23:15:52 2020 From: report at bugs.python.org (Paulo Henrique Silva) Date: Wed, 01 Apr 2020 03:15:52 +0000 Subject: [issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global() In-Reply-To: <1585185925.55.0.269553071046.issue40071@roundup.psfhosted.org> Message-ID: <1585710952.84.0.418877971689.issue40071@roundup.psfhosted.org> Paulo Henrique Silva added the comment: As discussed on PR19172, this module uses a global state in functions that do not receive a PyModule* and right now converting such cases to per-module state is not trivial. I will wait for PEP-573 implementation that will hopefully make this easier. Pushed PR19273 to avoid the potential crash induced by the original change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 23:20:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 01 Apr 2020 03:20: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: <1585711216.72.0.93141027791.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: My first though was that the 'guy' had executed 'import math' and you had not. (See the IDLE doc at https://docs.python.org/3/library/idle.html or, within IDLE, Help => IDLE Help, "Editing and navigations" section, "completions' subsection, 2nd to last paragraph.) Or maybe this was another 'Catalina' issue. But I tried completion on my MacbookAir with Mohave 10.14.6? and 3.8.2 and 3.7.5, in Shell at >>>, that don't need imports. 'i' should bring up a box with 'id' at the top. 'int.' should bring up a box with 'as_integer_ratio' at the top. This works for me on Windows but not on the Mac. For shortcuts, IDLE Preferences, Keys tab, has "force_open_completions ". But the edit menu has "Show completions ^S". Control-S is not Control-space. Bug 1. In either case, neither work. Nor does clicking the menu entry. Bug 2. Hitting ^S causes "Edit" on the main menu to flash blue (Mac only); ^space. I believe this means that ^S invoked an item on the menu. I repeated the above with IDLE started in Terminal ('python3 -m idlelib'). No errors messages appeared. There are issues where shortcuts don't work, because they duplicate system binding, but menu items do. This is different. Is this a tkinter widget problem? Similar Toplevel popups (calltips, squeezer tooltips) work. Listbox is also used in config, config-key, and debugger dialogs, all of which at least appear. A debug print is autocomplete_w.py show_window reveals that it is called when it should be, including after both ^space and ^S, with what I believe are appropriate arguments. Another print in winconfig_event, just before the geometry call to move the window into view, shows that x,y position looks good. But two oddities: winconfig_event is called twice instead of once, and with ^space and not ^S. I have no idea how this could be. Adding update() just before update_idletasks() prevents the 2nd winconfig_event call but does not make the popup appear. I am out of ideas at the moment, except for this. Other popups are withdrawn while created and filled in, and then deiconified, while this one is moved off screen to 10000,10000 and moved back. Wondering whether tk 8.6 does not like this movement, I disabled it. The widget should then appear, but does not. ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, taleinat title: IDLE Show completions/ autocomplete pop-up not working -> IDLE Show completions pop-up not working on macOS versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 31 23:24:32 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 01 Apr 2020 03:24:32 +0000 Subject: [issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict() In-Reply-To: <1560072227.25.0.180298594259.issue37207@roundup.psfhosted.org> Message-ID: <1585711472.48.0.505975550882.issue37207@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner @petr.viktorin I 'd like to experiment dict vector call and finalize the work. Can I proceed it? ---------- _______________________________________ Python tracker _______________________________________