]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoFix typo in compileall.py's docstring (GH-29865)
Alexander Münch [Thu, 17 Feb 2022 20:45:27 +0000 (21:45 +0100)] 
Fix typo in compileall.py's docstring (GH-29865)

3 years agobpo-29418: Add inspect.ismethodwrapper to whatsnew (GH-31377)
Hakan Çelik [Thu, 17 Feb 2022 19:45:55 +0000 (22:45 +0300)] 
bpo-29418: Add inspect.ismethodwrapper to whatsnew (GH-31377)

3 years agobpo-46730: Fix refleak and tighten NULL checks (GH-31389)
Christian Heimes [Thu, 17 Feb 2022 19:27:42 +0000 (21:27 +0200)] 
bpo-46730: Fix refleak and tighten NULL checks (GH-31389)

``PyType_GetQualName`` returns a new reference.

Signed-off-by: Christian Heimes <christian@python.org>
3 years agobpo-46778: Enable multiprocess compilation for source files when building on Windows...
Jeremy Kloth [Thu, 17 Feb 2022 18:40:33 +0000 (11:40 -0700)] 
bpo-46778: Enable multiprocess compilation for source files when building on Windows (GH-31390)

3 years agoUpdate html.parser.rst (GH-30678)
Géry Ogam [Thu, 17 Feb 2022 12:20:40 +0000 (13:20 +0100)] 
Update html.parser.rst (GH-30678)

This PR for the documentation of the [html.parser](https://docs.python.org/3/library/html.parser.html) module will

- fix a terminology mistake (‘start of a tag’ -> ‘start tag of an element’);
- mention the parameter names of the `HTMLParser.handle_*` methods where missing.

3 years agobpo-41086: Add exception for uninstantiated interpolation (configparser) (GH-21062)
Brian Faherty [Thu, 17 Feb 2022 12:17:43 +0000 (07:17 -0500)] 
bpo-41086: Add exception for uninstantiated interpolation (configparser) (GH-21062)

* Add exception for uninstantiated interpolation (configparser)

The current feedback when users try to pass an uninstantiated
interpolation into a ConfigParser is an error message that does not help
users solve the problem. This current error of `TypeError: before_set()
missing 1 required positional argument: 'value'` does not display until
the parser is used, which usually results in the assumption that
instantiation of the parser was done correctly. The new exception of
InterpolationTypeError, will be raised on the line where the
ConfigParser is instantiated. This will result in users see the line
that has the error in their backtrace for faster debugging.

There have been a number of bugs created in the issue tracker, which
could have been addressed by:
https://bugs.python.org/issue26831 and https://bugs.python.org/issue26469

* 📜🤖 Added by blurb_it.

* Replace custom Error with TypeError

Per feedback from @iritkatriel, the custom InterpolationTypeError has
been dropped in favour of a TypeError with a custom message, and the
unittests have been expanded.

* More verbose message

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agoClose stale PRs without signed CLA (GH-30500)
Erlend Egeberg Aasland [Thu, 17 Feb 2022 08:20:40 +0000 (09:20 +0100)] 
Close stale PRs without signed CLA (GH-30500)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
3 years agobpo-46745: Fix typo in PositionsIterator (#31322)
Robert-André Mauchin [Thu, 17 Feb 2022 05:20:06 +0000 (06:20 +0100)] 
bpo-46745: Fix typo in PositionsIterator (#31322)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376)
Dong-hee Na [Thu, 17 Feb 2022 04:02:17 +0000 (13:02 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376)

3 years agobpo-46333: Honor `module` parameter in ForwardRef (GH-30536)
aha79 [Thu, 17 Feb 2022 03:28:18 +0000 (04:28 +0100)] 
bpo-46333: Honor `module` parameter in ForwardRef (GH-30536)

The `module` parameter carries semantic information about the forward ref.
Forward refs are different if they refer to different module even if they
have the same name. This affects the `__eq__`, `__repr__` and `__hash__` methods.

Co-authored-by: Andreas Hangauer <andreas.hangauer@siemens.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)
97littleleaf11 [Thu, 17 Feb 2022 03:26:07 +0000 (11:26 +0800)] 
bpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)

Closes python/typing#981

https://bugs.python.org/issue46066

3 years agoBecome a CODEOWNER for typing (#31374)
Jelle Zijlstra [Wed, 16 Feb 2022 19:02:06 +0000 (11:02 -0800)] 
Become a CODEOWNER for typing (#31374)

3 years agobpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)
Brandt Bucher [Wed, 16 Feb 2022 16:49:58 +0000 (08:49 -0800)] 
bpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)

3 years agobpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)
Brandt Bucher [Wed, 16 Feb 2022 16:48:16 +0000 (08:48 -0800)] 
bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375)
Dong-hee Na [Wed, 16 Feb 2022 16:04:38 +0000 (01:04 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375)

3 years agobpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)
Erlend Egeberg Aasland [Wed, 16 Feb 2022 15:24:44 +0000 (16:24 +0100)] 
bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)
Dong-hee Na [Wed, 16 Feb 2022 15:24:03 +0000 (00:24 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)

3 years agobpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases...
Hakan Çelik [Wed, 16 Feb 2022 12:46:20 +0000 (15:46 +0300)] 
bpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases where methodwrapper is given (GH-19261)

Automerge-Triggered-By: GH:isidentical
3 years agoRemove offsets from expected output in test.test_dis (GH-31369)
Mark Shannon [Wed, 16 Feb 2022 12:19:09 +0000 (12:19 +0000)] 
Remove offsets from expected output in test.test_dis (GH-31369)

3 years agobpo-46762: Fix an assert failure in f-strings where > or < is the last character...
Eric V. Smith [Wed, 16 Feb 2022 10:54:09 +0000 (05:54 -0500)] 
bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (#31365)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)
Dong-hee Na [Wed, 16 Feb 2022 09:57:28 +0000 (18:57 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)

3 years agobpo-46730: Add more info to @property AttributeError messages (GH-31311)
Alex-Blade [Wed, 16 Feb 2022 07:07:34 +0000 (10:07 +0300)] 
bpo-46730: Add more info to @property AttributeError messages (GH-31311)

On `obj.read_only_property = x`, raise `AttributeError: property 'read_only_property' of 'A' object has no setter`.

3 years agobpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364)
Eric Snow [Wed, 16 Feb 2022 03:07:11 +0000 (20:07 -0700)] 
bpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364)

https://bugs.python.org/issue46541

3 years agobpo-46541: Drop the check for orphaned global strings. (gh-31363)
Eric Snow [Wed, 16 Feb 2022 03:06:38 +0000 (20:06 -0700)] 
bpo-46541: Drop the check for orphaned global strings. (gh-31363)

https://bugs.python.org/issue46541

3 years agobpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)
Guido van Rossum [Tue, 15 Feb 2022 23:42:04 +0000 (15:42 -0800)] 
bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)

asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes:

- Allow creating new tasks as long as the last task hasn't finished
- Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError
- Instead of monkey-patching the parent task's cancel() method,
  add a new public API to Task

The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`.

Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup.

This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside".

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)
Zackery Spytz [Tue, 15 Feb 2022 23:12:15 +0000 (15:12 -0800)] 
bpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)

3 years agobpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)
Alex Waygood [Tue, 15 Feb 2022 16:39:28 +0000 (16:39 +0000)] 
bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)

The docstring for `BufferedProtocol` states that the class is still an "experimental API", but it has been considered stable since 3.8.

3 years agoFix copyright years in `README.rst` (#31347)
Nikita Sobolev [Tue, 15 Feb 2022 15:22:00 +0000 (18:22 +0300)] 
Fix copyright years in `README.rst` (#31347)

3 years agobpo-44011: New asyncio ssl implementation (#31275)
Kumar Aditya [Tue, 15 Feb 2022 13:04:00 +0000 (18:34 +0530)] 
bpo-44011: New asyncio ssl implementation (#31275)

* bpo-44011: New asyncio ssl implementation

Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com>
* fix warning

* fix typo

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46724: Use `JUMP_ABSOLUTE` for all backward jumps. (GH-31326)
Mark Shannon [Tue, 15 Feb 2022 09:35:16 +0000 (09:35 +0000)] 
bpo-46724: Use `JUMP_ABSOLUTE` for all backward jumps. (GH-31326)

* Make sure all backward jumps use JUMP_ABSOLUTE.

* Add news.

* Fix up news item.

* Make test use consistent style.

3 years agobpo-46541: Discover the global strings. (gh-31346)
Eric Snow [Tue, 15 Feb 2022 00:36:51 +0000 (17:36 -0700)] 
bpo-46541: Discover the global strings. (gh-31346)

Instead of manually enumerating the global strings in generate_global_objects.py, we extrapolate the list from usage of _Py_ID() and _Py_STR() in the source files.

This is partly inspired by gh-31261.

https://bugs.python.org/issue46541

3 years agobpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293)
DongGeon Lee [Tue, 15 Feb 2022 00:02:21 +0000 (09:02 +0900)] 
bpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293)

3 years agoRegen the global objects using PYTHON_FOR_REGEN. (gh-31344)
Eric Snow [Mon, 14 Feb 2022 23:07:09 +0000 (16:07 -0700)] 
Regen the global objects using PYTHON_FOR_REGEN. (gh-31344)

https://bugs.python.org/issue46541

3 years agoUpdate the OMG link (GH-30383)
David Gilbertson [Mon, 14 Feb 2022 21:49:11 +0000 (08:49 +1100)] 
Update the OMG link (GH-30383)

3 years agoUpdate the copyright symbols in README.rst (GH-25514)
MishManners®™ [Mon, 14 Feb 2022 21:40:19 +0000 (08:40 +1100)] 
Update the copyright symbols in README.rst (GH-25514)

Updated a couple copyright symbols from (c) to ©

The rest of the doc are already using ©

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
3 years agoFix missing import in dataclass code snippet (GH-29214)
Leo [Mon, 14 Feb 2022 20:01:53 +0000 (20:01 +0000)] 
Fix missing import in dataclass code snippet (GH-29214)

field was not imported. It has been added now.

3 years agodoc: use colon for all color's rangs (GH-28998)
Rafael Fontenelle [Mon, 14 Feb 2022 19:46:40 +0000 (16:46 -0300)] 
doc: use colon for all color's rangs (GH-28998)

3 years agobpo-38619: Update the documentation for UUID.hex (GH-29830)
180909 [Mon, 14 Feb 2022 18:58:22 +0000 (02:58 +0800)] 
bpo-38619: Update the documentation for UUID.hex (GH-29830)

Explicitly state that it is lowercase.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agoUpdate __main__.rst (GH-30896)
David Gilbertson [Mon, 14 Feb 2022 18:53:16 +0000 (05:53 +1100)] 
Update __main__.rst (GH-30896)

The reference to `venv` appears in the paragraph below, instead of above.
Fixed the documentation.

3 years agoUpdate further README references from 3.10 to 3.11 (GH-31009)
Jacob Walls [Mon, 14 Feb 2022 18:50:15 +0000 (13:50 -0500)] 
Update further README references from 3.10 to 3.11 (GH-31009)

3 years agoFix a typo in Doc/faq/programming.rst (GH-31243)
Cooper Lees [Mon, 14 Feb 2022 18:49:28 +0000 (10:49 -0800)] 
Fix a typo in Doc/faq/programming.rst (GH-31243)

is not longer used -> is no longer used

3 years agoFix minor grammar error (#31325)
Scott Noyes [Mon, 14 Feb 2022 18:45:48 +0000 (12:45 -0600)] 
Fix minor grammar error (#31325)

"an" followed by consonant should be "a"

3 years agoRemove unnecessary basic block from comprehensions (GH-31263)
Brandt Bucher [Mon, 14 Feb 2022 17:48:45 +0000 (09:48 -0800)] 
Remove unnecessary basic block from comprehensions (GH-31263)

3 years agobpo-46747: Add missing key parameters in the bisect docs (GH-31323)
Zackery Spytz [Mon, 14 Feb 2022 16:16:49 +0000 (08:16 -0800)] 
bpo-46747: Add missing key parameters in the bisect docs (GH-31323)

Added *key* parameter to `bisect.bisect()` and `bisect.insort()` in bisect module docs.

3 years agoAdd pair counts to stats output and summary. (GH-31324)
Mark Shannon [Mon, 14 Feb 2022 15:53:38 +0000 (15:53 +0000)] 
Add pair counts to stats output and summary. (GH-31324)

3 years agoInclude length in stats for UNPACK_SEQUENCE. (GH-31254)
Mark Shannon [Mon, 14 Feb 2022 10:01:31 +0000 (10:01 +0000)] 
Include length in stats for UNPACK_SEQUENCE. (GH-31254)

3 years agoCorrections to format precision description. (GH-31291)
John Belmonte [Mon, 14 Feb 2022 00:00:32 +0000 (09:00 +0900)] 
Corrections to format precision description. (GH-31291)

* `precision` field is a decimal integer
  * clarify that stated limitations are on presentation type
    rather than input value type.  Especially misleading is
    "precision is not allowed for integer values", since integer
    value input to a format like `.1f` is fine.
  * regarding max field size, replace "non-number" with "string",
    which is the only non-numeric presentation type

Automerge-Triggered-By: GH:ericvsmith
3 years agoImprove docstring for set.discard() (GH-31315)
Raymond Hettinger [Sun, 13 Feb 2022 21:42:59 +0000 (15:42 -0600)] 
Improve docstring for set.discard() (GH-31315)

3 years agobpo-45447: Fix entry in What's New 3.11 (GH-31307)
Terry Jan Reedy [Sun, 13 Feb 2022 02:12:21 +0000 (21:12 -0500)] 
bpo-45447: Fix entry in What's New 3.11 (GH-31307)

3 years agobpo-45447: Add entry to What's new 3.9 (GH-31305)
Terry Jan Reedy [Sun, 13 Feb 2022 02:11:19 +0000 (21:11 -0500)] 
bpo-45447: Add entry to What's new 3.9 (GH-31305)

3 years agobpo-45447: Add entry to What's new 3.10 (GH-31304)
Terry Jan Reedy [Sun, 13 Feb 2022 02:10:29 +0000 (21:10 -0500)] 
bpo-45447: Add entry to What's new 3.10 (GH-31304)

3 years agobpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)
Alex Waygood [Sun, 13 Feb 2022 00:04:48 +0000 (00:04 +0000)] 
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)

Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues.
Add util.py to contain objects that are used in multiple idlelib modules
and have no dependencies on any of them.

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agobpo-46333: include `module` in `ForwardRef.__repr__` (#31283)
aha79 [Sat, 12 Feb 2022 15:35:57 +0000 (16:35 +0100)] 
bpo-46333: include `module` in `ForwardRef.__repr__` (#31283)

The module parameter carries semantic information about the forward ref.
Show to the user that forward refs with same argument but different
module are different.

Co-authored-by: Andreas Hangauer <andreas.hangauer@siemens.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agobpo-46400: Update libexpat from 2.4.1 to 2.4.4 (GH-31022)
Cyril Jouve [Sat, 12 Feb 2022 15:29:41 +0000 (16:29 +0100)] 
bpo-46400: Update libexpat from 2.4.1 to 2.4.4 (GH-31022)

3 years agobpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser ...
Jacob Walls [Sat, 12 Feb 2022 08:27:02 +0000 (03:27 -0500)] 
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser (GH-31152)

Both implementations accept target=None now.

3 years agobpo-46586: Fix documentation links (GH-31216)
Meer Suri [Sat, 12 Feb 2022 04:21:38 +0000 (12:21 +0800)] 
bpo-46586: Fix documentation links (GH-31216)

* Fix enum.property documentation link

3 years agobpo-46355: Amend What's New in Python 3.11 C API wording (GH-31288)
Erlend Egeberg Aasland [Sat, 12 Feb 2022 00:48:26 +0000 (01:48 +0100)] 
bpo-46355: Amend What's New in Python 3.11 C API wording (GH-31288)

3 years agobpo-46483: [doc] pathlib classes no longer support parameterized generics (GH-31281)
Alex Waygood [Fri, 11 Feb 2022 20:39:37 +0000 (20:39 +0000)] 
bpo-46483: [doc] pathlib classes no longer support parameterized generics (GH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.

3 years agobpo-46615: Don't crash when set operations mutate the sets (GH-31120)
Dennis Sweeney [Fri, 11 Feb 2022 16:25:08 +0000 (11:25 -0500)] 
bpo-46615: Don't crash when set operations mutate the sets (GH-31120)

Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called.

3 years agobpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)
Petr Viktorin [Fri, 11 Feb 2022 16:22:11 +0000 (17:22 +0100)] 
bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)

* Make PyType_GetModuleByDef public (remove underscore)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 years agobpo-45490: Rename static inline functions (GH-31217)
Victor Stinner [Fri, 11 Feb 2022 16:01:10 +0000 (17:01 +0100)] 
bpo-45490: Rename static inline functions (GH-31217)

When a static inline function is wrapped by a macro which casts its
arguments to the expected type, there is no need that the function
has a different name than the macro. Use the same name for the macro
and the function to avoid confusion.

Rename _PyUnicode_get_wstr_length() to PyUnicode_WSTR_LENGTH().

Don't rename static inline _Py_NewRef() and _Py_XNewRef() functions,
since the C API exports Py_NewRef() and Py_XNewRef() functions as
regular functions. The name cannot be reused in this case.

3 years agoFix the signature of multiprocessing.set_executable (GH-31276)
Géry Ogam [Fri, 11 Feb 2022 14:42:54 +0000 (15:42 +0100)] 
Fix the signature of multiprocessing.set_executable (GH-31276)

Automerge-Triggered-By: GH:merwok
3 years agobpo-46323: Fix double-free issue for borrowed refs (GH-31272)
Dong-hee Na [Fri, 11 Feb 2022 08:48:47 +0000 (17:48 +0900)] 
bpo-46323: Fix double-free issue for borrowed refs (GH-31272)

3 years agobpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)
Arie Bovenberg [Fri, 11 Feb 2022 00:56:21 +0000 (01:56 +0100)] 
bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)

Confirmed with @jaraco that this indeed needs a fix.

A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.

Automerge-Triggered-By: GH:jaraco
3 years agobpo-36876: Make sure the c-analyzer is checking all the source files.' (gh-31264)
Eric Snow [Thu, 10 Feb 2022 23:14:19 +0000 (16:14 -0700)] 
bpo-36876: Make sure the c-analyzer is checking all the source files.' (gh-31264)

https://bugs.python.org/issue36876

3 years agobpo-44953: Add newline at end of NEWS entry (GH-31265)
Dennis Sweeney [Thu, 10 Feb 2022 22:57:24 +0000 (17:57 -0500)] 
bpo-44953: Add newline at end of NEWS entry (GH-31265)

3 years agobpo-44953: Add vectorcall for itemgetter and attrgetter instances (GH-27828)
Dennis Sweeney [Thu, 10 Feb 2022 21:57:47 +0000 (16:57 -0500)] 
bpo-44953: Add vectorcall for itemgetter and attrgetter instances (GH-27828)

3 years agobpo-45923: Add `RESUME_QUICK` (GH-31244)
Brandt Bucher [Thu, 10 Feb 2022 17:50:02 +0000 (09:50 -0800)] 
bpo-45923: Add `RESUME_QUICK` (GH-31244)

3 years agoGather stats for PRECALL_METHOD. (GH-31259)
Mark Shannon [Thu, 10 Feb 2022 15:55:52 +0000 (15:55 +0000)] 
Gather stats for PRECALL_METHOD. (GH-31259)

3 years agoDon't print rejected tokens when using the debug flags in the parser (GH-31258)
Pablo Galindo Salgado [Thu, 10 Feb 2022 14:38:27 +0000 (14:38 +0000)] 
Don't print rejected tokens when using the debug flags in the parser (GH-31258)

3 years agoAllow the parser to avoid nested processing of invalid rules (GH-31252)
Pablo Galindo Salgado [Thu, 10 Feb 2022 13:12:14 +0000 (13:12 +0000)] 
Allow the parser to avoid nested processing of invalid rules (GH-31252)

3 years agobpo-46532: Reduce number of memory writes to update call_shape.kwnames. (GH-31231)
Mark Shannon [Thu, 10 Feb 2022 12:57:55 +0000 (12:57 +0000)] 
bpo-46532: Reduce number of memory writes to update call_shape.kwnames. (GH-31231)

3 years agoFix warning: asyncio.events._event_loop_policy was modified by test_asyncio (GH-31253)
Andrew Svetlov [Thu, 10 Feb 2022 12:57:20 +0000 (14:57 +0200)] 
Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio (GH-31253)

3 years agoFix sys.getdxp() when configured with --enable-pystats. (GH-31251)
Mark Shannon [Thu, 10 Feb 2022 12:14:57 +0000 (12:14 +0000)] 
Fix sys.getdxp() when configured with --enable-pystats. (GH-31251)

3 years agoAdd stats for PRECALL_FUNCTION. (GH-31250)
Mark Shannon [Thu, 10 Feb 2022 11:47:52 +0000 (11:47 +0000)] 
Add stats for PRECALL_FUNCTION. (GH-31250)

3 years agoRight justify numeric columns in stats summary script. (GH-31234)
Mark Shannon [Thu, 10 Feb 2022 11:01:18 +0000 (11:01 +0000)] 
Right justify numeric columns in stats summary script. (GH-31234)

3 years agobpo-46323: Allow alloca(0) for python callback function of ctypes (GH-31249)
Dong-hee Na [Thu, 10 Feb 2022 10:10:07 +0000 (19:10 +0900)] 
bpo-46323: Allow alloca(0) for python callback function of ctypes (GH-31249)

3 years agoFix sphinx-lint after #31097 and b878b3a (GH-31248)
Nikita Sobolev [Thu, 10 Feb 2022 09:08:47 +0000 (12:08 +0300)] 
Fix sphinx-lint after #31097 and b878b3a (GH-31248)

`main` branch is failing, see https://dev.azure.com/python/cpython/_build/results?buildId=96616&view=logs&j=4db1505a-29e5-5cc0-240b-53a8a2681f75&t=a975920c-8356-5388-147c-613d5fab0171

Logs:

```
PATH=./venv/bin:$PATH sphinx-lint -i tools -i ./venv -i README.rst
No problems found.
PATH=./venv/bin:$PATH sphinx-lint ../Misc/NEWS.d/next/
[1] ../Misc/NEWS.d/next/Library/2022-02-09-00-53-23.[bpo-45863]().zqQXVv.rst:0: No newline at end of file (no-newline-at-end-of-file).
[1] ../Misc/NEWS.d/next/Build/2022-01-19-11-08-32.[bpo-46430]().k403m_.rst:0: No newline at end of file (no-newline-at-end-of-file).
2 problems with severity 1 found.
```

This PR fixes these two problems, so `main` is green again.

Related PR: https://github.com/python/cpython/pull/31097
CC @JulienPalard

Automerge-Triggered-By: GH:JulienPalard
3 years agobpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
Julien Palard [Thu, 10 Feb 2022 07:59:04 +0000 (08:59 +0100)] 
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)

3 years agobpo-46707: Avoid potential exponential backtracking in some syntax errors (GH-31241)
Pablo Galindo Salgado [Thu, 10 Feb 2022 03:37:17 +0000 (03:37 +0000)] 
bpo-46707: Avoid potential exponential backtracking in some syntax errors (GH-31241)

3 years agobpo-36876: Minor cleanup to c-analyzer "ignored" data.' (gh-31239)
Eric Snow [Thu, 10 Feb 2022 00:10:53 +0000 (17:10 -0700)] 
bpo-36876: Minor cleanup to c-analyzer "ignored" data.' (gh-31239)

https://bugs.python.org/issue36876

3 years agobpo-46528: Attempt SWAPs at compile-time (GH-30970)
Brandt Bucher [Wed, 9 Feb 2022 23:15:36 +0000 (15:15 -0800)] 
bpo-46528: Attempt SWAPs at compile-time (GH-30970)

3 years agobpo-43532: add version added to KW_ONLY (GH-31235)
Henry Schreiner [Wed, 9 Feb 2022 20:56:10 +0000 (15:56 -0500)] 
bpo-43532: add version added to KW_ONLY (GH-31235)

Minor missing version note mentioned at the end of  (and affected me independently before reading that note).

Automerge-Triggered-By: GH:ericvsmith
3 years agobpo-46528: Check PyMem_Malloc for NULL (GH-30998)
Brandt Bucher [Wed, 9 Feb 2022 19:31:01 +0000 (11:31 -0800)] 
bpo-46528: Check PyMem_Malloc for NULL (GH-30998)

3 years agobpo-46323: Reduce stack usage of ctypes python callback function. (GH-31224)
Dong-hee Na [Wed, 9 Feb 2022 18:10:11 +0000 (03:10 +0900)] 
bpo-46323: Reduce stack usage of ctypes python callback function. (GH-31224)

3 years agobpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)
Joshua Root [Wed, 9 Feb 2022 17:06:19 +0000 (04:06 +1100)] 
bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)

Numeric fields of type float, notably mtime, can't be represented
exactly in the ustar header, so the pax header is used. But it is
helpful to set them to the nearest int (i.e. second rather than
nanosecond precision mtimes) in the ustar header as well, for the
benefit of unarchivers that don't understand the pax header.

Add test for tarfile.TarInfo.create_pax_header to confirm correct
behaviour.

3 years agobpo-46430: Intern strings in deep-frozen modules (GH-30683)
Kumar Aditya [Wed, 9 Feb 2022 16:52:42 +0000 (22:22 +0530)] 
bpo-46430: Intern strings in deep-frozen modules  (GH-30683)

3 years agobpo-44289: Keep argument file object's current position in tarfile.is_tarfile (GH...
Andrzej Mateja [Wed, 9 Feb 2022 16:19:16 +0000 (17:19 +0100)] 
bpo-44289: Keep argument file object's current position in tarfile.is_tarfile (GH-26488)

3 years agobpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)
Nikita Sobolev [Wed, 9 Feb 2022 14:23:07 +0000 (17:23 +0300)] 
bpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)

3 years agobpo-46072: Output stats as markdown with collapsible sections. (GH-31228)
Mark Shannon [Wed, 9 Feb 2022 12:30:26 +0000 (12:30 +0000)] 
bpo-46072: Output stats as markdown with collapsible sections. (GH-31228)

3 years agobpo-36876: Update the c-analyzer whitelist. (gh-31225)
Eric Snow [Wed, 9 Feb 2022 01:37:57 +0000 (18:37 -0700)] 
bpo-36876: Update the c-analyzer whitelist. (gh-31225)

This change adds variables that had been added since the last time the whitelist was updated. It also cleans up the list a little.

https://bugs.python.org/issue36876

3 years agobpo-46556: emit `DeprecationWarning` from `pathlib.Path.__enter__()` (GH-30971)
Barney Gale [Tue, 8 Feb 2022 21:01:37 +0000 (21:01 +0000)] 
bpo-46556: emit `DeprecationWarning` from `pathlib.Path.__enter__()` (GH-30971)

In Python 3.9, Path.__exit__() was made a no-op and has never been documented.

Co-authored-by: Brett Cannon <brett@python.org>
3 years agobpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global...
Eric Snow [Tue, 8 Feb 2022 20:39:07 +0000 (13:39 -0700)] 
bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928)

We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code.  It is still used in a number of non-builtin stdlib modules.

The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime.  A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings).

https://bugs.python.org/issue46541#msg411799 explains the rationale for this change.

The core of the change is in:

* (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros
* Include/internal/pycore_runtime_init.h - added the static initializers for the global strings
* Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState
* Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers

I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings.  That check is added to the PR CI config.

The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()).  This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *.

The following are not changed (yet):

* stop using _Py_IDENTIFIER() in the stdlib modules
* (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API
* (maybe) intern the strings during runtime init

https://bugs.python.org/issue46541

3 years agobpo-45952: Get the C analyzer tool working again. (gh-31220)
Eric Snow [Tue, 8 Feb 2022 19:37:53 +0000 (12:37 -0700)] 
bpo-45952: Get the C analyzer tool working again. (gh-31220)

https://bugs.python.org/issue45952

3 years agobpo-46475: Add typing.Never and typing.assert_never (GH-30842)
Jelle Zijlstra [Tue, 8 Feb 2022 18:50:26 +0000 (10:50 -0800)] 
bpo-46475: Add typing.Never and typing.assert_never (GH-30842)

3 years agobpo-45952: Get the C analyzer tool working again. (gh-31219)
Eric Snow [Tue, 8 Feb 2022 18:42:17 +0000 (11:42 -0700)] 
bpo-45952: Get the C analyzer tool working again. (gh-31219)

https://bugs.python.org/issue45952

3 years agobpo-46323: Use PyObject_Vectorcall while calling ctypes callback function (GH-31138)
Dong-hee Na [Tue, 8 Feb 2022 13:09:17 +0000 (22:09 +0900)] 
bpo-46323: Use PyObject_Vectorcall while calling ctypes callback function (GH-31138)

3 years agobpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010)
Pablo Galindo Salgado [Tue, 8 Feb 2022 11:54:37 +0000 (11:54 +0000)] 
bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010)

3 years agobpo-46675: Allow object value arrays and split key dictionaries larger than 16 (GH...
Mark Shannon [Tue, 8 Feb 2022 11:50:38 +0000 (11:50 +0000)] 
bpo-46675: Allow object value arrays and split key dictionaries larger than 16 (GH-31191)

3 years agoPrint summary stats for overall success of specialization. (GH-31211)
Mark Shannon [Tue, 8 Feb 2022 11:50:02 +0000 (11:50 +0000)] 
Print summary stats for overall success of specialization. (GH-31211)