]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 weeks ago[3.15] gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (GH...
Miss Islington (bot) [Sat, 23 May 2026 07:33:21 +0000 (09:33 +0200)] 
[3.15] gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (GH-146470) (#150292)

gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (GH-146470)
(cherry picked from commit e62a61177f8b793d787e337034a740ca75c1ab44)

Co-authored-by: Farhan Saif <fsaif@uic.edu>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 weeks ago[3.15] Revert "[3.15] gh-146452: Improve locking granularity in pickle's batch_dict_e...
Victor Stinner [Sat, 23 May 2026 06:57:27 +0000 (08:57 +0200)] 
[3.15] Revert "[3.15] gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (GH-150025) (#150039)" (#150262)

Revert "[3.15] gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (GH-150025) (#150039)"

This reverts commit 66ade2861fec1d6c18998710938a1c71fde5f76b.

2 weeks ago[3.15] gh-82907: Document mtime=0 for reproducible tarfile gzip output (GH-150269...
Miss Islington (bot) [Fri, 22 May 2026 21:17:51 +0000 (23:17 +0200)] 
[3.15] gh-82907: Document mtime=0 for reproducible tarfile gzip output (GH-150269) (GH-150271)

(cherry picked from commit 9df2b6ccc719b0bc0167da65b72b57f9da39398b)

Co-authored-by: Omkar Kabde <omkarkabde@gmail.com>
2 weeks ago[3.15] gh-149189: Revert "Modern defaults for `pprint` (GH-149190)" (GH-150249) ...
Miss Islington (bot) [Fri, 22 May 2026 20:49:36 +0000 (22:49 +0200)] 
[3.15] gh-149189: Revert "Modern defaults for `pprint` (GH-149190)" (GH-150249) (#150268)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks ago[3.15] gh-148829: Make sentinels' repr and module customizable (GH-149654) (#150092)
Miss Islington (bot) [Fri, 22 May 2026 14:44:34 +0000 (16:44 +0200)] 
[3.15] gh-148829: Make sentinels' repr and module customizable (GH-149654) (#150092)

Implementation of python/peps#4968.
(cherry picked from commit 08218030a507b2ef38db9696216bf3eb24d9a6a1)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 weeks ago[3.15] CI: Move Homebrew dependencies into Brewfile (GH-148335) (#149882)
Miss Islington (bot) [Fri, 22 May 2026 14:44:08 +0000 (16:44 +0200)] 
[3.15] CI: Move Homebrew dependencies into Brewfile (GH-148335) (#149882)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
2 weeks ago[3.15] gh-149902: Remove dead packaging docs link and add a new section for external...
Miss Islington (bot) [Fri, 22 May 2026 11:40:49 +0000 (13:40 +0200)] 
[3.15] gh-149902: Remove dead packaging docs link and add a new section for external resources (GH-150030) (#150241)

Co-authored-by: Mia Albert <micha@2231puppy.tech>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks ago[3.15] gh-137571: Protect against possible UnboundLocalError in gzip._GzipReader...
Miss Islington (bot) [Fri, 22 May 2026 09:46:14 +0000 (11:46 +0200)] 
[3.15] gh-137571: Protect against possible UnboundLocalError in gzip._GzipReader.read() (GH-150222) (GH-150229)

This has not been observed in practice, but we cannot be 100% sure that
it will not happen with some weird gzip data.
(cherry picked from commit 28eac9a7263ad8dcfa9b536aa238549131857e0f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.15] gh-133998: Fix gzip file creation when time is out of range (GH-134278) (GH...
Miss Islington (bot) [Fri, 22 May 2026 07:48:42 +0000 (09:48 +0200)] 
[3.15] gh-133998: Fix gzip file creation when time is out of range (GH-134278) (GH-150221)

(cherry picked from commit 1daad8a1630c9ee011f6ff3796c4e7aef243463b)

Co-authored-by: adang1345 <adang1345@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.15] gh-149995: Update typing.py docstrings and documentation (GH-149996) (#150215)
Miss Islington (bot) [Fri, 22 May 2026 06:41:43 +0000 (08:41 +0200)] 
[3.15] gh-149995: Update typing.py docstrings and documentation (GH-149996) (#150215)

gh-149995: Update typing.py docstrings and documentation (GH-149996)

Some of these docstrings read as if they were written when typing.py was
first written, and things have evolved since then.

A few motivations:
- Call protocols protocols instead of ABCs. They are also ABCs, but the fact
  they are protocols is more relevant to typing.
- Avoid recommending direct use of .__annotations__ and steer users to
  annotationlib instead.
- For TypedDict, mention NotRequired before total=False since it is more
  general and probably more frequently useful.
- For overloads, mention runtime use first instead of stub use. I think early on
  there was talk of allowing overload only in stubs, but it is now heavily used at
  runtime too and that's more likely to be relevant to users.
(cherry picked from commit f159419ae2ef1aebbd90ce9427b55e27738c960c)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 weeks ago[3.15] gh-148294: Make configure find g++ correctly (GH-150212)
Miss Islington (bot) [Fri, 22 May 2026 02:18:28 +0000 (04:18 +0200)] 
[3.15] gh-148294: Make configure find g++ correctly (GH-150212)

The `AC_PATH_TOOL` calls had included a duplicated argument, causing a "`PATH`"
consisting of `notfound` to be searched instead of `$PATH`.
(cherry picked from commit c613f72eeef83340cb369287f7c1a195e086d1d5)

Co-authored-by: sendaoYan <yansendao@126.com>
2 weeks ago[3.15] gh-149819: fix .pth and .start file processing in subprocess when inheriting...
Miss Islington (bot) [Thu, 21 May 2026 22:31:41 +0000 (00:31 +0200)] 
[3.15] gh-149819: fix .pth and .start file processing in subprocess when inheriting PYTHONPATH (GH-150177) (#150202)

gh-149819: fix .pth and .start file processing in subprocess when inheriting PYTHONPATH (GH-150177)

* gh-149819: Fix .pth files not loaded in Python subprocesses

After PR gh-149583 (Fix double evaluation of .pth and .site files in
venvs), .pth files are no longer loaded in subprocesses started with
subprocess.run([sys.executable, ...]).  The root cause: main() seeds
known_paths from removeduppaths() with all sys.path entries inherited
from the parent process.  addsitedir() then skips .pth processing for
every directory already in known_paths.

Fix:
- main(): call removeduppaths() for dedup but start known_paths as a
  fresh empty set, so that addsitedir() processes .pth files in every
  site-packages directory regardless of inherited sys.path.
- addsitedir(): move known_paths.add() before the sys.path.append and
  guard the append with 'sitedir not in sys.path' to avoid creating
  duplicate entries when called with a fresh known_paths.

This preserves the gh-75723 dedup guarantee while allowing subprocesses
to load .pth files.

* Fill out the tests for GH#149888

* Extend _make_start() and _make_pth() to take an optional `basedir` which is used instead of
 `site.tmpdir` if given.
* Add test_pth_processed_when_sitedir_already_on_path() to test the core GH#149819 bug: .pth files
  in subprocesses aren't handled if PYTHONPATH pointing to the .pth directory is inherited.
* Similarly add test_start_processed_when_sitedir_already_on_path() to verify that .start files in
  the same circumstances are also now processed.

* Update Lib/site.py

* Oops!  Remove redundant code

---------
(cherry picked from commit 3c298e2e385fc6f462abaada2fd680deb1a2b58e)

Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: BugBounty Mind <bugbounty-mind@deepseek.tui>
Co-authored-by: scoder <stefan_ml@behnel.de>
2 weeks ago[3.15] gh-107398: Fix tarfile stream mode exception when process the file with the...
Miss Islington (bot) [Thu, 21 May 2026 20:02:10 +0000 (22:02 +0200)] 
[3.15] gh-107398: Fix tarfile stream mode exception when process the file with the gzip extra field (GH-126304) (GH-150199)

(cherry picked from commit 65f99329edf5d0df3ee14d9a242e1a4c8b842211)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.15] gh-149219: Test `frozendict` in `Lib/test/test_crossinterp.py` (GH-149220...
Miss Islington (bot) [Thu, 21 May 2026 15:22:24 +0000 (17:22 +0200)] 
[3.15] gh-149219: Test `frozendict` in `Lib/test/test_crossinterp.py` (GH-149220) (#150186)

gh-149219: Test `frozendict` in `Lib/test/test_crossinterp.py` (GH-149220)
(cherry picked from commit c35b0f2b624ecc4d649a808acdb07a7fbcea60ac)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 weeks ago[3.15] gh-149981: Test lazy import corner cases with module-level `__getattr__` ...
sobolevn [Thu, 21 May 2026 09:53:00 +0000 (12:53 +0300)] 
[3.15] gh-149981: Test lazy import corner cases with module-level `__getattr__` (GH-149982) (#150185)

(cherry picked from commit 6dbf4ba403cd38d0219d3c7514f61c2ac8f6a74f)

2 weeks ago[3.15] Add summary table to the `unicodedata` doc (GH-149957) (#150161)
Miss Islington (bot) [Wed, 20 May 2026 20:10:21 +0000 (22:10 +0200)] 
[3.15] Add summary table to the `unicodedata` doc (GH-149957) (#150161)

(cherry picked from commit 87a879f4d0ec2e545e84c898c5ce452a6c87b09e)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.15] gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests...
Miss Islington (bot) [Wed, 20 May 2026 19:49:13 +0000 (21:49 +0200)] 
[3.15] gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (GH-134264) (#150137)

gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (GH-134264)

---------
(cherry picked from commit 9dcf94e906906ff39c7955227c2b044b515ee162)

Co-authored-by: Caleb <23644849+ctrlaltf2@users.noreply.github.com>
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>
2 weeks ago[3.15] gh-143387: Add news blurb for importlib.metadata highlighting the change....
Miss Islington (bot) [Wed, 20 May 2026 19:48:04 +0000 (21:48 +0200)] 
[3.15] gh-143387: Add news blurb for importlib.metadata highlighting the change. (GH-150169) (#150171)

gh-143387: Add news blurb for importlib.metadata highlighting the change. (GH-150169)
(cherry picked from commit cb3b4b98d8d141c9de0462a0fa7e227a2104c1c7)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
3 weeks ago[3.15] PEP 810 - Update some error strings (GH-150126) (#150135)
Miss Islington (bot) [Wed, 20 May 2026 15:17:28 +0000 (17:17 +0200)] 
[3.15] PEP 810 - Update some error strings (GH-150126) (#150135)

3 weeks ago[3.15] gh-150146: Fix NULL dereference in `_Py_subs_parameters` (GH-150147) (#150153)
Miss Islington (bot) [Wed, 20 May 2026 13:55:30 +0000 (15:55 +0200)] 
[3.15] gh-150146: Fix NULL dereference in `_Py_subs_parameters` (GH-150147) (#150153)

gh-150146: Fix NULL dereference in `_Py_subs_parameters` (GH-150147)
(cherry picked from commit f621ba16b72510e1abc9646a844a632df4ac275c)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-150034: Print JSONL filename when profiling finishes (GH-150035) (#150151)
Miss Islington (bot) [Wed, 20 May 2026 12:00:49 +0000 (14:00 +0200)] 
[3.15] gh-150034: Print JSONL filename when profiling finishes (GH-150035) (#150151)

3 weeks ago[3.15] gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache...
Miss Islington (bot) [Wed, 20 May 2026 11:59:10 +0000 (13:59 +0200)] 
[3.15] gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior (GH-149649) (#150152)

3 weeks ago[3.15] gh-149807: Fix hash(frozendict): compute (key, value) pair hash (GH-149841...
Miss Islington (bot) [Wed, 20 May 2026 11:51:54 +0000 (13:51 +0200)] 
[3.15] gh-149807: Fix hash(frozendict): compute (key, value) pair hash (GH-149841) (#150149)

gh-149807: Fix hash(frozendict): compute (key, value) pair hash (GH-149841)
(cherry picked from commit 244300162d2e863a0588d1754e224d68931ada37)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.15] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#150150)
Miss Islington (bot) [Wed, 20 May 2026 11:48:24 +0000 (13:48 +0200)] 
[3.15] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#150150)

gh-148260: Use at least 1 MiB stack size on musl (GH-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.
(cherry picked from commit df6c157e51430e8e7458012417c534ad8c33119f)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.15] gh-143387: Update docs to reflect the behavior and note the changed version...
Miss Islington (bot) [Wed, 20 May 2026 01:03:47 +0000 (03:03 +0200)] 
[3.15] gh-143387: Update docs to reflect the behavior and note the changed version. (GH-150095) (#150106)

gh-143387: Update docs to reflect the behavior and note the changed version. (GH-150095)
(cherry picked from commit 192796cfd4793cd7c9e88261795394ab016d5984)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
3 weeks ago[3.15] gh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related...
Miss Islington (bot) [Wed, 20 May 2026 01:00:54 +0000 (03:00 +0200)] 
[3.15] gh-72088: clarify `inspect.ismethod` and `inspect.isfunction` (and related) usage with class-level access (GH-150013) (GH-150119)

(cherry picked from commit 0aa59ce2d4f007a9d19740eb2f6230ed302096f7)

Co-authored-by: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
Co-authored-by: CHINMAY <89741289+Das-Chinmay@users.noreply.github.com>
3 weeks ago[3.15] gh-134887: Add references to `locale` module for locale-aware number formattin...
Miss Islington (bot) [Wed, 20 May 2026 00:54:59 +0000 (02:54 +0200)] 
[3.15] gh-134887: Add references to `locale` module for locale-aware number formatting references in `string` module docs (GH-134888) (GH-150120)

(cherry picked from commit 47723af4e74ae1a65108837fe15795e2f70f9d02)

Co-authored-by: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
3 weeks ago[3.15] gh-150042: queue.SimpleQueue.put: fix minor refleak. (GH-150043) (GH-150127)
Miss Islington (bot) [Wed, 20 May 2026 00:46:42 +0000 (02:46 +0200)] 
[3.15] gh-150042: queue.SimpleQueue.put: fix minor refleak. (GH-150043) (GH-150127)

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.
(cherry picked from commit 79088e0d82931c21fa72eadc416a18b7b0fdf9c1)

Co-authored-by: larryhastings <larry@hastings.org>
3 weeks ago[3.15] gh-150114: Reduce memory usage of test_free_threading.test_iteration (gh-15011...
Miss Islington (bot) [Tue, 19 May 2026 22:05:19 +0000 (00:05 +0200)] 
[3.15] gh-150114: Reduce memory usage of test_free_threading.test_iteration (gh-150115) (#150124)

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

(cherry picked from commit 61f12211fc40aef4a2dcccb9c94aae8108042edb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 weeks ago[3.15] gh-150052: Resolve un-loaded lazily loaded submodules via module.__getattr__...
Dino Viehland [Tue, 19 May 2026 21:23:30 +0000 (14:23 -0700)] 
[3.15] gh-150052: Resolve un-loaded lazily loaded submodules via module.__getattr__ instead of publishing lazy values (#150055)

3 weeks ago[3.15] gh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984...
Miss Islington (bot) [Tue, 19 May 2026 21:11:13 +0000 (23:11 +0200)] 
[3.15] gh-149983: Fix PyErr_NoMemory call without GIL in winconsoleio.c (GH-149984) (GH-150113)

(cherry picked from commit 3d2aa899bad1c0e274640dc0c4323f1744e73435)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
3 weeks ago[3.15] gh-124111: Keep tests passing for Tcl prior to 9.0 (GH-150102)
Miss Islington (bot) [Tue, 19 May 2026 20:57:21 +0000 (22:57 +0200)] 
[3.15] 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).
(cherry picked from commit ec9ce3ee98c68f235be6d075fa4bbd8f56d20256)

Co-authored-by: Steve Dower <steve.dower@python.org>
3 weeks ago[3.15] gh-149945: Fix potential OOM for gzip with large header (GH-149979) (GH-150093)
Miss Islington (bot) [Tue, 19 May 2026 20:38:47 +0000 (22:38 +0200)] 
[3.15] gh-149945: Fix potential OOM for gzip with large header (GH-149979) (GH-150093)

Do not read the whole filename and comment to memory for calculating the CRC.
(cherry picked from commit 51a5715df9c56f616944cf1b39323bd6ae009143)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 weeks ago[3.15] gh-69619: Clarify whitespace definition in str.strip docs (#150049)
Miss Islington (bot) [Tue, 19 May 2026 17:48:48 +0000 (19:48 +0200)] 
[3.15] gh-69619: Clarify whitespace definition in str.strip docs (#150049)

(cherry picked from commit 17eb17d43f66a0f7985fca05c7c9684bc01fabcd)

Co-authored-by: Daniil <d.mayorov@innopolis.university>
3 weeks ago[3.15] gh-146581: Update docs for dangerous filenames in ZIP files (GH-149994) (GH...
Miss Islington (bot) [Tue, 19 May 2026 08:44:35 +0000 (10:44 +0200)] 
[3.15] gh-146581: Update docs for dangerous filenames in ZIP files (GH-149994) (GH-150064)

gh-146581: Update docs for dangerous filenames in ZIP files (GH-149994)
(cherry picked from commit ba0aca3bffce431fe2fbd53ca4cd6a717a2e2c19)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Sebastian Gassner <sebastian.gassner@gmail.com>
3 weeks ago[3.15] gh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011...
Miss Islington (bot) [Tue, 19 May 2026 05:10:01 +0000 (07:10 +0200)] 
[3.15] gh-86533: Restore os.makedirs() ability to apply *mode* recursively (GH-150011) (#150036)

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

+ Make Path.mkdir parent_mode tests umask-independent

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.

---------

Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 weeks ago[3.15] gh-149816: fix `dict.clear()` race on split-table dict with non-embedded value...
Miss Islington (bot) [Tue, 19 May 2026 04:42:25 +0000 (06:42 +0200)] 
[3.15] gh-149816: fix `dict.clear()` race on split-table dict with non-embedded values (GH-149914) (#150000)

gh-149816: fix `dict.clear()` race on split-table dict with non-embedded values (GH-149914)
(cherry picked from commit 169285470630b697c5e6e0e4c8091c31f25ffb04)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 weeks ago[3.15] gh-149816: fix thread safety of deletion of list slice (GH-149936) (#150003)
Miss Islington (bot) [Tue, 19 May 2026 04:41:43 +0000 (06:41 +0200)] 
[3.15] gh-149816: fix thread safety of deletion of list slice (GH-149936) (#150003)

gh-149816: fix thread safety of deletion of list slice (GH-149936)
(cherry picked from commit 00ea77613b942a9e08df6e3eb74b2ccd37641ba6)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 weeks ago[3.15] gh-148587: Make sys.lazy_modules match PEP and keep internal lazy submodules...
Dino Viehland [Tue, 19 May 2026 00:53:54 +0000 (17:53 -0700)] 
[3.15] gh-148587: Make sys.lazy_modules match PEP and keep internal lazy submodules tra… (#150014)

Make sys.lazy_modules match PEP and keep internal lazy submodules tracking internal

3 weeks ago[3.15] gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix...
Miss Islington (bot) [Mon, 18 May 2026 23:53:57 +0000 (01:53 +0200)] 
[3.15] gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (GH-150025) (#150039)

gh-146452: Improve locking granularity in pickle's batch_dict_exact and fix race condition (GH-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.
(cherry picked from commit 57a0e570d36f41b953a91bbaf4262a5d05d0391b)

Co-authored-by: Saul Cooperman <58375603+scopreon@users.noreply.github.com>
3 weeks ago[3.15] gh-149590: Remove faulthandler_traverse (GH-150023) (#150037)
Miss Islington (bot) [Mon, 18 May 2026 23:28:04 +0000 (01:28 +0200)] 
[3.15] gh-149590: Remove faulthandler_traverse (GH-150023) (#150037)

gh-149590: Remove faulthandler_traverse (GH-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.
(cherry picked from commit 56737483c2ffdaadfec648fd38d409c6b10941c0)

Co-authored-by: Armaan Vakharia <43391096+armaan-v924@users.noreply.github.com>
3 weeks ago[3.15] gh-95816: Fix TLS version range example in docs (GH-148574) (#150008)
Miss Islington (bot) [Mon, 18 May 2026 21:47:19 +0000 (23:47 +0200)] 
[3.15] gh-95816: Fix TLS version range example in docs (GH-148574) (#150008)

gh-95816: Fix TLS version range example in docs (GH-148574)

docs(ssl): Fix TLS version range example
(cherry picked from commit dbd8985e8262055ed091de9a72660b7c112a4ce7)

Co-authored-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
3 weeks ago[3.15] gh-149977: Fix extra output of `-m test test_lazy_import` (GH-149978) (#150016)
Miss Islington (bot) [Mon, 18 May 2026 19:24:06 +0000 (21:24 +0200)] 
[3.15] gh-149977: Fix extra output of `-m test test_lazy_import` (GH-149978) (#150016)

gh-149977: Fix extra output of `-m test test_lazy_import` (GH-149978)
(cherry picked from commit 6d5be4b1d6ca91a18e76ae8dad2c5e94837d6309)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-149816: Fix a RC in `_random.Random.__init__` method (GH-149824) (#149997)
Miss Islington (bot) [Mon, 18 May 2026 16:16:55 +0000 (18:16 +0200)] 
[3.15] gh-149816: Fix a RC in `_random.Random.__init__` method (GH-149824) (#149997)

gh-149816: Fix a RC in `_random.Random.__init__` method (GH-149824)
(cherry picked from commit 14af19e6c0d9dd05b525596fdd53373f726253d8)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
Miss Islington (bot) [Mon, 18 May 2026 13:52:17 +0000 (15:52 +0200)] 
[3.15] gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)

gh-149887: Install python3t.lib for GIL-enabled Windows install (GH-149900)
(cherry picked from commit bd6bf91fcba8a8fba8b9aea6cc971333c9be3ad9)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
3 weeks ago[3.15] gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956...
Miss Islington (bot) [Mon, 18 May 2026 09:00:19 +0000 (11:00 +0200)] 
[3.15] gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956) (#149976)

gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956)

Move  check before
(cherry picked from commit 0ed497a350d76dd20de1a1689c84426c7c1d6e22)

Co-authored-by: Nezuko Agent <nezukoagent@gmail.com>
3 weeks ago[3.15] gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules...
Miss Islington (bot) [Sun, 17 May 2026 11:01:15 +0000 (13:01 +0200)] 
[3.15] gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (GH-149922) (#149943)

gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (GH-149922)
(cherry picked from commit acefff95eab3db6b7cf837f3ce2707bbf9199376)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
3 weeks ago[3.15] gh-149916: Restore the commented out part of test_body_encode in test_email...
Miss Islington (bot) [Sun, 17 May 2026 08:33:11 +0000 (10:33 +0200)] 
[3.15] gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917) (GH-149937)

(cherry picked from commit 1cbe035723698f15aa1b1af5deef615b28aae2e5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 weeks ago[3.15] gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading...
Miss Islington (bot) [Sat, 16 May 2026 09:06:14 +0000 (11:06 +0200)] 
[3.15] gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (GH-149909) (#149911)

gh-149816: Fix a race condition in `_PyBytes_FromList` with free-threading (GH-149909)
(cherry picked from commit 46afba7b9324bc9492c3527d0fe47dd74f1f598c)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-142349: Add `help("lazy")` support (GH-149886) (#149889)
Miss Islington (bot) [Fri, 15 May 2026 16:57:59 +0000 (18:57 +0200)] 
[3.15] gh-142349: Add `help("lazy")` support (GH-149886) (#149889)

gh-142349: Add `help("lazy")` support (GH-149886)
(cherry picked from commit 8be3fb1b50ce6b01bf0924f0a0362a5e04af83b4)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)
Miss Islington (bot) [Fri, 15 May 2026 14:12:05 +0000 (16:12 +0200)] 
[3.15] gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847)

(cherry picked from commit 1c5fe21eb2a65190c04bb3f4c0931d76f5ccf415)

Co-authored-by: Steve Dower <steve.dower@python.org>
3 weeks ago[3.15] gh-138489: Add build-details.json generation to PC/layout (GH-149153)
Miss Islington (bot) [Fri, 15 May 2026 13:19:39 +0000 (15:19 +0200)] 
[3.15] gh-138489: Add build-details.json generation to PC/layout (GH-149153)

(cherry picked from commit 4aa296f9c4a85a7badc09bf7ca6ede36cd8cd14c)

Co-authored-by: Steve Dower <steve.dower@python.org>
3 weeks ago[3.15] gh-149816: Fix race condition in `memoryview` with free-threading (GH-149858...
Miss Islington (bot) [Fri, 15 May 2026 13:07:18 +0000 (15:07 +0200)] 
[3.15] gh-149816: Fix race condition in `memoryview` with free-threading (GH-149858) (#149875)

gh-149816: Fix race condition in `memoryview` with free-threading (GH-149858)
(cherry picked from commit 1fdf0337742762cc47837042747cc607f024a202)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804...
Miss Islington (bot) [Fri, 15 May 2026 12:08:15 +0000 (14:08 +0200)] 
[3.15] gh-149801: Add IANA registered names and aliases with leading zeros (GH-149804) (GH-149870)

Like IBM00858, CP00858, IBM01140, CP01140.
(cherry picked from commit 20438866aefc2e63949d8bb85d8f8e55633fd977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 weeks ago[3.15] gh-148675: Use a string for ctypes cparam tag (GH-149778) (#149869)
Miss Islington (bot) [Fri, 15 May 2026 11:52:55 +0000 (13:52 +0200)] 
[3.15] gh-148675: Use a string for ctypes cparam tag (GH-149778) (#149869)

gh-148675: Use a string for ctypes cparam tag (GH-149778)
(cherry picked from commit 3ecca22567249ae44bf4369fbdb4d6d056701405)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.15] gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791) (#149865)
Victor Stinner [Fri, 15 May 2026 11:36:21 +0000 (13:36 +0200)] 
[3.15] gh-149707: Fix compiler warning in _ctypes_test on strchr() (#149791) (#149865)

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*".

(cherry picked from commit 5465b69255890650df99debb8256e0a7bc68138b)

3 weeks ago[3.15] gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648) (#149792)
Miss Islington (bot) [Fri, 15 May 2026 10:50:45 +0000 (12:50 +0200)] 
[3.15] gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648) (#149792)

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)
(cherry picked from commit eac4fe3b2c77693790a5ef7dfab127c1fee81bf9)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
3 weeks ago[3.15] gh-149763: Improve availablity docs in `select.rst` (GH-149764) (#149854)
Miss Islington (bot) [Fri, 15 May 2026 07:24:43 +0000 (09:24 +0200)] 
[3.15] gh-149763: Improve availablity docs in `select.rst` (GH-149764) (#149854)

gh-149763: Improve availablity docs in `select.rst` (GH-149764)
(cherry picked from commit 7e98debdf4bfcf1c3f592c9424bc654117c2723e)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.15] gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-14915...
Miss Islington (bot) [Thu, 14 May 2026 22:38:11 +0000 (00:38 +0200)] 
[3.15] gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157) (GH-149846)

gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157)
(cherry picked from commit 461b1d96313de02992d284c1782be9aff24586c9)

Co-authored-by: Seth Larson <seth@python.org>
3 weeks ago[3.15] gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149842)
Miss Islington (bot) [Thu, 14 May 2026 18:49:29 +0000 (20:49 +0200)] 
[3.15] gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149842)

(cherry picked from commit c62c3710dc795a60c3c3dc8e2aeeeb16c06da197)

Co-authored-by: Zachary Ware <zach@python.org>
3 weeks ago[3.15] gh-149231: Revert extra NEWS entry (GH-149840)
Petr Viktorin [Thu, 14 May 2026 17:16:23 +0000 (19:16 +0200)] 
[3.15] gh-149231: Revert extra NEWS entry (GH-149840)

gh-149231: Revert extra NEWS entry

This reverts commit dc7cad2f5db834aefb5ecabebc6f25bbb898381b.

3 weeks ago[3.15] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149836)
Miss Islington (bot) [Thu, 14 May 2026 17:09:05 +0000 (19:09 +0200)] 
[3.15] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149836)

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.
(cherry picked from commit c37529293d1e05081cb4e8668162c76583b88007)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
3 weeks ago[3.15] gh-148821: Add more tests for invalid XML encodings (GH-149820) (GH-149821)
Miss Islington (bot) [Thu, 14 May 2026 10:37:11 +0000 (12:37 +0200)] 
[3.15] gh-148821: Add more tests for invalid XML encodings (GH-149820) (GH-149821)

(cherry picked from commit c6f7368157ecf9f2cdd537d8b6fad6e011bce344)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 weeks ago[3.15] gh-149698: Update bundled expat to 2.8.1 (GH-149699) (#149812)
Miss Islington (bot) [Thu, 14 May 2026 08:52:51 +0000 (10:52 +0200)] 
[3.15] gh-149698: Update bundled expat to 2.8.1 (GH-149699) (#149812)

(cherry picked from commit f1a47e79fb7081d3cde6364530bfa98240ebbe4c)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks ago[3.15] Fix incorrect sentence in stable.rst (GH-149684) (GH-149814)
Miss Islington (bot) [Wed, 13 May 2026 23:34:59 +0000 (01:34 +0200)] 
[3.15] Fix incorrect sentence in stable.rst (GH-149684) (GH-149814)

(cherry picked from commit 374f9d3f5e70d2204d88ab123f29825d71537de2)

Co-authored-by: Manoj K M <manojkmdev24@gmail.com>
3 weeks ago[3.15] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149677)
Miss Islington (bot) [Wed, 13 May 2026 23:24:29 +0000 (01:24 +0200)] 
[3.15] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149677)

(cherry picked from commit bc7c102f3462a9f014f3ac2546acfb471b2a7eae)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks ago[3.15] gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.add sitedir...
Barry Warsaw [Wed, 13 May 2026 22:45:39 +0000 (15:45 -0700)] 
[3.15] gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.add sitedir() (#149659) (#149799)

* 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

(cherry picked from commit b162307d7f216e87976d76c9b8f4a932961cb2d4)

* Add myself back to CODEOWNERS

3 weeks ago[3.15] gh-140550: Update xxlimited with 3.15 limited API (GH-142827) (GH-149785)
Miss Islington (bot) [Wed, 13 May 2026 22:00:29 +0000 (00:00 +0200)] 
[3.15] gh-140550: Update xxlimited with 3.15 limited API (GH-142827) (GH-149785)

(cherry picked from commit fa81cd976ad88e022839a37501d75d8716e22e3b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
3 weeks ago[3.15] gh-149685: Use the _Py prefix for private C macros (GH-149686) (GH-149790)
Miss Islington (bot) [Wed, 13 May 2026 21:29:08 +0000 (23:29 +0200)] 
[3.15] gh-149685: Use the _Py prefix for private C macros (GH-149686) (GH-149790)

(cherry picked from commit 125f26358ac7ecab98095fa85490e5465bdad698)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
3 weeks ago[3.15] gh-128110: Fix rfc2047 whitespace handling in email parser address headers...
Miss Islington (bot) [Wed, 13 May 2026 20:26:42 +0000 (22:26 +0200)] 
[3.15] gh-128110: Fix rfc2047 whitespace handling in email parser address headers (GH-130749) (#149787)

RFC 2047 Section 6.2 requires that "any 'linear-white-space' that
separates a pair of adjacent 'encoded-word's is ignored." The modern
header value parser correctly implements that for unstructured headers,
but had missed a case in structured headers. This could cause a parsed
address header to include extraneous spaces in a display-name.

Switch to @bitdancer's fix from review feedback. Recharacterize space
between ews as fws after parsing in get_phrase.

RDM: This fix is dependent on the fact that "subsequent" atoms will never have
leading whitespace because that's been consumed already. I don't think
it's worth adding extra code for the possibility of leading whitespace
because the parser won't produce it. It's a bit of parser fragility in the
face of code changes, but I think that's a minor concern given the
parser design (which is that it consumes whitespace greedily)
(cherry picked from commit 7a4c6dfb8839eb05fb87baf70364680e45001dd4)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
3 weeks ago[3.15] gh-148906: fix performance scaling of descriptors on free-threading (GH-148915...
Miss Islington (bot) [Wed, 13 May 2026 18:09:33 +0000 (20:09 +0200)] 
[3.15] gh-148906: fix performance scaling of descriptors on free-threading (GH-148915) (#149798)

gh-148906: fix performance scaling of descriptors on free-threading (GH-148915)
(cherry picked from commit 94bca40ff09c20f6168d6a27e3aa42bf8a8077b8)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
4 weeks ago[3.15] gh-149776: Skip UDP Lite tests if it's not supported (GH-149777) (#149780)
Miss Islington (bot) [Wed, 13 May 2026 15:36:27 +0000 (17:36 +0200)] 
[3.15] gh-149776: Skip UDP Lite tests if it's not supported (GH-149777) (#149780)

gh-149776: Skip UDP Lite tests if it's not supported (GH-149777)

Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if
it's not supported.
(cherry picked from commit 3cfc249e11a132dc69624150843779aa96c72b2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 weeks ago[3.15] Run mypy with four worker processes and uv (GH-149726) (#149773)
Miss Islington (bot) [Wed, 13 May 2026 11:33:31 +0000 (13:33 +0200)] 
[3.15] Run mypy with four worker processes and uv (GH-149726) (#149773)

Run mypy with four worker processes and uv (GH-149726)
(cherry picked from commit 6304eb1f5b93f682bff558befe4a7b9585f4601e)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 weeks ago[3.15] gh-148821: Add more strict tests for XML encodings (GH-149765) (GH-149770)
Miss Islington (bot) [Wed, 13 May 2026 11:10:30 +0000 (13:10 +0200)] 
[3.15] gh-148821: Add more strict tests for XML encodings (GH-149765) (GH-149770)

Exclude encodings like 'utf-8-sig', 'iso2022-jp' and 'hz' from the list of
supported encodings.
(cherry picked from commit fa2afa64d9467fb7362672ed603d29d8e246d240)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 weeks ago[3.15] bpo-45509: Check gzip headers for corrupted fields (GH-29028) (GH-149769)
Miss Islington (bot) [Wed, 13 May 2026 10:54:10 +0000 (12:54 +0200)] 
[3.15] bpo-45509: Check gzip headers for corrupted fields (GH-29028) (GH-149769)

Check the header checksum it the HCRC field is present.
(cherry picked from commit dd94457893a1dd2c99c2405e197f54a7692cbe09)

Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
4 weeks ago[3.15] gh-148829: Add PySentinel_CheckExact() (GH-149725) (#149766)
Miss Islington (bot) [Wed, 13 May 2026 10:39:38 +0000 (12:39 +0200)] 
[3.15] gh-148829: Add PySentinel_CheckExact() (GH-149725) (#149766)

gh-148829: Add PySentinel_CheckExact() (GH-149725)
(cherry picked from commit 94df62542cdf1c9eb082abab1534cbd1fd425062)

Co-authored-by: scoder <stefan_ml@behnel.de>
4 weeks ago[3.15] gh-149701: Fully silence potential `hash -r` error (GH-149702) (GH-149757)
Miss Islington (bot) [Wed, 13 May 2026 09:28:27 +0000 (11:28 +0200)] 
[3.15] gh-149701: Fully silence potential `hash -r` error (GH-149702) (GH-149757)

(cherry picked from commit cd6096887e22cdb6d6365ad0eb5b0ffac50d4791)

4 weeks ago[3.15] gh-149642: Fix interaction between exec and lazy_imports=all (GH-149643) ...
Miss Islington (bot) [Wed, 13 May 2026 03:36:32 +0000 (05:36 +0200)] 
[3.15] gh-149642: Fix interaction between exec and lazy_imports=all (GH-149643) (#149749)

gh-149642: Fix interaction between exec and lazy_imports=all (GH-149643)
(cherry picked from commit 4087ff859958abc897711b501bb66dc308890ba5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4 weeks ago[3.15] gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass...
Miss Islington (bot) [Wed, 13 May 2026 03:08:49 +0000 (05:08 +0200)] 
[3.15] gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (GH-149604) (#149750)

gh-149574: Document that is_typeddict, is_protocol, is_dataclass, isclass return False for generic aliases (GH-149604)
(cherry picked from commit a4e51c8dac9fdd49ae26ff8c6cd3c808fd8ba15e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4 weeks ago[3.15] gh-149718: Aggregate same stack frames in Tachyon in some collectors (GH-14971...
Miss Islington (bot) [Wed, 13 May 2026 00:30:22 +0000 (02:30 +0200)] 
[3.15] gh-149718: Aggregate same stack frames in Tachyon in some collectors (GH-149719) (#149747)

gh-149718: Aggregate same stack frames in Tachyon in some collectors (GH-149719)
(cherry picked from commit 76f22853410d3ded872cbfe1430852cf8c048962)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
4 weeks ago[3.15] gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set...
Miss Islington (bot) [Tue, 12 May 2026 21:25:21 +0000 (23:25 +0200)] 
[3.15] gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579) (#149745)

gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579)

gh-149496: Fix MacOSTest.test_default failing when BROWSER env var is set

MacOSTest.test_default calls webbrowser.get() and asserts it returns a
MacOS instance. When BROWSER is set in the environment (e.g. BROWSER=open,
a common macOS workaround for the old osascript-based implementation),
register_standard_browsers() registers a GenericBrowser as the preferred
browser instead, causing the assertion to fail.

This is a regression introduced in gh-137586, which added MacOSTest and
moved test_default into it from MacOSXOSAScriptTest. MacOSXOSAScriptTest
had an identical setUp() guard added in gh-131254 specifically to fix this
same failure. The guard was not carried over to MacOSTest.

Add setUp() to MacOSTest to unset BROWSER for the duration of each test,
restoring the isolation that was already established as the correct pattern
for macOS webbrowser tests.
(cherry picked from commit 45c47d26c230086163ac1ef0aa9f955f794fb69c)

Co-authored-by: Jeff Lyon <146767590+secengjeff@users.noreply.github.com>
4 weeks ago[3.15] gh-134837: Correct and improve base85 documentation for base64 and binascii...
Miss Islington (bot) [Tue, 12 May 2026 20:25:28 +0000 (22:25 +0200)] 
[3.15] gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843) (GH-149742)

(cherry picked from commit e667d62f114b54dcba17bdfad3835b9c91fda348)

Co-authored-by: David Huggins-Daines <dhd@ecolingui.ca>
4 weeks ago[3.15] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864...
Miss Islington (bot) [Tue, 12 May 2026 20:10:24 +0000 (22:10 +0200)] 
[3.15] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864) (#149730)

gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864)

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
(cherry picked from commit da8477b25c6124c961306d4d7cd5ec7dafda6be4)

Co-authored-by: stratakis <cstratak@redhat.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
4 weeks ago[3.15] GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (GH-149502) (#149737)
Miss Islington (bot) [Tue, 12 May 2026 17:58:31 +0000 (19:58 +0200)] 
[3.15] GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (GH-149502) (#149737)

GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (GH-149502)
(cherry picked from commit 1a79fd0ad650f0a0f21f653cc46a89bc1741d253)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
4 weeks ago[3.15] gh-149694: Fix missing docstring on `asyncio.iscoroutinefunction` (#149696)
deadlovelll [Tue, 12 May 2026 17:22:36 +0000 (20:22 +0300)] 
[3.15] gh-149694: Fix missing docstring on `asyncio.iscoroutinefunction` (#149696)

4 weeks ago[3.15] Remove myself from CODEOWNERS (GH-149727) (#149732)
Miss Islington (bot) [Tue, 12 May 2026 16:09:41 +0000 (18:09 +0200)] 
[3.15] Remove myself from CODEOWNERS (GH-149727) (#149732)

Remove myself from CODEOWNERS (GH-149727)

(cherry picked from commit 058c12528d98954c44d6f92f2eea48b881c1967f)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
4 weeks ago[3.15] gh-149676: Fix hash(frozendict | frozendict) (GH-149675) (#149717)
Miss Islington (bot) [Tue, 12 May 2026 13:57:02 +0000 (15:57 +0200)] 
[3.15] gh-149676: Fix hash(frozendict | frozendict) (GH-149675) (#149717)

gh-149676: Fix hash(frozendict | frozendict) (GH-149675)

Fix new_dict_impl() to properly initialize ma_hash on frozendict.
(cherry picked from commit f5fb491341e566bbaf17d9bf3e4ec3af4a56bb3f)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
4 weeks ago[3.15] Update mypy to 2.1.0 (GH-149709) (#149711)
Miss Islington (bot) [Tue, 12 May 2026 09:09:52 +0000 (11:09 +0200)] 
[3.15] Update mypy to 2.1.0 (GH-149709) (#149711)

Update mypy to 2.1.0 (GH-149709)
(cherry picked from commit b546cc10f5c659344ce3cf49db6d9c92307ed1fc)

Co-authored-by: sobolevn <mail@sobolevn.me>
4 weeks ago[3.15] gh-148669: Clarify `__reduce__()` module lookup behavior (GH-148670) (#149703)
Miss Islington (bot) [Tue, 12 May 2026 02:54:10 +0000 (04:54 +0200)] 
[3.15] gh-148669: Clarify `__reduce__()` module lookup behavior (GH-148670) (#149703)

gh-148669: Clarify `__reduce__()` module lookup behavior (GH-148670)
(cherry picked from commit 54a5fd4126df74f7b84d1f8a6a36ef79803f66f9)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
4 weeks ago[3.15] gh-149614 - Restore deepcopiability of argparse.ArgumentParser… (#149693)
Savannah Ostrowski [Mon, 11 May 2026 18:25:40 +0000 (11:25 -0700)] 
[3.15] gh-149614 - Restore deepcopiability of argparse.ArgumentParser… (#149693)

[3.15] gh-149614 - Restore deepcopiability of argparse.ArgumentParser instances (GH-149617)
(cherry picked from commit fadd9bc14e43041c84bb8d06824990264fe1434a)

Co-authored-by: David Ellis <ducksual@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 weeks ago[3.15] gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh...
Sam Gross [Mon, 11 May 2026 18:23:39 +0000 (18:23 +0000)] 
[3.15] gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233) (#149690)

In free-threaded builds, concurrent calls to PyDict_AddWatcher, PyDict_ClearWatcher, PyDict_Watch, and PyDict_Unwatch can race on the shared callback array and the per-dict watcher tags. This change adds a mutex to serialize watcher registration and removal, atomic operations for tag updates, and atomic acquire/release synchronization for callback dispatch in _PyDict_SendEvent.

(cherry picked from commit 8a4895985f42282504d83b9bd0c77b129f95a5d5)

Co-authored-by: Alper <alperyoney@fb.com>
4 weeks ago[3.15] gh-112821: Fix rlcompleter failures on objects with descriptors (GH-149577...
Miss Islington (bot) [Mon, 11 May 2026 16:07:50 +0000 (18:07 +0200)] 
[3.15] gh-112821: Fix rlcompleter failures on objects with descriptors (GH-149577) (#149656)

gh-112821: Fix rlcompleter failures on objects with descriptors (GH-149577)

* gh-112821: Fix rlcompleter failures on objects with descriptors

* Confirm no accesses
(cherry picked from commit f23a1837d7156c4c478528321a423eae2b31e4bf)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
4 weeks ago[3.15] gh-144957: Fix lazy imports + module __getattr__ (GH-149624) (#149678)
Miss Islington (bot) [Mon, 11 May 2026 13:36:35 +0000 (15:36 +0200)] 
[3.15] gh-144957: Fix lazy imports + module __getattr__ (GH-149624) (#149678)

gh-144957: Fix lazy imports + module __getattr__ (GH-149624)
(cherry picked from commit 56171da3417bc14fded2f42033d72f63e1bf7cd9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4 weeks ago[3.15] gh-149663: fix typo in `unittest` docs (GH-149670) (#149672)
Miss Islington (bot) [Mon, 11 May 2026 12:02:28 +0000 (14:02 +0200)] 
[3.15] gh-149663: fix typo in `unittest` docs (GH-149670) (#149672)

gh-149663: fix typo in `unittest` docs (GH-149670)

`hastattr` -> `hasattr`
(cherry picked from commit 4956d2be9d5e555f2cf64faed9ef39e6a797c360)

Co-authored-by: Árni Már Jónsson <arnimarj@gmail.com>
4 weeks ago[3.15] gh-146061: Clarify indent=None in json docs (GH-146095) (GH-149667)
Miss Islington (bot) [Mon, 11 May 2026 11:44:11 +0000 (13:44 +0200)] 
[3.15] gh-146061: Clarify indent=None in json docs (GH-146095) (GH-149667)

(cherry picked from commit 833dae7c1fdc556200cbfc3e76bad4d54628042c)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
4 weeks ago[3.15] gh-149486: tarfile.data_filter: validate written link target (GH-149487) ...
Miss Islington (bot) [Mon, 11 May 2026 09:57:32 +0000 (11:57 +0200)] 
[3.15] gh-149486: tarfile.data_filter: validate written link target (GH-149487) (GH-149553)

gh-149486: tarfile.data_filter: validate written link target (GH-149487)

The data filter rewrote linknames with normpath() but ran the
containment check against the un-normalised value, and computed a
symlink's directory before stripping trailing slashes.  Both let a
crafted archive create links pointing outside the destination.  Also
reject link members that resolve to the destination directory itself,
which could otherwise replace it with a symlink and redirect all
subsequent members.

(cherry picked from commit 578411982c16f753f4893532510099ef665117da)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
4 weeks ago[3.15] gh-149083: use sentinel to fix _functools.reduce() signature (GH-149591) ...
Miss Islington (bot) [Sun, 10 May 2026 23:32:35 +0000 (01:32 +0200)] 
[3.15] gh-149083: use sentinel to fix _functools.reduce() signature (GH-149591) (#149653)

gh-149083: use sentinel to fix _functools.reduce() signature (GH-149591)
(cherry picked from commit c6fd7de64ac7591a9708c14a34737eb9baf050bc)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
4 weeks ago[3.15] gh-139489: Add is_valid_text to xml.__all__ (GH-149641) (#149652)
Miss Islington (bot) [Sun, 10 May 2026 21:11:04 +0000 (23:11 +0200)] 
[3.15] gh-139489: Add is_valid_text to xml.__all__ (GH-149641) (#149652)

gh-139489: Add is_valid_text to xml.__all__ (GH-149641)
(cherry picked from commit b45319e13273ee17e84e6b8c459f03b141518289)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4 weeks ago[3.15] gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904...
Miss Islington (bot) [Sun, 10 May 2026 14:11:57 +0000 (16:11 +0200)] 
[3.15] gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904) (#149639)

gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904)
(cherry picked from commit bc1be4f6174086b4a46e3fe656552f5bb4e6e7b2)

Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
4 weeks ago[3.15] gh-139871: Fix 3.15 bytearray.take_bytes example (GH-149520) (#149622)
Miss Islington (bot) [Sat, 9 May 2026 21:47:21 +0000 (23:47 +0200)] 
[3.15] gh-139871: Fix 3.15 bytearray.take_bytes example (GH-149520) (#149622)

gh-139871: Fix 3.15 bytearray.take_bytes example (GH-149520)

Currently:
```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    assert data == b'abc'
           ^^^^^^^^^^^^^^
AssertionError
```

Adding in the `\n` makes the two match:

```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc\n'
assert buffer == bytearray(b'def')

buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = buffer.take_bytes(n + 1)
assert data == b'abc\n'
assert buffer == bytearray(b'def')
```
(cherry picked from commit cc5cf14ae0a3665ba9d192cc4152c0a46a9dab2f)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>