]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months agogh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-122183)
Sebastian Rittau [Mon, 21 Apr 2025 21:15:05 +0000 (23:15 +0200)] 
gh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-122183)

* Fix hashlib.file_digest and non-blocking I/O
* Add documentation around this behavior
* Add versionchanged

7 months agogh-132747: Fix `NULL` dereference when calling a method's `__get__` manually (#132772)
Peter Bierma [Mon, 21 Apr 2025 21:09:34 +0000 (17:09 -0400)] 
gh-132747: Fix `NULL` dereference when calling a method's `__get__` manually (#132772)

7 months agogh-132719: Fix AMD64 FreeBSD14/15 3.x failures - `test_rlock_locked_2processes` used...
Duprat [Mon, 21 Apr 2025 20:59:15 +0000 (22:59 +0200)] 
gh-132719: Fix AMD64 FreeBSD14/15 3.x failures - `test_rlock_locked_2processes` used an unknown `Value` (GH-132774)

* Fix creation of resvariable

7 months agogh-132479: Fix crash with multiple comprehensions in annotations (#132778)
Jelle Zijlstra [Mon, 21 Apr 2025 20:49:59 +0000 (13:49 -0700)] 
gh-132479: Fix crash with multiple comprehensions in annotations (#132778)

7 months agoPR 132638 typo fix (#132785)
Stan Ulbrych [Mon, 21 Apr 2025 20:33:19 +0000 (21:33 +0100)] 
PR 132638 typo fix (#132785)

Update remote_debugging.rst

7 months agogh-131591: Add remote debugging attachment protocol documentation (#132638)
ivonastojanovic [Mon, 21 Apr 2025 20:18:24 +0000 (21:18 +0100)] 
gh-131591: Add remote debugging attachment protocol documentation (#132638)

Add a developer-facing document describing the protocol used by
remote_exec(pid, script) to execute Python code in a running process.
This is intended to guide debugger and tool authors in reimplementing
the protocol.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
7 months agogh-131586: Avoid refcount contention in context managers (gh-131851)
Sam Gross [Mon, 21 Apr 2025 19:54:25 +0000 (15:54 -0400)] 
gh-131586: Avoid refcount contention in context managers (gh-131851)

This avoid reference count contention in the free threading build
when calling special methods like `__enter__` and `__exit__`.

7 months agogh-127604: Add C stack dumps to `faulthandler` (#128159)
Peter Bierma [Mon, 21 Apr 2025 19:48:02 +0000 (15:48 -0400)] 
gh-127604: Add C stack dumps to `faulthandler` (#128159)

7 months agogh-132769: Refactor possible read-out-of-bounds in `lexer.c` (#132770)
sobolevn [Mon, 21 Apr 2025 17:48:48 +0000 (20:48 +0300)] 
gh-132769: Refactor possible read-out-of-bounds in `lexer.c` (#132770)

7 months agogh-127945: add `test_ctypes` to free-threading TSAN CI (#132727)
Kumar Aditya [Mon, 21 Apr 2025 17:26:56 +0000 (22:56 +0530)] 
gh-127945: add `test_ctypes` to free-threading TSAN CI (#132727)

7 months agoGH-130415: Improve the JIT's unneeded uop removal pass (GH-132333)
Brandt Bucher [Mon, 21 Apr 2025 16:58:55 +0000 (09:58 -0700)] 
GH-130415: Improve the JIT's unneeded uop removal pass (GH-132333)

7 months agogh-132777: Fix Error Message for Duplicates in generate_global_scripts.py (gh-132780)
Eric Snow [Mon, 21 Apr 2025 16:58:10 +0000 (10:58 -0600)] 
gh-132777: Fix Error Message for Duplicates in generate_global_scripts.py (gh-132780)

The fstring would actually raise a KeyError, which we fix. We also adjust the text to be correct.

7 months agogh-132639: Adds PyLong_AsNativeBytes, PyLong_FromNativeBytes and PyLong_FromUnsignedN...
Steve Dower [Mon, 21 Apr 2025 14:59:03 +0000 (15:59 +0100)] 
gh-132639: Adds PyLong_AsNativeBytes, PyLong_FromNativeBytes and PyLong_FromUnsignedNativeBytes to the limited API (GH-132640)

7 months agoannotations: Add tests to check that async comprehensions produce errors (#132513)
Jelle Zijlstra [Mon, 21 Apr 2025 14:06:33 +0000 (07:06 -0700)] 
annotations: Add tests to check that async comprehensions produce errors (#132513)

This already works correctly but I forgot to test for it.

7 months agogh-132054: Add ``application/yaml`` to ``mimetypes`` (#132056)
Саша Черных [Mon, 21 Apr 2025 09:05:37 +0000 (12:05 +0300)] 
gh-132054: Add ``application/yaml`` to ``mimetypes`` (#132056)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-85583: Add an overview of formatted string literals (f-strings) to ``str`` (#132689)
Adam Turner [Mon, 21 Apr 2025 07:49:06 +0000 (08:49 +0100)] 
gh-85583: Add an overview of formatted string literals (f-strings) to ``str`` (#132689)

7 months agogh-132742: Add more tests for fcntl.ioctl() (GH-132756)
Serhiy Storchaka [Mon, 21 Apr 2025 06:26:06 +0000 (09:26 +0300)] 
gh-132742: Add more tests for fcntl.ioctl() (GH-132756)

Test with different types of argument: integer, mutable and immutable
buffers, immutable buffer with mutable_flag set to false.

7 months agogh-132753: Argument Clinic: Fix support of c_default for the bool converter (GH-132754)
Serhiy Storchaka [Sun, 20 Apr 2025 23:21:29 +0000 (02:21 +0300)] 
gh-132753: Argument Clinic: Fix support of c_default for the bool converter (GH-132754)

7 months agoInternalDocs: Fix outdated struct references in frames.md (#132613)
Alper [Sun, 20 Apr 2025 22:24:21 +0000 (15:24 -0700)] 
InternalDocs: Fix outdated struct references in frames.md (#132613)

Docs: Fix outdated struct references in frames.md

Co-authored-by: alperyoney <alperyoney@fb.com>
7 months agogh-131298: eliminate HACL* static libraries for cryptographic modules (GH-132438)
Bénédikt Tran [Sun, 20 Apr 2025 17:40:17 +0000 (19:40 +0200)] 
gh-131298: eliminate HACL* static libraries for cryptographic modules (GH-132438)

* simplify HACL* build for MD5, SHA1, SHA2 and SHA3 modules

* remove statically linked libraries for HACL* implementation

* is it better now?

* is it better now?

* fixup

* Present HACL* as a static or shared library.

On WASI, extension modules based on HACL* require the HACL*
library to be linked statically. On other platforms, it can
be built dynamically.

* amend whitespace

* remove temporary .so file as it requires more symlinks

* avoid smelly symbols

* fixup checksums

* regen sbom

* fixup shell warnings and comments

* it *should* work

7 months agogh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks...
Bénédikt Tran [Sun, 20 Apr 2025 17:24:30 +0000 (19:24 +0200)] 
gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (#130721)

7 months agogh-132390: Apply Ruff linting to `Tools/build` (#132391)
Bénédikt Tran [Sun, 20 Apr 2025 09:21:41 +0000 (11:21 +0200)] 
gh-132390: Apply Ruff linting to `Tools/build` (#132391)

---------

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
7 months agogh-127117: ensure that `_initial_thread` is the last field of `PyInterpreterState...
Bénédikt Tran [Sun, 20 Apr 2025 06:23:00 +0000 (08:23 +0200)] 
gh-127117: ensure that `_initial_thread` is the last field of `PyInterpreterState` when `Py_STACKREF_DEBUG` is defined (#132721)

7 months agogh-129327: revise hashlib documentation to account for FIPS removing sha1 (GH-132729)
Stan Ulbrych [Sun, 20 Apr 2025 01:06:24 +0000 (02:06 +0100)] 
gh-129327: revise hashlib documentation to account for FIPS removing sha1 (GH-132729)

* gh-129327: revise hashlib documentation to account for FIPS removing sha1

More generally, the current documentation is a bit scattered, talking
about what terms are "equal" despite those terms not being very
interesting and given the term "secure hash", probably wrong (because
md5 and sha1 are not secure anymore).

Let's talk about cryptographically secure instead, and note that two of
them aren't. And then we can also link to the source for NIST going
through the removal process for SHA1.

* Add Gregors Suggestion

* Clean up

---------

Co-authored-by: Eli Schwartz <eschwartz@gentoo.org>
7 months agogh-131952: Add colour to the ``json`` module CLI (#132126)
Tomas R. [Sat, 19 Apr 2025 18:11:21 +0000 (20:11 +0200)] 
gh-131952: Add colour to the ``json`` module CLI (#132126)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-130167: Improve the error case for ``textwrap.dedent`` (#132666)
Adam Turner [Sat, 19 Apr 2025 15:18:03 +0000 (16:18 +0100)] 
gh-130167: Improve the error case for ``textwrap.dedent`` (#132666)

7 months agoUpdate entry for Willow Chargin in `.mailmap` and `ACKS` (#132714)
Willow Chargin [Sat, 19 Apr 2025 14:50:59 +0000 (07:50 -0700)] 
Update entry for Willow Chargin in `.mailmap` and `ACKS` (#132714)

7 months agoDocs: Fix REPL example in `Doc/library/shutil.rst` (#132700)
Stan Ulbrych [Sat, 19 Apr 2025 14:15:00 +0000 (15:15 +0100)] 
Docs: Fix REPL example in `Doc/library/shutil.rst` (#132700)

7 months agoExclude `.mailmap` in Codeowners (#132722)
Stan Ulbrych [Sat, 19 Apr 2025 13:34:40 +0000 (14:34 +0100)] 
Exclude `.mailmap` in Codeowners (#132722)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
7 months agogh-127945: add lock held assertions in ctypes arrays (#132720)
Kumar Aditya [Sat, 19 Apr 2025 12:57:10 +0000 (18:27 +0530)] 
gh-127945: add lock held assertions in ctypes arrays  (#132720)

7 months agogh-132308: prevent `TracebackException` swallowing attributes of a falsey `Exception...
Duprat [Sat, 19 Apr 2025 09:49:18 +0000 (11:49 +0200)] 
gh-132308: prevent `TracebackException` swallowing attributes of a falsey `Exception` or `ExceptionGroup` (#132363)

7 months agogh-132399: ensure correct alignment of `PyInterpreterState` (#132428)
Bénédikt Tran [Sat, 19 Apr 2025 09:03:06 +0000 (11:03 +0200)] 
gh-132399: ensure correct alignment of `PyInterpreterState` (#132428)

7 months agogh-128398: improve error messages when incorrectly using `with` and `async with`...
Bénédikt Tran [Sat, 19 Apr 2025 08:44:01 +0000 (10:44 +0200)] 
gh-128398: improve error messages when incorrectly using `with` and `async with` (#132218)

Improve the error message with a suggestion when an object supporting the synchronous
(resp. asynchronous) context manager protocol is entered using `async with` (resp. `with`)
instead of `with` (resp. `async with`).

7 months agoCorrect _PyLong_Frexp() description in comments (GH-132716)
Sergey B Kirpichev [Sat, 19 Apr 2025 07:42:20 +0000 (10:42 +0300)] 
Correct _PyLong_Frexp() description in comments (GH-132716)

This amends d08c788822, now this function always successful.

7 months agospeedup test_pyrepl (#132688)
Chris Eibl [Sat, 19 Apr 2025 01:12:40 +0000 (03:12 +0200)] 
speedup test_pyrepl (#132688)

speedup test_unix_console.py and test_windows_console.py

7 months agogh-131591: Execute the source and not the file to avoid locking it in Windows (#132712)
Pablo Galindo Salgado [Sat, 19 Apr 2025 00:38:12 +0000 (01:38 +0100)] 
gh-131591: Execute the source and not the file to avoid locking it in Windows (#132712)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
7 months agogh-89562: Remove hostflags from PySSLContext (GH-28602)
Rami [Fri, 18 Apr 2025 22:27:32 +0000 (01:27 +0300)] 
gh-89562: Remove hostflags from PySSLContext (GH-28602)

Remove hostflags from PySSLContext as that was only needed for OpenSSL versions prior to 1.1.1

7 months agogh-129719: Restore missing `socket.CAN_RAW_ERR_FILTER` on Linux (#129721)
Jeroen Bogers [Fri, 18 Apr 2025 19:59:37 +0000 (21:59 +0200)] 
gh-129719: Restore missing `socket.CAN_RAW_ERR_FILTER` on Linux (#129721)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
7 months agoMinor doc edit: Make multinomial() the first math example (gh-132697)
Raymond Hettinger [Fri, 18 Apr 2025 17:41:13 +0000 (12:41 -0500)] 
Minor doc edit: Make multinomial() the first math example (gh-132697)

7 months agogh-132396: Resolve 'redefinition of unused name' errors in ``Lib/test/`` (#132397)
Bénédikt Tran [Fri, 18 Apr 2025 17:14:54 +0000 (19:14 +0200)] 
gh-132396: Resolve 'redefinition of unused name' errors in ``Lib/test/`` (#132397)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-126366: fix thread safety of dict key iterator (#132693)
Kumar Aditya [Fri, 18 Apr 2025 16:13:49 +0000 (21:43 +0530)] 
gh-126366: fix thread safety of dict key iterator (#132693)

7 months agogh-132685: fix thread safety of `PyMember_GetOne` with `_Py_T_OBJECT` (#132690)
Kumar Aditya [Fri, 18 Apr 2025 15:33:42 +0000 (21:03 +0530)] 
gh-132685: fix thread safety of `PyMember_GetOne` with `_Py_T_OBJECT` (#132690)

7 months agogh-132657: Avoid locking in frozenset.__contains__ (#132659)
Pieter Eendebak [Fri, 18 Apr 2025 14:50:29 +0000 (16:50 +0200)] 
gh-132657: Avoid locking in frozenset.__contains__ (#132659)

7 months agogh-132673: Fix `ctypes.Structure` with `_align_=0` (#132676)
sobolevn [Fri, 18 Apr 2025 14:32:28 +0000 (17:32 +0300)] 
gh-132673: Fix `ctypes.Structure` with `_align_=0` (#132676)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-131498: Replace single-element arrays with scalars in bytecodes.c (GH-132615)
Brandt Bucher [Fri, 18 Apr 2025 14:16:28 +0000 (07:16 -0700)] 
GH-131498: Replace single-element arrays with scalars in bytecodes.c (GH-132615)

7 months agogh-132678: Add --prioritize to regrtest (GH-132679)
Łukasz Langa [Fri, 18 Apr 2025 13:56:44 +0000 (15:56 +0200)] 
gh-132678: Add --prioritize to regrtest (GH-132679)

This is an option that allows the user to specify, which selected tests should
execute first, even if the order is otherwise randomized.  This is particularly
useful for tests that run the longest.

7 months agogh-130861: Add clarification to the perf docs on optimization levels (#131098)
Pablo Galindo Salgado [Fri, 18 Apr 2025 13:42:20 +0000 (14:42 +0100)] 
gh-130861: Add clarification to the perf docs on optimization levels (#131098)

7 months agogh-127945: skip more tests in ctypes when using parallel threads (#132682)
Kumar Aditya [Fri, 18 Apr 2025 13:12:45 +0000 (18:42 +0530)] 
gh-127945: skip more tests in ctypes when using parallel threads  (#132682)

7 months agogh-129958: Properly disallow newlines in format specs in single-quoted f-strings...
Pablo Galindo Salgado [Fri, 18 Apr 2025 12:30:04 +0000 (13:30 +0100)] 
gh-129958: Properly disallow newlines in format specs in single-quoted f-strings (GH-130063)

7 months agogh-132553: Build the perf tool without buildid cache (GH-132663)
Pablo Galindo Salgado [Fri, 18 Apr 2025 12:26:59 +0000 (13:26 +0100)] 
gh-132553: Build the perf tool without buildid cache (GH-132663)

7 months agogh-132668: Remove outdated description of `POP_JUMP_*` instructions (#132669)
Yuki Kobayashi [Fri, 18 Apr 2025 12:08:50 +0000 (21:08 +0900)] 
gh-132668: Remove outdated description of `POP_JUMP_*` instructions (#132669)

7 months agogh-132674: fix `_hashopenssl.c` compiler warnings on free-threaded build (#132675)
Bénédikt Tran [Fri, 18 Apr 2025 11:52:17 +0000 (13:52 +0200)] 
gh-132674: fix `_hashopenssl.c` compiler warnings on free-threaded build (#132675)

7 months agogh-132097: use a macro for semantically casting function pointers (#132406)
Bénédikt Tran [Fri, 18 Apr 2025 10:24:34 +0000 (12:24 +0200)] 
gh-132097: use a macro for semantically casting function pointers (#132406)

7 months agogh-132643: use atomic load for dict in specializer (#132653)
Kumar Aditya [Fri, 18 Apr 2025 09:36:27 +0000 (15:06 +0530)] 
gh-132643: use atomic load for dict in specializer (#132653)

7 months agoGH-131296: fix clang-cl warning on Windows in `Objects/longobject.c` for 32bit builds...
Chris Eibl [Fri, 18 Apr 2025 08:45:30 +0000 (10:45 +0200)] 
GH-131296: fix clang-cl warning on Windows in `Objects/longobject.c` for 32bit builds (#131604)

7 months agogh-103997: Automatically dedent the argument to "-c" (#103998)
Jon Crall [Fri, 18 Apr 2025 08:39:30 +0000 (04:39 -0400)] 
gh-103997: Automatically dedent the argument to "-c" (#103998)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-132097: allow AC to disable fastcall convention to avoid UBSan failures (#131605)
Bénédikt Tran [Fri, 18 Apr 2025 08:15:40 +0000 (10:15 +0200)] 
gh-132097: allow AC to disable fastcall convention to avoid UBSan failures (#131605)

7 months agoRemove duplicate includes: Python/importdl.c (#132623)
Adam Turner [Fri, 18 Apr 2025 01:49:19 +0000 (02:49 +0100)] 
Remove duplicate includes: Python/importdl.c (#132623)

7 months agogh-131173: Improve exception handling during take_ownership processing (#132620)
Alper [Thu, 17 Apr 2025 20:38:34 +0000 (13:38 -0700)] 
gh-131173: Improve exception handling during take_ownership processing (#132620)

Save and restore exceptions during take_ownership processing to preserve
exceptions currently being raised.

Co-authored-by: alperyoney <alperyoney@fb.com>
7 months agoDocs: Migrate entirely to PSF hosted plausible for analytics (#132648)
Ee Durbin [Thu, 17 Apr 2025 19:42:40 +0000 (15:42 -0400)] 
Docs: Migrate entirely to PSF hosted plausible for analytics (#132648)

7 months agogh-132649: Allow passing --include-tcltk to PC\layout on Windows ARM64 (GH-132650)
Steve Dower [Thu, 17 Apr 2025 19:14:00 +0000 (20:14 +0100)] 
gh-132649: Allow passing --include-tcltk to PC\layout on Windows ARM64 (GH-132650)

7 months agogh-127945: fix critical sections around ctypes array (#132646)
Kumar Aditya [Thu, 17 Apr 2025 18:44:14 +0000 (00:14 +0530)] 
gh-127945: fix critical sections around ctypes array (#132646)

7 months agogh-132284: Don't wrap base PyCFunction slots on class creation if not overridden...
Tomasz Pytel [Thu, 17 Apr 2025 17:08:59 +0000 (13:08 -0400)] 
gh-132284: Don't wrap base PyCFunction slots on class creation if not overridden (#132329)

7 months agogh-132493: Avoid eager import of annotationlib in typing (again) (#132596)
Jelle Zijlstra [Thu, 17 Apr 2025 16:03:53 +0000 (09:03 -0700)] 
gh-132493: Avoid eager import of annotationlib in typing (again) (#132596)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
7 months agogh-132042: Do not lookup tp_dict each time to speedup class creation (#132619)
Sergey Miryanov [Thu, 17 Apr 2025 10:04:42 +0000 (03:04 -0700)] 
gh-132042: Do not lookup tp_dict each time to speedup class creation (#132619)

7 months agogh-132561: Fix the public `multiprocessing.SemLock.locked` method (#132586)
Duprat [Thu, 17 Apr 2025 09:41:30 +0000 (11:41 +0200)] 
gh-132561: Fix the public `multiprocessing.SemLock.locked` method (#132586)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
7 months agogh-101410: Revert loghelper() change in 75f59bb for integer input (GH-132625)
Sergey B Kirpichev [Thu, 17 Apr 2025 07:55:00 +0000 (10:55 +0300)] 
gh-101410: Revert loghelper() change in 75f59bb for integer input (GH-132625)

7 months agogh-130070: Fix `exec(<string>, closure=<non-None>)` unexpected path (#130071)
Bartosz Sławecki [Thu, 17 Apr 2025 07:14:55 +0000 (09:14 +0200)] 
gh-130070: Fix `exec(<string>, closure=<non-None>)` unexpected path (#130071)

Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled)
for `exec` when the `source` argument is a string and the `closure` argument is not `None`.

Co-authored-by: sobolevn <mail@sobolevn.me>
7 months agoRemove duplicate includes: Python/ast_opt.c (#132621)
Adam Turner [Thu, 17 Apr 2025 07:10:01 +0000 (08:10 +0100)] 
Remove duplicate includes: Python/ast_opt.c (#132621)

7 months agogh-118761: Add helper to ensure that lazy imports are actually lazy (#132614)
Jelle Zijlstra [Thu, 17 Apr 2025 03:46:36 +0000 (20:46 -0700)] 
gh-118761: Add helper to ensure that lazy imports are actually lazy (#132614)

This ensures that if we jump through some hoops to make sure something is imported
lazily, we don't regress on importing it.

I recently already accidentally made typing import warnings and annotationlib eagerly.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agoGH-131296: Remove unused variable from overlapped.c (GH-131590)
Chris Eibl [Wed, 16 Apr 2025 21:44:57 +0000 (23:44 +0200)] 
GH-131296: Remove unused variable from overlapped.c (GH-131590)

7 months agogh-128384: Fix for unreliable warnings unit tests. (gh-132611)
Neil Schemenauer [Wed, 16 Apr 2025 20:13:23 +0000 (13:13 -0700)] 
gh-128384: Fix for unreliable warnings unit tests. (gh-132611)

When the `showwarning()` function is replaced, make sure to restore
it after the test finishes.  Add a timeout for `Barrier()` so we
don't hang for a long time if something goes wrong.

7 months agoAdd Doc section in free-threaded extension howto for critical sections (GH-132531)
Neil Schemenauer [Wed, 16 Apr 2025 19:43:01 +0000 (12:43 -0700)] 
Add Doc section in free-threaded extension howto for critical sections (GH-132531)

7 months agogh-132608: Fix a sample code coloring for ast.While (#132609)
Tan90909090 [Wed, 16 Apr 2025 19:23:13 +0000 (04:23 +0900)] 
gh-132608: Fix a sample code coloring for ast.While (#132609)

Add missing '>' in prompt.

7 months agoRemove unused headers from _asynciomodule.c file (#132047)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 16 Apr 2025 18:20:41 +0000 (23:50 +0530)] 
Remove unused headers from _asynciomodule.c file (#132047)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
7 months agoFix some typos in various doc files (GH-132589)
Yongzi Li [Wed, 16 Apr 2025 18:11:47 +0000 (02:11 +0800)] 
Fix some typos in various doc files (GH-132589)

7 months agoClean up pdb state after each pdb doctest (#132577)
Tian Gao [Wed, 16 Apr 2025 17:44:33 +0000 (10:44 -0700)] 
Clean up pdb state after each pdb doctest (#132577)

7 months agotyping docs: Clarify Protocol / runtime_checkable docs (#132606)
Jelle Zijlstra [Wed, 16 Apr 2025 17:44:17 +0000 (10:44 -0700)] 
typing docs: Clarify Protocol / runtime_checkable docs (#132606)

- Explicitly say that isinstance/issubclass do not work on non-runtime checkable
  protocols.
- Move the sentence "This raises TypeError when applied to a non-protocol class". It
  took me quite some time to decide what "this" was here: it refers to applying the
  decorator, not to an isinstance() call.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
7 months agogh-127945: change `_ctypes_test.c` static globals to thread local (#132575)
Kumar Aditya [Wed, 16 Apr 2025 17:41:27 +0000 (23:11 +0530)] 
gh-127945: change `_ctypes_test.c` static globals to thread local (#132575)

7 months agogh-131798: Use `sym_new_type` instead of `sym_new_not_null` for `_BUILD_LIST`, `_BUIL...
Nadeshiko Manju [Wed, 16 Apr 2025 17:17:48 +0000 (01:17 +0800)] 
gh-131798: Use `sym_new_type` instead of `sym_new_not_null` for `_BUILD_LIST`, `_BUILD_SLICE`, and `_BUILD_MAP` (GH-132434)

---------

Signed-off-by: Manjusaka <me@manjusaka.me>
7 months agogh-130104: Call __rpow__ in ternary pow() if necessary (GH-130251)
Serhiy Storchaka [Wed, 16 Apr 2025 15:32:41 +0000 (18:32 +0300)] 
gh-130104: Call __rpow__ in ternary pow() if necessary (GH-130251)

Previously it was only called in binary pow() and the binary
power operator.

7 months agotyping: Add missing test case for Protocol inheritance (#132597)
Jelle Zijlstra [Wed, 16 Apr 2025 15:21:27 +0000 (08:21 -0700)] 
typing: Add missing test case for Protocol inheritance (#132597)

7 months agogh-132493: lazy evaluation of annotations in `typing._proto_hook` (#132534)
Felix Scherz [Wed, 16 Apr 2025 15:20:35 +0000 (17:20 +0200)] 
gh-132493: lazy evaluation of annotations in `typing._proto_hook` (#132534)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
7 months agogh-130052: Fix search_map_for_section() error handling (#132594)
Victor Stinner [Wed, 16 Apr 2025 13:56:58 +0000 (15:56 +0200)] 
gh-130052: Fix search_map_for_section() error handling (#132594)

* Don't call close() if the file descriptor is negative.
* If close() fails, chain the existing exception.

7 months agoannotationlib: Move ForwardRef tests to test_annotationlib (#132571)
Jelle Zijlstra [Wed, 16 Apr 2025 13:40:29 +0000 (06:40 -0700)] 
annotationlib: Move ForwardRef tests to test_annotationlib (#132571)

I started with just moving ForwardRefTests to test_annotationlib,
but found that it contained a number of tests for no_type_check, which
I moved to a new class in test_typing, as well as a number of tests that
are more appropriately classified as tests for get_type_hints().

One test, test_forward_equality_namespace(), was somewhat accidentally
depending on a global class A in test_typing. I added a class A in the
annotationlib tests instead.

Also add a useful comment in annotationlib.

7 months agoUse Windows ARM64 hosted runners (#132546)
Hugo van Kemenade [Wed, 16 Apr 2025 13:27:20 +0000 (16:27 +0300)] 
Use Windows ARM64 hosted runners (#132546)

Co-authored-by: Diego Russo <diego.russo@arm.com>
7 months agoannotationlib: Remove some unnecessary dict copies (#132495)
Jelle Zijlstra [Wed, 16 Apr 2025 13:16:13 +0000 (06:16 -0700)] 
annotationlib: Remove some unnecessary dict copies (#132495)

7 months agogh-130941: Fix `configparser` parsing values with `allow_no_value` and `interpolation...
sobolevn [Wed, 16 Apr 2025 10:39:11 +0000 (13:39 +0300)] 
gh-130941: Fix `configparser` parsing values with `allow_no_value` and `interpolation` set (GH-130949)

7 months agogh-127591: Fix altering environment in test_urllib2 (unsetting no_proxy) (GH-132584)
Serhiy Storchaka [Wed, 16 Apr 2025 10:05:54 +0000 (13:05 +0300)] 
gh-127591: Fix altering environment in test_urllib2 (unsetting no_proxy) (GH-132584)

7 months agogh-132099: Accept an integer as the address for BTPROTO_HCI on Linux (GH-132525)
Serhiy Storchaka [Wed, 16 Apr 2025 10:02:51 +0000 (13:02 +0300)] 
gh-132099: Accept an integer as the address for BTPROTO_HCI on Linux (GH-132525)

Previously only an integer packed in a tuple was accepted, while
getsockname() could return a raw integer.
Now the result of getsockname() is always acceptable as an address.

7 months agogh-132535: Fix resource warnings in test_timeout (GH-132572)
Serhiy Storchaka [Wed, 16 Apr 2025 07:20:07 +0000 (10:20 +0300)] 
gh-132535: Fix resource warnings in test_timeout (GH-132572)

They were emitted if internet connection was not available.

7 months agogh-132070: add `PyObject_Realloc` suppression in free-threading (#132468)
Kumar Aditya [Wed, 16 Apr 2025 00:40:56 +0000 (06:10 +0530)] 
gh-132070: add `PyObject_Realloc` suppression in free-threading (#132468)

7 months agogh-132536: Do not disable PY_THROW event in bdb (#132537)
Tian Gao [Tue, 15 Apr 2025 22:31:52 +0000 (15:31 -0700)] 
gh-132536: Do not disable PY_THROW event in bdb (#132537)

7 months agoDocs: Synchronise ``indexsidebar.html`` with docsbuild-scripts (#132567)
Adam Turner [Tue, 15 Apr 2025 22:27:01 +0000 (23:27 +0100)] 
Docs: Synchronise ``indexsidebar.html`` with docsbuild-scripts (#132567)

7 months agogh-132491: Rename annotationlib.value_to_string to type_repr (#132492)
Jelle Zijlstra [Tue, 15 Apr 2025 20:10:53 +0000 (13:10 -0700)] 
gh-132491: Rename annotationlib.value_to_string to type_repr (#132492)

7 months agogh-129463: Remove two attributes from ForwardRef equality (#132283)
Jelle Zijlstra [Tue, 15 Apr 2025 19:58:21 +0000 (12:58 -0700)] 
gh-129463: Remove two attributes from ForwardRef equality (#132283)

7 months agogh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (#114731)
Bogdan Romanyuk [Tue, 15 Apr 2025 18:41:52 +0000 (18:41 +0000)] 
gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (#114731)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
7 months agoGH-90812: Add test for `urlopen()` of file URI for UNC path (#132489)
Barney Gale [Tue, 15 Apr 2025 18:16:34 +0000 (19:16 +0100)] 
GH-90812: Add test for `urlopen()` of file URI for UNC path (#132489)

7 months agogh-132493: Support deferred annotations in Protocols (#132494)
Jelle Zijlstra [Tue, 15 Apr 2025 17:14:27 +0000 (10:14 -0700)] 
gh-132493: Support deferred annotations in Protocols (#132494)

7 months agoFix argument order in multinomial() example (gh-132557)
Raymond Hettinger [Tue, 15 Apr 2025 16:50:52 +0000 (11:50 -0500)] 
Fix argument order in multinomial() example (gh-132557)