Commit Graph

125740 Commits

Author SHA1 Message Date
Miss Islington (bot) ba2f30eb83 [3.13] gh-137335: remove a mktemp use in multiprocessing.connection to avoid security scanner noise (GH-148578) (#148584)
gh-137335: remove a mktemp use in multiprocessing.connection to avoid security scanner noise (GH-148578)

remove a mktemp use to avoid security scanner noise
(cherry picked from commit fd81246bd5)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-04-14 17:06:33 -07:00
Miss Islington (bot) cb4b94c74d [3.13] gh-148186: Improve assertCountEqual description in docs. (GH-148463) (#148586)
gh-148186: Improve `assertCountEqual` description in docs. (GH-148463)
(cherry picked from commit 94d42bf5c2)

Co-authored-by: Kliment Lamonov <klimentlamonov@yandex.ru>
2026-04-14 23:45:32 +00:00
Savannah Ostrowski ee34f95dbc [3.13] gh-72406: Document argument ordering in argparse help output (GH-148534) (#148567)
gh-72406: Document argument ordering in argparse help output (#148534)

(cherry picked from commit 4286227308)

Co-authored-by: Santi Hernandez <santi@santihdzs.com>
2026-04-14 17:53:11 +00:00
Miss Islington (bot) 5a4143a392 [3.13] gh-148192: Fix Generator._make_boundary behavior with CRLF line endings. (GH-148193) (#148549)
The Generator._make_boundary regex did not match on boundary phrases correctly when using CRLF line endings due to re.MULTILINE not considering \r\n as a line ending.
(cherry picked from commit 4af46b4ab5)

Co-authored-by: Henry Jones <44321887+henryivesjones@users.noreply.github.com>
2026-04-14 12:21:55 -04:00
Victor Stinner 63c9aa60a6 [3.13] gh-148487: Fix issues in test_add_python_opts (#148507) (#148546)
gh-148487: Fix issues in `test_add_python_opts` (#148507)

(cherry picked from commit 44f1b987ed)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-14 10:08:32 +00:00
Miss Islington (bot) ff88ee4b3a [3.13] gh-148508: Add resilience to SSL preauth tests on iOS (GH-148536) (#148540)
Adds handling for a test case seen in the iOS SSL tests where an SSL connection fails to
handshake correctly.
(cherry picked from commit c40e8b016a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-04-14 11:54:43 +08:00
Miss Islington (bot) a69b14bc01 [3.13] gh-148370: prevent quadratic behavior in configparser.ParsingError.combine (GH-148452) (#148533)
gh-148370: prevent quadratic behavior in `configparser.ParsingError.combine` (GH-148452)
(cherry picked from commit 2662db0c45)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-04-13 23:05:38 +00:00
Miss Islington (bot) d82c491b2e [3.13] gh-146139: Disable socketpair authentication on WASI (GH-146140) (#148527)
gh-146139: Disable `socketpair` authentication on WASI (GH-146140)

Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
(cherry picked from commit a5b76d53bb)

Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
2026-04-13 21:30:52 +00:00
Miss Islington (bot) 26105b03a6 [3.13] InternalDocs: Correct struct path for latin1 singletons in string_interning.md (GH-148358) (#148491)
(cherry picked from commit 0274d8304e)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-13 18:52:47 +00:00
Miss Islington (bot) f35859bca6 [3.13] Fix "encodings" typo in argparse.FileType documentation (GH-148502) (#148514)
Fix "encodings" typo in argparse.FileType documentation (GH-148502)
(cherry picked from commit 8ecb6b8b0c)

Co-authored-by: Gleb Popov <gvpopov.dev@gmail.com>
2026-04-13 11:34:05 -07:00
Miss Islington (bot) c3cf71c336 [3.13] gh-148395: Fix a possible UAF in {LZMA,BZ2,_Zlib}Decompressor (GH-148396) (#148479)
gh-148395: Fix a possible UAF in `{LZMA,BZ2,_Zlib}Decompressor` (GH-148396)

Fix dangling input pointer after `MemoryError` in _lzma/_bz2/_ZlibDecompressor.decompress
(cherry picked from commit 8fc66aef6d)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-13 01:35:24 +00:00
Miss Islington (bot) 74be9e2c76 [3.13] tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345) (#148411)
tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345)

test_interpreters: use errno.EBADF instead of hardcoded number in _close_file()

Replace the hardcoded `9` check in `Lib/test/test_interpreters/utils.py` with `errno.EBADF`.

Using `errno.EBADF` makes the helper portable across platforms with different errno numbering while preserving the intended behavior.
(cherry picked from commit cef334fd4c)

Co-authored-by: Artem Yarulin <artem.yarulin@kapteko.com>
2026-04-12 18:13:53 -07:00
Miss Islington (bot) 9628a797da [3.13] gh-146450: Ensure Android gradle build uses custom cross-build dir (GH-148319) (#148471)
Ensures that the testbed's Gradle configuration uses the cross-build environment
variable, and that variable is passed to Gradle by the cross-build script.
(cherry picked from commit b29afe62f7)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-04-13 09:13:37 +08:00
Miss Islington (bot) a268d3fcef [3.13] gh-146313: Fix multiprocessing ResourceTracker deadlock after os.fork() (GH-146316) (#148426)
gh-146313: Fix multiprocessing ResourceTracker deadlock after os.fork() (GH-146316)

`ResourceTracker.__del__` (added in gh-88887 circa Python 3.12) calls
os.waitpid(pid, 0) which blocks indefinitely if a process created via os.fork()
still holds the tracker pipe's write end. The tracker never sees EOF, never
exits, and the parent hangs at interpreter shutdown.

Fix with two layers:

- **At-fork handler.** An os.register_at_fork(after_in_child=...)
  handler closes the inherited pipe fd in the child unless a preserve
  flag is set. popen_fork.Popen._launch() sets the flag before its
  fork so mp.Process(fork) children keep the fd and reuse the parent's
  tracker (preserving gh-80849). Raw os.fork() children close the fd,
  letting the parent reap promptly.

- **Timeout safety-net.** _stop_locked() gains a wait_timeout
  parameter. When called from `__del__`, it polls with WNOHANG using
  exponential backoff for up to 1 second instead of blocking
  indefinitely. The at-fork handler makes this unreachable in
  well-behaved paths; it remains for abnormal shutdowns.
(cherry picked from commit 3a7df632c9)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-04-12 10:08:36 -07:00
Miss Islington (bot) 4830d291e7 [3.13] gh-147965: Add shutdown() to multiprocessing.Queue excluded methods (GH-147970) (#148417)
gh-147965: Add shutdown() to multiprocessing.Queue excluded methods (GH-147970)

The multiprocessing.Queue documentation states it implements all
methods of queue.Queue except task_done() and join(). Since
queue.Queue.shutdown() was added in Python 3.13,
multiprocessing.Queue also does not implement it. Update the docs
to include shutdown() in the list of excluded methods.
(cherry picked from commit 22290ed011)

Co-authored-by: WYSIATI <chester.lee.cold@gmail.com>
2026-04-12 00:52:32 +00:00
Miss Islington (bot) 2f30fcf674 [3.13] gh-148337: Document importlib.resources security model (GH-148340) (#148355)
gh-148337: Document `importlib.resources` security model (GH-148340)
(cherry picked from commit 70b86e7829)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-11 17:10:53 -07:00
Hugo van Kemenade fdc7f7e742 [3.13] Default GHA permissions to contents: read (GH-148346) (#148387)
(cherry picked from commit 9c9df8ac8c)
2026-04-11 17:06:41 -07:00
Miss Islington (bot) 8e369d3645 [3.13] gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) (#148405)
gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106)

When a custom iterator calls next() on the same csv.reader from
within __next__, the inner iteration sets self->fields to NULL.
The outer iteration then crashes in parse_save_field() by passing
NULL to PyList_Append.

Add a guard after PyIter_Next() to detect that fields was set to
NULL by a re-entrant call, and raise csv.Error instead of crashing.
(cherry picked from commit 20994b1809)

Co-authored-by: Ramin Farajpour Cami <ramin.blackhat@gmail.com>
2026-04-11 22:44:45 +00:00
Hugo van Kemenade a14e4e3a1a [3.13] Fix mixed line endings with pre-commit (GH-148336) (#148339)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2026-04-10 18:36:16 +03:00
Miss Islington (bot) 0530f105ce [3.13] gh-145831: email.quoprimime: decode() leaves stray \r when eol='\r\n' (GH-145832) (#148311)
decoded[:-1] only strips one character, leaving a stray \r when eol
is two characters. Fix: decoded[:-len(eol)].
(cherry picked from commit 1a0edb1fa8)

Co-authored-by: Stefan Zetzsche <120379523+stefanzetzsche@users.noreply.github.com>
2026-04-10 08:51:34 -04:00
Hugo van Kemenade fe08867347 [3.13] gh-148254: Use singular "sec" in timeit verbose output (GH-148290) (#148304)
Co-authored-by: gaweng <38250674+gaweng@users.noreply.github.com>
2026-04-09 15:06:27 +00:00
Miss Islington (bot) 83cca73a0d [3.13] gh-148091: clarify asyncio.Future.cancel(msg) behaviour (GH-148248) (#148300)
gh-148091: clarify asyncio.Future.cancel(msg) behaviour (GH-148248)
(cherry picked from commit 2acb8d9257)

Co-authored-by: Manoj K M <136242596+manoj-k-m@users.noreply.github.com>
2026-04-09 20:22:59 +05:30
Miss Islington (bot) 88b4c2305e [3.13] gh-148067: Fix typo in asyncio event loop docs: 'signals' -> 'signal' (GH-148073) (#148245)
Co-authored-by: TT <70463940+Herrtian@users.noreply.github.com>
2026-04-09 14:07:54 +00:00
Miss Islington (bot) 8337805ad1 [3.13] gh-106318: Add example for str.swapcase() method (GH-144575) (#148297)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-04-09 13:40:28 +00:00
Miss Islington (bot) 0438467b2d [3.13] gh-146646: Document that glob functions suppress OSError (GH-147996) (#148289)
gh-146646: Document that glob functions suppress OSError (GH-147996)
(cherry picked from commit 8000a9de3c)

Co-authored-by: WYSIATI <chester.lee.cold@gmail.com>
2026-04-09 10:51:12 +00:00
Miss Islington (bot) 461ae64628 [3.13] gh-70039: smtplib: store the server name in ._host in .connect() (GH-115259) (#148272)
Original patch by gigaplastik, extended with a few more tests.

Addresses gh-70039 and bpo-25852: failure of starttls if connect is called explicitly.
(cherry picked from commit 442f83a5ea)

Co-authored-by: nmartensen <nis.martensen@web.de>
2026-04-08 18:15:16 -04:00
Miss Islington (bot) 4002c3a461 [3.13] Minor edit: Four space indent in example (gh-148264) (gh-148266) 2026-04-08 17:56:10 +00:00
Thomas Wouters 12683e3ce8 Post 3.13.13 2026-04-07 23:28:57 +02:00
Thomas Wouters 01104ce1be Python 3.13.13 v3.13.13 2026-04-07 20:19:01 +02:00
Hugo van Kemenade 8a0993f500 [3.13] GH-146128: Remove the buggy AArch64 "33rx" relocation (#146263) (#148199)
GH-146128: Remove the buggy AArch64 "33rx" relocation (#146263)

(cherry picked from commit 6bb7b33e8f)

Co-authored-by: Brandt Bucher <brandt@python.org>
Co-authored-by: Ken Jin <kenjin@python.org>
2026-04-07 20:10:33 +02:00
Miss Islington (bot) 9f15d25c52 [3.13] gh-124613: Deactivate perf support in tests if the jit is set (GH-124794) (GH-148214)
gh-124613: Deactivate perf support in tests if the jit is set (GH-124794)

gh-124613: Deactivate the JIT during perf tests

(cherry picked from commit 5e9e50612e)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-04-07 22:51:43 +08:00
Miss Islington (bot) 5af6ce3e7b [3.13] gh-146121: Clarify security model of pkgutil.getdata; revert checks (GH-148197) (#148205)
gh-146121: Clarify security model of pkgutil.getdata; revert checks (GH-148197)

This reverts commit bcdf231946,
and clarifies get_data's security model.

(cherry picked from commit cf59bf7647)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-07 12:26:51 +02:00
Miss Islington (bot) 7fc8507f3d [3.13] gh-146613: Fix re-entrant use-after-free in itertools._grouper (GH-147962) (#148011)
gh-146613: Fix re-entrant use-after-free in `itertools._grouper` (GH-147962)
(cherry picked from commit fc7a188fe7)

Co-authored-by: Ma Yukun <68433685+TheSkyC@users.noreply.github.com>
2026-04-07 12:24:54 +02:00
Ramin Farajpour Cami 4c8d6f4f68 [3.13] gh-144984: Fix crash in Expat's ExternalEntityParserCreate error paths (GH-144992) (#146142)
* gh-144984: Fix crash in Expat's `ExternalEntityParserCreate` error paths (#144992)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* gh-144984: Skip test under tracerefs (GH-146218)

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-04-07 12:22:22 +02:00
Gregory P. Smith 3038ee956e [3.13] gh-144503: Pass sys.argv to forkserver as real argv elements (GH-148194) (#148196)
Avoid embedding the parent's sys.argv into the forkserver -c command
string via repr().  When sys.argv is large (e.g. thousands of file
paths from a pre-commit hook), the resulting single argument could
exceed the OS per-argument length limit (MAX_ARG_STRLEN on Linux,
typically 128 KiB), causing posix_spawn to fail and the parent to
observe a BrokenPipeError.

Instead, append the argv entries as separate command-line arguments
after -c; the forkserver child reads them back as sys.argv[1:].  This
cannot exceed any limit the parent itself did not already satisfy.

Regression introduced by gh-143706 / 298d5440eb.
(cherry picked from commit 5e9d90b615)
2026-04-06 23:19:40 -07:00
Miss Islington (bot) c358b89d24 [3.13] gh-137586: Open external osascript program with absolute path (GH-137584) (#148174)
Co-authored-by: Fionn <1897918+fionn@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-07 03:35:14 +00:00
Miss Islington (bot) 4dfcdbe22c [3.13] gh-148157: Check for _PyPegen_add_type_comment_to_arg fail in _PyPegen_name_default_pair (GH-148158) (#148163)
(cherry picked from commit 1795fccfbc)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-06 12:13:32 +00:00
Miss Islington (bot) 9b576f14bf [3.13] Docs: Update "Installing Python modules" (GH-146249) (#148160)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-06 11:28:40 +00:00
Miss Islington (bot) 06f11ecff4 [3.13] gh-144418: Increase Android testbed emulator RAM to 4 GB (GH-148054) (#148151)
Pre-create the Android emulator image so that the the configuration can be
modified to use 4GB of RAM.
(cherry picked from commit a95ee3a21d)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-04-06 14:09:20 +08:00
Malcolm Smith 3ea97a26b6 [3.13] gh-146541: Allow building the Android testbed for 32-bit targets (GH-146542) (#148107)
Allows building the Android testbed for 32-bit targets, adding the target triplets
`arm-linux-androideabi` and `i686-linux-android`.
(cherry picked from commit 848bbe9ff2)

Co-authored-by: Robert Kirkman <31490854+robertkirkman@users.noreply.github.com>
2026-04-06 07:47:01 +08:00
Hugo van Kemenade 38e2470f56 [3.13] gh-145098: Use macos-15-intel instead of unstable macos-26-intel in {jit,tail-call}.yml (GH-148126) (#148136)
(cherry picked from commit bce96a1813)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-06 01:11:29 +03:00
Miss Islington (bot) b21aa5a6aa [3.13] gh-94632: document the subprocess need for extra_groups=() with user= (GH-148129) (#148131)
gh-94632: document the subprocess need for extra_groups=() with user= (GH-148129)
(cherry picked from commit a1cf4430ed)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-04-05 18:14:03 +00:00
Ezio Melotti ce0c2c9fab [3.13] Add permissions: {} to all reusable workflows (#148114) (#148116)
Add `permissions: {}` to all reusable workflows (#148114)

Add permissions: {} to all reusable workflows

(cherry picked from commit 1f36a510a2)
2026-04-05 12:04:33 +02:00
Stan Ulbrych abea3e2861 [3.13] Docs: Standardize documentation authors (GH-148102) (#148106)
(cherry picked from commit 75be902a13)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-04 18:14:37 +00:00
Miss Islington (bot) f5776fdb73 [3.13] Regex HOWTO: invalid string literals result in SyntaxWarning (GH-148092) (#148098)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-04 16:19:58 +00:00
Miss Islington (bot) df89a705d0 [3.13] gh-145883: Fix two heap-buffer-overflows in _zoneinfo (GH-145885) (#148086)
(cherry picked from commit fe9befc1ca)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-04 17:14:19 +01:00
Hugo van Kemenade df12674ecc [3.13] gh-145098: Use macos-15-intel instead of unstable macos-26-intel (GH-148038) (#148077) 2026-04-04 10:04:43 +00:00
Miss Islington (bot) 140074eae6 [3.13] gh-146450: Normalise feature set of Android build script with other platform build scripts (GH-146451) (#148066)
Allows for cleaning a subset of targets, customization of the download cache and
cross-build directories, and modifies the build command to allow 'all', 'build'
and 'hosts' targets.
(cherry picked from commit b8470deb5d)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-04-04 12:27:56 +08:00
Miss Islington (bot) 9ff584503e [3.13] gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435) (#148049)
gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435)
(cherry picked from commit 80d0a85d96)

Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com>
Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-04-03 12:10:09 -07:00
Łukasz Langa 89bfb8e5ed [3.13] gh-143930: Tweak the exception message and increase test coverage (GH-146476) (GH-148045)
(cherry picked from commit 3681d47a44)
2026-04-03 19:45:02 +02:00