Commit graph

131377 commits

Author SHA1 Message Date
Miss Islington (bot)
c417fcabfd
[3.15] gh-149590: Remove faulthandler_traverse (GH-150023) (#150037)
gh-149590: Remove faulthandler_traverse (GH-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.
(cherry picked from commit 56737483c2)

Co-authored-by: Armaan Vakharia <43391096+armaan-v924@users.noreply.github.com>
2026-05-18 23:28:04 +00:00
Miss Islington (bot)
16f8ed5a82
[3.15] gh-95816: Fix TLS version range example in docs (GH-148574) (#150008)
gh-95816: Fix TLS version range example in docs (GH-148574)

docs(ssl): Fix TLS version range example
(cherry picked from commit dbd8985e82)

Co-authored-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
2026-05-18 14:47:19 -07:00
Miss Islington (bot)
84ea87cde0
[3.15] gh-149977: Fix extra output of -m test test_lazy_import (GH-149978) (#150016)
gh-149977: Fix extra output of `-m test test_lazy_import` (GH-149978)
(cherry picked from commit 6d5be4b1d6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-18 19:24:06 +00:00
Miss Islington (bot)
01b07df858
[3.15] gh-149816: Fix a RC in _random.Random.__init__ method (GH-149824) (#149997)
gh-149816: Fix a RC in `_random.Random.__init__` method (GH-149824)
(cherry picked from commit 14af19e6c0)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-18 16:16:55 +00:00
Miss Islington (bot)
34e4005c35
[3.15] gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
(cherry picked from commit bd6bf91fcb)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2026-05-18 13:52:17 +00:00
Miss Islington (bot)
6e83c55e64
[3.15] gh-149953: Fix null pointer dereference order in code_objects.c (GH-149956) (#149976)
gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956)

Move  check before
(cherry picked from commit 0ed497a350)

Co-authored-by: Nezuko Agent <nezukoagent@gmail.com>
2026-05-18 09:00:19 +00:00
Miss Islington (bot)
42ff9b4959
[3.15] gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (GH-149922) (#149943)
gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (GH-149922)
(cherry picked from commit acefff95ea)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-05-17 11:01:15 +00:00
Miss Islington (bot)
bdc44c55a2
[3.15] gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917) (GH-149937)
(cherry picked from commit 1cbe035723)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-17 08:33:11 +00:00
Miss Islington (bot)
ec3aa6ab48
[3.15] gh-149816: Fix a race condition in _PyBytes_FromList with free-threading (GH-149909) (#149911)
gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (GH-149909)
(cherry picked from commit 46afba7b93)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-16 09:06:14 +00:00
Miss Islington (bot)
6136ad6801
[3.15] gh-142349: Add help("lazy") support (GH-149886) (#149889)
gh-142349: Add `help("lazy")` support (GH-149886)
(cherry picked from commit 8be3fb1b50)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-15 16:57:59 +00:00
Miss Islington (bot)
0e2184aca0
[3.15] gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)
(cherry picked from commit 1c5fe21eb2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2026-05-15 14:12:05 +00:00
Miss Islington (bot)
a57855561e
[3.15] gh-138489: Add build-details.json generation to PC/layout (GH-149153)
(cherry picked from commit 4aa296f9c4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2026-05-15 13:19:39 +00:00
Miss Islington (bot)
b3819aeff3
[3.15] gh-149816: Fix race condition in memoryview with free-threading (GH-149858) (#149875)
gh-149816: Fix race condition in `memoryview` with free-threading (GH-149858)
(cherry picked from commit 1fdf033774)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-15 13:07:18 +00:00
Miss Islington (bot)
176d0f51cf
[3.15] gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804) (GH-149870)
Like IBM00858, CP00858, IBM01140, CP01140.
(cherry picked from commit 20438866ae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-15 15:08:15 +03:00
Miss Islington (bot)
cc624f74ba
[3.15] gh-148675: Use a string for ctypes cparam tag (GH-149778) (#149869)
gh-148675: Use a string for ctypes cparam tag (GH-149778)
(cherry picked from commit 3ecca22567)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-15 11:52:55 +00:00
Victor Stinner
8d32ae75d4
[3.15] gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791) (#149865)
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*".

(cherry picked from commit 5465b69255)
2026-05-15 11:36:21 +00:00
Miss Islington (bot)
5dadc64673
[3.15] gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648) (#149792)
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)
(cherry picked from commit eac4fe3b2c)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-05-15 10:50:45 +00:00
Miss Islington (bot)
168a3c85be
[3.15] gh-149763: Improve availablity docs in select.rst (GH-149764) (#149854)
gh-149763: Improve availablity docs in `select.rst` (GH-149764)
(cherry picked from commit 7e98debdf4)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-15 07:24:43 +00:00
Miss Islington (bot)
ed27363ddf
[3.15] gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157) (GH-149846)
gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)
(cherry picked from commit 461b1d9631)

Co-authored-by: Seth Larson <seth@python.org>
2026-05-15 00:38:11 +02:00
Miss Islington (bot)
21909e898e
[3.15] gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149842)
(cherry picked from commit c62c3710dc)

Co-authored-by: Zachary Ware <zach@python.org>
2026-05-14 13:49:29 -05:00
Petr Viktorin
ff6f921ffa
[3.15] gh-149231: Revert extra NEWS entry (GH-149840)
gh-149231: Revert extra NEWS entry

This reverts commit dc7cad2f5d.
2026-05-14 19:16:23 +02:00
Miss Islington (bot)
451f06b02e
[3.15] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149836)
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.
(cherry picked from commit c37529293d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-05-14 19:09:05 +02:00
Miss Islington (bot)
6302a8f17a
[3.15] gh-148821: Add more tests for invalid XML encodings (GH-149820) (GH-149821)
(cherry picked from commit c6f7368157)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-14 10:37:11 +00:00
Miss Islington (bot)
b5d508d40b
[3.15] gh-149698: Update bundled expat to 2.8.1 (GH-149699) (#149812)
(cherry picked from commit f1a47e79fb)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-14 09:52:51 +01:00
Miss Islington (bot)
894ec10b56
[3.15] Fix incorrect sentence in stable.rst (GH-149684) (GH-149814)
(cherry picked from commit 374f9d3f5e)

Co-authored-by: Manoj K M <manojkmdev24@gmail.com>
2026-05-14 01:34:59 +02:00
Miss Islington (bot)
dc7cad2f5d
[3.15] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149677)
(cherry picked from commit bc7c102f34)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-14 01:24:29 +02:00
Barry Warsaw
45fc9acb8c
[3.15] gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.add sitedir() (#149659) (#149799)
* 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

(cherry picked from commit b162307d7f)

* Add myself back to CODEOWNERS
2026-05-13 15:45:39 -07:00
Miss Islington (bot)
b6503057b2
[3.15] gh-140550: Update xxlimited with 3.15 limited API (GH-142827) (GH-149785)
(cherry picked from commit fa81cd976a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-05-14 00:00:29 +02:00
Miss Islington (bot)
63a4007d25
[3.15] gh-149685: Use the _Py prefix for private C macros (GH-149686) (GH-149790)
(cherry picked from commit 125f26358a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-05-13 23:29:08 +02:00
Miss Islington (bot)
fb3500466d
[3.15] gh-128110: Fix rfc2047 whitespace handling in email parser address headers (GH-130749) (#149787)
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)
(cherry picked from commit 7a4c6dfb88)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
2026-05-13 16:26:42 -04:00
Miss Islington (bot)
166c56b311
[3.15] gh-148906: fix performance scaling of descriptors on free-threading (GH-148915) (#149798)
gh-148906: fix performance scaling of descriptors on free-threading (GH-148915)
(cherry picked from commit 94bca40ff0)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-05-13 18:09:33 +00:00
Miss Islington (bot)
bb7a539da2
[3.15] gh-149776: Skip UDP Lite tests if it's not supported (GH-149777) (#149780)
gh-149776: Skip UDP Lite tests if it's not supported (GH-149777)

Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if
it's not supported.
(cherry picked from commit 3cfc249e11)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-13 15:36:27 +00:00
Miss Islington (bot)
b37e91f6cf
[3.15] Run mypy with four worker processes and uv (GH-149726) (#149773)
Run mypy with four worker processes and uv (GH-149726)
(cherry picked from commit 6304eb1f5b)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-05-13 11:33:31 +00:00
Miss Islington (bot)
1a639b8669
[3.15] gh-148821: Add more strict tests for XML encodings (GH-149765) (GH-149770)
Exclude encodings like 'utf-8-sig', 'iso2022-jp' and 'hz' from the list of
supported encodings.
(cherry picked from commit fa2afa64d9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-13 11:10:30 +00:00
Miss Islington (bot)
37f3deb571
[3.15] bpo-45509: Check gzip headers for corrupted fields (GH-29028) (GH-149769)
Check the header checksum it the HCRC field is present.
(cherry picked from commit dd94457893)

Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
2026-05-13 10:54:10 +00:00
Miss Islington (bot)
a5f77a13fd
[3.15] gh-148829: Add PySentinel_CheckExact() (GH-149725) (#149766)
gh-148829: Add PySentinel_CheckExact() (GH-149725)
(cherry picked from commit 94df62542c)

Co-authored-by: scoder <stefan_ml@behnel.de>
2026-05-13 10:39:38 +00:00
Miss Islington (bot)
4e369c1dea
[3.15] gh-149701: Fully silence potential hash -r error (GH-149702) (GH-149757)
(cherry picked from commit cd6096887e)
2026-05-13 10:28:27 +01:00
Miss Islington (bot)
15a597e9ba
[3.15] gh-149642: Fix interaction between exec and lazy_imports=all (GH-149643) (#149749)
gh-149642: Fix interaction between exec and lazy_imports=all (GH-149643)
(cherry picked from commit 4087ff8599)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-05-13 03:36:32 +00:00
Miss Islington (bot)
bc20c2b146
[3.15] gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (GH-149604) (#149750)
gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (GH-149604)
(cherry picked from commit a4e51c8dac)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-05-13 03:08:49 +00:00
Miss Islington (bot)
8b73ce9ab8
[3.15] gh-149718: Aggregate same stack frames in Tachyon in some collectors (GH-149719) (#149747)
gh-149718: Aggregate same stack frames in Tachyon in some collectors (GH-149719)
(cherry picked from commit 76f2285341)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-05-13 01:30:22 +01:00
Miss Islington (bot)
e3fbcc3eac
[3.15] gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579) (#149745)
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.
(cherry picked from commit 45c47d26c2)

Co-authored-by: Jeff Lyon <146767590+secengjeff@users.noreply.github.com>
2026-05-12 21:25:21 +00:00
Miss Islington (bot)
670f982fbd
[3.15] gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843) (GH-149742)
(cherry picked from commit e667d62f11)

Co-authored-by: David Huggins-Daines <dhd@ecolingui.ca>
2026-05-12 20:25:28 +00:00
Miss Islington (bot)
564902ea8a
[3.15] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864) (#149730)
gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-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
(cherry picked from commit da8477b25c)

Co-authored-by: stratakis <cstratak@redhat.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-12 22:10:24 +02:00
Miss Islington (bot)
e2e9cea769
[3.15] GH-149501: Fix compilation warning in _YIELD_VALUE uop (GH-149502) (#149737)
GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (GH-149502)
(cherry picked from commit 1a79fd0ad6)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
2026-05-12 17:58:31 +00:00
deadlovelll
6a66005699
[3.15] gh-149694: Fix missing docstring on asyncio.iscoroutinefunction (#149696) 2026-05-12 22:52:36 +05:30
Miss Islington (bot)
5f9d0d0b86
[3.15] Remove myself from CODEOWNERS (GH-149727) (#149732)
Remove myself from CODEOWNERS (GH-149727)

(cherry picked from commit 058c12528d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2026-05-12 16:09:41 +00:00
Miss Islington (bot)
d3b86111ef
[3.15] gh-149676: Fix hash(frozendict | frozendict) (GH-149675) (#149717)
gh-149676: Fix hash(frozendict | frozendict) (GH-149675)

Fix new_dict_impl() to properly initialize ma_hash on frozendict.
(cherry picked from commit f5fb491341)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-12 15:57:02 +02:00
Miss Islington (bot)
45c431a55d
[3.15] Update mypy to 2.1.0 (GH-149709) (#149711)
Update mypy to 2.1.0 (GH-149709)
(cherry picked from commit b546cc10f5)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-05-12 09:09:52 +00:00
Miss Islington (bot)
9138bf2612
[3.15] gh-148669: Clarify __reduce__() module lookup behavior (GH-148670) (#149703)
gh-148669: Clarify `__reduce__()` module lookup behavior (GH-148670)
(cherry picked from commit 54a5fd4126)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2026-05-12 02:54:10 +00:00
Savannah Ostrowski
a8c420879e
[3.15] gh-149614 - Restore deepcopiability of argparse.ArgumentParser… (#149693)
[3.15] gh-149614 - Restore deepcopiability of argparse.ArgumentParser instances (GH-149617)
(cherry picked from commit fadd9bc14e)

Co-authored-by: David Ellis <ducksual@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-05-11 18:25:40 +00:00