[issue42222] Modernize integer test/conversion in randrange()

2020-12-24 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37779] configparser: add documentation about several read() behaviour

2020-12-24 Thread Stéphane Blondon
Stéphane Blondon added the comment: Merged by Łukasz Langa in september 2020. (Thanks Łukasz) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue42730] TypeError in Time.Sleep when invoked from shell script background

2020-12-24 Thread Abdulrahman Alabdulkareem
New submission from Abdulrahman Alabdulkareem : I get a random TypeError exception thrown whenever I interrupt/kill a sleeping parent thread from a child thread but ONLY if the python script was invoked by a shell script with an & argument to make it run in the background. (this is in

[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset 3bb85672bb894403a787a9c5afc0ca5987d28fe0 by Miss Islington (bot) in branch '3.9': closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912) https://github.com/python/cpython/commit/3bb85672bb894403a787a9c5afc0ca5987d28fe0

[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset efd64c8ea0fed1c13839cec0feea450820da34f8 by Miss Islington (bot) in branch '3.8': closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912) https://github.com/python/cpython/commit/efd64c8ea0fed1c13839cec0feea450820da34f8

[issue36876] [subinterpreters] Global C variables are a problem

2020-12-24 Thread Eric Snow
Eric Snow added the comment: New changeset 7ec59d8861ef1104c3028678b2cacde4c5693e19 by Eric Snow in branch 'master': bpo-36876: [c-analyzer tool] Add a "capi" subcommand to the c-analyzer tool. (gh-23918) https://github.com/python/cpython/commit/7ec59d8861ef1104c3028678b2cacde4c5693e19

[issue41644] builtin type kwargs

2020-12-24 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42674] __init_subclass__ only called for first subclass when class has multiple inheritance

2020-12-24 Thread Ethan Furman
New submission from Ethan Furman : The two subclasses in the test script are not calling super(). When they do, both __init_subclasses__ are called. -- nosy: +ethan.furman resolution: -> not a bug stage: -> resolved status: open -> closed ___

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +22778 pull_request: https://github.com/python/cpython/pull/23927 ___ Python tracker ___

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently, it's possible: * To get from stream-of-characters program representation to AST representation (AST.parse()). * To get from AST to code object (compile()). * To get from a code object to first-class function to the execute the program. Python

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- keywords: +patch pull_requests: +22773 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23922 ___ Python tracker ___

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > I propose to close that gap, and establish an API which would allow to parse > token stream (iterable) into an AST. An initial implementation for CPython > can (and likely should) be naive, making a loop thru surface program > representation. There is

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > That's exactly the implementation in the patch now submitted against this > issue. But that's the patch for CPython, the motive of the proposal here is > to establish a standard API call for *Python*, which different implementation > can implement how

[issue42643] http.server does not support HTTP range requests

2020-12-24 Thread Stéphane Blondon
Stéphane Blondon added the comment: RangeHTTPServer seems to support python3: there is a try-except clause to manage the different import of SimpleHTTPServer: https://github.com/danvk/RangeHTTPServer/blob/master/RangeHTTPServer/__main__.py#L13 The code is under Apache 2.0 licence. I don't

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > What prevents you from using ast.parse(tokenize.untokenize(token_stream))? That's exactly the implementation in the patch now submitted against this issue. But that's the patch for CPython, the motive of the proposal here is to establish a standard API

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: The thing is that the parser itself does not get a stream of tokens as input. It only accepts either a file or a string and it lazily converts its input to tokens. As for the PR attached to this patch, I'm -1 on that. I don't think the usecase is

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > but the thing I don't quite get is the use case. And if that went unanswered: the usecase, how I'd formulate it, is to not expose CPython historical implementation detail of "tokenize" being disconnected from the rest of the language processing

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-24 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: I concur with Guido. I feel that making this an error is the best alternative we have. -- ___ Python tracker ___

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am with Lysandros and Batuhan. The parser is considerably coupled with the C tokenizer and the only way to reuse *the parser* is to make flexible enough to receive a token stream of Python objects as input and that can not only have a performance

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with other core developers. Seems there is no real need for this feature and the idea was proposed purely to "close a gap". Taking into account significant cost of implementing and maintaining this feature, I think that it should not be added.

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > There is a considerable tension on exposed parts of the compiler pipeline for > introspection and other capabilities and our ability to do optimizations. > Given how painful it has been in the past to deal with this, my view is to > avoid exposing as

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > the idea was proposed purely to "close a gap" That pinpoints it well. I was just writing a tutorial on implementing custom import hooks, with the idea to show people how easy it to do it in Python. As first step, I explained that it's bad idea to do any

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: Thank you for your patch though! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset b57ada98da0d5b0cf1ebc2c9c5502d04aa962042 by Augusto Hack in branch 'master': closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912) https://github.com/python/cpython/commit/b57ada98da0d5b0cf1ebc2c9c5502d04aa962042

[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +22775 pull_request: https://github.com/python/cpython/pull/23924 ___ Python tracker ___

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: I tried update `abc.py` with the same dance I have to use with `Enum`: def __new__(mcls, name, bases, namespace, **kwargs): # remove current __init_subclass__ so previous one can be found with getattr try: new_init_subclass =

[issue42731] Enhancement request for proxying PyString

2020-12-24 Thread Karl Nelson
New submission from Karl Nelson : When developing with JPype, the largest hole currently is that Java returns a string type which cannot be represented as a str. Java strings are string like and immutable and can be pulled to Python when needed, but it is best if they remain in Java until

[issue42730] TypeError/hang inside of Time.Sleep() when _thread.interrupt_main()

2020-12-24 Thread Abdulrahman Alabdulkareem
Change by Abdulrahman Alabdulkareem : -- title: TypeError in Time.Sleep when invoked from shell script background -> TypeError/hang inside of Time.Sleep() when _thread.interrupt_main() ___ Python tracker

[issue42732] Buildbot s390x Fedora LTO + PGO 3.x fails intermittently

2020-12-24 Thread Ken Jin
New submission from Ken Jin : Dear core developers, I noticed that for many recent commits, the s390x Fedora LTO + PGO 3.x buildbot often fails. Here's an error log:: gcc -pthread -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Xlinker

[issue32501] Documentation for dir([object])

2020-12-24 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: A use-case for writable bases: __init_subclass__ is called in type.__new__, which means that for Enum __init_subclass__ is called before the members have been added. To work around this I am currently (3.10) adding in a _NoInitSubclass to the bases before

[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: I just added **kwds to EnumMeta -- can this be closed? -- nosy: +ethan.furman ___ Python tracker ___

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset f7dca9b9c864c1b7807014ea21a30cac76727e8b by Ethan Furman in branch '3.9': [3.9] bpo-42727: [Enum] EnumMeta.__prepare__ now accepts **kwds (GH-23917). (GH-23926) https://github.com/python/cpython/commit/f7dca9b9c864c1b7807014ea21a30cac76727e8b

[issue42732] Buildbot s390x Fedora LTO + PGO 3.x fails intermittently

2020-12-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Isn't this the same as the problem described in https://bugs.python.org/issue42164 ? -- ___ Python tracker ___

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-24 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, let's do it. It should probably a post-parse check (before we invoke the bytecode compiler but after we have the AST in hand). -- ___ Python tracker

[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +22776 pull_request: https://github.com/python/cpython/pull/23925 ___ Python tracker ___

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +22777 pull_request: https://github.com/python/cpython/pull/23926 ___ Python tracker ___

[issue42685] Improve placing of simple query windows.

2020-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c6c43b28746b0642cc3c49dd8138b896bed3028f by Serhiy Storchaka in branch 'master': bpo-42685: Improve placing of simple query windows. (GH-23856) https://github.com/python/cpython/commit/c6c43b28746b0642cc3c49dd8138b896bed3028f --

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Mark Diekhans
Mark Diekhans added the comment: calling setpgid() is a common post-fork task that would need to be an explicit parameter to Popen when preexec_fn goes away -- nosy: +diekhans ___ Python tracker

[issue36876] [subinterpreters] Global C variables are a problem

2020-12-24 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +22779 pull_request: https://github.com/python/cpython/pull/23929 ___ Python tracker ___

[issue42732] Buildbot s390x Fedora LTO + PGO 3.x fails intermittently

2020-12-24 Thread Ken Jin
Ken Jin added the comment: Oops, you're right! Sorry, I'll close this issue. Anyways I realized I had the wrong hunch - I was looking at a different part of the logs. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +22780 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/23930 ___ Python tracker

[issue42733] [issue] io's r+ mode truncate(0)

2020-12-24 Thread 施文峰
New submission from 施文峰 : happen at io's reading & updating(r+) mode after read, file object's postion stay in last if you remove whole content ( truncate(0) ), postion wil not back to 0 still stay in the last then you start writing from last position(not 0) that's why problem happen test case

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Ethan Furman
Ethan Furman added the comment: New changeset 786d97a66cac48e7a933010367b8993a5b3ab85b by Ethan Furman in branch 'master': bpo-42727: [Enum] use super() and include **kwds (GH-23927) https://github.com/python/cpython/commit/786d97a66cac48e7a933010367b8993a5b3ab85b --

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +22781 pull_request: https://github.com/python/cpython/pull/23931 ___ Python tracker

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith nosy_count: 2.0 -> 3.0 pull_requests: +22782 pull_request: https://github.com/python/cpython/pull/23932 ___ Python tracker

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 8badadec53cbf9dc049c5b54198c5689481e3f3f by Gregory P. Smith in branch 'master': bpo-42727: Fix the NEWS entry .rst (GH-23932) https://github.com/python/cpython/commit/8badadec53cbf9dc049c5b54198c5689481e3f3f --

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +22783 pull_request: https://github.com/python/cpython/pull/23933 ___ Python tracker ___

[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset 5a6b5d8c392ca7028e7c034710a89492cd704778 by Miss Islington (bot) in branch '3.9': bpo-42727: Fix the NEWS entry .rst (GH-23932) https://github.com/python/cpython/commit/5a6b5d8c392ca7028e7c034710a89492cd704778 --

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- versions: +Python 3.10 -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +22784 pull_request: https://github.com/python/cpython/pull/23934 ___ Python tracker

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 64abf373444944a240274a9b6d66d1cb01ecfcdd by Gregory P. Smith in branch 'master': bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467) https://github.com/python/cpython/commit/64abf373444944a240274a9b6d66d1cb01ecfcdd

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +22785 pull_request: https://github.com/python/cpython/pull/23935 ___ Python tracker ___

[issue42730] TypeError/hang inside of Time.Sleep() when _thread.interrupt_main()

2020-12-24 Thread Eryk Sun
Eryk Sun added the comment: When a process executes in the background from a non-interactive bash script, the initial handler for SIGINT is SIG_IGN (ignore). Prior to 3.7, _thread.interrupt_main() tries to trip SIGINT even when the C handler is set to SIG_IGN. But Python uses an integer

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Meta issue behind this one: The input= behavior on check_output is yet another unfortunate wart in the subprocess collection of APIs. PR to the main branch is in, 3.9 and 3.8 will automerge after CI runs. -- resolution: -> fixed stage: patch

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset 7acfe4125725e86c982300cf10c0ab791a0783f4 by Miss Islington (bot) in branch '3.9': bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467) https://github.com/python/cpython/commit/7acfe4125725e86c982300cf10c0ab791a0783f4

[issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

2020-12-24 Thread miss-islington
miss-islington added the comment: New changeset d5aadb28545fd15cd3517b604a8c7a520abd09c6 by Miss Islington (bot) in branch '3.8': bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467) https://github.com/python/cpython/commit/d5aadb28545fd15cd3517b604a8c7a520abd09c6

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: PR up to add setpgid support. From what I've come across, some setpgid() users can use setsid() already available via start_new_session= instead. But rather than getting into the differences between those, making both available makes sense to allow for

[issue42734] "bogus_code_obj.py" should be removed from "cPython/Lib/test/crashers"

2020-12-24 Thread Xinmeng Xia
New submission from Xinmeng Xia : In "Python/Lib/test/crashers/README", it said "This directory only contains tests for outstanding bugs that cause the interpreter to segfault. Once the crash is fixed, the test case should be moved into an appropriate test." The file "bogus_code_obj.py"

[issue42735] "trace_at_recursion_limit.py" should be removed from "Python/Lib/test/crashers"

2020-12-24 Thread Xinmeng Xia
New submission from Xinmeng Xia : In "Python/Lib/test/crashers/", only tests for outstanding bugs that cause the interpreter to segfault should be included. The file "trace_at_recursion_limit.py" has been fixed on Python 3.7, 3.8, 3.9, 3.10. No segmentation fault will be caused any more. I

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-24 Thread Gregory P. Smith
New submission from Gregory P. Smith : Another use of `subprocess preexec_fn=` that I've come across has been to call Linux's `prctl` in the child process before the `exec`. `_libc.prctl(_PR_SET_PDEATHSIG, value)` for example. Adding a linux_prctl_calls= parameter listing information about

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://bugs.python.org/issue42736 filed to track adding Linux prctl() support. -- ___ Python tracker ___

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Another preexec_fn use to consider: resource.setrlimit(resource.RLIMIT_CORE, (XXX, XXX)) Using an intermediate shell script wrapper that changes the rlimit and exec's the actual process is also an alternative. --

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm also seeing a lot of os.setpgrp() calls, though those are more likely able to use start_new_session to do setsid() as a dropin replacement. -- ___ Python tracker

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: signal.signal use case: Calls to signal.signal(x, y) to sometimes to set a non SIG_DFL behavior on a signal. SIGINT -> SIG_IGN for example. I see a lot of legacy looking code calling signal.signal in prexec_fn that appears to set SIG_DFL for the signals

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +22786 pull_request: https://github.com/python/cpython/pull/23936 ___ Python tracker ___

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Doing the code inspection of existing preexec_fn= users within our codebase at work is revealing. But those seem to be the bulk of uses. I expect this deprecation to take a while. Ex: if we mark it as PendingDeprecationWarning in 3.10, I'd still wait