]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
54 min agogh-149879: Fix test_signal on Cygwin (#149896) main
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).

2 hours 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)

3 hours 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.

3 hours 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').

3 hours 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)

4 hours 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)

5 hours 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 hours 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 hours 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 hours 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)

7 hours 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)

7 hours 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.

7 hours 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)

8 hours 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.

9 hours 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)

9 hours 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.

9 hours 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*".

13 hours 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)

23 hours 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)

26 hours 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)

27 hours 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.

34 hours 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)

45 hours 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)

46 hours 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>
2 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)

2 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.

2 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)

2 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)

2 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)

2 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

2 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)

2 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.

2 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)

2 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.

2 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.

2 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)

2 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`

2 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)

2 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)

2 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)

2 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)

2 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>
3 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)

3 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)

3 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)

3 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)

3 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>
3 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!

3 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>
3 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)

3 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>
3 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)

3 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)

3 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>
4 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.

4 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>
4 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)

4 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)

4 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)

4 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)

4 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>
4 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`

4 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)

4 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)

4 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)

4 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

4 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>
4 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

4 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)

4 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)

5 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>
5 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)

5 days agogh-148441: Avoid integer overflow in Expat's CharacterDataHandler (#148904)
ByteFlow [Sun, 10 May 2026 13:42:04 +0000 (21:42 +0800)] 
gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (#148904)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 days agogh-149436: Speed up inspect.getattr_static for the common-metaclass case (#149437)
Pieter Eendebak [Sun, 10 May 2026 02:52:52 +0000 (04:52 +0200)] 
gh-149436: Speed up inspect.getattr_static for the common-metaclass case (#149437)

Consecutive MRO entries usually share their metaclass, so call
_shadowed_dict at most once per distinct metaclass.

5 days agogh-139871: Fix 3.15 bytearray.take_bytes example (#149520)
Cody Maloney [Sat, 9 May 2026 21:39:01 +0000 (14:39 -0700)] 
gh-139871: Fix 3.15 bytearray.take_bytes example (#149520)

Currently:
```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    assert data == b'abc'
           ^^^^^^^^^^^^^^
AssertionError
```

Adding in the `\n` makes the two match:

```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc\n'
assert buffer == bytearray(b'def')

buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = buffer.take_bytes(n + 1)
assert data == b'abc\n'
assert buffer == bytearray(b'def')
```

5 days agoFix minor typos in unicode.rst (#149587)
Manoj K M [Sat, 9 May 2026 21:31:55 +0000 (03:01 +0530)] 
Fix minor typos in unicode.rst (#149587)

6 days agogh-149388: Make asyncio `PipeHandle.close` idempotent (#149518)
Max Schmitt [Sat, 9 May 2026 14:14:29 +0000 (07:14 -0700)] 
gh-149388: Make asyncio `PipeHandle.close` idempotent (#149518)

6 days agogh-149430: Fix edge-cases in `profiling.sampling` outputs (#149431)
László Kiss Kollár [Sat, 9 May 2026 13:05:46 +0000 (14:05 +0100)] 
gh-149430: Fix edge-cases in `profiling.sampling` outputs (#149431)

The line highlights on the heatmap are driven by the URL hash and the
`:target` selector. When clicking a caller/callee link for the line that
was already selected, the hash doesn't change, so the browser keeps the
existing target state and doesn't restart the animation. Due to this the
highlight only works the first time.

With this fix, line navigation goes through JavaScript. If the target
URL already points to the current location, the highlight is replayed by
clearing the animation, forcing style recalculation, and restoring it.

The `baseline_self` variable isn't initialized for structural elided
roots. This variable is accessed later unconditionally and leads to a
crash.

The child process ends up being invoked with `--diff_flamegraph` instead
of the correct argument.

6 days agogh-149530: Remove `symtable.Class.get_methods` deprecated method (#149531)
sobolevn [Sat, 9 May 2026 08:33:09 +0000 (11:33 +0300)] 
gh-149530: Remove `symtable.Class.get_methods` deprecated method (#149531)

6 days agogh-149083: Convert `_initial_missing` for pure py `reduce` to `sentinel` (#149536)
sobolevn [Sat, 9 May 2026 07:55:09 +0000 (10:55 +0300)] 
gh-149083: Convert `_initial_missing` for pure py `reduce` to `sentinel` (#149536)

6 days agogh-149474: use `Py_fopen` in `Binary{Reader,Writer}` for audit hook and path-like...
Maurycy Pawłowski-Wieroński [Sat, 9 May 2026 00:01:35 +0000 (02:01 +0200)] 
gh-149474: use `Py_fopen` in `Binary{Reader,Writer}` for audit hook and path-like support (#149524)

6 days agogh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH...
Jeff Lyon [Fri, 8 May 2026 20:33:05 +0000 (13:33 -0700)] 
gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579)

gh-149496: Fix MacOSTest.test_default failing when BROWSER env var is set

MacOSTest.test_default calls webbrowser.get() and asserts it returns a
MacOS instance. When BROWSER is set in the environment (e.g. BROWSER=open,
a common macOS workaround for the old osascript-based implementation),
register_standard_browsers() registers a GenericBrowser as the preferred
browser instead, causing the assertion to fail.

This is a regression introduced in gh-137586, which added MacOSTest and
moved test_default into it from MacOSXOSAScriptTest. MacOSXOSAScriptTest
had an identical setUp() guard added in gh-131254 specifically to fix this
same failure. The guard was not carried over to MacOSTest.

Add setUp() to MacOSTest to unset BROWSER for the duration of each test,
restoring the isolation that was already established as the correct pattern
for macOS webbrowser tests.

7 days agogh-79638: Test other HTTP error codes besides 403 in test_robotparser (#149569)
Serhiy Storchaka [Fri, 8 May 2026 20:24:34 +0000 (23:24 +0300)] 
gh-79638: Test other HTTP error codes besides 403 in test_robotparser (#149569)

Also, use urllib.request.urlcleanup() in NetworkTestCase.

7 days agogh-149537: Remove kw parameters from python version of `reduce` (#149538)
sobolevn [Fri, 8 May 2026 15:34:48 +0000 (18:34 +0300)] 
gh-149537: Remove kw parameters from python version of `reduce` (#149538)

7 days agoRename fp unwind test module to C stack unwind (#149563)
Diego Russo [Fri, 8 May 2026 13:58:38 +0000 (14:58 +0100)] 
Rename fp unwind test module to C stack unwind (#149563)

7 days agoSkip GNU backtrace test on Arm 32-bit (#149493)
Diego Russo [Fri, 8 May 2026 13:03:05 +0000 (14:03 +0100)] 
Skip GNU backtrace test on Arm 32-bit (#149493)

7 days agogh-149486: tarfile.data_filter: validate written link target (GH-149487)
Petr Viktorin [Fri, 8 May 2026 12:16:06 +0000 (14:16 +0200)] 
gh-149486: tarfile.data_filter: validate written link target (GH-149487)

The data filter rewrote linknames with normpath() but ran the
containment check against the un-normalised value, and computed a
symlink's directory before stripping trailing slashes.  Both let a
crafted archive create links pointing outside the destination.  Also
reject link members that resolve to the destination directory itself,
which could otherwise replace it with a symlink and redirect all
subsequent members.

(Patch by Greg; Petr's just reviewing & merging.)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 days agoAdd Diego as author of PEP 831 (#149551)
Diego Russo [Fri, 8 May 2026 11:58:48 +0000 (12:58 +0100)] 
Add Diego as author of PEP 831 (#149551)

7 days agogh-149459: Fix segfault when `_LOAD_SPECIAL` guard deoptimizes (#149478)
Hai Zhu [Fri, 8 May 2026 11:20:27 +0000 (19:20 +0800)] 
gh-149459: Fix segfault when `_LOAD_SPECIAL` guard deoptimizes (#149478)

7 days agogh-100239: expose `sq_repeat` helpers for `BINARY_OP_EXTEND` (#148791)
Neko Asakura [Fri, 8 May 2026 11:12:20 +0000 (19:12 +0800)] 
gh-100239: expose `sq_repeat` helpers for `BINARY_OP_EXTEND` (#148791)

7 days agogh-145176: Update CODEOWNERS for Emscripten migration to Platforms directory (#149544)
Malcolm Smith [Fri, 8 May 2026 11:08:07 +0000 (12:08 +0100)] 
gh-145176: Update CODEOWNERS for Emscripten migration to Platforms directory (#149544)

7 days agodocs: Clarify docs for error case of `PyDict_GetItemRef` (#149506)
Nathan Goldbaum [Fri, 8 May 2026 10:53:44 +0000 (04:53 -0600)] 
docs: Clarify docs for error case of `PyDict_GetItemRef` (#149506)

7 days agogh-146445: Update CODEOWNERS for Android and iOS migration to Platforms directory...
Malcolm Smith [Fri, 8 May 2026 10:32:36 +0000 (11:32 +0100)] 
gh-146445: Update CODEOWNERS for Android and iOS migration to Platforms directory (#149543)

7 days agogh-149521: Do not update `last_profiled_frame` if it's not changed (#149522)
Maurycy Pawłowski-Wieroński [Fri, 8 May 2026 08:25:49 +0000 (10:25 +0200)] 
gh-149521: Do not update `last_profiled_frame` if it's not changed (#149522)

7 days agogh-149528: Remove `annotationlib.ForwardRef._evaluate` for 3.16 (#149529)
sobolevn [Fri, 8 May 2026 04:48:15 +0000 (07:48 +0300)] 
gh-149528: Remove `annotationlib.ForwardRef._evaluate` for 3.16 (#149529)

7 days agogh-149481: skip `FOR_ITER` inline specialization for Python `__next__` (#149491)
Neko Asakura [Thu, 7 May 2026 23:02:04 +0000 (07:02 +0800)] 
gh-149481: skip `FOR_ITER` inline specialization for Python `__next__` (#149491)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Stan Ulbrych <stan@python.org>
7 days agoImprove error messages when the WASI SDK can't be found (GH-149508)
Brett Cannon [Thu, 7 May 2026 22:20:35 +0000 (15:20 -0700)] 
Improve error messages when the WASI SDK can't be found (GH-149508)

7 days agogh-106693: Revert "Explicitly mark ob_sval as unsigned char to avoid UB (#106826...
Hugo van Kemenade [Thu, 7 May 2026 20:39:08 +0000 (23:39 +0300)] 
gh-106693: Revert "Explicitly mark ob_sval as unsigned char to avoid UB (#106826)" (#149514)

8 days agogh-79638: Treat an unreachable robots.txt as "disallow all" (GH-138555)
Serhiy Storchaka [Thu, 7 May 2026 19:06:57 +0000 (22:06 +0300)] 
gh-79638: Treat an unreachable robots.txt as "disallow all" (GH-138555)

Disallow all access in urllib.robotparser if the robots.txt file is
unreachable due to server or network errors.

8 days agogh-106693: Explicitly mark ob_sval as unsigned char to avoid UB (#106826)
Pablo Galindo Salgado [Thu, 7 May 2026 19:06:53 +0000 (20:06 +0100)] 
gh-106693: Explicitly mark ob_sval as unsigned char to avoid UB (#106826)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>