Commit graph

54127 commits

Author SHA1 Message Date
Miss Islington (bot)
cd3e9b3fd2
[3.13] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145298)
(cherry picked from commit 06b0920f12)

Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
2026-02-27 01:13:08 +01:00
Stan Ulbrych
e418e3351f
[3.13] gh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993) (GH-145190)
(cherry picked from commit 56c4f10d6e)
2026-02-25 00:27:40 +02:00
R. David Murray
a3c0a809e1
[3.13] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145195)
The fix for gh-92081 (gh-92281) was unfortunately flawed, and broke whitespace handling for encoded word patterns that had previously been working correctly but had no corresponding tests, unfortunately in a way that made the resulting headers not RFC compliant, in such a way that Yahoo started rejecting the resulting emails.  This fix was released in 3.14 alpha 1, 3.13 beta 2 and 3.12.5.   This PR fixes the original problem in a way that does not break anything, and in fact fixes a small pre-existing bug (a spurious whitespace after the ':' of the header label if the header value is immediately wrapped on to the next line).  (RDM)
(cherry picked from commit 0f7cd5544a)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-02-24 15:55:54 -05:00
Miss Islington (bot)
6f1e0c4f01
[3.13] gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (GH-137389) (GH-145171)
Since os.stat() raises an OSError for existing named pipe "\\.\pipe\...",
os.path.exists() always returns False for it, and tempfile.mktemp() can
return a name that matches an existing named pipe.

So, tempfile.mktemp() cannot be used to generate unique names for named
pipes. Instead, CreateNamedPipe() should be called in a loop with
different names until it completes successfully.
(cherry picked from commit d6a71f4690)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-24 17:20:53 +00:00
Miss Islington (bot)
f1534307e8
[3.13] Fix inspect.Parameter docstring on the kind attribute (GH-143541) (GH-145175)
(cherry picked from commit 4c95ad8e49)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-02-24 13:18:48 +00:00
Miss Islington (bot)
cb1d20b81d
[3.13] gh-66305: Fix a hang on Windows in the tempfile module (GH-144672) (GH-145169)
It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c40c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-24 11:37:52 +00:00
Miss Islington (bot)
dd355045f6
[3.13] _struct.c: Fix UB from integer overflow in prepare_s (GH-145158) (#145163)
`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)

Avoid possible undefined behaviour from signed overflow in `struct` module

As discovered via oss-fuzz.
(cherry picked from commit fd0400585e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-24 01:16:45 +00:00
Miss Islington (bot)
83ecd18779
[3.13] gh-143916: Allow HTAB in wsgiref header values (GH-144762)
(cherry picked from commit 66da7bf6fe)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-23 14:38:04 +01:00
Bénédikt Tran
0038b58ac9
[3.13] gh-143698: correctly check scheduler and setpgroup values for os.posix_spawn[p] (GH-143699) (#145074)
* [3.13] gh-143698: correctly check `scheduler` and `setpgroup` values for `os.posix_spawn[p]` (GH-143699)

Fix an issue where passing invalid arguments to `os.posix_spawn[p]` functions
raised a SystemError instead of a TypeError, and allow to explicitly use `None`
for `scheduler` and `setpgroup` as specified in the docs.

(cherry picked from commit 347fc438cf)
2026-02-21 16:05:57 +01:00
Stan Ulbrych
773cd81028
[3.13] compute-changes.py: Fix & test process_changed_files() (GH-144674) (#145014)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-02-21 14:24:53 +02:00
Miss Islington (bot)
635d1b7b63
[3.13] Correct MAX_N in Lib/zipfile ZipExtFile (GH-144973) (GH-145023)
"<<" has lower precedence than "-".
(cherry picked from commit 4141f0a1ee)

Co-authored-by: J Berg <j.berg2349@gmail.com>
2026-02-19 23:11:16 +00:00
Serhiy Storchaka
e54507374b
[3.13] gh-140652: Fix a crash in _interpchannels.list_all() after clo…sing a channel (GH-143743) (GH-144953)
(cherry picked from commit 3f50432e31)
2026-02-18 14:18:39 +00:00
Miss Islington (bot)
6579e03813
[3.13] gh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris (GH-144890) (#144902)
gh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris (GH-144890)

Use socket.SCM_RIGHTS operation.
(cherry picked from commit 63531a3867)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-17 10:12:25 +00:00
Peter Bierma
9314ec23a6
[3.13] gh-144601: Avoid sharing exception objects raised in a PyInit function across multiple interpreters (GH-144602) (GH-144880)
(cherry picked from commit fd6b639a49)
2026-02-16 16:05:55 +00:00
Miss Islington (bot)
e701a5cb18
[3.13] gh-144601: Use _testmultiphase instead of _testsinglephase in test_importlib (GH-144769) (GH-144877)
[3.14] gh-144601: Use `_testmultiphase` instead of `_testsinglephase` in `test_importlib` (GH-144769)
(cherry picked from commit d148662326)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-16 10:11:17 -05:00
Miss Islington (bot)
ba0bab40f7
[3.13] gh-80667: Fix lookup for Tangut ideographs in unicodedata (GH-144789) (GH-144871) (GH-144875)
(cherry picked from commit 8b7b5a9946)
(cherry picked from commit bcabbd02f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Pierre Le Marre <dev@wismill.eu>
2026-02-16 15:02:01 +00:00
Pablo Galindo Salgado
0151abcd9f
[3.13] gh-144766: Fix a crash in fork child process when perf support is enabled. (GH-144795) (#144818)
(cherry picked from commit 5922149a50)

Co-authored-by: Yilei <hi@mangoumbrella.com>
2026-02-14 17:52:42 +00:00
Miss Islington (bot)
795f436fc5
[3.13] gh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790) (#144792)
gh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790)

Allow TLS v1.2 to be minimum version

Updates test_min_max_version to allow TLS v1.2 to be minimum version if
TLS 1.0 and 1.1 are disabled in OpenSSL.
(cherry picked from commit d625f7da33)

Co-authored-by: Colin McAllister <colinmca242@gmail.com>
2026-02-13 12:28:14 -08:00
Miss Islington (bot)
309bacdb4a
[3.13] gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (GH-143892) (#144785)
gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (GH-143892)
(cherry picked from commit 82b92e3cd1)

Co-authored-by: Priyanshu Singh <priyanshu2282@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-02-13 15:58:59 +00:00
Serhiy Storchaka
2f354107f3
[3.13] gh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281) (GH-144754)
Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.
(cherry picked from commit e66f4a5a9c)

Co-authored-by: James <snoopjedi@gmail.com>
2026-02-12 17:18:48 +00:00
Serhiy Storchaka
009583fc6f
[3.13] gh-84424: Use numeric_changed for UCD.numeric (GH-19457) (GH-144732)
This was causing ucd_3_2_0.numeric() to pick up only decimal
changes between Unicode 3.2.0 and the current version.
(cherry picked from commit 3e0322ff16)

Co-authored-by: William Meehan <wmeehan@fb.com>
2026-02-12 08:35:09 +00:00
Gregory P. Smith
c117ef1a1c
[3.13] gh-143650: Fix importlib race condition on import failure (GH-143651) (#144697)
gh-143650: Fix importlib race condition on import failure (GH-143651)

Fix a race condition where a thread could receive a partially-initialized
module when another thread's import fails. The race occurs when:

1. Thread 1 starts importing, adds module to sys.modules
2. Thread 2 sees the module in sys.modules via the fast path
3. Thread 1's import fails, removes module from sys.modules
4. Thread 2 returns a stale module reference not in sys.modules

The fix adds verification after the "skip lock" optimization in both Python
and C code paths to check if the module is still in sys.modules. If the
module was removed (due to import failure), we retry the import so the
caller receives the actual exception from the import failure rather than
a stale module reference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

cherry picked from ac8b5b6890
2026-02-11 06:37:25 +00:00
Miss Islington (bot)
36aa0815ca
[3.13] gh-138744: Skip test_dtrace on Windows (GH-144657) (#144668)
[3.14] gh-138744: Skip test_dtrace on Windows (GH-144657)
(cherry picked from commit 8b4210c30e)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Ken Jin <kenjin@python.org>
2026-02-10 14:54:27 +00:00
Miss Islington (bot)
d177460b43
[3.13] gh-143543: Fix re-entrant use-after-free in itertools.groupby (GH-143738) (GH-144627)
(cherry picked from commit a91b5c3fb5)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-10 14:01:23 +01:00
Miss Islington (bot)
ac9bc7c8fc
[3.13] gh-144538: Upgrade bundled pip to 26.0.1 (gh-144556) (#144561)
gh-144538: Upgrade bundled pip to 26.0.1 (gh-144556)

Upgrade bundled pip to 26.0.1
(cherry picked from commit f4364a51c1)

Co-authored-by: Damian Shaw <damian.peter.shaw@gmail.com>
2026-02-07 14:22:54 +02:00
Miss Islington (bot)
b6c6cd6321
[3.13] gh-144330: Initialize classmethod and staticmethod in new (GH-144498) (#144537)
[3.14] gh-144330: Initialize classmethod and staticmethod in new (GH-144498)

gh-144330: Initialize classmethod and staticmethod in new

Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.
(cherry picked from commit 160810de89)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-06 09:48:55 +00:00
Miss Islington (bot)
d5d4d2c36f
[3.13] gh-144148: Update the urllib.parse documentation (GH-144497) (GH-144507) (GH-144509)
(cherry picked from commit 2fb9cde118)

Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9aa9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-05 15:47:52 +00:00
Thomas Wouters
1cbe481834 Python 3.13.12 2026-02-03 18:53:27 +01:00
Miss Islington (bot)
9d76689343
[3.13] gh-75572: Speed up test_xpickle (GH-144393) (GH-144404)
Run a long living subprocess which handles multiple requests instead of
running a new subprocess for each request.
(cherry picked from commit 29acc08c8d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-03 10:40:48 +00:00
Miss Islington (bot)
ebc047f717
[3.13] gh-144415: Android testbed fixes (GH-142912) (#144417)
Modifies handling of `.gz` files in Android app payloads, and ensures that
when the Android testbed streams logs, stream flushes aren't treated as
newlines. This improves the output of test suites that use "one dot per test"
progress indicators.
(cherry picked from commit cb1dc91dcb)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-02-03 09:28:43 +00:00
Guo Ci
b4a84bc555
[3.13] gh-140806: add docs for enum.bin function (#140807) (#143740)
(cherry picked from commit 7f50a5febd)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-02-02 22:57:53 +01:00
Miss Islington (bot)
b74e3a4c05
[3.13] gh-142555: Fix null pointer dereference in array.__setitem__ via re-entrant __index__ (GH-142713) (#144397)
gh-142555: Fix null pointer dereference in array.__setitem__ via re-entrant __index__ (GH-142713)
(cherry picked from commit 39f16a93ef)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-02-02 21:06:59 +01:00
Miss Islington (bot)
bb1247d83c
[3.13] gh-129401: Test repr rlock failing randomly (GH-129959) (#144405)
Fix and simplify a test of `test_repr_rlock` about multiprocessing.RLock primitive.
(cherry picked from commit a98a6bd112)

Co-authored-by: Duprat <yduprat@gmail.com>
2026-02-02 14:11:03 -05:00
Jelle Zijlstra
bc92e7878f
[3.13] gh-144169: Fix three crashes in AST objects with non-str kwargs (GH-144178) (#144260)
(cherry picked from commit 639c1ad4f1)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-27 20:37:35 -08:00
Victor Stinner
3df9e31142
[3.13] gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108) (#144245)
gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108)


(cherry picked from commit 8f459255eb)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-27 12:59:55 +01:00
Miss Islington (bot)
33a488e929
[3.13] gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466) (#144268)
gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466)

The code in test_makefile was attempting to ignore any
non-interesting files, but missed some corners:

1. There is never a *file* called `__pycache__`.
2. A directory containing only a `__pycache__` subdirectory should be
   ignored.
3. A directory containing only hidden files should be ignored.

Simplify this all into a couple of filters that let us check for empty
lists.
(cherry picked from commit 17d447e993)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2026-01-27 10:28:09 +00:00
Petr Viktorin
fdac87ae39
[3.13] gh-127773: Disable attribute cache on incompatible MRO entries (GH-127924) (GH-143729) 2026-01-26 16:31:52 +01:00
Miss Islington (bot)
f738386838
[3.13] gh-143935: Email preserve parens when folding comments (GH-143936) (#144035)
gh-143935: Email preserve parens when folding comments (GH-143936)

Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.
(cherry picked from commit 17d1490aa9)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
2026-01-25 17:09:53 +00:00
Miss Islington (bot)
8ad828750f
[3.13] gh-143237: Fix support of named pipes in the rotating logging handlers (GH-143259) (#143298)
gh-143237: Fix support of named pipes in the rotating logging handlers (GH-143259)

This fixes regression introduced in GH-105887.
(cherry picked from commit aa8a43d179)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-25 17:09:40 +00:00
Miss Islington (bot)
0a925ab591
[3.13] gh-144125: email: verify headers are sound in BytesGenerator (#144181)
gh-144125: email: verify headers are sound in BytesGenerator
(cherry picked from commit 052e55e7d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
Co-authored-by: Denis Ledoux <5822488+beledouxdenis@users.noreply.github.com>
Co-authored-by: Petr Viktorin <302922+encukou@users.noreply.github.com>
Co-authored-by: Bas Bloemsaat <1586868+basbloemsaat@users.noreply.github.com>
2026-01-25 17:09:26 +00:00
Miss Islington (bot)
918387e491
[3.13] gh-143919: Reject control characters in http cookies (#144090)
gh-143919: Reject control characters in http cookies
(cherry picked from commit 95746b3a13)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-25 17:09:22 +00:00
Seth Michael Larson
a35ca3be58
[3.13] gh-143925: Reject control characters in data: URL mediatypes (#144111)
(cherry picked from commit f25509e78e)
2026-01-25 17:06:01 +00:00
Terry Jan Reedy
ed102a8c5a
[3.13] gh-135142: Initial 3.15 News3.txt entries (GH-144200) (#144202)
(cherry picked from commit 29f1e778fa)
2026-01-23 22:16:21 -05:00
Miss Islington (bot)
cbfebb1bc5
[3.13] gh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028) (GH-144193)
It does not support an ASCII string.

Also add more tests.
(cherry picked from commit 25a10b60b0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-23 19:19:22 +00:00
Stan Ulbrych
837b88fd9f
[3.13] gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022) (#144152)
[3.13] gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)

The check was (fd > 0), should be (fd >= 0).
(cherry picked from commit fa44efa0ef)

Co-authored-by: AZero13 <gfunni234@gmail.com>
2026-01-22 15:52:49 +00:00
Miss Islington (bot)
ac9715bf13
[3.13] gh-77188: Add pickle tests for objects with slots (GH-144116) (GH-144120)
(cherry picked from commit cf71e34940)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-22 11:26:48 +00:00
Miss Islington (bot)
015b90dc02
[3.13] gh-143959: Make _datetime optional for test_sys (GH-144003) (#144144)
gh-143959: Make _datetime optional for test_sys (GH-144003)
(cherry picked from commit c447d1bc14)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-01-22 11:15:00 +00:00
Yongtao Huang
a6acb1628f
[3.13] gh-144085: Add {gi,cr}_suspended to inspect comments and generator/coroutine tests (GH-144086) (#144134)
(cherry picked from commit 4ef30a5871)
2026-01-22 12:20:32 +03:00
Bera
740db907a8
[3.13] gh-143866: Verify return value of pathlib.write_{bytes,text} methods in tests (GH-143870) (#144078)
(cherry picked from commit cb6a662bb0)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-20 21:34:43 +03:00
Miss Islington (bot)
77dddece52
[3.13] gh-144050: Fix stat.filemode pure Python file type detection (GH-144059) (GH-144074)
(cherry picked from commit fe629262c0)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-01-20 12:44:46 +00:00