]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 days agogh-149590: Remove faulthandler_traverse (#150023)
Armaan Vakharia [Mon, 18 May 2026 23:00:59 +0000 (16:00 -0700)] 
gh-149590: Remove faulthandler_traverse (#150023)

`faulthandler_traverse` visits Python objects owned by `_PyRuntime`, not
by the module instance. With multi-phase init allowing multiple module
instances, each instance's GC traversal decrements `gc_refs` on the same
runtime-owned objects, driving it negative when two instances are
collected simultaneously.

2 days agogh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011)
nessita [Mon, 18 May 2026 23:00:27 +0000 (20:00 -0300)] 
gh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011)

bpo-42367: Restore os.makedirs() and pathlib.mkdir() ability to apply *mode* recursively via a new parent_mode= keyword argument.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 days agogh-149879: Fix multiprocessing tests on Cygwin (#150031)
Victor Stinner [Mon, 18 May 2026 22:45:35 +0000 (00:45 +0200)] 
gh-149879: Fix multiprocessing tests on Cygwin (#150031)

* Disable AF_UNIX connection family on Cygwin.
* forkserver start method is not available on Cygwin: update tests
  for that.
* test_logging calls multiprocessing.get_all_start_methods().

2 days agogh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related) usage...
Stefanie Molin [Mon, 18 May 2026 22:42:55 +0000 (18:42 -0400)] 
gh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related) usage with class-level access (GH-150013)

Co-authored-by: CHINMAY <89741289+Das-Chinmay@users.noreply.github.com>
2 days agogh-149980: Strip all trailing slashes from GNU long directory names in tarfile (GH...
ankhikarmakar [Mon, 18 May 2026 19:31:15 +0000 (12:31 -0700)] 
gh-149980: Strip all trailing slashes from GNU long directory names in tarfile (GH-150019)

2 days agogh-149977: Fix extra output of `-m test test_lazy_import` (#149978)
sobolevn [Mon, 18 May 2026 18:55:27 +0000 (21:55 +0300)] 
gh-149977: Fix extra output of `-m test test_lazy_import` (#149978)

2 days agogh-140344: ast: Add deprecation warnings (#140345)
Jeff Epler [Mon, 18 May 2026 18:20:49 +0000 (11:20 -0700)] 
gh-140344: ast: Add deprecation warnings (#140345)

These were all deprecated in 3.9 (bace59d8b8) but without
a runtime deprecation warning. Add it now, so that these
items can be removed in 3.21 per PEP 387.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 days agogh-95816: Fix TLS version range example in docs (GH-148574)
Jan Brasna [Mon, 18 May 2026 18:01:56 +0000 (20:01 +0200)] 
gh-95816: Fix TLS version range example in docs (GH-148574)

docs(ssl): Fix TLS version range example

2 days agogh-149816: fix thread safety of deletion of list slice (#149936)
Kumar Aditya [Mon, 18 May 2026 16:38:37 +0000 (22:08 +0530)] 
gh-149816: fix thread safety of deletion of list slice (#149936)

3 days agogh-149816: fix `dict.clear()` race on split-table dict with non-embedded values ...
Kumar Aditya [Mon, 18 May 2026 16:09:45 +0000 (21:39 +0530)] 
gh-149816: fix `dict.clear()` race on split-table dict with non-embedded values (#149914)

3 days agogh-149816: Fix a RC in `_random.Random.__init__` method (#149824)
sobolevn [Mon, 18 May 2026 15:39:54 +0000 (18:39 +0300)] 
gh-149816: Fix a RC in `_random.Random.__init__` method (#149824)

3 days agogh-146531: Skip hanging `wm iconbitmap` test on macOS 26 Intel (#148032)
Hugo van Kemenade [Mon, 18 May 2026 14:57:02 +0000 (17:57 +0300)] 
gh-146531: Skip hanging `wm iconbitmap` test on macOS 26 Intel (#148032)

3 days agogh-149464: Add `os.pidfd_getfd(pidfd, targetfd, flags=0)` function (#149465)
Maurycy Pawłowski-Wieroński [Mon, 18 May 2026 14:29:58 +0000 (16:29 +0200)] 
gh-149464: Add `os.pidfd_getfd(pidfd, targetfd, flags=0)` function (#149465)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 days agogh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
Nathan Goldbaum [Mon, 18 May 2026 13:24:06 +0000 (07:24 -0600)] 
gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)

3 days agogh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)
Nezuko Agent [Mon, 18 May 2026 08:28:28 +0000 (15:28 +0700)] 
gh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)

Move  check before

3 days agogh-144140: Optimize len for frozen dict/set constants in optimizer (#149969)
Lukas Geiger [Mon, 18 May 2026 06:50:42 +0000 (07:50 +0100)] 
gh-144140: Optimize len for frozen dict/set constants in optimizer (#149969)

3 days agogh-138325: steal list items in `INTRINSIC_LIST_TO_TUPLE` opcode (#149960)
Pieter Eendebak [Mon, 18 May 2026 06:37:12 +0000 (08:37 +0200)] 
gh-138325: steal list items in `INTRINSIC_LIST_TO_TUPLE` opcode (#149960)

4 days agogh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922) 149613/head
AN Long [Sun, 17 May 2026 10:09:19 +0000 (19:09 +0900)] 
gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922)

4 days agogh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)
Farhan Saif [Sun, 17 May 2026 09:05:27 +0000 (04:05 -0500)] 
gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
4 days agogh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917)
Serhiy Storchaka [Sun, 17 May 2026 08:06:35 +0000 (11:06 +0300)] 
gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917)

4 days agogh-149857: Clarify multiprocessing Process argument wording (GH-149919)
Mani Salahmand [Sun, 17 May 2026 06:01:50 +0000 (08:01 +0200)] 
gh-149857: Clarify multiprocessing Process argument wording (GH-149919)

Use consistent 'picklable' wording

4 days agogh-67512: Document IMAP4.append() flags argument (#149907)
Savage Mechanic [Sat, 16 May 2026 18:24:41 +0000 (19:24 +0100)] 
gh-67512: Document IMAP4.append() flags argument (#149907)

5 days agogh-149879: Fix test_socket on Cygwin (#149913)
Victor Stinner [Sat, 16 May 2026 10:02:19 +0000 (12:02 +0200)] 
gh-149879: Fix test_socket on Cygwin (#149913)

Disable SCM_RIGHTS, recvmsg(), sendmsg() and sethostname() on Cygwin.

5 days agogh-149879: Fix test_os on Cygwin (#149910)
Victor Stinner [Sat, 16 May 2026 08:50:55 +0000 (10:50 +0200)] 
gh-149879: Fix test_os on Cygwin (#149910)

5 days agogh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (#149909)
sobolevn [Sat, 16 May 2026 08:37:34 +0000 (11:37 +0300)] 
gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (#149909)

5 days agogh-149879: Fix test_resource on Cygwin (#149903)
Victor Stinner [Fri, 15 May 2026 23:09:36 +0000 (01:09 +0200)] 
gh-149879: Fix test_resource on Cygwin (#149903)

Setting RLIMIT_FSIZE or RLIMIT_CPU fails with EINVAL on Cygwin.

5 days agogh-149879: Don't import msvcrt in _pyio on Cygwin (#149899)
Victor Stinner [Fri, 15 May 2026 21:11:09 +0000 (23:11 +0200)] 
gh-149879: Don't import msvcrt in _pyio on Cygwin (#149899)

The msvcrt extension module cannot be built on Cygwin.

5 days agogh-149879: Fix test_tarfile on Cygwin (#149897)
Victor Stinner [Fri, 15 May 2026 20:49:37 +0000 (22:49 +0200)] 
gh-149879: Fix test_tarfile on Cygwin (#149897)

On Cygwin, there is no root user (uid 0).

Fix test_realpath_limit_attack(): the test fails with ELOOP on
Cygwin.

5 days agogh-149879: Fix test_signal on Cygwin (#149896)
Victor Stinner [Fri, 15 May 2026 19:32:10 +0000 (21:32 +0200)] 
gh-149879: Fix test_signal on Cygwin (#149896)

* Check for SIG_BLOCK instead of pthread_sigmask() to decide if
  SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK constants should be
  converted to enums.
* Skip ITIMER_VIRTUAL and ITIMER_PROF tests on Cygwin: setitimer()
  fails with ItimerError(EINVAL).

5 days agogh-149567: Remove deprecated `shutil.ExecError` (#149568)
Stan Ulbrych [Fri, 15 May 2026 17:54:05 +0000 (18:54 +0100)] 
gh-149567: Remove deprecated `shutil.ExecError` (#149568)

5 days agogh-149879: Set thread name max length on Cygwin (#149890)
Victor Stinner [Fri, 15 May 2026 16:57:05 +0000 (18:57 +0200)] 
gh-149879: Set thread name max length on Cygwin (#149890)

This change fix test_threading on Cygwin.

6 days agogh-149879: Fix test_pwd on Cygwin (#149880)
Victor Stinner [Fri, 15 May 2026 16:33:46 +0000 (18:33 +0200)] 
gh-149879: Fix test_pwd on Cygwin (#149880)

On Cygwin, pwd.getpwuid(-1) returns an user ('Unknown+User').

6 days agogh-142349: Add `help("lazy")` support (#149886)
sobolevn [Fri, 15 May 2026 16:30:40 +0000 (19:30 +0300)] 
gh-142349: Add `help("lazy")` support (#149886)

6 days agogh-149879: Fix sys.orig_argv[0] on Cygwin: add ".exe" suffix (#149885)
Victor Stinner [Fri, 15 May 2026 15:55:34 +0000 (17:55 +0200)] 
gh-149879: Fix sys.orig_argv[0] on Cygwin: add ".exe" suffix (#149885)

6 days agogh-149831: Fix ctypes DLL library name on Cygwin (#149832)
Carlo Bramini [Fri, 15 May 2026 14:29:26 +0000 (16:29 +0200)] 
gh-149831: Fix ctypes DLL library name on Cygwin (#149832)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agoCI: Move Homebrew dependencies into Brewfile (#148335)
Hugo van Kemenade [Fri, 15 May 2026 14:03:46 +0000 (17:03 +0300)] 
CI: Move Homebrew dependencies into Brewfile (#148335)

Co-authored-by: Brett Cannon <brett@python.org>
6 days agogh-149833: Change DLL prefix to "cygpython" on Cygwin (#149834)
Carlo Bramini [Fri, 15 May 2026 13:54:08 +0000 (15:54 +0200)] 
gh-149833: Change DLL prefix to "cygpython" on Cygwin (#149834)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agogh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)
Steve Dower [Fri, 15 May 2026 13:43:41 +0000 (14:43 +0100)] 
gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)

6 days agogh-138489: Add build-details.json generation to PC/layout (GH-149153)
Steve Dower [Fri, 15 May 2026 12:51:27 +0000 (13:51 +0100)] 
gh-138489: Add build-details.json generation to PC/layout (GH-149153)

6 days agogh-148200: Update Modules/_hacl/ for Cygwin (#149802)
Victor Stinner [Fri, 15 May 2026 12:42:30 +0000 (14:42 +0200)] 
gh-148200: Update Modules/_hacl/ for Cygwin (#149802)

This pulls an updated version of HACL* that fixes Lib_Memzero0.c on
Cygwin, via an upstream fix.

6 days agogh-149816: Fix race condition in `memoryview` with free-threading (#149858)
sobolevn [Fri, 15 May 2026 12:38:51 +0000 (15:38 +0300)] 
gh-149816: Fix race condition in `memoryview` with free-threading (#149858)

6 days agogh-149801: Add IANA registered names and aliases with leading zeros (GH-149804)
Serhiy Storchaka [Fri, 15 May 2026 11:34:48 +0000 (14:34 +0300)] 
gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804)

Like IBM00858, CP00858, IBM01140, CP01140.

6 days agogh-148675: Use a string for ctypes cparam tag (#149778)
Victor Stinner [Fri, 15 May 2026 11:25:09 +0000 (13:25 +0200)] 
gh-148675: Use a string for ctypes cparam tag (#149778)

6 days agogh-148675: Reuse typecodes for array.array() error message (#149779)
Victor Stinner [Fri, 15 May 2026 11:22:40 +0000 (13:22 +0200)] 
gh-148675: Reuse typecodes for array.array() error message (#149779)

array.array() error message now reuses array.typecodes, instead of
maintaining an hardcoded list of valid type codes.

6 days agogh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)
Victor Stinner [Fri, 15 May 2026 11:04:50 +0000 (13:04 +0200)] 
gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)

Change my_strchr() return type to "const char*" (add "const").

Fix the compiler warning:

Modules/_ctypes/_ctypes_test.c: In function 'my_strchr':
Modules/_ctypes/_ctypes_test.c:451:12: warning: return discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  451 |     return strchr(s, c);
      |            ^~~~~~

When using C23, strchr(text, ch) return type is "const char*" if text
type is "const char*".

6 days agogh-149763: Improve availablity docs in `select.rst` (#149764)
sobolevn [Fri, 15 May 2026 07:16:34 +0000 (10:16 +0300)] 
gh-149763: Improve availablity docs in `select.rst` (#149764)

6 days agogh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)
Seth Larson [Thu, 14 May 2026 21:10:39 +0000 (16:10 -0500)] 
gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)

6 days agogh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149477)
Zachary Ware [Thu, 14 May 2026 17:47:28 +0000 (12:47 -0500)] 
gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149477)

6 days agoLink to existing rules in compound_stmts.rst (GH-149811)
Petr Viktorin [Thu, 14 May 2026 16:47:52 +0000 (18:47 +0200)] 
Link to existing rules in compound_stmts.rst (GH-149811)

In gh-138418, `!` was added to links to rules that don't exist in
the docs, in order to silence broken link warnings.
However, productionlist doesn't parse the `!`, which ends up in
the rendered documentation. (It's possible that gh-127835 broke
the `!` support.)

Replace the names with ones that appear in docs:

- `star_named_expression` in the grammar corresponds to
  `flexible_expression` in the docs
- `star_named_expressions` in the grammar corresponds to
  `flexible_expression_list` in the docs
- `named_expression` in the grammar corresponds to
  `assignment_expression` in the docs

Having two sets of names isn't great of course. Consolidating them
is tracked in (subissues of) gh-127833.

7 days agogh-148821: Add more tests for invalid XML encodings (GH-149820)
Serhiy Storchaka [Thu, 14 May 2026 10:10:28 +0000 (13:10 +0300)] 
gh-148821: Add more tests for invalid XML encodings (GH-149820)

7 days agogh-149698: Update bundled expat to 2.8.1 (GH-149699)
Stan Ulbrych [Wed, 13 May 2026 23:21:03 +0000 (00:21 +0100)] 
gh-149698: Update bundled expat to 2.8.1 (GH-149699)

7 days agogh-148758: Fix dynamic loading file extensions for Cygwin (#148759)
Carlo Bramini [Wed, 13 May 2026 21:50:24 +0000 (23:50 +0200)] 
gh-148758: Fix dynamic loading file extensions for Cygwin (#148759)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 days agogh-148575: Use /dev/fd/ to read the set of file descriptors on Cygwin (#148576)
Carlo Bramini [Wed, 13 May 2026 20:05:27 +0000 (22:05 +0200)] 
gh-148575: Use /dev/fd/ to read the set of file descriptors on Cygwin (#148576)

7 days agogh-148461: Use arc4random_buf() in mimalloc on Cygwin (#148462)
Carlo Bramini [Wed, 13 May 2026 19:09:24 +0000 (21:09 +0200)] 
gh-148461: Use arc4random_buf() in mimalloc on Cygwin (#148462)

See also issue #113141.

7 days agogh-148906: fix performance scaling of descriptors on free-threading (#148915)
Kumar Aditya [Wed, 13 May 2026 17:33:59 +0000 (23:03 +0530)] 
gh-148906: fix performance scaling of descriptors on free-threading (#148915)

7 days agogh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648)
Gregory P. Smith [Wed, 13 May 2026 17:33:43 +0000 (10:33 -0700)] 
gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648)

ftpcp() called parse227() directly and passed the source server's
self-reported PASV IPv4 address to the target server's PORT command,
bypassing the CVE-2021-4189 fix that was applied only to FTP.makepasv().
A malicious source FTP server could use this to redirect the target
server's data connection to an arbitrary host:port (SSRF).

ftpcp() now uses the source server's actual peer address, honoring the
existing trust_server_pasv_ipv4_address opt-out, the same as makepasv().

Thanks to Qi Ding at Aurascape AI for the report. (GHSA-w8c5-q2xf-gf7c)

7 days agogh-149685: Use the _Py prefix for private C macros (GH-149686)
Petr Viktorin [Wed, 13 May 2026 17:14:05 +0000 (19:14 +0200)] 
gh-149685: Use the _Py prefix for private C macros (GH-149686)

7 days agogh-149504: Fix re-entrancy bug when .pth/.start file invokes site.addsitedir() (...
Barry Warsaw [Wed, 13 May 2026 16:45:25 +0000 (09:45 -0700)] 
gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.addsitedir() (#149659)

* Add re-entrant tests for gh-149504
* Add end-to-end integration test coverage

This ensures that future whitebox internal test changes do not regress the
public surface semantics.

* Implement a state class to process .pth and .start files

By using this state class and managing implicit and explicit batching, we make it structurally
impossible to get bitten by re-entrant site startup processing.

Fixes #149504

8 days agogh-140550: Update xxlimited with 3.15 limited API (GH-142827)
Petr Viktorin [Wed, 13 May 2026 16:35:50 +0000 (18:35 +0200)] 
gh-140550: Update xxlimited with 3.15 limited API (GH-142827)

8 days agogh-149776: Skip UDP Lite tests if it's not supported (#149777)
Victor Stinner [Wed, 13 May 2026 14:55:45 +0000 (16:55 +0200)] 
gh-149776: Skip UDP Lite tests if it's not supported (#149777)

Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if
it's not supported.

8 days agoRun mypy with four worker processes and uv (#149726)
Hugo van Kemenade [Wed, 13 May 2026 11:03:33 +0000 (14:03 +0300)] 
Run mypy with four worker processes and uv (#149726)

8 days agogh-148821: Add more strict tests for XML encodings (GH-149765)
Serhiy Storchaka [Wed, 13 May 2026 10:40:47 +0000 (13:40 +0300)] 
gh-148821: Add more strict tests for XML encodings (GH-149765)

Exclude encodings like 'utf-8-sig', 'iso2022-jp' and 'hz' from the list of
supported encodings.

8 days agobpo-45509: Check gzip headers for corrupted fields (GH-29028)
Ruben Vorderman [Wed, 13 May 2026 10:20:33 +0000 (12:20 +0200)] 
bpo-45509: Check gzip headers for corrupted fields (GH-29028)

Check the header checksum it the HCRC field is present.

8 days agogh-148829: Add PySentinel_CheckExact() (#149725)
scoder [Wed, 13 May 2026 10:10:37 +0000 (12:10 +0200)] 
gh-148829: Add PySentinel_CheckExact() (#149725)

8 days agogh-149720: Fix docs for `mimetypes.MimeType.add_type` method (#149731)
sobolevn [Wed, 13 May 2026 08:48:01 +0000 (11:48 +0300)] 
gh-149720: Fix docs for `mimetypes.MimeType.add_type` method (#149731)

gh-149720: Fix docs for `mimetypes.MimeType.add_type` method`

8 days agogh-149701: Fully silence potential `hash -r` error (GH-149702)
John Merkel [Wed, 13 May 2026 07:59:57 +0000 (00:59 -0700)] 
gh-149701: Fully silence potential `hash -r` error (GH-149702)

8 days agogh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return...
Jelle Zijlstra [Wed, 13 May 2026 03:00:01 +0000 (20:00 -0700)] 
gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (#149604)

8 days agogh-149642: Fix interaction between exec and lazy_imports=all (#149643)
Jelle Zijlstra [Wed, 13 May 2026 02:59:09 +0000 (19:59 -0700)] 
gh-149642: Fix interaction between exec and lazy_imports=all (#149643)

8 days agogh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719)
Maurycy Pawłowski-Wieroński [Tue, 12 May 2026 23:46:21 +0000 (01:46 +0200)] 
gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719)

8 days agogh-115119: Removed bundled copy of the libmpdec (GH-133964)
Sergey B Kirpichev [Tue, 12 May 2026 21:34:37 +0000 (00:34 +0300)] 
gh-115119: Removed bundled copy of the libmpdec (GH-133964)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
8 days agogh-134837: Correct and improve base85 documentation for base64 and binascii modules...
David Huggins-Daines [Tue, 12 May 2026 19:46:46 +0000 (15:46 -0400)] 
gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843)

8 days agogh-149600: Remove deprecated `asyncio.iscoroutinefunction` function (#149601)
sobolevn [Tue, 12 May 2026 17:29:46 +0000 (20:29 +0300)] 
gh-149600: Remove deprecated `asyncio.iscoroutinefunction` function (#149601)

8 days agogh-148701: Add missing test coverage for asyncio.graph (#148702)
Shamil [Tue, 12 May 2026 17:27:00 +0000 (20:27 +0300)] 
gh-148701: Add missing test coverage for asyncio.graph (#148702)

8 days agoGH-149501: Fix compilation warning in `_YIELD_VALUE` uop (#149502)
Sergey Miryanov [Tue, 12 May 2026 17:17:35 +0000 (22:17 +0500)] 
GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (#149502)

9 days agogh-149595: Remove the `sys._enablelegacywindowsfsencoding()` function (#149596)
Stan Ulbrych [Tue, 12 May 2026 16:11:34 +0000 (17:11 +0100)] 
gh-149595: Remove the `sys._enablelegacywindowsfsencoding()` function (#149596)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
9 days agoRemove myself from CODEOWNERS (#149727)
Berker Peksag [Tue, 12 May 2026 16:07:15 +0000 (19:07 +0300)] 
Remove myself from CODEOWNERS (#149727)

Thank you!

9 days agogh-139808: Add branch protections for aarch64 in asm_trampoline.S (#130864)
stratakis [Tue, 12 May 2026 15:42:44 +0000 (17:42 +0200)] 
gh-139808: Add branch protections for aarch64 in asm_trampoline.S (#130864)

Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S.

The BTI flag must be applied in assembler sources for this class
of attacks to be mitigated on newer aarch64 processors.

See also:
https://sourceware.org/annobin/annobin.html/Test-branch-protection.html
and
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/enabling-pac-and-bti-on-aarch64

Co-authored-by: Victor Stinner <vstinner@python.org>
9 days agogh-149720: Remove support for undotted `ext` in `mimetypes.MimeType.add_type` (#149721)
sobolevn [Tue, 12 May 2026 13:40:21 +0000 (16:40 +0300)] 
gh-149720: Remove support for undotted `ext` in `mimetypes.MimeType.add_type` (#149721)

9 days agogh-149676: Fix hash(frozendict | frozendict) (#149675)
Thomas Kowalski [Tue, 12 May 2026 10:47:39 +0000 (12:47 +0200)] 
gh-149676: Fix hash(frozendict | frozendict) (#149675)

Fix new_dict_impl() to properly initialize ma_hash on frozendict.

Co-authored-by: Victor Stinner <vstinner@python.org>
9 days agoUpdate mypy to 2.1.0 (#149709)
sobolevn [Tue, 12 May 2026 08:40:51 +0000 (11:40 +0300)] 
Update mypy to 2.1.0 (#149709)

9 days agogh-148669: Clarify `__reduce__()` module lookup behavior (#148670)
Victorien [Tue, 12 May 2026 02:45:51 +0000 (04:45 +0200)] 
gh-148669: Clarify `__reduce__()` module lookup behavior (#148670)

9 days agogh-128110: Fix rfc2047 whitespace handling in email parser address headers (#130749)
Mike Edmunds [Mon, 11 May 2026 22:20:09 +0000 (15:20 -0700)] 
gh-128110: Fix rfc2047 whitespace handling in email parser address headers (#130749)

RFC 2047 Section 6.2 requires that "any 'linear-white-space' that
separates a pair of adjacent 'encoded-word's is ignored." The modern
header value parser correctly implements that for unstructured headers,
but had missed a case in structured headers. This could cause a parsed
address header to include extraneous spaces in a display-name.

Switch to @bitdancer's fix from review feedback. Recharacterize space
between ews as fws after parsing in get_phrase.

RDM: This fix is dependent on the fact that "subsequent" atoms will never have
leading whitespace because that's been consumed already. I don't think
it's worth adding extra code for the possibility of leading whitespace
because the parser won't produce it. It's a bit of parser fragility in the
face of code changes, but I think that's a minor concern given the
parser design (which is that it consumes whitespace greedily)

Co-authored-by: R David Murray <rdmurray@bitdance.com>
10 days agogh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233)
Alper [Mon, 11 May 2026 15:39:55 +0000 (08:39 -0700)] 
gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233)

In free-threaded builds, concurrent calls to PyDict_AddWatcher, PyDict_ClearWatcher, PyDict_Watch, and PyDict_Unwatch can race on the shared callback array and the per-dict watcher tags. This change adds a mutex to serialize watcher registration and removal, atomic operations for tag updates, and atomic acquire/release synchronization for callback dispatch in _PyDict_SendEvent.

10 days agogh-149614 - Restore deepcopiability of argparse.ArgumentParser instances (#149617)
David Ellis [Mon, 11 May 2026 15:28:23 +0000 (16:28 +0100)] 
gh-149614 - Restore deepcopiability of argparse.ArgumentParser instances (#149617)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
10 days agoFix incorrect sentence in stable.rst (GH-149684)
Manoj K M [Mon, 11 May 2026 15:27:16 +0000 (20:57 +0530)] 
Fix incorrect sentence in stable.rst (GH-149684)

10 days agogh-149634: Fix removed docs from `TarFile.tarfile` to `TarInfo.tarfile` (#149680)
sobolevn [Mon, 11 May 2026 15:03:57 +0000 (18:03 +0300)] 
gh-149634: Fix removed docs from `TarFile.tarfile` to `TarInfo.tarfile` (#149680)

10 days agogh-140924: In locale module, add missing names to __all__ (GH-140925)
Guo Ci [Mon, 11 May 2026 14:21:03 +0000 (10:21 -0400)] 
gh-140924: In locale module, add missing names to __all__ (GH-140925)

10 days agogh-144957: Fix lazy imports + module __getattr__ (GH-149624)
Jelle Zijlstra [Mon, 11 May 2026 13:08:12 +0000 (06:08 -0700)] 
gh-144957: Fix lazy imports + module __getattr__ (GH-149624)

10 days agogh-149402: Don't assume single-character type codes (struct/array/ctypes) (#149483)
Sergey B Kirpichev [Mon, 11 May 2026 13:05:50 +0000 (16:05 +0300)] 
gh-149402: Don't assume single-character type codes (struct/array/ctypes) (#149483)

In the struct docs, section "Format Characters" was renamed to "Type
Codes".

Co-authored-by: Victor Stinner <vstinner@python.org>
10 days agogh-149663: fix typo in `unittest` docs (#149670)
Árni Már Jónsson [Mon, 11 May 2026 11:54:09 +0000 (11:54 +0000)] 
gh-149663: fix typo in `unittest` docs (#149670)

`hastattr` -> `hasattr`

10 days agogh-146061: Clarify indent=None in json docs (GH-146095)
Jonathan Dung [Mon, 11 May 2026 11:14:54 +0000 (19:14 +0800)] 
gh-146061: Clarify indent=None in json docs (GH-146095)

10 days agogh-149634: Remove deprecated and unused `tarfile.Tarfile.tarfile` attr (GH-149635)
sobolevn [Mon, 11 May 2026 10:54:49 +0000 (13:54 +0300)] 
gh-149634: Remove deprecated and unused `tarfile.Tarfile.tarfile` attr (GH-149635)

10 days agoFix typos in C API documentation (GH-149588)
pengyu lee [Mon, 11 May 2026 08:28:19 +0000 (16:28 +0800)] 
Fix typos in C API documentation (GH-149588)

10 days agogh-112821: Fix rlcompleter failures on objects with descriptors (#149577)
Michael Droettboom [Mon, 11 May 2026 01:44:59 +0000 (21:44 -0400)] 
gh-112821: Fix rlcompleter failures on objects with descriptors (#149577)

* gh-112821: Fix rlcompleter failures on objects with descriptors

* Confirm no accesses

10 days agogh-75723: Fix double evaluation of .pth and .site files in venvs (#149583)
Barry Warsaw [Mon, 11 May 2026 00:25:39 +0000 (17:25 -0700)] 
gh-75723: Fix double evaluation of .pth and .site files in venvs (#149583)

* Idempotent `.pth` execution in `site.addsitedir`
* potentially fix monkeypatch leak?

* fix blind copy paste of recommendation

* Update 2026-03-31-16-15-15.gh-issue-75723.BZ4Rsn.rst

* fix implicit merge conflict with 24c4aecc1674414d3dc3238625802778c4ad29d2

* Add failing tests for gh-75723

Based on @asottle branch !asottle-gh-75723 but refactored for `main`.
This will need a different backport.

* Repair gh-75723

The original fix is here: https://github.com/python/cpython/pull/147951
but I'm refactoring a bit for `main`.

* Refactor _make_mod() so we can use it to create package modules too

* Add myself to CODEOWNERS for the site module

---------

Co-authored-by: anthony sottile <asottile@umich.edu>
Co-authored-by: Filipe Laíns <lains@riseup.net>
10 days agogh-149598: Remove `strm` argument support from `logging` handlers (#149599)
sobolevn [Mon, 11 May 2026 00:05:56 +0000 (03:05 +0300)] 
gh-149598: Remove `strm` argument support from `logging` handlers (#149599)

gh-149598: Remove *strm* argument support from `logging` handlers

10 days agogh-149083: use sentinel to fix _functools.reduce() signature (#149591)
Sergey B Kirpichev [Sun, 10 May 2026 22:22:16 +0000 (01:22 +0300)] 
gh-149083: use sentinel to fix _functools.reduce() signature (#149591)

10 days agogh-139489: Add is_valid_text to xml.__all__ (#149641)
Jelle Zijlstra [Sun, 10 May 2026 20:43:57 +0000 (13:43 -0700)] 
gh-139489: Add is_valid_text to xml.__all__ (#149641)

10 days agogh-149611: Explain return values for `Path.write_text()` and `Path.write_bytes()...
Omkar Kabde [Sun, 10 May 2026 17:41:37 +0000 (23:11 +0530)] 
gh-149611: Explain return values for `Path.write_text()` and `Path.write_bytes()` (#149629)

specify return explanation

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
10 days agogh-149018: Use `XML_SetHashSalt16Bytes` in `pyexpat`/`_elementtree` when possible...
Stan Ulbrych [Sun, 10 May 2026 17:36:26 +0000 (18:36 +0100)] 
gh-149018: Use `XML_SetHashSalt16Bytes` in `pyexpat`/`_elementtree` when possible (#149023)