[issue40399] IO streams locking can be broken after fork() with threads

2020-04-29 Thread Delgan
Delgan added the comment: Yeah, I just wanted to illustrate the issue with a more realistic example. The thread is often abstracted away by a class or a library. Conclusion: do not abstract it away. :) I've noticed that the mere fact of using "sys.stderr.write()", without even involving a

[issue39837] Make Azure Pipelines optional on GitHub PRs

2020-04-29 Thread Brett Cannon
Brett Cannon added the comment: Best place to report workflow issues or to have discussions about it is https://github.com/python/core-workflow/. Otherwise there were so many posts I didn't find an explicit ask of what you wanted changed, Victor. --

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: What's also possible is to handle keywords at tokenizer level and return a different token type for each one of them (like with async and await), which is currently handled at parser level. This would enable us to allow reserved keywords right before a

[issue40346] Add random.BaseRandom to ease implementation of subclasses

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: I created this issue to propose PR 19631 (BaseRandom class) which looked like as a good idea to me: simple base class which fix different kind of problems. But it seems like other people would prefer a complete rewrite from scratch and require a PEP. I

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: So then it appears the snake case function couldn't be used for database column names, without some additional processing. So, what is the use case for it? I just don't see a lot of use for this. -- ___ Python

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: I'd like also to point that there are few other cases: https://stackoverflow.com/questions/11273282/whats-the-name-for-hyphen-separated-case This is PascalCase: SomeSymbol This is camelCase: someSymbol This is snake_case: some_symbol So a possible function could

[issue9216] FIPS support for hashlib

2020-04-29 Thread miss-islington
miss-islington added the comment: New changeset e3dfb9b967c560f4d094092dcae4a16fc9634681 by Victor Stinner in branch 'master': bpo-9216: Expose OpenSSL FIPS_mode() as _hashlib.get_fips_mode() (GH-19703) https://github.com/python/cpython/commit/e3dfb9b967c560f4d094092dcae4a16fc9634681

[issue40286] Add randbytes() method to random.Random

2020-04-29 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19118 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/19797 ___ Python tracker ___

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
jeffolsi10 added the comment: snake case has very specific definition : https://en.wikipedia.org/wiki/Snake_case I expect the function to implement the definition and not something that I or someone else desire. As for your question about '$' char I could ask the same thing for lower() The

[issue40228] Make setting line number in frame more robust.

2020-04-29 Thread Mark Shannon
Mark Shannon added the comment: New changeset 57697245e1deafdedf68e5f21ad8890be591efc0 by Mark Shannon in branch 'master': bpo-40228: More robust frame.setlineno. (GH-19437) https://github.com/python/cpython/commit/57697245e1deafdedf68e5f21ad8890be591efc0 --

[issue40439] Error in an external reference

2020-04-29 Thread Patrick A.
New submission from Patrick A. : This URL doesn't exist anymore. If you click on this URL you have a 404 not found. https://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html The website was changed and Dr. Martin v. Löwis is not hosted on the new site. Regards -- assignee:

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: I think you're right, since rb obviously works, too. I just wanted to make sure we're covering all the bases. There's some code in either the stdlib or the test suite where I generate all of the valid prefixes (it's something like 80 prefixes). I can dig it

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: Thanks Miro for the bug report, it's now fixed ;-) In PR 19792, Miro proposed to skip test_gdb is gdb is available but exit with non-zero exit code. I chose to raise a hard exception instead, to notify CI owners that something is wrong. I prefer to not make

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread miss-islington
miss-islington added the comment: New changeset beba1a808000d5fc445cb28eab96bdb4cdb7c959 by Miss Islington (bot) in branch '3.7': bpo-40436: Fix code parsing gdb version (GH-19792) https://github.com/python/cpython/commit/beba1a808000d5fc445cb28eab96bdb4cdb7c959 --

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread miss-islington
miss-islington added the comment: New changeset d9e904919197a22b95946f11ba5f24b796088c06 by Miss Islington (bot) in branch '3.8': bpo-40436: Fix code parsing gdb version (GH-19792) https://github.com/python/cpython/commit/d9e904919197a22b95946f11ba5f24b796088c06 --

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it was a typo. You cannot combine anything with the u prefix. -- ___ Python tracker ___

Re: Techniques to extend code without modifying it? (besides modules and decorators)

2020-04-29 Thread Christian Seberino
If you want to know, I'm trying to add metaprogramming (macros!) to a tiny Lisp interpreter I wrote. I'm hesitant to mess with all that nice debugged code to add this new stuff. -- https://mail.python.org/mailman/listinfo/python-list

[issue39837] Make Azure Pipelines optional on GitHub PRs

2020-04-29 Thread STINNER Victor
Change by STINNER Victor : -- title: Remove Azure Pipelines from GitHub PRs -> Make Azure Pipelines optional on GitHub PRs ___ Python tracker ___

[issue39837] Remove Azure Pipelines from GitHub PRs

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: Another issue: I still see "Azure Pipelines PR Expected — Waiting for status to be reported" 15 min after I created my PR :-/ Technically, I created the PR and then pushed a second commit to the PR. The only option is to close/reopen the PR to re-trigger

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: >From earlier in this issue: https://bugs.python.org/msg366164 > So a slightly shorter example uses ru''. This is an error because you can't > combine the r prefix and the u prefix (in fact you can't combine anything > with the r prefix). That's not true:

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: I fixed test.pythoninfo to ignore gdb output if the command failed. I also enhanced test_gdb error message: display stdout, stderr and the exit code. Backport to 3.8 and 3.7 will be merged as soon as the CI pass. -- resolution: -> fixed stage:

[issue40438] Python 3.9 eval on list comprehension sometimes returns coroutines

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: > I first noticed this when testing xdoctest on Python 3.9, and then again when > using IPython. What is your Python 3.9 exact version number? I cannot reproduce your issue with Python 3.9.0a6: vstinner@apu$ ./python -c "print(eval(compile('[i for i in

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +19117 pull_request: https://github.com/python/cpython/pull/19796 ___ Python tracker ___

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +19116 pull_request: https://github.com/python/cpython/pull/19795 ___ Python tracker

[issue40438] Python 3.9 eval on list comprehension sometimes returns coroutines

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: I close the issue: it's already fixed in 3.9.0a6. If it's not the case, feel free to reopen the issue ;-) -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue25521] optparse module does not emit DeprecationWarning

2020-04-29 Thread John Hagen
John Hagen added the comment: With PEP 594 (https://www.python.org/dev/peps/pep-0594/) in the pipeline, is it time that optparse correctly emits DeprecationWarnings? -- ___ Python tracker

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset ec9bea4a3766bd815148a27f61eb24e7dd459ac7 by Victor Stinner in branch 'master': bpo-40436: Fix code parsing gdb version (GH-19792) https://github.com/python/cpython/commit/ec9bea4a3766bd815148a27f61eb24e7dd459ac7 --

[issue40438] Python 3.9 eval on list comprehension sometimes returns coroutines

2020-04-29 Thread Jonathan Crall
Jonathan Crall added the comment: Ah, sorry. I neglected all the important information. I tested this using: Python 3.9.0a5 (default, Apr 23 2020, 14:11:34) [GCC 8.3.0] Specifically, I ran in a docker container: DOCKER_IMAGE=circleci/python:3.9-rc docker pull $DOCKER_IMAGE docker run

[issue40438] Python 3.9 eval on list comprehension sometimes returns coroutines

2020-04-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40438] Python 3.9 eval on list comprehension sometimes returns coroutines

2020-04-29 Thread Jonathan Crall
New submission from Jonathan Crall : I first noticed this when testing xdoctest on Python 3.9, and then again when using IPython. I was finally able to generate a minimal working example in Python itself. The following code: python -c "print(eval(compile('[i for i in range(3)]',

[issue40428] [C API] Remove PyTuple_ClearFreeList() function (move it to the internal C API)

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9a8c1315c3041fdb85d091bb8dc92f0d9dcb1529 by Victor Stinner in branch 'master': bpo-40428: Cleanup free list part of C API Changes doc (GH-19793) https://github.com/python/cpython/commit/9a8c1315c3041fdb85d091bb8dc92f0d9dcb1529 --

Re: [RELEASE] Python 3.9.0a6 is now available for testing

2020-04-29 Thread Robin Becker
On 28/04/2020 16:52, Łukasz Langa wrote: On behalf of the entire Python development community, and the currently serving Python release team in particular, I’m pleased to announce the release of Python 3.9.0a6. Get it here: thanks for the release; I tried to reply in the dev list, but

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Petr Viktorin
Petr Viktorin added the comment: reportlab reported failures on code like: norm=lambda m: m+(m and(m[-1]!='\n'and'\n'or'')or'\n') Note that `or` has a `r` in it. -- nosy: +petr.viktorin ___ Python tracker

[issue40431] turtledemo/__main__.py: SyntaxError: invalid string prefix else"#fca"

2020-04-29 Thread STINNER Victor
STINNER Victor added the comment: Ok, the typo is now fixed in 3.7, 3.8 and master branches ;-) Thanks Miro for the bug reportand Kyle for the backport. -- ___ Python tracker

[issue40428] [C API] Remove PyTuple_ClearFreeList() function (move it to the internal C API)

2020-04-29 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19115 pull_request: https://github.com/python/cpython/pull/19793 ___ Python tracker ___

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread Miro Hrončok
Miro Hrončok added the comment: BTW The test gdb also crashes in the same way: test test_gdb crashed -- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.9.0a6/Lib/test/libregrtest/runtest.py", line 270, in _runtest_inner refleak = _runtest_inner2(ns, test_name)

[issue40437] add string.snake function

2020-04-29 Thread Eric V. Smith
Eric V. Smith added the comment: What would be the full specification of this? If you want to use it for column names, what happens if the string starts with a $, or some character that can't be used by your particular database? I'm skeptical that this could be general purpose enough to be

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +19114 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19792 ___ Python tracker ___

Techniques to extend code without modifying it? (besides modules and decorators)

2020-04-29 Thread Christian Seberino
I have some code I'd like to extend without modifying it. I'm sure this is a common pattern. I wondered what the options were for "extending without modifying (much)". I'm aware one can import a module and add functions to decorators. Are there other ways? Thanks! chris --

[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2020-04-29 Thread kuzja
kuzja added the comment: Here the same problem occurred when installing Python in Win7 Pro. Both standard and custom (with pip checked) installations lead to the same result (i.e. the empty Scripts folder). It seems that the problem originates somewhere between Python 3.6 and 3.7, as 3.7

[issue40435] IDLE should catch user config file UnicodeDecodeError

2020-04-29 Thread 左迟
左迟 added the comment: Hi! Thanks for your useful comment. And I'm sorry for uploading the image but not pasting it in the comment. When I append "encoding=utf-8" to ~/.idlerc/config-main.cfg, the idle turns to be good and works well. Yes, the "[] Beta: Use Unicode UTF8 for worldwide language

[issue40437] add string.snake function

2020-04-29 Thread jeffolsi10
New submission from jeffolsi10 : Like we have: capitalize swapcase and others we should also have snake case Which converts: before: First Name, Last Name, Employee Status, Subject after: first_name, last_name, employee_status, subject This is very useful when working with titles of columns

[issue40435] IDLE should catch user config file UnicodeDecodeError

2020-04-29 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: Failed to launch IDLE in a UTF-8 code page terminal environment -> IDLE should catch user config file UnicodeDecodeError ___ Python tracker

[issue40435] Failed to launch IDLE in a UTF-8 code page terminal environment

2020-04-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: The uploaded .png has the traceback. (Pasting it into the post would have been fine and a bit easier for all of us.) The error occurred when IDLE's config tried to load the user config files, ~/.idlerc/config-xyz.cfg. (~ is usually C:/Users/yourname.)

[issue40436] pythoninfo collect_gdb() blows up when gdb fails to run

2020-04-29 Thread Miro Hrončok
New submission from Miro Hrončok : We had this weird traceback when running pythoninfo in Fedora build with Python 3.9.0a6: + /builddir/build/BUILD/Python-3.9.0a6/build/optimized/python -m test.pythoninfo ERROR: collect_gdb() failed Traceback (most recent call last): File

[issue33428] pathlib.Path.glob does not follow symlinks

2020-04-29 Thread Danya Alexeyevsky
Danya Alexeyevsky added the comment: I can reproduce the bug with Linux and python 3.7.5: ``` Python 3.7.5 (default, Apr 19 2020, 20:18:17) [GCC 9.2.1 20191008] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pathlib import Path >>>

[issue40402] Race condition in multiprocessing/connection.py: broken handle

2020-04-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +19113 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19790 ___ Python tracker

[issue40435] Failed to launch IDLE in a UTF-8 code page terminal environment

2020-04-29 Thread 左迟
New submission from 左迟 : Environment: 1.OS: Windows 10 1909 Pro 2.Python version: 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] 3.Error message: UnicodeDecodeError: 'CP_UTF8' codec can't decode byte 0xd0 in position 23: No mapping for the Unicode character exists in the

[issue40431] turtledemo/__main__.py: SyntaxError: invalid string prefix else"#fca"

2020-04-29 Thread miss-islington
miss-islington added the comment: New changeset adb1f853482e75e81ae0ae7307318a1051ca46b5 by Miss Islington (bot) in branch '3.7': [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (GH-19784) https://github.com/python/cpython/commit/adb1f853482e75e81ae0ae7307318a1051ca46b5

[issue40334] PEP 617: new PEG-based parser

2020-04-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 4db245ee9ddbe6c53d375de59a35ff59dea2a8e0 by Pablo Galindo in branch 'master': bpo-40334: refactor and cleanup for the PEG generators (GH-19775) https://github.com/python/cpython/commit/4db245ee9ddbe6c53d375de59a35ff59dea2a8e0

[issue38787] PEP 573: Module State Access from C Extension Methods

2020-04-29 Thread Petr Viktorin
Petr Viktorin added the comment: I'm working on the implementation as my time allows, here: https://github.com/encukou/cpython/pull/3 . Would it help to create a proper PR for CPython now? That would mean I could no longer do rebases/force-pushes, so the commits would be less readable. But

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-29 Thread Thomas Moreau
Thomas Moreau added the comment: I did GH 19788 with a few modifications. There is only one lock that seems to mater for the perf, and I actually added one other (the one in _python_exit, which necessitate another bug fix for fork context). I did not benchmark to see if it was worth it in

[issue40431] turtledemo/__main__.py: SyntaxError: invalid string prefix else"#fca"

2020-04-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +19112 pull_request: https://github.com/python/cpython/pull/19789 ___ Python tracker

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-29 Thread Thomas Moreau
Change by Thomas Moreau : -- pull_requests: +19111 pull_request: https://github.com/python/cpython/pull/19788 ___ Python tracker ___

[issue40432] Pegen regenerate project for Windows not working

2020-04-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40432] Pegen regenerate project for Windows not working

2020-04-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 9b64ef3ac7b434065dbff0048b9103999e4b491a by Anthony Shaw in branch 'master': bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785) https://github.com/python/cpython/commit/9b64ef3ac7b434065dbff0048b9103999e4b491a --

[issue40434] Update of reasoning why there is no case statement

2020-04-29 Thread Ama Aje My Fren
Change by Ama Aje My Fren : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40434] Update of reasoning why there is no case statement

2020-04-29 Thread Ama Aje My Fren
Change by Ama Aje My Fren : -- keywords: +patch pull_requests: +19110 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19787 ___ Python tracker ___

[issue40434] Update of reasoning why there is no case statement

2020-04-29 Thread Ama Aje My Fren
New submission from Ama Aje My Fren : The design and history FAQ (https://docs.python.org/dev/faq/design.html#why-isn-t-there-a-switch-or-case-statement-in-python) explains why there is no case statement referencing PEP 275(https://www.python.org/dev/peps/pep-0275/). For Python 3 there is,

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-29 Thread Thomas Moreau
Thomas Moreau added the comment: I think this is a reasonable way to move on.Some of the locks can probably be removed but this needs careful investigation and in the mean time, it hinders everyone. Thanks victor for the fast fix up! To me, an interesting observation is that the failure

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I looked at the change and it seemed ok to me. Perhaps Thomas can give it a look too. -- assignee: aeros -> vstinner ___ Python tracker ___

[issue40405] asyncio.as_completed documentation misleading

2020-04-29 Thread Bar Harel
Bar Harel added the comment: @Kyle, looks good to me. Maybe this will work better? Together with the current example which shows the "earliest_result" variable of course. "Each coroutine returns the next result from the set of the remaining awaitables, based upon the order of completion."

[issue40275] test.support has way too many imports

2020-04-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bfb1cf44658934cbcd9707fb717d6770c78fbeb3 by Serhiy Storchaka in branch 'master': bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)

[issue40334] PEP 617: new PEG-based parser

2020-04-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +19109 pull_request: https://github.com/python/cpython/pull/19786 ___ Python tracker ___

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It's no different from other edge cases where for some reason the space seems > optional, like `1and 2`. The parser is not consistent here. `0or[]` is an error, while `0and[]` and `1or[]` are valid. See

<    1   2