120671 Commits
Author SHA1 Message Date
Thomas Wouters 2c2462afc5 Python 3.12.16 v3.12.16 2026-10-25 19:24:37 +01:00
Miss Islington (bot)andStan Ulbrych f4401da82e [3.12] gh-160097: Reject links replacing the destination in tarfile.tar_filter (GH-160098) (#160342)
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>
2026-10-25 06:44:56 -07:00
Miss Islington (bot)andGregory P. Smith 673da877d9 [3.12] gh-160300: Reject cookies with a negative version in http.cookiejar (GH-160301) (#160648)
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:43:46 -07:00
Stan UlbrychandPetr Viktorin 5cf3260c8c [3.12] gh-158876: Update bundled Expat to 2.9.0 (GH-158881) (#160258)
(cherry picked from commit 0071fb5111)
(cherry picked from commit 25f598d15e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-10-25 06:42:42 -07:00
Cary Hawkins 2f00690fd5 [3.12] gh-159428: Don't read mimetypes.knownfiles by default on Windows (GH-159445) (#159572)
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:42:16 -07:00
c39b52d00b [3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) (GH-158430) (#159074)
* [3.12] gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDirectory` (GH-157580) (GH-158430)

* gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDirectory` (GH-157580)

(cherry picked from commit 5c20517a4f)

* Add root user checks to test.support

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

---------
(cherry picked from commit 58ed0259ca)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>

* gh-134993: Add os.lstat() to os.supports_dir_fd (#135188)

---------

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-25 06:42:02 -07:00
Miss Islington (bot)andR. David Murray a5d1e3318c [3.12] gh-87720 Fix additional header refolding-quoting edge case (GH-134271) (#159066)
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>
2026-10-25 06:38:29 -07:00
284c40b30f [3.12] gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916) (GH-160201) (#160650)
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)
(cherry picked from commit d9b6c229f2)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-25 05:38:29 -07:00
Christian Heimes e4500d8a43 [3.12] gh-160040: Add ssl eMudhra distrust entry to whatsnew (#160592)
gh-160040: Add ssl eMudhra distrust entry to whatsnew [3.12]

Signed-off-by: Christian Heimes <christian@python.org>
2026-10-24 12:44:58 -07:00
Gregory P. SmithandChristian Heimes a17d9ef549 [3.12] gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) (GH-160042) (#160571)
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:30:46 -07:00
Miss Islington (bot)andStan Ulbrych bb130d8a07 [3.12] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (GH-159913) (#159925)
[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:22:31 -07:00
Hugo van Kemenade 58ed60b741 [3.12] gh-158399: Remove unused GitHub files from backport branch (#158579) 2026-10-01 19:49:16 +00:00
Thomas Wouters 2f35c404b3 Post 3.12.15 2026-10-01 00:36:34 +02:00
Thomas Wouters e848e4b09c Python 3.12.15 v3.12.15 2026-10-01 00:04:19 +02:00
869069d52c [3.12] gh-156793: Validate SSLContext.wrap_bio() parameters like wrap_socket() (GH-158503) (#158513)
* [3.12] gh-156793: Validate SSLContext.wrap_bio() parameters like wrap_socket() (GH-158503)
(cherry picked from commit 1697ea386c)

* Raise a DeprecationWarning instead of ValueError

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>
Co-authored-by: T. Wouters <thomas@python.org>
2026-09-30 23:29:07 +02:00
09a2e7e667 [3.12] gh-156002: Bound zipfile decompression for bzip2/LZMA/Zstandard (GH-156003) (GH-156362) (#156739)
* 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-30 22:55:10 +02:00
764fd0af8d [3.12] gh-157265: tarfile: Honor None result of filter for link fallbacks (GH-157266) (#157305)
* gh-157265: tarfile: Honor None result of filter for link fallbacks (GH-157266)

(cherry picked from commit fb2f0bbc3b)

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

* gh-157265: Adjust test for Windows (GH-157334)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-09-30 22:23:33 +02:00
T. Wouters e1f3590f15 [3.12] GH-157579: Revert GH-158489 (prematurely merged) (#158528)
Revert "[3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) (#158489)"

This reverts commit 458e7134a5.
2026-09-30 21:36:13 +02:00
458e7134a5 [3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) (#158489)
* gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDirectory` (GH-157580)
(cherry picked from commit 5c20517a4f)

* Add root user checks to test.support

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

* gh-134993: Add os.lstat() to os.supports_dir_fd (#135188)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-09-30 21:15:08 +02:00
Hugo van KemenadeandRussell Keith-Magee f5b8f7a8de [3.12] gh-148508: Add another common pattern for iOS SSL failures to test_ssl (GH-150442) (#158246)
Match also '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'.
(cherry picked from commit 540b3d0a7f)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-09-30 21:12:45 +02:00
Stan Ulbrych 308b715020 [3.12] gh-157953: Update bundled Expat to 2.8.5 (GH-157957) (#157999)
(cherry picked from commit 5f1f21894f)
2026-09-30 21:07:53 +02:00
Stan UlbrychandRussell Keith-Magee cc1689830c [3.12] gh-157190: Fix tarfile data/tar filter bypass via hard link to a symlink (GH-157191) (GH-157192) (#157454)
* [3.12] gh-157190: Fix tarfile `data`/`tar` filter bypass via hard link to a symlink (GH-157191)  (GH-157192)

(cherry picked from commit 480ea4aab8)
The backport to 3.13 and below includes a NEWS entry.
(cherry picked from commit b8f23e3070)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-09-30 21:07:34 +02:00
Seth LarsonandGregory P. Smith 46133cd57d [3.12] gh-156293: Use-after-free for server-side SSLContext with sni_callback (#158517)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-09-30 19:01:26 +02:00
f30b0d15d4 [3.12] gh-158446: Reject float format precision near INT_MAX (GH-158474) (#158479)
* 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>

* gh-158446: Fix the new test_format test on 3.12

test_format.py does not import import_module on this branch.  Import
INT_MAX from _testcapi directly, as the neighboring test does.

---------

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-09-30 17:00:00 +02:00
dependabot[bot] e41f7ca69c [3.12] build(deps): bump the actions group with 12 updates (#158385)
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-29 11:44:04 +03:00
Hugo van KemenadeandPetr Viktorin da0b9b965d [3.12] gh-157983: Skip test for ctypes.util.find_library when ld is mold (GH-157984) (GH-158065)
(cherry picked from commit 1b42680b3a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-09-24 13:52:29 +02:00
Petr ViktorinSeth Larson seth@python.orgStan Ulbrych 89152624+stanfromireland@users.noreply.github.comPetr Viktorin encukou@gmail.com
c016c2535b [3.12] gh-155292: Don't consider Unicode codepoint attributes outside RFC 3454 (GH-155293) (GH-156020) (#156930)
Due to a bug, some Unicode codepoint attributes were considered
for characters not yet defined in Unicode 3.2.0 or attributes
which changed in later Unicode versions. RFC 3454 (StringPrep)
requires using Unicode 3.2.0 strictly.

(cherry picked from commit 7e109d0)
The cherry-pick needed reworking as GH-144815 wasn't backported to 3.14
and below, so unassigned characters don't have bidi values.
(cherry picked from commit 1e54caa)
Also, add Unicode_3_2_0_FunctionsTest as in the later versions,
to make the new test work.

Co-authored-by: Seth Larson seth@python.org
Co-authored-by: Stan Ulbrych 89152624+stanfromireland@users.noreply.github.com
Co-authored-by: Petr Viktorin encukou@gmail.com
2026-09-08 15:41:59 +02:00
Stan Ulbrych 278c3c2f07 [3.12] gh-156723: Update bundled libexpat to version 2.8.4 (GH-156724) (#156785)
(cherry picked from commit 287b7cffb7)
2026-09-08 15:39:57 +02:00
9ac916cd42 [3.12] gh-156353: Fix configparser space delimiter parsing (GH-156382) (#156560)
gh-156353: Fix configparser space delimiter parsing (GH-156382)
(cherry picked from commit f973bd9d38)

Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
Co-authored-by: sundeep8967 <71071718+sundeep8967@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-09-08 15:29:02 +02:00
Miss Islington (bot)andStan Ulbrych e11441508a [3.12] gh-151365: Revert temporary Git downgrade (GH-156584) (GH-156599) (#156601)
[3.14] gh-151365: Revert temporary Git downgrade (GH-156584) (GH-156599)

Revert "gh-151365: Temporarily downgrade Git to prevent fatal error (GH-155495)"
(cherry picked from commit da06c4cf88)


This reverts commit 6d2b551399.
(cherry picked from commit 3e9efe5509)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-30 08:07:32 +03:00
Miss Islington (bot)andStan Ulbrych a5bfd964c7 [3.12] gh-155999: tarfile: handle a member that leaves the destination but comes back (GH-156000) (#156043)
gh-155999: `tarfile`: handle a member that leaves the destination but comes back (GH-156000)
(cherry picked from commit 97688346ad)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-20 14:36:42 +00:00
Stan Ulbrych ead210ded6 [3.12] Add a timeout to the 'Check if the ABI has changed' job (GH-156051) (#156093)
(cherry picked from commit 93404cebd9)
2026-08-20 16:20:17 +02:00
Miss Islington (bot)andŁukasz 851cf9a714 [3.12] gh-155694: Scope HTTPPasswordMgr credentials by URL scheme (GH-155696) (#155971)
gh-155694: Scope HTTPPasswordMgr credentials by URL scheme (GH-155696)

Credentials stored for an https:// URI were also matched against the
corresponding http:// URI, since `reduce_uri()` discards the scheme.

`HTTPPasswordMgr` and `HTTPPasswordMgrWithPriorAuth` now compare the scheme
too; URIs registered without a scheme still match any scheme.
(cherry picked from commit a7bb524fef)

Co-authored-by: Łukasz <lukaszlapinski7@gmail.com>
2026-08-20 16:19:40 +02:00
Brett Cannon 58c86ab1b4 [3.12] GH-155757: Set --argv0 for wasmtime in configure.ac (#155815)
Set `--argv0` for wasmtime in HOSTRUNNER for configure.ac
2026-08-15 01:55:35 +02:00
Brett Cannon 06ba5f48e0 [3.12] GH-155757: Set --argv0 for wasmtime (#155758) 2026-08-14 13:42:35 +00:00
Thomas Wouters dc9697f0de Post 3.12.14 2026-08-12 20:51:31 +02:00
Thomas Wouters 2abcf904b8 Python 3.12.14 v3.12.14 2026-08-12 15:57:54 +02:00
Miss Islington (bot)andStan Ulbrych c546712e2f [3.12] gh-155558: Update bundled Expat to 2.8.3 (GH-155560) (#155615)
gh-155558: Update bundled Expat to 2.8.3 (GH-155560)
(cherry picked from commit 3d6a50598b)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-12 11:37:22 +00:00
Miss Islington (bot)andStan Ulbrych 01d1f81d5a [3.12] gh-152216: Update bundled expat to 2.8.2 (GH-152234) (GH-154747) (#155552)
[3.13] gh-152216: Update bundled expat to 2.8.2 (GH-152234) (GH-154747)
(cherry picked from commit 31b4886e8f)
(cherry picked from commit c22e9c9dae)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-11 13:55:04 +02:00
Stan Ulbrych e37df2a6a7 [3.12] gh-149018: Use XML_SetHashSalt16Bytes in pyexpat/_elementtree when possible (GH-149023) (#155345)
(cherry picked from commit fc9b11ff49)
(cherry picked from commit 24b8f12544)
2026-08-11 13:54:43 +02:00
Miss Islington (bot)andHugo van Kemenade af5a056899 [3.12] gh-151365: Temporarily downgrade Git to prevent fatal error (GH-155495) (GH-155532) (GH-155533) (GH-155535) (#155537)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-08-11 07:01:41 +00:00
Serhiy StorchakaandMiss Islington 063d4555c9 [3.12] gh-98820: Fix quadratic time in csv.Sniffer for quoted fields (GH-154867) (#155166)
(cherry picked from commit b30c7fa9ed)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
2026-08-04 12:15:52 +02:00
stratakisandVictor Stinner d9d98e0f5e [3.12] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (#130864) (#150198)
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>
2026-08-04 11:46:47 +02:00
Miss Islington (bot)andSerhiy Storchaka 94ea52f634 [3.12] gh-109638: Fix exponential time in csv.Sniffer for doubled quotes (GH-154868) (GH-155113) (#155114)
[3.13] gh-109638: Fix exponential time in csv.Sniffer for doubled quotes (GH-154868) (GH-155113)
(cherry picked from commit eaa9bac703)


(cherry picked from commit d52184ba1e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-08-04 11:30:57 +02:00
96510a3758 [3.12] gh-152674: Avoid quadratic behavior in xml.etree.ElementPath index predicates (GH-152676) (#154815)
gh-152674: Avoid quadratic behavior in xml.etree.ElementPath index predicates (GH-152676)

(cherry picked from commit 2ffab08378)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Alexis <alexis.challande@trailofbits.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-08-04 11:30:44 +02:00
Petr ViktorinandStan Ulbrych d7810660d5 [3.12] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815) (#154143)
[3.13] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815)

(cherry picked from commit bc7c102f34)
(cherry picked from commit 724a5e5e3b)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-04 11:30:11 +02:00
Petr ViktorinandJoshua Swanson 5755830790 [3.12] gh-146333: Fix quadratic regex backtracking in configparser option parsing (GH-146399) (GH-148559) (#154081)
Use negative lookahead in option regex to prevent backtracking, and to avoid changing logic outside the regexes (since people could use the regex directly).
(cherry picked from commit 7e0a0be409)


(cherry picked from commit a5969e8f0f)

Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com>
2026-08-04 11:29:49 +02:00
d1e23e2c4f [3.12] gh-153438: Update NuGet download URL (GH-153482) (GH-153515) (#153608)
[3.13] gh-153438: Update NuGet download URL (GH-153482) (GH-153515)

gh-153438: Update NuGet download URL (GH-153482)
(cherry picked from commit 106eb532ea)
(cherry picked from commit 62eb50d65d)

Co-authored-by: Steve Dower <steve.dower@python.org>
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
2026-08-04 11:29:30 +02:00
Victor Stinner 3ecb27b045 [3.12] gh-149776: Skip UDP Lite tests if it's not supported (#149777) (#153592)
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.

(cherry picked from commit 3cfc249e11)
2026-08-04 11:29:09 +02:00
Hugo van KemenadeandStan Ulbrych 5dfdc5f27c [3.12] RTD Previews: Get correct base branch for backports (GH-150690) (#153165)
(cherry picked from commit 082ac30eaf)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-08-04 11:28:42 +02:00