Commit graph

54145 commits

Author SHA1 Message Date
Ramin Farajpour Cami
b2894626aa
[3.13] gh-145623: Fix crashes on uninitialized struct.Struct objects (gh-145624) (GH-145631) 2026-03-09 17:41:45 +01:00
Miss Islington (bot)
16dbbe56f0
[3.13] gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589) (#145594)
gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f7fe)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-06 21:34:45 +01:00
Miss Islington (bot)
5db017755b
[3.13] gh-144370: Disallow usage of control characters in status in wsgiref.handlers for security (GH-144371) (#145585)
gh-144370: Disallow usage of control characters in status in wsgiref.handlers for security (GH-144371)

Disallow usage of control characters in status in wsgiref.handlers
to prevent HTTP header injections.
(cherry picked from commit d931725bc8)

Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-06 12:45:34 +00:00
Miss Islington (bot)
1c8fa3968b
[3.13] gh-122941: Fix test_launcher sporadic failures via py.ini isolation (GH-145090)
Adds _PYLAUNCHER_INIDIR as a private variable since the launcher is deprecated and not getting new features.
(cherry picked from commit 6cdbd7bc5d)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-03-06 10:22:19 +00:00
Miss Islington (bot)
cc2c276f22
[3.13] gh-145417: Do not preserve SELinux context when copying venv scripts (GH-145454) (#145550)
gh-145417: Do not preserve SELinux context when copying venv scripts (GH-145454)
(cherry picked from commit dbe0007ab2)

Co-authored-by: Shrey Naithani <shrey.naithani@shelllite.tech>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-05 17:44:29 +00:00
Miss Islington (bot)
8fab30ed11
[3.13] gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems (GH-143318) (GH-145173)
The handle parameter was being ignored in the POSIX implementation
of CDLL._load_library(), causing it to always call _dlopen() even
when a valid handle was provided. This was a regression introduced
in recent refactoring.
(cherry picked from commit 27ded24348)

Co-authored-by: Arjit Singh Grover <143692910+Koolvansh07@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-05 15:34:49 +01:00
Miss Islington (bot)
482d6f8bdb
[3.13] gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507)
(cherry picked from commit a51b1b512d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2026-03-04 20:17:04 +00:00
Miss Islington (bot)
fb83592b56
[3.13] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494) (#145510)
[3.14] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494)

GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740)

(cherry picked from commit 45e9343d7e)
(cherry picked from commit bcc2dd8d30)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2026-03-04 19:47:34 +00:00
Miss Islington (bot)
dbeb29aee3
[3.13] gh-142781: Fix type confusion in zoneinfo weak cache (GH-142925) (GH-145418)
(cherry picked from commit b611db491d)

Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-03 12:47:57 +01:00
Stan Ulbrych
5577bd1298
[3.13] gh-144872: fix heap buffer overflow _PyTokenizer_ensure_utf8 (GH-144807) (#145441)
(cherry picked from commit 3fc945df22)

Co-authored-by: AdamKorcz <44787359+AdamKorcz@users.noreply.github.com>
2026-03-02 23:00:59 +00:00
Sam Gross
702d085783
[3.13] gh-130327: Always traverse managed dictionaries, even when inline values are available (GH-130469) (#145440)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-03-02 20:03:08 +00:00
Sam Gross
d567f451e1
[3.13] gh-130555: Fix use-after-free in dict.clear() with embedded values (gh-145268) (#145430) 2026-03-02 13:59:52 -05:00
Miss Islington (bot)
d305326458
[3.13] gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390) (#145432)
gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390)
(cherry picked from commit 5c3a47b94a)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-02 18:32:29 +00:00
Miss Islington (bot)
a75f0bd476
[3.13] gh-144835: Added missing explanations for some parameters in glob and iglob. (GH-144836) (#145416)
Co-authored-by: Facundo Batista <facundo@taniquetil.com.ar>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-03-02 15:32:13 +02:00
Miss Islington (bot)
0e57600bb7
[3.13] gh-145269: simplify bisect.bisect doc example (GH-145270) (#145368)
gh-145269: simplify bisect.bisect doc example (GH-145270)



---------
(cherry picked from commit fdb4b3527f)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-03-01 00:20:20 +01:00
Kumar Aditya
aa0aa314ad
[3.13] gh-142352: Fix asyncio start_tls() to transfer buffered data from StreamReader (GH-142354) (#145364)
[3.13] gh-142352: Fix `asyncio` `start_tls()` to transfer buffered data from StreamReader (GH-142354)
(cherry picked from commit 0598f4a899)

Co-authored-by: Maksym Kasimov <39828623+kasimov-maxim@users.noreply.github.com>
2026-03-01 00:23:27 +05:30
Stan Ulbrych
1a2b0fb3e5
[3.13] gh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (GH-144788) (#145355) 2026-02-28 13:49:37 +00:00
Pablo Galindo Salgado
2daece9903
[3.13] gh-145234: Normalize decoded CR in string tokenizer (GH-145281) (#145312) 2026-02-28 01:38:36 +00:00
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