[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset bcb094b41f7fe4dd1686c50891d85632fcf0d481 by Victor Stinner in branch 'master': bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) https://github.com/python/cpython/commit/bcb094b41f7fe4dd1686c50891d85632fcf0d481 ---

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset a486054b24658fa623e030ddd4cc0cbfcac54ab0 by Victor Stinner in branch 'master': bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579) https://github.com/python/cpython/commit/a486054b24658fa623e030ddd4cc0cbfcac54ab0 -- _

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset acde3f1530f1664c9ec7f22e16a7f54c5191e4a6 by Victor Stinner in branch 'master': bpo-43268: Remove abusive usage of tstate in sysmodule.c (#24581) https://github.com/python/cpython/commit/acde3f1530f1664c9ec7f22e16a7f54c5191e4a6 --

[issue42093] Add opcode cache for LOAD_ATTR

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner nosy_count: 4.0 -> 5.0 pull_requests: +23361 pull_request: https://github.com/python/cpython/pull/24582 ___ Python tracker ___ ___

[issue27646] doc: yield from expression can be any iterable

2021-02-19 Thread Irit Katriel
Change by Irit Katriel : -- title: yield from expression can be any iterable -> doc: yield from expression can be any iterable versions: +Python 3.10 -Python 3.5, Python 3.6 ___ Python tracker __

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23360 pull_request: https://github.com/python/cpython/pull/24581 ___ Python tracker ___ __

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23359 pull_request: https://github.com/python/cpython/pull/24580 ___ Python tracker ___ __

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: _PyErr_Occurred() is defined as: static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) { assert(tstate != NULL); return tstate->curexc_type; } -- ___ Python tracker

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +23358 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24579 ___ Python tracker ___ _

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: > #define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type) But this way, this macro access directly the PyThreadState.curexc_type member which goes against the bpo-39947 "[C API] Make the PyThreadState structure opaque (move it to the internal C API)" is

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
New submission from STINNER Victor : The private _PyErr_OCCURRED() function was introduced to optimize Objects/setobject.c: commit 5ba0cbe39221ff8985ce5a4702a3b01a17ae3248 Author: Raymond Hettinger Date: Sat Aug 6 18:31:24 2005 + * set_new() doesn't need to zero the structure a sec

[issue34013] Inconsistent SyntaxError for print

2021-02-19 Thread Andre Roberge
Andre Roberge added the comment: +1 to the idea of adding something to the grammar, and have a simple error message: SyntaxError: Missing parentheses in call to 'print'. in *all* cases, including the first one that prompted this bug report. I write that even though I have created a third-pa

[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

2021-02-19 Thread Christoph Anton Mitterer
Change by Christoph Anton Mitterer : Added file: https://bugs.python.org/file49822/test-no-parent.py ___ Python tracker ___ ___ Python-bugs-

[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

2021-02-19 Thread Christoph Anton Mitterer
Christoph Anton Mitterer added the comment: Okay the problem seems to be that I didn't give you the exact details on what I do. Actually, the group (which then contains the mutually exclusive group) is contained in a "shared" parent parser, which I then use in the subparsers. If I leave out

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 101bf69ff18a946fed7c274f088878aaf85174cc by Victor Stinner in branch 'master': bpo-43268: _Py_IsMainInterpreter() now expects interp (GH-24577) https://github.com/python/cpython/commit/101bf69ff18a946fed7c274f088878aaf85174cc -- _

[issue43269] [sqlite3] Clean up function scoping

2021-02-19 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Ref. https://github.com/python/cpython/pull/24569#issuecomment-782014177, Berker. -- ___ Python tracker ___

[issue34013] Inconsistent SyntaxError for print

2021-02-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Let's step back a bit and focus on the issue at hand. The problem is the following: * We **already** have a warning for the print statement without parens: Python 3.9.1 (default, Dec 14 2020, 11:49:16) [Clang 12.0.0 (clang-1200.0.32.27)] on darwin Typ

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 62078101ea1be5d2fc472a3f0d9d135e0bd5cd38 by Victor Stinner in branch 'master': bpo-40522: Replace PyThreadState_GET() with PyThreadState_Get() (GH-24575) https://github.com/python/cpython/commit/62078101ea1be5d2fc472a3f0d9d135e0bd5cd38 ---

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 5592f2b9daa24bf74cc616abcc40a29da2bdccb2 by Victor Stinner in branch 'master': bpo-43268: Replace _PyThreadState_GET() with _PyInterpreterState_GET() (GH-24576) https://github.com/python/cpython/commit/5592f2b9daa24bf74cc616abcc40a29da2bdccb2

[issue43269] [sqlite3] Clean up function scoping

2021-02-19 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +23357 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24578 ___ Python tracker _

[issue43269] [sqlite3] Clean up function scoping

2021-02-19 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : There's a lot of file scoped functions without the static storage-class specifier. All file local functions should have the static storage-class specifier. -- components: Library (Lib) messages: 387310 nosy: berker.peksag, erlendaasland pri

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23356 pull_request: https://github.com/python/cpython/pull/24577 ___ Python tracker ___ __

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +23355 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24576 ___ Python tracker ___ _

[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag
Change by Berker Peksag : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag
Berker Peksag added the comment: New changeset 2bb0bf4dd8c0bd4d23eb04afce1a58e07982 by Erlend Egeberg Aasland in branch 'master': bpo-43258: Make sqlite3 callback functions static (GH-24574) https://github.com/python/cpython/commit/2bb0bf4dd8c0bd4d23eb04afce1a58e07982 -- __

[issue43268] [internals] Pass the current interpreter (interp) rather than the current Python thread state (state)

2021-02-19 Thread STINNER Victor
New submission from STINNER Victor : I modified many internal C functions to pass the current Python thread state (tstate), but in practice, only the current interpreter (interp) is needed. -- components: Interpreter Core messages: 387308 nosy: vstinner priority: normal severity: norma

[issue34013] Inconsistent SyntaxError for print

2021-02-19 Thread Vedran Čačić
Vedran Čačić added the comment: > "It's still one of the most common beginner mistakes" Do you have any data to back this up? I really think it's overblown. On the other hand, if it really _is_ so, how about changing the language? It wouldn't be the first thing that was changed for Py3, and t

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23354 pull_request: https://github.com/python/cpython/pull/24575 ___ Python tracker ___ __

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: Updated PR documentation: --- The types.FunctionType constructor now inherits the current builtins if the globals parameter is used and the globals dictionary has no "__builtins__" key, rather than rather than using {"None": None} as builtins: same behavior tha

[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +23353 pull_request: https://github.com/python/cpython/pull/24574 ___ Python tracker ___ __

[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag
Berker Peksag added the comment: New changeset 979b23cbe44071b056ff524c0aa20e5d9794b5b0 by Erlend Egeberg Aasland in branch 'master': bpo-43258: Don't allocate sqlite3 aggregate context for empty queries (GH-24569) https://github.com/python/cpython/commit/979b23cbe44071b056ff524c0aa20e5d9794b

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: I rephrased PR 24564 to clarify the scope of the incompatible change: in practice, only the types.FunctionType constructor changes. Defining functions in Python using "def function(...): ...", eval(code, {}) and exec(code, {}) are not affected. eval() and ex

[issue43263] threading module unable to run

2021-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry, but as Ronald says there's not nearly enough information here. Some questions: - What do you mean by "embedded Python"? - What is "the exe" that you refer to in your second mesasge? Is that python.exe? Is that an executable you compiled from your Pyth

[issue43267] [sqlite3] Redundant type checks in pysqlite_statement_bind_parameter()

2021-02-19 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : The type checks at the start of pysqlite_statement_bind_parameter() are redundant: We first check for exact types (*_CheckExact()), and then we check again for exact or subtyped versions (*_Check()). (Adding to the redundantness: the result of this

[issue43175] filecmp is not working for UTF-8 BOM file.

2021-02-19 Thread suresh
suresh added the comment: I am getting same file size and are regular files (True) as below. Could you assist on filecmp any changes required in passing the inputs. Since it returns false. Code: >>> os.chdir(r'C:\Users\suresh.n\Files') >>> open('source.css', 'rb').read() == open('destinati

[issue43251] sqlite3_column_name() failures should raise MemoryError

2021-02-19 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- title: sqlite3_column_name() failures should call PyErr_NoMemory() -> sqlite3_column_name() failures should raise MemoryError ___ Python tracker

[issue43260] Never release buffer when MemoryError in print()

2021-02-19 Thread Eryk Sun
Eryk Sun added the comment: Issue 36748 added the ASCII optimization in write(), so I'm adding Inada Naoki to the nosy list. -- nosy: +methane ___ Python tracker ___

[issue43260] Never release buffer when MemoryError in print()

2021-02-19 Thread Eryk Sun
Eryk Sun added the comment: The sys.stdout TextIOWrapper is stuck in a bad state. When the write() method is called with an ASCII string, it implements an optimization that stores a reference to the str() object in the internal pending_bytes instead of immediately encoding the string. Subseq

[issue43266] "String conversion and formatting" formatting messes up array subscripting

2021-02-19 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +23352 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24573 ___ Python tracker _

[issue43266] "String conversion and formatting" formatting messes up array subscripting

2021-02-19 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : str[size-1] is rendered incorrectly in https://docs.python.org/3.10/c-api/conversion.html The original intent was probably to apply italics to the variables names only. This can be fixed by prefixing the first bracket with a backslash. However, th

[issue43265] Improve sqlite3 backup error handling

2021-02-19 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : There are some issues with the error handling in pysqlite_connection_backup_impl(): 1. ValueError is returned if the target connection equals source connection. Should be OperationalError, IMHO. 2. The aforementioned check is already performed by

[issue43263] threading module unable to run

2021-02-19 Thread twoone3
twoone3 <3197653...@qq.com> added the comment: I use cpython to running .py file,the file created a new thread,but the exe can't continue to run -- ___ Python tracker ___

[issue43264] ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem

2021-02-19 Thread Tobiichi
Change by Tobiichi <754785...@qq.com>: -- title: Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem -> ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem _

[issue43264] Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem

2021-02-19 Thread Tobiichi
Change by Tobiichi <754785...@qq.com>: Added file: https://bugs.python.org/file49820/client1.py ___ Python tracker ___ ___ Python-bugs-list

[issue43264] Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem

2021-02-19 Thread Tobiichi
New submission from Tobiichi <754785...@qq.com>: I append EventProxy into ListProxy like this: ``` l = manager.list([mp.Event() for _ in range(2)]) ``` It works fine on a single node when I'm trying to get this listproxy. but when I trying to use multiple nodes across ethernet. it cause probl

[issue43263] threading module unable to run

2021-02-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: Please add more information about what you're doing. Your report does not contain enough information to try to reproduce the problem. This is supposed to work just fine, and does work for me. -- nosy: +ronaldoussoren __

[issue43263] threading module unable to run

2021-02-19 Thread twoone3
New submission from twoone3 <3197653...@qq.com>: When I use embedded Python to import and use threading module,The program will hang,I tested it in versions 3.6.5 and 3.9.1. -- components: C API messages: 387293 nosy: twoone3 priority: normal severity: normal status: open title: thread

[issue34013] Inconsistent SyntaxError for print

2021-02-19 Thread Irit Katriel
Irit Katriel added the comment: I agree with Terry’s point about printing long expressions in the error msg. Perhaps just the preamble would be useful though: SyntaxError: Missing parentheses in call to 'print'. Instead of just SyntaxError: invalid syntax. -- _

<    1   2