126680 Commits
Author SHA1 Message Date
Thomas Wouters 42155a0fea Post 3.13.18 2026-10-25 20:35:10 +01:00
Thomas Wouters 0d4bd512fc Python 3.13.18 v3.13.18 2026-10-25 19:31:23 +01:00
d8f88eca61 [3.13] gh-87720 Fix additional header refolding-quoting edge case (GH-134271) (#160456)
gh-87720 Fix additional header refolding-quoting edge case (GH-134271)

In this case, the higher level syntactic unit fit on the remainder of
the line in un-encoded format, and that higher level unit was
not a ptext or vtext, so the encoding check failed.  To fix this, we
look inside the current unit to see if has anything that was
originally encoded.
(cherry picked from commit 5a22a62b96)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Co-authored-by: T. Wouters <thomas@python.org>
2026-10-25 07:40:24 -07:00
04d8fca7da [3.13] gh-160097: Reject links replacing the destination in tarfile.tar_filter (GH-160098) (#160341)
gh-160097: Reject links replacing the destination in `tarfile.tar_filter` (GH-160098)
(cherry picked from commit e7e0b3523a)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: T. Wouters <thomas@python.org>
2026-10-25 13:55:41 +00:00
cb3a838553 [3.13] gh-158876: Update bundled Expat to 2.9.0 (GH-158881) (#160257)
(cherry picked from commit 0071fb5111)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2026-10-25 06:49:20 -07:00
0478b52788 [3.13] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) (#158429)
* gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDirectory` (GH-157580)

(cherry picked from commit 5c20517a4f)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>

* Add root user checks to test.support

This partially backports commit 86b8617747
(GH-146195); making existing tests use the helper is omitted.

* Skip test on Android

* Skip other affected test

---------

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2026-10-25 06:41:11 -07:00
Miss Islington (bot)andGregory P. Smith b4198a80e6 [3.13] gh-160300: Reject cookies with a negative version in http.cookiejar (GH-160301) (#160647)
gh-160300: Reject cookies with a negative version in http.cookiejar (GH-160301)

DefaultCookiePolicy only applied its domain checks to cookies with
version 0 or a positive version.

ANT-2026-TA36I7V7
(cherry picked from commit d59d96853b)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-10-25 06:37:34 -07:00
Ned DeilyandDavi de Jesus de84a64d0d [3.13] gh-160547: Fix outdated details in the macOS build READMEs (#160548) (#160555)
Co-authored-by: Davi de Jesus <davidejesus.log@proton.me>
2026-10-25 06:36:34 -07:00
Miss Islington (bot)andDavi de Jesus 42b2b22269 [3.13] Docs: Fix installer name in the macOS command-line install example (GH-160527) (#160534)
Docs: Fix installer name in the macOS command-line install example (GH-160527)
(cherry picked from commit 5ca490bda6)

Co-authored-by: Davi de Jesus <davidejesus.log@proton.me>
2026-10-25 06:35:07 -07:00
Cary Hawkins 8d4286a3f4 [3.13] gh-159428: Don't read mimetypes.knownfiles by default on Windows (GH-159445) (#159570)
Make knownfiles empty on Windows so that only the registry is used by default. Files passed to init() or assigned to knownfiles explicitly are still read.
(cherry picked from commit 04a29bf8f9)
2026-10-25 06:30:04 -07:00
Stefan AgnerandClaude Opus 5.5 2aa06a7253 [3.13] gh-159015: Fix test_math import on musl (#159016)
The 3.13 backport of gh-152563 compares the return value of
support.linked_to_musl() with a version tuple, but on 3.13 the helper
still returns a bool. On musl this raises TypeError at class definition
time, so test_math and test_cmath fail to import. Restore the previous
skip condition.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 06:28:51 -07:00
Miss Islington (bot)andVictor Stinner d9b6c229f2 [3.13] gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916) (#160201)
gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916)

test_strings() gets gdb.host_charset(), but fails if gdb writes
anything to stderr. For example, it fails if gdb logs the warning:

    "/usr/bin/gdb: warning: Couldn't determine a path for the index
    cache directory."

Even if stdout contains the expected encoding ("UTF-8").

Change test_gdb to only fail if stdout is empty, ignore stderr
otherwise to ignore gdb warnings.
(cherry picked from commit 88d922ad98)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-24 14:03:13 -07:00
Christian Heimes 48d9b2712c [3.13] gh-160040: Add ssl eMudhra distrust entry to whatsnew (#160593)
gh-160040: Add ssl eMudhra distrust entry to whatsnew [3.13]

Signed-off-by: Christian Heimes <christian@python.org>
2026-10-24 12:41:08 -07:00
Gregory P. SmithandChristian Heimes 98f0e4ed34 [3.13] gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) (GH-160042) (#160570)
The ssl module now rejects TLS certificate chains that contain any of a set of
compromised eMudhra intermediate CA keys.  This is an extraordinary measure and
a last line of defense: removing trust is primarily the job of the platform root
store, and the built-in denylist only blocks connections while that update has
not yet reached the OS, a container image, or a bundled trust store in various
Python packages.  Entries are added to the denylist only under a very high
threshold.

The denylist matches on the public key (the SHA-256 digest of the RFC-5280
SubjectPublicKeyInfo), so it also covers the cross-signed certificates that
reuse one of the distrusted keys.

(cherry picked from commit 7dd8b4736a)

Co-authored-by: Christian Heimes <christian@python.org>
2026-10-24 12:28:52 -07:00
Thomas Wouters a737e40512 Post 3.13.17 2026-10-21 17:53:33 +02:00
Thomas Wouters 64e080d381 Python 3.13.17 v3.13.17 2026-10-21 15:48:20 +02:00
Miss Islington (bot)andDamian Shaw d811ad43ce [3.13] gh-159894: Upgrade bundled pip to 26.2.2 (GH-159910) (#159943)
gh-159894: Upgrade bundled pip to 26.2.2 (GH-159910)
(cherry picked from commit 39d7c0ff0d)

Co-authored-by: Damian Shaw <damian.peter.shaw@gmail.com>
2026-10-21 06:45:43 -07:00
Miss Islington (bot)andStan Ulbrych d9d7139627 [3.13] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (GH-159913) (#159924)
[3.14] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (GH-159913)
(cherry picked from commit aa5b0ed2b4)


(cherry picked from commit 44a2c1a5d9)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-20 11:18:11 -07:00
dependabot[bot] 24d048d360 [3.13] build(deps): bump the actions group with 2 updates (#159103)
build(deps): bump the actions group with 2 updates

Bumps the actions group with 2 updates: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `astral-sh/setup-uv` from 10.1.0 to 10.2.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/bec219d24cd3e171d82865faccec33120bb574f4...c18668ad3cf93ea998bef934396af7bb5c839dc7)

Updates `github/codeql-action/upload-sarif` from 4.38.0 to 4.38.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b96794f015dfd88f77b49b1c93e0fa7110f94c63...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.38.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-10 11:23:47 +00:00
Miss Islington (bot)andPetr Viktorin c35ca4cb6e [3.13] Add os.supports_dir_fd to test.pythoninfo (GH-158605) (#159059)
Add os.supports_dir_fd to test.pythoninfo (GH-158605)

Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
(cherry picked from commit eb77b4b2e4)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-10-09 11:22:34 +00:00
Miss Islington (bot)andVictor Stinner d73971f830 [3.13] gh-146410: Add --pythoninfo option to regrtest (GH-146413) (#159025)
gh-146410: Add --pythoninfo option to regrtest (GH-146413)

* Android now runs tests with --pythoninfo to dump build information.
* Add display_title() function.
(cherry picked from commit b5a27bdcf0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-09 12:59:49 +02:00
Hugo van Kemenade 15e701adde [3.13] gh-158399: Remove unused GitHub files from backport branch (#158578) 2026-10-01 19:55:39 +00:00
Thomas Wouters 855c7403f0 Post 3.13.16 2026-09-30 23:54:55 +02:00
Thomas Wouters cbc944f4bc Python 3.13.16 v3.13.16 2026-09-30 20:57:20 +02:00
f4e43ba525 [3.13] gh-156793: Validate SSLContext.wrap_bio() parameters like wrap_socket() (GH-158503) (#158510)
Co-authored-by: Seth Larson <seth@python.org>
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>
2026-09-30 20:45:43 +03:00
Seth LarsonandGregory P. Smith d8717ed017 [3.13] gh-156293: Use-after-free for server-side SSLContext with sni_… (#158507)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-09-30 18:35:27 +03:00
Stan UlbrychandVictor Stinner 25335f9272 [3.13] Avoid Clang bug in UBSan CI (GH-157958) (#158508)
(cherry picked from commit c57c8772b0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-09-30 15:18:40 +00:00
Miss Islington (bot)andGregory P. Smith 824836b660 [3.13] gh-158446: Reject float format precision near INT_MAX (GH-158474) (#158478)
gh-158446: Reject float format precision near INT_MAX (GH-158474)

Formatting a float or complex with a precision within about 1000 of
INT_MAX could crash or produce incorrect output.
PyOS_double_to_string() now raises ValueError("precision too big") for
such precisions, as the format string parsers already do for
precisions above INT_MAX.

The limit applies regardless of presentation type or value, so a few
calls that previously succeeded (inf, nan, or 'g' with such a
precision) now raise as well.
(cherry picked from commit b7b4f3ecf2)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-09-30 05:47:43 +00:00
Peter BiermaandHimesh Rupchandani 36ebb65e1b [3.13] gh-158364: Don't report other interpreters' threads in sys._current_frames (GH-158369) (GH-158473)
(cherry picked from commit c3cb46870b)

Co-authored-by: Himesh Rupchandani <rupchandanihimesh69@gmail.com>
2026-09-30 02:54:58 +00:00
Miss Islington (bot)andZachary Ware 1c43d8ec63 [3.13] gh-158010: Update macOS installer to use OpenSSL 3.5.9 (GH-158462)
(cherry picked from commit 540274c649)

Co-authored-by: Zachary Ware <zach@python.org>
2026-09-30 00:08:58 +00:00
Zachary Ware 967e136a7e [3.13] gh-158010: Update Android build script to use OpenSSL 3.5.9 (GH-158458)
(cherry picked from commit 596d92387a)
2026-09-29 23:16:09 +00:00
Arnesh 4192eadc82 [3.13] gh-154711: Strip comments after escaped quotes in f-string debug text (#158310)
When a replacement field ended with a string that had an escaped quote and
was followed by a comment, the comment leaked into the debug f-string output.

The comment detection loop in set_fstring_expr skips escaped characters, but
the comment stripping loop did not. So an escaped quote left the scanner
thinking it was still inside a string, and the comment was never removed.

This makes the stripping loop skip escaped characters the same way the
detection loop does. 3.14 and later already have this fix from gh-154719.
2026-09-29 23:45:21 +01:00
Miss Islington (bot)andRishi Raj 036d2d648c [3.13] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) (#158299)
_Py_hashtable_set() returns -1 on failure, so the "< -1" check could never be true and the Py_FatalError() call was unreachable.
(cherry picked from commit a4eb936727)

Co-authored-by: Rishi Raj <180109771+rishiraj38@users.noreply.github.com>
2026-09-29 22:02:38 +00:00
Bénédikt Tran 33a65116df [3.13] gh-155835: fix digest_size and block_size data races on SHA-3 objects (GH-155838) (#157041)
* [3.13] gh-155835: fix `digest_size` and `block_size` data races on SHA-3 objects (GH-155838)
(cherry picked from commit 90ac5398e4)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-09-29 21:57:07 +00:00
Serhiy Storchaka 20c07473f4 [3.13] gh-75876: Run bigmem tests in a subprocess (GH-155302) (#156014)
A test which really allocates the memory it asks for (that is, run with -M)
now runs in a subprocess, so that the memory it uses and the address space
it fragments are released when it ends.  A dummy run stays in the process.

The separate watchdog process is no longer used.  Unlike in the main branch,
the parent process does not report the memory usage of the subprocess:
get_process_memory_usage() (gh-150114) is not available on this branch.

(cherry picked from commit 66d7c89104)
2026-09-29 23:51:11 +02:00
dcdd406ddb [3.13] gh-156002: Bound zipfile decompression for bzip2/LZMA (GH-156003) (GH-156362) (#156738)
* [3.15] gh-156002: Bound zipfile decompression for bzip2/LZMA/Zstandard (GH-156003) (GH-156362)

Patch by @tonghuaroot.

zipfile.ZipExtFile._read1() bounds the output of each decompress() call
for DEFLATE members by passing a max_length to zlib, but for bzip2, LZMA,
and Zstandard members it called decompress() with no bound. A whole
compressed chunk was therefore expanded into a single allocation before
the data[:self._left] clip ran, so a consumer that deliberately reads in
small chunks to limit memory (for example zf.open(name).read(8192)) was
silently unprotected for non-DEFLATE members. A small, spec-conformant
archive member declaring a large uncompressed size could drive multi-GB
peak memory.

_read1() now passes a per-call bound to the non-DEFLATE decompress()
(mirroring the DEFLATE branch) and drains the decompressor's internal
buffer across calls by checking needs_input before reading more
compressed input. zipfile's LZMADecompressor wrapper forwards max_length
and exposes needs_input so the bound also holds for LZMA members.

(cherry picked from commit f897dbf2f3)
(cherry picked from commit 1b424c0178)

* gh-156002: Keep reading through monkey-patched zipfile decompressors (GH-157180) (GH-157557)
(cherry picked from commit f507e6946a)


Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: tonghuaroot <tonghuaroot@gmail.com>
Co-authored-by: rasmusfaber <rfaber@gmail.com>
2026-09-29 21:49:03 +00:00
Timofei Ivankov fc9b015d94 [3.13] gh-157301: Fix asyncio event loop hanging on a failed eager task start (#157845)
gh-157301: Fix asyncio event loop hanging on a failed eager task start
2026-09-29 23:37:50 +02:00
Miss Islington (bot)andSamartha 5634116591 [3.13] gh-157621: Clear weakrefs for ParamSpec attributes (GH-157622) (#157655)
gh-157621: Clear weakrefs for ParamSpec attributes (GH-157622)
(cherry picked from commit b215552a32)

Co-authored-by: Samartha <samarthat9@gmail.com>
2026-09-29 23:35:56 +02:00
0557ba8914 [3.13] gh-156920, gh-156698: fix ProactorEventLoop datagram transport hangs on close() and after write errors (GH-156921) (#157609)
gh-156920, gh-156698: fix ProactorEventLoop datagram transport hangs on close() and after write errors (GH-156921)
(cherry picked from commit 7f52444d9b)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-09-29 23:35:17 +02:00
Cody Maloney 6959d94c01 [3.13] gh-154175: Fetch _PY_GIL_DROP_REQUEST_BIT under GIL (#157013)
gh-154175: Fetch _PY_GIL_DROP_REQUEST_BIT under GIL

Once the GIL is released the tstate may be freed which shows up as ASAN
and TSAN failures in test_io with daemon threads. Check the bit before
dropping the GIL so the tstate is guaranteed to still be allocated.

Remove the TSAN suppressions which were added for 3.13 as this should
fix this case.
2026-09-29 23:24:31 +02:00
Dongjun ShinandVyron Vasileiadis d5527b6658 [3.13] gh-153970: Fix str() of CalledProcessError when returncode is not an integer (GH-153971) (#155931)
CalledProcessError.__str__() fell through to a branch that formats the
return code with %d, which raises TypeError when returncode is None.
(cherry picked from commit 7c653e2540)

Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
2026-09-29 23:19:48 +02:00
f61d36036c [3.13] gh-82535: Ignore address resolution failure in SysLogHandler constructor (GH-154504) (#155459)
gh-82535: Ignore address resolution failure in SysLogHandler constructor (GH-154504)

The address may be temporarily unresolvable when the handler is created.
It is resolved again when a record is emitted.
(cherry picked from commit c294654287)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-29 23:15:26 +02:00
Zachary Ware 571c51f292 [3.13] gh-158010: Update Windows builds to use OpenSSL 3.5.9 (GH-158438)
(cherry picked from commit 115c297fdc)
2026-09-29 16:56:25 +00:00
Zachary Ware 20ae0f7695 [3.13] gh-158010: Update CI to use latest OpenSSL releases (GH-158412) (#158422) 2026-09-29 19:05:58 +03:00
69368ebc33 [3.13] gh-158102: Add tests for the slice C API (GH-158120) (GH-158293)
Test PySlice_Check(), PySlice_New(), PySlice_GetIndices(), PySlice_Unpack(),
PySlice_AdjustIndices() and PySlice_GetIndicesEx() -- both the macro and the
deprecated function.

Document the length and step precondition of PySlice_AdjustIndices()
(cherry picked from commit 8c056c33aa)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-09-29 15:38:46 +03:00
dependabot[bot] 04327d0401 [3.13] build(deps): bump the actions group with 13 updates (#158392)
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-29 08:54:09 +00:00
Miss Islington (bot)andStan Ulbrych 18ac992aa7 [3.13] gh-157847: Tidy up turtle motion docstrings and docs in turtle module (GH-158330) (#158367)
(cherry picked from commit 6e32490d92)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-09-28 19:43:01 +00:00
9dd852df70 [3.13] gh-158010: Avoid recommending out-of-date OpenSSL in configure doc (GH-158351)
(cherry picked from commit 869a50574f)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-09-28 10:51:58 -05:00
Stan Ulbrych 624a6a8b35 [3.13] gh-158322: Tidy up some docstrings in turtle module (GH-158281) (#158326)
(cherry picked from commit 4e9ea689fe)
2026-09-28 11:19:41 +01:00
Stan UlbrychandHugo van Kemenade 267b64be82 [3.13] gh-157847: Reorganize turtle documentation (GH-157868) (#158321)
(cherry picked from commit 4c3cb33db7)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-09-28 09:54:31 +01:00