]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
31 hours agogh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavio...
Pablo Galindo Salgado [Wed, 20 May 2026 11:32:08 +0000 (04:32 -0700)] 
gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior (#149649)

Use exact remote reads for interpreter state, thread state, and
interpreter frame structs instead of pulling full remote pages into the
profiler page cache. This matches the core change from
python/cpython#149585.

The profiler clears the page cache between samples, so live entries are
always packed at the front. Track the live count and only clear/search
that prefix instead of scanning all 1024 slots on the hot path.

Use the frame cache to predict the next thread state and top frame
address, then batch interpreter/thread/frame reads with process_vm_readv
when profiling a Linux target. Reuse prefetched frame buffers in the
frame walker when the prediction is valid.

Cache the last FrameInfo tuple per code object/instruction offset, reuse
cached thread id objects, and append cached parent frames directly on
full frame-cache hits. This cuts Python allocation churn in the
steady-state profiler path.

31 hours agogh-150034: Print JSONL filename when profiling finishes (#150035)
László Kiss Kollár [Wed, 20 May 2026 11:29:48 +0000 (04:29 -0700)] 
gh-150034: Print JSONL filename when profiling finishes (#150035)

31 hours agogh-149807: Fix hash(frozendict): compute (key, value) pair hash (#149841)
Victor Stinner [Wed, 20 May 2026 11:22:57 +0000 (13:22 +0200)] 
gh-149807: Fix hash(frozendict): compute (key, value) pair hash (#149841)

31 hours agogh-148260: Use at least 1 MiB stack size on musl (#149993)
Victor Stinner [Wed, 20 May 2026 11:21:59 +0000 (13:21 +0200)] 
gh-148260: Use at least 1 MiB stack size on musl (#149993)

On Linux when Python is linked to the musl C library, use a thread
stack size of at least 1 MiB instead of musl default which is 128
kiB.

39 hours agogh-146406: add clear() cross-language hint for immutable types (GH-149927)
Matt Van Horn [Wed, 20 May 2026 03:01:15 +0000 (20:01 -0700)] 
gh-146406: add clear() cross-language hint for immutable types (GH-149927)

41 hours agogh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (#134264)
Caleb [Wed, 20 May 2026 01:36:19 +0000 (21:36 -0400)] 
gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (#134264)

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
42 hours agoPEP 810 - Update some error strings (#150126)
Tim Stumbaugh [Wed, 20 May 2026 00:47:44 +0000 (18:47 -0600)] 
PEP 810 - Update some error strings (#150126)

43 hours agogh-149321: Remove lazy_imports=none startup mode (#149389)
Pablo Galindo Salgado [Tue, 19 May 2026 23:01:15 +0000 (16:01 -0700)] 
gh-149321: Remove lazy_imports=none startup mode (#149389)

44 hours agogh-150042: queue.SimpleQueue.put: fix minor refleak. (GH-150043)
larryhastings [Tue, 19 May 2026 22:27:04 +0000 (15:27 -0700)] 
gh-150042: queue.SimpleQueue.put: fix minor refleak. (GH-150043)

If queue.SimpleQueue.put can't handoff the item to a
waiting thread, and fails to allocate memory when adding
the item to a ringbuf, it would leak a reference.  Fixed.

44 hours agogh-149816: Fix UAF in Modules/_pickle.c (GH-150024)
Alexey Katsman [Tue, 19 May 2026 22:11:17 +0000 (15:11 -0700)] 
gh-149816: Fix UAF in Modules/_pickle.c (GH-150024)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
45 hours agogh-150114: Reduce memory usage of test_free_threading.test_iteration (gh-150115)
Sam Gross [Tue, 19 May 2026 21:36:31 +0000 (21:36 +0000)] 
gh-150114: Reduce memory usage of test_free_threading.test_iteration (gh-150115)

Reduce NUMITEMS from 100000 to 5000. Peak RSS for the full
test_free_threading suite drops from ~850 MB to ~175 MB.

45 hours agoMark PRs as stale after 90 days (#150104)
Hugo van Kemenade [Tue, 19 May 2026 21:13:37 +0000 (00:13 +0300)] 
Mark PRs as stale after 90 days (#150104)

45 hours agogh-134887: Add references to `locale` module for locale-aware number formatting refer...
Stefanie Molin [Tue, 19 May 2026 21:10:39 +0000 (17:10 -0400)] 
gh-134887: Add references to `locale` module for locale-aware number formatting references in `string` module docs (GH-134888)

46 hours agogh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984)
AN Long [Tue, 19 May 2026 20:31:00 +0000 (05:31 +0900)] 
gh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984)

46 hours agogh-124111: Keep tests passing for Tcl prior to 9.0 (GH-150102)
Steve Dower [Tue, 19 May 2026 20:27:44 +0000 (21:27 +0100)] 
gh-124111: Keep tests passing for Tcl prior to 9.0 (GH-150102)

Also disables the UWP build in CI, since it was breaking (and is no longer released).

47 hours agogh-143387: Update docs to reflect the behavior and note the changed version. (#150095)
Jason R. Coombs [Tue, 19 May 2026 19:38:27 +0000 (12:38 -0700)] 
gh-143387: Update docs to reflect the behavior and note the changed version. (#150095)

2 days agogh-149816: Fix SNI callback callable race (GH-150018)
Kirill Ignatev [Tue, 19 May 2026 18:36:46 +0000 (11:36 -0700)] 
gh-149816: Fix SNI callback callable race (GH-150018)

2 days agogh-150027: Avoid copying during construction of `frozenset` objects (GH-150028)
Peter Bierma [Tue, 19 May 2026 17:57:37 +0000 (13:57 -0400)] 
gh-150027: Avoid copying during construction of `frozenset` objects (GH-150028)

2 days agogh-149473: Emit audit event on calling os.environ.clear() (#149768)
Victor Stinner [Tue, 19 May 2026 16:38:12 +0000 (18:38 +0200)] 
gh-149473: Emit audit event on calling os.environ.clear() (#149768)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 days agogh-149945: Fix potential OOM for gzip with large header (GH-149979)
Serhiy Storchaka [Tue, 19 May 2026 16:20:01 +0000 (19:20 +0300)] 
gh-149945: Fix potential OOM for gzip with large header (GH-149979)

Do not read the whole filename and comment to memory for calculating the CRC.

2 days agogh-148829: Make sentinels' repr and module customizable (#149654)
Jelle Zijlstra [Tue, 19 May 2026 16:18:56 +0000 (09:18 -0700)] 
gh-148829: Make sentinels' repr and module customizable (#149654)

Implementation of python/peps#4968; still needs SC approval.

2 days agogh-149879: Fix test_tempfile on Cygwin (#150081)
Victor Stinner [Tue, 19 May 2026 14:09:03 +0000 (16:09 +0200)] 
gh-149879: Fix test_tempfile on Cygwin (#150081)

On Cygwin, text files are not truncated at the first Ctrl+Z byte.

2 days agogh-146581: Update docs for dangerous filenames in ZIP files (GH-149994)
Serhiy Storchaka [Tue, 19 May 2026 08:36:12 +0000 (11:36 +0300)] 
gh-146581: Update docs for dangerous filenames in ZIP files (GH-149994)

Co-authored-by: Sebastian Gassner <sebastian.gassner@gmail.com>
2 days agogh-145098: Use `macos-26-intel` instead of `macos-15-intel` (#149991)
Hugo van Kemenade [Tue, 19 May 2026 04:41:25 +0000 (07:41 +0300)] 
gh-145098: Use `macos-26-intel` instead of `macos-15-intel` (#149991)

This reverts commit cb76ab3819f778e55a3f49ddb1f681ee20978eda.

2 days agogh-86533: Make Path.mkdir parent_mode tests umask-independent (#150040)
Gregory P. Smith [Tue, 19 May 2026 01:19:06 +0000 (18:19 -0700)] 
gh-86533: Make Path.mkdir parent_mode tests umask-independent (#150040)

test_mkdir_with_parent_mode, test_mkdir_parent_mode_deep_hierarchy and
test_mkdir_parent_mode_same_as_mode assert exact directory mode bits but
did not pin the process umask.  On buildbots running with a restrictive
umask (e.g. 0o077) the 0o755 leaf was masked down to 0o700, failing the
assertions.  Wrap them in os_helper.temp_umask(0o022), matching the
other umask-aware mkdir tests in this file.

2 days agogh-69619: Clarify whitespace definition in str.strip docs (GH-150021)
Daniil [Tue, 19 May 2026 01:10:50 +0000 (04:10 +0300)] 
gh-69619: Clarify whitespace definition in str.strip docs (GH-150021)

2 days agogh-141968: Use `take_bytes` to remove copy in `_pyio.BytesIO.read()` (#149850)
Lukas Geiger [Tue, 19 May 2026 00:48:41 +0000 (01:48 +0100)] 
gh-141968: Use `take_bytes` to remove copy in `_pyio.BytesIO.read()` (#149850)

2 days agogh-79413: Add `qualname` parameter to `dataclass.make_dataclass`. (GH-150026)
Dan Shernicoff [Mon, 18 May 2026 23:55:47 +0000 (16:55 -0700)] 
gh-79413: Add `qualname` parameter to `dataclass.make_dataclass`. (GH-150026)

Added `qualname` parameter to `dataclasses.make_dataclass` in order to allow user to set `__qualname__` for the generated class.

2 days agogh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race...
Saul Cooperman [Mon, 18 May 2026 23:26:08 +0000 (16:26 -0700)] 
gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (#150025)

Remove assertion that could fail in rare race condition.

Replace the coarse critical section wrapping the entire function with
fine-grained sections covering only PyDict_Next + Py_INCREF.
Also handle PyDict_Next returning 0 in the single-item fast path.

2 days agogh-149590: Remove faulthandler_traverse (#150023)
Armaan Vakharia [Mon, 18 May 2026 23:00:59 +0000 (16:00 -0700)] 
gh-149590: Remove faulthandler_traverse (#150023)

`faulthandler_traverse` visits Python objects owned by `_PyRuntime`, not
by the module instance. With multi-phase init allowing multiple module
instances, each instance's GC traversal decrements `gc_refs` on the same
runtime-owned objects, driving it negative when two instances are
collected simultaneously.

2 days agogh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011)
nessita [Mon, 18 May 2026 23:00:27 +0000 (20:00 -0300)] 
gh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011)

bpo-42367: Restore os.makedirs() and pathlib.mkdir() ability to apply *mode* recursively via a new parent_mode= keyword argument.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 days agogh-149879: Fix multiprocessing tests on Cygwin (#150031)
Victor Stinner [Mon, 18 May 2026 22:45:35 +0000 (00:45 +0200)] 
gh-149879: Fix multiprocessing tests on Cygwin (#150031)

* Disable AF_UNIX connection family on Cygwin.
* forkserver start method is not available on Cygwin: update tests
  for that.
* test_logging calls multiprocessing.get_all_start_methods().

2 days agogh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related) usage...
Stefanie Molin [Mon, 18 May 2026 22:42:55 +0000 (18:42 -0400)] 
gh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related) usage with class-level access (GH-150013)

Co-authored-by: CHINMAY <89741289+Das-Chinmay@users.noreply.github.com>
2 days agogh-149980: Strip all trailing slashes from GNU long directory names in tarfile (GH...
ankhikarmakar [Mon, 18 May 2026 19:31:15 +0000 (12:31 -0700)] 
gh-149980: Strip all trailing slashes from GNU long directory names in tarfile (GH-150019)

2 days agogh-149977: Fix extra output of `-m test test_lazy_import` (#149978)
sobolevn [Mon, 18 May 2026 18:55:27 +0000 (21:55 +0300)] 
gh-149977: Fix extra output of `-m test test_lazy_import` (#149978)

3 days agogh-140344: ast: Add deprecation warnings (#140345)
Jeff Epler [Mon, 18 May 2026 18:20:49 +0000 (11:20 -0700)] 
gh-140344: ast: Add deprecation warnings (#140345)

These were all deprecated in 3.9 (bace59d8b8) but without
a runtime deprecation warning. Add it now, so that these
items can be removed in 3.21 per PEP 387.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 days agogh-95816: Fix TLS version range example in docs (GH-148574)
Jan Brasna [Mon, 18 May 2026 18:01:56 +0000 (20:01 +0200)] 
gh-95816: Fix TLS version range example in docs (GH-148574)

docs(ssl): Fix TLS version range example

3 days agogh-149816: fix thread safety of deletion of list slice (#149936)
Kumar Aditya [Mon, 18 May 2026 16:38:37 +0000 (22:08 +0530)] 
gh-149816: fix thread safety of deletion of list slice (#149936)

3 days agogh-149816: fix `dict.clear()` race on split-table dict with non-embedded values ...
Kumar Aditya [Mon, 18 May 2026 16:09:45 +0000 (21:39 +0530)] 
gh-149816: fix `dict.clear()` race on split-table dict with non-embedded values (#149914)

3 days agogh-149816: Fix a RC in `_random.Random.__init__` method (#149824)
sobolevn [Mon, 18 May 2026 15:39:54 +0000 (18:39 +0300)] 
gh-149816: Fix a RC in `_random.Random.__init__` method (#149824)

3 days agogh-146531: Skip hanging `wm iconbitmap` test on macOS 26 Intel (#148032)
Hugo van Kemenade [Mon, 18 May 2026 14:57:02 +0000 (17:57 +0300)] 
gh-146531: Skip hanging `wm iconbitmap` test on macOS 26 Intel (#148032)

3 days agogh-149464: Add `os.pidfd_getfd(pidfd, targetfd, flags=0)` function (#149465)
Maurycy Pawłowski-Wieroński [Mon, 18 May 2026 14:29:58 +0000 (16:29 +0200)] 
gh-149464: Add `os.pidfd_getfd(pidfd, targetfd, flags=0)` function (#149465)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 days agogh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
Nathan Goldbaum [Mon, 18 May 2026 13:24:06 +0000 (07:24 -0600)] 
gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)

3 days agogh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)
Nezuko Agent [Mon, 18 May 2026 08:28:28 +0000 (15:28 +0700)] 
gh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)

Move  check before

3 days agogh-144140: Optimize len for frozen dict/set constants in optimizer (#149969)
Lukas Geiger [Mon, 18 May 2026 06:50:42 +0000 (07:50 +0100)] 
gh-144140: Optimize len for frozen dict/set constants in optimizer (#149969)

3 days agogh-138325: steal list items in `INTRINSIC_LIST_TO_TUPLE` opcode (#149960)
Pieter Eendebak [Mon, 18 May 2026 06:37:12 +0000 (08:37 +0200)] 
gh-138325: steal list items in `INTRINSIC_LIST_TO_TUPLE` opcode (#149960)

4 days agogh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922) 149613/head
AN Long [Sun, 17 May 2026 10:09:19 +0000 (19:09 +0900)] 
gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922)

4 days agogh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)
Farhan Saif [Sun, 17 May 2026 09:05:27 +0000 (04:05 -0500)] 
gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
4 days agogh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917)
Serhiy Storchaka [Sun, 17 May 2026 08:06:35 +0000 (11:06 +0300)] 
gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917)

4 days agogh-149857: Clarify multiprocessing Process argument wording (GH-149919)
Mani Salahmand [Sun, 17 May 2026 06:01:50 +0000 (08:01 +0200)] 
gh-149857: Clarify multiprocessing Process argument wording (GH-149919)

Use consistent 'picklable' wording

5 days agogh-67512: Document IMAP4.append() flags argument (#149907)
Savage Mechanic [Sat, 16 May 2026 18:24:41 +0000 (19:24 +0100)] 
gh-67512: Document IMAP4.append() flags argument (#149907)

5 days agogh-149879: Fix test_socket on Cygwin (#149913)
Victor Stinner [Sat, 16 May 2026 10:02:19 +0000 (12:02 +0200)] 
gh-149879: Fix test_socket on Cygwin (#149913)

Disable SCM_RIGHTS, recvmsg(), sendmsg() and sethostname() on Cygwin.

5 days agogh-149879: Fix test_os on Cygwin (#149910)
Victor Stinner [Sat, 16 May 2026 08:50:55 +0000 (10:50 +0200)] 
gh-149879: Fix test_os on Cygwin (#149910)

5 days agogh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (#149909)
sobolevn [Sat, 16 May 2026 08:37:34 +0000 (11:37 +0300)] 
gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (#149909)

5 days agogh-149879: Fix test_resource on Cygwin (#149903)
Victor Stinner [Fri, 15 May 2026 23:09:36 +0000 (01:09 +0200)] 
gh-149879: Fix test_resource on Cygwin (#149903)

Setting RLIMIT_FSIZE or RLIMIT_CPU fails with EINVAL on Cygwin.

5 days agogh-149879: Don't import msvcrt in _pyio on Cygwin (#149899)
Victor Stinner [Fri, 15 May 2026 21:11:09 +0000 (23:11 +0200)] 
gh-149879: Don't import msvcrt in _pyio on Cygwin (#149899)

The msvcrt extension module cannot be built on Cygwin.

5 days agogh-149879: Fix test_tarfile on Cygwin (#149897)
Victor Stinner [Fri, 15 May 2026 20:49:37 +0000 (22:49 +0200)] 
gh-149879: Fix test_tarfile on Cygwin (#149897)

On Cygwin, there is no root user (uid 0).

Fix test_realpath_limit_attack(): the test fails with ELOOP on
Cygwin.

5 days agogh-149879: Fix test_signal on Cygwin (#149896)
Victor Stinner [Fri, 15 May 2026 19:32:10 +0000 (21:32 +0200)] 
gh-149879: Fix test_signal on Cygwin (#149896)

* Check for SIG_BLOCK instead of pthread_sigmask() to decide if
  SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK constants should be
  converted to enums.
* Skip ITIMER_VIRTUAL and ITIMER_PROF tests on Cygwin: setitimer()
  fails with ItimerError(EINVAL).

6 days agogh-149567: Remove deprecated `shutil.ExecError` (#149568)
Stan Ulbrych [Fri, 15 May 2026 17:54:05 +0000 (18:54 +0100)] 
gh-149567: Remove deprecated `shutil.ExecError` (#149568)

6 days agogh-149879: Set thread name max length on Cygwin (#149890)
Victor Stinner [Fri, 15 May 2026 16:57:05 +0000 (18:57 +0200)] 
gh-149879: Set thread name max length on Cygwin (#149890)

This change fix test_threading on Cygwin.

6 days agogh-149879: Fix test_pwd on Cygwin (#149880)
Victor Stinner [Fri, 15 May 2026 16:33:46 +0000 (18:33 +0200)] 
gh-149879: Fix test_pwd on Cygwin (#149880)

On Cygwin, pwd.getpwuid(-1) returns an user ('Unknown+User').

6 days agogh-142349: Add `help("lazy")` support (#149886)
sobolevn [Fri, 15 May 2026 16:30:40 +0000 (19:30 +0300)] 
gh-142349: Add `help("lazy")` support (#149886)

6 days agogh-149879: Fix sys.orig_argv[0] on Cygwin: add ".exe" suffix (#149885)
Victor Stinner [Fri, 15 May 2026 15:55:34 +0000 (17:55 +0200)] 
gh-149879: Fix sys.orig_argv[0] on Cygwin: add ".exe" suffix (#149885)

6 days agogh-149831: Fix ctypes DLL library name on Cygwin (#149832)
Carlo Bramini [Fri, 15 May 2026 14:29:26 +0000 (16:29 +0200)] 
gh-149831: Fix ctypes DLL library name on Cygwin (#149832)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agoCI: Move Homebrew dependencies into Brewfile (#148335)
Hugo van Kemenade [Fri, 15 May 2026 14:03:46 +0000 (17:03 +0300)] 
CI: Move Homebrew dependencies into Brewfile (#148335)

Co-authored-by: Brett Cannon <brett@python.org>
6 days agogh-149833: Change DLL prefix to "cygpython" on Cygwin (#149834)
Carlo Bramini [Fri, 15 May 2026 13:54:08 +0000 (15:54 +0200)] 
gh-149833: Change DLL prefix to "cygpython" on Cygwin (#149834)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agogh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)
Steve Dower [Fri, 15 May 2026 13:43:41 +0000 (14:43 +0100)] 
gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)

6 days agogh-138489: Add build-details.json generation to PC/layout (GH-149153)
Steve Dower [Fri, 15 May 2026 12:51:27 +0000 (13:51 +0100)] 
gh-138489: Add build-details.json generation to PC/layout (GH-149153)

6 days agogh-148200: Update Modules/_hacl/ for Cygwin (#149802)
Victor Stinner [Fri, 15 May 2026 12:42:30 +0000 (14:42 +0200)] 
gh-148200: Update Modules/_hacl/ for Cygwin (#149802)

This pulls an updated version of HACL* that fixes Lib_Memzero0.c on
Cygwin, via an upstream fix.

6 days agogh-149816: Fix race condition in `memoryview` with free-threading (#149858)
sobolevn [Fri, 15 May 2026 12:38:51 +0000 (15:38 +0300)] 
gh-149816: Fix race condition in `memoryview` with free-threading (#149858)

6 days agogh-149801: Add IANA registered names and aliases with leading zeros (GH-149804)
Serhiy Storchaka [Fri, 15 May 2026 11:34:48 +0000 (14:34 +0300)] 
gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804)

Like IBM00858, CP00858, IBM01140, CP01140.

6 days agogh-148675: Use a string for ctypes cparam tag (#149778)
Victor Stinner [Fri, 15 May 2026 11:25:09 +0000 (13:25 +0200)] 
gh-148675: Use a string for ctypes cparam tag (#149778)

6 days agogh-148675: Reuse typecodes for array.array() error message (#149779)
Victor Stinner [Fri, 15 May 2026 11:22:40 +0000 (13:22 +0200)] 
gh-148675: Reuse typecodes for array.array() error message (#149779)

array.array() error message now reuses array.typecodes, instead of
maintaining an hardcoded list of valid type codes.

6 days agogh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)
Victor Stinner [Fri, 15 May 2026 11:04:50 +0000 (13:04 +0200)] 
gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791)

Change my_strchr() return type to "const char*" (add "const").

Fix the compiler warning:

Modules/_ctypes/_ctypes_test.c: In function 'my_strchr':
Modules/_ctypes/_ctypes_test.c:451:12: warning: return discards
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  451 |     return strchr(s, c);
      |            ^~~~~~

When using C23, strchr(text, ch) return type is "const char*" if text
type is "const char*".

6 days agogh-149763: Improve availablity docs in `select.rst` (#149764)
sobolevn [Fri, 15 May 2026 07:16:34 +0000 (10:16 +0300)] 
gh-149763: Improve availablity docs in `select.rst` (#149764)

6 days agogh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)
Seth Larson [Thu, 14 May 2026 21:10:39 +0000 (16:10 -0500)] 
gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)

7 days agogh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149477)
Zachary Ware [Thu, 14 May 2026 17:47:28 +0000 (12:47 -0500)] 
gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149477)

7 days agoLink to existing rules in compound_stmts.rst (GH-149811)
Petr Viktorin [Thu, 14 May 2026 16:47:52 +0000 (18:47 +0200)] 
Link to existing rules in compound_stmts.rst (GH-149811)

In gh-138418, `!` was added to links to rules that don't exist in
the docs, in order to silence broken link warnings.
However, productionlist doesn't parse the `!`, which ends up in
the rendered documentation. (It's possible that gh-127835 broke
the `!` support.)

Replace the names with ones that appear in docs:

- `star_named_expression` in the grammar corresponds to
  `flexible_expression` in the docs
- `star_named_expressions` in the grammar corresponds to
  `flexible_expression_list` in the docs
- `named_expression` in the grammar corresponds to
  `assignment_expression` in the docs

Having two sets of names isn't great of course. Consolidating them
is tracked in (subissues of) gh-127833.

7 days agogh-148821: Add more tests for invalid XML encodings (GH-149820)
Serhiy Storchaka [Thu, 14 May 2026 10:10:28 +0000 (13:10 +0300)] 
gh-148821: Add more tests for invalid XML encodings (GH-149820)

7 days agogh-149698: Update bundled expat to 2.8.1 (GH-149699)
Stan Ulbrych [Wed, 13 May 2026 23:21:03 +0000 (00:21 +0100)] 
gh-149698: Update bundled expat to 2.8.1 (GH-149699)

7 days agogh-148758: Fix dynamic loading file extensions for Cygwin (#148759)
Carlo Bramini [Wed, 13 May 2026 21:50:24 +0000 (23:50 +0200)] 
gh-148758: Fix dynamic loading file extensions for Cygwin (#148759)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 days agogh-148575: Use /dev/fd/ to read the set of file descriptors on Cygwin (#148576)
Carlo Bramini [Wed, 13 May 2026 20:05:27 +0000 (22:05 +0200)] 
gh-148575: Use /dev/fd/ to read the set of file descriptors on Cygwin (#148576)

7 days agogh-148461: Use arc4random_buf() in mimalloc on Cygwin (#148462)
Carlo Bramini [Wed, 13 May 2026 19:09:24 +0000 (21:09 +0200)] 
gh-148461: Use arc4random_buf() in mimalloc on Cygwin (#148462)

See also issue #113141.

8 days agogh-148906: fix performance scaling of descriptors on free-threading (#148915)
Kumar Aditya [Wed, 13 May 2026 17:33:59 +0000 (23:03 +0530)] 
gh-148906: fix performance scaling of descriptors on free-threading (#148915)

8 days agogh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648)
Gregory P. Smith [Wed, 13 May 2026 17:33:43 +0000 (10:33 -0700)] 
gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648)

ftpcp() called parse227() directly and passed the source server's
self-reported PASV IPv4 address to the target server's PORT command,
bypassing the CVE-2021-4189 fix that was applied only to FTP.makepasv().
A malicious source FTP server could use this to redirect the target
server's data connection to an arbitrary host:port (SSRF).

ftpcp() now uses the source server's actual peer address, honoring the
existing trust_server_pasv_ipv4_address opt-out, the same as makepasv().

Thanks to Qi Ding at Aurascape AI for the report. (GHSA-w8c5-q2xf-gf7c)

8 days agogh-149685: Use the _Py prefix for private C macros (GH-149686)
Petr Viktorin [Wed, 13 May 2026 17:14:05 +0000 (19:14 +0200)] 
gh-149685: Use the _Py prefix for private C macros (GH-149686)

8 days agogh-149504: Fix re-entrancy bug when .pth/.start file invokes site.addsitedir() (...
Barry Warsaw [Wed, 13 May 2026 16:45:25 +0000 (09:45 -0700)] 
gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.addsitedir() (#149659)

* Add re-entrant tests for gh-149504
* Add end-to-end integration test coverage

This ensures that future whitebox internal test changes do not regress the
public surface semantics.

* Implement a state class to process .pth and .start files

By using this state class and managing implicit and explicit batching, we make it structurally
impossible to get bitten by re-entrant site startup processing.

Fixes #149504

8 days agogh-140550: Update xxlimited with 3.15 limited API (GH-142827)
Petr Viktorin [Wed, 13 May 2026 16:35:50 +0000 (18:35 +0200)] 
gh-140550: Update xxlimited with 3.15 limited API (GH-142827)

8 days agogh-149776: Skip UDP Lite tests if it's not supported (#149777)
Victor Stinner [Wed, 13 May 2026 14:55:45 +0000 (16:55 +0200)] 
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.

8 days agoRun mypy with four worker processes and uv (#149726)
Hugo van Kemenade [Wed, 13 May 2026 11:03:33 +0000 (14:03 +0300)] 
Run mypy with four worker processes and uv (#149726)

8 days agogh-148821: Add more strict tests for XML encodings (GH-149765)
Serhiy Storchaka [Wed, 13 May 2026 10:40:47 +0000 (13:40 +0300)] 
gh-148821: Add more strict tests for XML encodings (GH-149765)

Exclude encodings like 'utf-8-sig', 'iso2022-jp' and 'hz' from the list of
supported encodings.

8 days agobpo-45509: Check gzip headers for corrupted fields (GH-29028)
Ruben Vorderman [Wed, 13 May 2026 10:20:33 +0000 (12:20 +0200)] 
bpo-45509: Check gzip headers for corrupted fields (GH-29028)

Check the header checksum it the HCRC field is present.

8 days agogh-148829: Add PySentinel_CheckExact() (#149725)
scoder [Wed, 13 May 2026 10:10:37 +0000 (12:10 +0200)] 
gh-148829: Add PySentinel_CheckExact() (#149725)

8 days agogh-149720: Fix docs for `mimetypes.MimeType.add_type` method (#149731)
sobolevn [Wed, 13 May 2026 08:48:01 +0000 (11:48 +0300)] 
gh-149720: Fix docs for `mimetypes.MimeType.add_type` method (#149731)

gh-149720: Fix docs for `mimetypes.MimeType.add_type` method`

8 days agogh-149701: Fully silence potential `hash -r` error (GH-149702)
John Merkel [Wed, 13 May 2026 07:59:57 +0000 (00:59 -0700)] 
gh-149701: Fully silence potential `hash -r` error (GH-149702)

8 days agogh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return...
Jelle Zijlstra [Wed, 13 May 2026 03:00:01 +0000 (20:00 -0700)] 
gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (#149604)

8 days agogh-149642: Fix interaction between exec and lazy_imports=all (#149643)
Jelle Zijlstra [Wed, 13 May 2026 02:59:09 +0000 (19:59 -0700)] 
gh-149642: Fix interaction between exec and lazy_imports=all (#149643)

8 days agogh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719)
Maurycy Pawłowski-Wieroński [Tue, 12 May 2026 23:46:21 +0000 (01:46 +0200)] 
gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719)

8 days agogh-115119: Removed bundled copy of the libmpdec (GH-133964)
Sergey B Kirpichev [Tue, 12 May 2026 21:34:37 +0000 (00:34 +0300)] 
gh-115119: Removed bundled copy of the libmpdec (GH-133964)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
8 days agogh-134837: Correct and improve base85 documentation for base64 and binascii modules...
David Huggins-Daines [Tue, 12 May 2026 19:46:46 +0000 (15:46 -0400)] 
gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843)