]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
10 days ago[3.14] gh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH...
Miss Islington (bot) [Fri, 19 Jun 2026 16:08:03 +0000 (18:08 +0200)] 
[3.14] gh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH-151732) (GH-151738)

Cover previously-untested methods of the Misc, Wm, Pack, Place and Grid
classes:

* a new WinfoTest class for the winfo_* query methods (class, name,
  parent, children, toplevel, visual and screen information, atoms,
  pointer and screen coordinates, fpixels, containing, interps,
  viewable), including the pre-existing winfo_rgb and winfo_pathname;
* in MiscTest: getint, getdouble, getvar, register, deletecommand,
  option_add/get/clear, nametowidget, the focus_*, grab_* and
  selection_own* methods, event_add/delete/info, and bell;
* in WmTest: title, geometry, minsize/maxsize, resizable, aspect, grid,
  positionfrom/sizefrom, focusmodel, iconname, client/command,
  overrideredirect, state (with withdraw and deiconify), frame, group,
  protocol and transient;
* the short-named aliases of the grid_*, pack_* and place_* geometry
  manager methods.
(cherry picked from commit 23793ac211371415eaf9491fef031f121969dfb3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10 days ago[3.14] gh-150902: Optimize PyCriticalSection2 to skip locking the same locks held...
Miss Islington (bot) [Fri, 19 Jun 2026 13:51:55 +0000 (15:51 +0200)] 
[3.14] gh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the current CS2 (gh-151555)

This mimics an optimization already present for the single-mutex critical section.
(cherry picked from commit c2ca7724af94df6e078a4b2e86d1be8c410d9940)

Co-authored-by: Daniele Parmeggiani <8658291+dpdani@users.noreply.github.com>
10 days ago[3.14] gh-151693: Make the curses tests portable to other curses implementations...
Serhiy Storchaka [Fri, 19 Jun 2026 12:08:22 +0000 (15:08 +0300)] 
[3.14] gh-151693: Make the curses tests portable to other curses implementations (GH-151729) (GH-151731)

Guard the chgat() check (chgat() needs wchgat()) and stop assuming a
subpad shares the parent pad's cells (implementation-defined in X/Open).
(cherry picked from commit 64fab74bd7288bfa67cd7727452febdaafed4270)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151678: Add tests for the remaining tkinter widgets (GH-151687) (GH-151726)
Miss Islington (bot) [Fri, 19 Jun 2026 10:50:09 +0000 (12:50 +0200)] 
[3.14] gh-151678: Add tests for the remaining tkinter widgets (GH-151687) (GH-151726)

Cover previously-untested methods of several widgets:

* Button, Checkbutton and Radiobutton: invoke, flash and toggle;
* Entry: delete, icursor and the select_* aliases;
* Spinbox: invoke, identify and scan;
* Scale and Scrollbar: identify, and Scrollbar fraction and delta;
* PanedWindow: panes, remove/forget, sash and proxy positioning,
  identify, and adding panes with configuration options.

Also test that invoke does nothing for a disabled button and the
errors raised for invalid indices, coordinates, option names and values.
(cherry picked from commit 93b9e7666f4337e3cacfed6993568e4bec575e9b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151693: Add curses tests for panels, textpad, and window behavior (GH-15169...
Miss Islington (bot) [Fri, 19 Jun 2026 10:15:40 +0000 (12:15 +0200)] 
[3.14] gh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694) (GH-151720)

Add curses tests for panels, textpad, and window behavior

Extend test_curses with behavior-verifying tests that go beyond the
existing smoke tests:

* curses.panel stacking: new_panel/top/bottom/above/below ordering,
  hide/show/hidden, move, replace and userptr round-trip.
* Real-window curses.textpad.Textbox: gather(), edit(), stripspaces,
  insert mode and the Emacs-like editing commands (previously only
  exercised through a MagicMock).
* Window output: addstr cursor advance and addnstr truncation,
  insstr/insnstr shifting without cursor movement, and pad behavior
  (instr, subpad cell sharing, the required 6-argument refresh()).
* Error handling: out-of-range coordinates raising curses.error and
  bad character/string argument types.
(cherry picked from commit b4cfb992ed3a28b8cd626f70e3550ac8dbec1758)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151695: Fix use-after-free of the curses screen encoding (GH-151696) (GH...
Serhiy Storchaka [Fri, 19 Jun 2026 09:49:22 +0000 (12:49 +0300)] 
[3.14] gh-151695: Fix use-after-free of the curses screen encoding (GH-151696) (GH-151706)

The module-global curses_screen_encoding stored a borrowed pointer to the
encoding owned by the window returned by the first initscr() call.  That
window can be deallocated while unctrl() and ungetch(), which have no window
of their own, still use the pointer to encode non-ASCII characters.

Keep a private copy of the encoding instead.
(cherry picked from commit 551f8e16f8bb38a1e9c6df259a2a0969493de070)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151678: Add tests for tkinter.Canvas (GH-151683) (GH-151717)
Miss Islington (bot) [Fri, 19 Jun 2026 09:40:57 +0000 (11:40 +0200)] 
[3.14] gh-151678: Add tests for tkinter.Canvas (GH-151683) (GH-151717)

Cover previously-untested Canvas methods in CanvasTest:

* item creation and types, bbox, coordinate conversion, move/scale,
  find and addtag queries, tags, item configuration, stacking order,
  text-item editing, selection, focus, scan and postscript;
* the create_arc, create_oval, create_bitmap, create_image,
  create_text and create_window item creation methods, checking
  coordinates, default and explicit options, valid enumerations and
  rejection of invalid values;
* tag_bind() and tag_unbind(), checking the returned function id and
  binding script, querying bound sequences, the add parameter, event
  delivery to items via a tag, and removal of a single binding by id
  or all bindings for a sequence.
(cherry picked from commit bb127c5a96a285f1f6b11261c1f0dc2b3c7f70ff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151678: Add tests for tkinter.Listbox (GH-151686) (GH-151713)
Miss Islington (bot) [Fri, 19 Jun 2026 09:28:37 +0000 (11:28 +0200)] 
[3.14] gh-151678: Add tests for tkinter.Listbox (GH-151686) (GH-151713)

Cover previously-untested Listbox methods in ListboxTest: size, delete,
index resolution, nearest, see, activate, and the selection methods
(selection_set/clear/includes/anchor and their select_* aliases),
including the errors raised for invalid indices.
(cherry picked from commit cf3b3c11485a870d8e8c02579bed27a316838eb1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151678: Add tests for tkinter.Menu (GH-151685) (GH-151710)
Miss Islington (bot) [Fri, 19 Jun 2026 09:25:05 +0000 (11:25 +0200)] 
[3.14] gh-151678: Add tests for tkinter.Menu (GH-151685) (GH-151710)

Cover previously-untested Menu methods in MenuTest: adding, inserting and
deleting items of every type, index resolution, invoking items, entry x/y
positions, and post/unpost/tk_popup mapping.

Also test per-entry configuration options and the errors raised for
invalid indices, entry types, option names and option values.
(cherry picked from commit ef5c32a40be50a33a9b7ac39ee64e6893bc22f60)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151678: Add tests for tkinter.Text (GH-151681) (GH-151705)
Serhiy Storchaka [Fri, 19 Jun 2026 09:08:14 +0000 (12:08 +0300)] 
[3.14] gh-151678: Add tests for tkinter.Text (GH-151681) (GH-151705)

Cover previously-untested Text methods (indices, content, marks, tags,
undo/redo, dump, embedded images and windows, peers, and geometry) and
the tag, embedded-image and embedded-window configuration options.
(cherry picked from commit 4ac809e10bdb413d7dd8c7bab7e365b2b618ad91)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-151427: add 'not macOS' and 'not iOS' restrictions on availability state...
Miss Islington (bot) [Fri, 19 Jun 2026 08:18:23 +0000 (10:18 +0200)] 
[3.14] gh-151427: add  'not macOS' and 'not iOS' restrictions on availability state of some functions in `os` module. (GH-151537) (#151698)

(cherry picked from commit da69fcf98de500b1e10bdce41a05c904e345d89f)
Co-authored-by: Duprat <yduprat@gmail.com>
11 days ago[3.14] gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH...
Serhiy Storchaka [Thu, 18 Jun 2026 14:45:00 +0000 (17:45 +0300)] 
[3.14] gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655) (GH-151659)

It returns a sys.version_info-like named tuple, not a string.
(cherry picked from commit 3cd02a1c2da023974464fd1155982a16474f331b)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days ago[3.14] gh-86726: Document the full public API of tkinter (GH-151579) (GH-151650)
Miss Islington (bot) [Thu, 18 Jun 2026 13:10:22 +0000 (15:10 +0200)] 
[3.14] gh-86726: Document the full public API of tkinter (GH-151579) (GH-151650)

Replace the previously sparse reference documentation with full coverage of
the public API of the tkinter package, written from the Tcl/Tk manual pages,
the existing documentation and the module docstrings.

* Doc/library/tkinter.rst gains a "Reference" section documenting every public
  class, method, function and constant of the core module -- the widgets, the
  Misc, Wm, Pack, Place, Grid, XView and YView mix-ins, the Variable and image
  classes, the module-level functions and the symbolic constants.
* Doc/library/tkinter.ttk.rst, dialog.rst, tkinter.font.rst and the other
  module pages document their remaining classes, methods and functions.

The descriptions are Python-oriented (correct return types -- tuples rather
than Tcl lists, booleans, integers, None on cancellation, and so on) and were
checked against the Tcl/Tk 9.1 manual pages and the implementation.

versionadded, versionchanged and deprecated directives are added for the
public API, determined from the git history relative to Python 3.0: the
tkinter.ttk module (3.1); the Text, Wm, Menu and Misc methods exposing Tk 8.5
features (3.3); and the many later additions and behavior changes up to 3.15.
The Tk version required by features added after Tk 8.6 is noted as well.  The
bundled Tcl/Tk version is updated to 9.0 and the manual-page links point at
the tcl9.0 reference.

--------
(cherry picked from commit 8b270b72a2d20bf4b7fb457141cd68a38808f7d9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-86726: Adjust tkinter docs for the 3.14 backport

Remove documentation of API added only in 3.15 (the grid_content/
pack_content/place_content aliases, Text.search_all, the search
nolinestop/strictlimits parameters and Event.user_data/detail), date the
wm_attributes positional-argument deprecation to 3.13, and update the
bundled Tcl/Tk version to 8.6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 days ago[3.14] gh-151623: Add missing curses docstrings and document intrflush() (GH-151632...
Serhiy Storchaka [Thu, 18 Jun 2026 11:20:45 +0000 (14:20 +0300)] 
[3.14] gh-151623: Add missing curses docstrings and document intrflush() (GH-151632) (GH-151642)

(cherry picked from commit 12add3822f458a3e107dff4176b4c4b991764ea7)

12 days ago[3.14] gh-151623: Improve curses documentation style (GH-151635) (#151637)
Miss Islington (bot) [Thu, 18 Jun 2026 09:57:07 +0000 (11:57 +0200)] 
[3.14] gh-151623: Improve curses documentation style (GH-151635) (#151637)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 days ago[3.14] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151629)
Serhiy Storchaka [Thu, 18 Jun 2026 09:16:10 +0000 (12:16 +0300)] 
[3.14] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151629)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.
(cherry picked from commit 65afcdd8dfb3621ac696fce076e6282c76a04b2b)

12 days ago[3.14] gh-120665: make unittest loaders avoid loading test cases that are abstract...
Miss Islington (bot) [Wed, 17 Jun 2026 15:47:15 +0000 (17:47 +0200)] 
[3.14] gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666) (#151600)

gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666)
(cherry picked from commit 5ad3c6dfbfe60a7f232e9604866c77ced24c4bfe)

Co-authored-by: blhsing <blhsing@gmail.com>
12 days ago[3.14] gh-141984: Reword the Generator expressions section (GH-150518) (GH-151267)
Stan Ulbrych [Wed, 17 Jun 2026 13:31:36 +0000 (14:31 +0100)] 
[3.14] gh-141984: Reword the Generator expressions section (GH-150518) (GH-151267)

(cherry picked from commit 7bbb9607a2e7d1f8a7de11ce02f0a2402d6e7262)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
13 days ago[3.14] gh-151593: Use timeout on GitHub Action TSan jobs (GH-151594) (#151598)
Miss Islington (bot) [Wed, 17 Jun 2026 11:28:38 +0000 (13:28 +0200)] 
[3.14] gh-151593: Use timeout on GitHub Action TSan jobs (GH-151594) (#151598)

gh-151593: Use timeout on GitHub Action TSan jobs (GH-151594)

Use a timeout of 15 minutes for --tsan command and a timeout of 10
minutes for --tsan-parallel command. Display also the slowest tests
to help adjusting these timeouts later if needed.
(cherry picked from commit 460dec26518df5aa262ded5a2ee4e94b8854b569)

Co-authored-by: Victor Stinner <vstinner@python.org>
13 days ago[3.14] gh-151546: Fix stack limits on musl (#151548) (#151583) (#151591)
Victor Stinner [Wed, 17 Jun 2026 09:41:24 +0000 (11:41 +0200)] 
[3.14] gh-151546: Fix stack limits on musl (#151548) (#151583) (#151591)

[3.15] gh-151546: Fix stack limits on musl (#151548) (#151583)

gh-151546: Fix stack limits on musl (#151548)

If the thread stack size is set by linker flags, pass the stack size
to Python/ceval.c via the new _Py_LINKER_THREAD_STACK_SIZE variable
to set Py_C_STACK_SIZE macro.

(cherry picked from commit 9a61d1c0c8ebe21277c0a84abf6000049540464f)
(cherry picked from commit a5c5edddbc3ca7192c057f65fb3a8ff4ea360f96)

13 days ago[3.14] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#151586)
Miss Islington (bot) [Wed, 17 Jun 2026 09:11:29 +0000 (11:11 +0200)] 
[3.14] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#151586)

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>
13 days ago[3.14] gh-151218: Replace sys.flags in PyConfig_Set() (#151402) (#151553)
Victor Stinner [Tue, 16 Jun 2026 16:55:35 +0000 (18:55 +0200)] 
[3.14] gh-151218: Replace sys.flags in PyConfig_Set() (#151402) (#151553)

gh-151218: Replace sys.flags in PyConfig_Set() (#151402)

PyConfig_Set() and sys.set_int_max_str_digits() now replace
sys.flags (create a new object), instead of modifying sys.flags in-place.

Modifying sys.flags in-place can lead to data races when multiple
threads are reading or writing sys.flags in parallel.

Use _Py_atomic functions to get and set max_str_digits members.

(cherry picked from commit b16d23fc9fe9cb72fa15c8a3036753e5437b5b8c)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
13 days ago[3.14] gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard ...
Miss Islington (bot) [Tue, 16 Jun 2026 16:42:20 +0000 (18:42 +0200)] 
[3.14] gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521) (#151550)

gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521)

The guard that skips the "chown to gid 0 should fail" assertion used
only `os.getgroups()` (supplementary groups). The kernel also accepts
the effective/filesystem gid for chown, so when a process runs with
egid 0 and a non-zero uid (common in containers and user namespaces),
chown(-1, 0) succeeds and the assertion spuriously fails.

Add an `os.getegid() != 0` check alongside the existing
`0 not in os.getgroups()` guard.
(cherry picked from commit 2ce260033b457a0ad2c9767a1d9902bef5a30b0e)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2 weeks ago[3.14] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523...
Miss Islington (bot) [Tue, 16 Jun 2026 05:54:48 +0000 (07:54 +0200)] 
[3.14] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151529)

gh-151522: Guard against None transport in slow-socket SSL test (GH-151523)
(cherry picked from commit 11f032f904c8019b332a3c367f335e05cde63628)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2 weeks ago[3.14] gh-151422: Don't link libffi into _ctypes_test.so (GH-151423) (#151517)
Miss Islington (bot) [Mon, 15 Jun 2026 22:41:39 +0000 (00:41 +0200)] 
[3.14] gh-151422: Don't link libffi into _ctypes_test.so (GH-151423) (#151517)

_ctypes_test doesn't use libffi directly, and linking it into the module
causes emscripten tests to fail.
(cherry picked from commit 8646385076ea4f6ef08682d8ef07a544d3b4ef30)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2 weeks ago[3.14] gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed...
Miss Islington (bot) [Mon, 15 Jun 2026 14:52:51 +0000 (16:52 +0200)] 
[3.14] gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854) (#151505)

gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854)

/run/ on my FreeBSD install is not readable causing failing test.
(cherry picked from commit 35ce2e5f98c04cb8d1e442de5439d3151362e21b)

Co-authored-by: Nick Begg <nick@stunttruck.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks ago[3.14] gh-150389: Make perf profiler tests resilient (#150437) (#151501)
Victor Stinner [Mon, 15 Jun 2026 13:16:19 +0000 (15:16 +0200)] 
[3.14] gh-150389: Make perf profiler tests resilient (#150437) (#151501)

gh-150389: Make perf profiler tests resilient (#150437)

(cherry picked from commit 638754cb8579a4f7acfd465c885f783c073c0baf)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2 weeks ago[3.14] Add `.toml` to `.editorconfig` (GH-151481) (#151492)
Miss Islington (bot) [Mon, 15 Jun 2026 09:43:39 +0000 (11:43 +0200)] 
[3.14] Add `.toml` to `.editorconfig` (GH-151481) (#151492)

Add `.toml` to `.editorconfig` (GH-151481)
(cherry picked from commit 7a70afa199a9bdd5bf65b2b396b9fa76c8842ac2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 weeks ago[3.14] gh-139837: Document attributes of objects recorded by warnings.catch_warnings...
Miss Islington (bot) [Mon, 15 Jun 2026 09:24:16 +0000 (11:24 +0200)] 
[3.14] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (#151473)

* gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)
(cherry picked from commit 47b7dc788c9bcf3d5ea69a2ea0aed3d5883647a8)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
* Apply suggestions from code review

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
---------

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH...
Miss Islington (bot) [Sun, 14 Jun 2026 18:37:28 +0000 (20:37 +0200)] 
[3.14] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460) (#151469)

Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)

Since the recursion guard tracks real C-stack bounds (gh-91079), this test
asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack
(some Nix build envs use one that large), the optimized interpreter uses ~160
bytes/level (raises at ~420k levels) so the assertion holds with only ~16%
margin; the PGO *instrumented* stage inlines less, its per-level scanner frames
are smaller, and the 500k-deep decode completes -- "RecursionError not raised"
fails the profile run and aborts `make profile-opt`. Upstream's
skip_if_unlimited_stack_size (gh-143460) only covers RLIM_INFINITY, not
large-finite stacks like ours.

We could also keep playing whack a mole and raise the 500k to a much larger
number... but there's little value in PGO training on this test anyways.
(cherry picked from commit e91f68ab40e25dc964afb872eb75873c8b1838d6)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2 weeks ago[3.14] gh-151390: Colorize `match +` and `match -` in the REPL (GH-151391) (#151477)
Bartosz Sławecki [Sun, 14 Jun 2026 16:40:51 +0000 (18:40 +0200)] 
[3.14] gh-151390: Colorize `match +` and `match -` in the REPL (GH-151391) (#151477)

(cherry picked from commit a7007322c2a70b01e7c2a9e6b3f8f222d241c7d7)

2 weeks ago[3.14] gh-151461: Fix encoding-related exception handling in file tokenizer (GH-15146...
Bartosz Sławecki [Sun, 14 Jun 2026 13:10:39 +0000 (15:10 +0200)] 
[3.14] gh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462) (GH-151474)

2 weeks ago[3.14] gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args...
Miss Islington (bot) [Sat, 13 Jun 2026 21:33:01 +0000 (23:33 +0200)] 
[3.14] gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404) (#151446)

gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404)

---------
(cherry picked from commit 6679ac07d881f6e0ce30b7cc28b5671eafa20d9d)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2 weeks ago[3.14] gh-151443: Fix documented default of `unittest.mock.mock_open`'s `read_data...
Miss Islington (bot) [Sat, 13 Jun 2026 18:38:38 +0000 (20:38 +0200)] 
[3.14] gh-151443: Fix documented default of  `unittest.mock.mock_open`'s `read_data` parameter (GH-151444) (#151451)

(cherry picked from commit 9ad6ba0324a71ae5b51ded6e59b1ea3b653814a5)

Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
2 weeks ago[3.14] gh-77328: Update `base64` module RFC references to RFC 4648 (GH-151275) (...
Miss Islington (bot) [Sat, 13 Jun 2026 13:01:07 +0000 (15:01 +0200)] 
[3.14] gh-77328: Update `base64` module RFC references to RFC 4648 (GH-151275) (#151439)

(cherry picked from commit e9339876883f96af2e406a92a05be647b7fbe5d5)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception...
Gregory P. Smith [Sat, 13 Jun 2026 09:13:13 +0000 (02:13 -0700)] 
[3.14] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (#151431)

* gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)
(cherry picked from commit 3c00ebc2bbd902495b163def850bc931420209fc)

Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit 4e8c9c6a5742659ca9f77719178802cce06a3507)

* Drop the abrupt-exit-code reporting from the 3.14 backport

Reporting the exit codes of processes that died without a known cause
is a new feature, not part of the gh-101267 bugfix. Keep only the
bugfix on 3.14: each failed future gets its own BrokenProcessPool
exception instead of one shared instance.

---------

Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks ago[3.14] Docs: Fix method directive signatures in `enum` docs (GH-151429) (#151432)
Miss Islington (bot) [Sat, 13 Jun 2026 08:54:44 +0000 (10:54 +0200)] 
[3.14] Docs: Fix method directive signatures in `enum` docs (GH-151429) (#151432)

(cherry picked from commit 5b385197625e669473859c63bee6f14c983d2be6)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2 weeks ago[3.14] Fix typos in the `curses.ascii` module documentation (GH-129300) (#151414)
Miss Islington (bot) [Fri, 12 Jun 2026 16:10:27 +0000 (18:10 +0200)] 
[3.14] Fix typos in the `curses.ascii` module documentation (GH-129300) (#151414)

(cherry picked from commit f4f102027a9b0edc72a048f17b696aa92d2e6893)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] Docs: avoid repetitions of class references in functions.rst (GH-150891) ...
Hugo van Kemenade [Fri, 12 Jun 2026 15:04:49 +0000 (18:04 +0300)] 
[3.14] Docs: avoid repetitions of class references in functions.rst (GH-150891) (#151406)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2 weeks ago[3.14] gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382...
Miss Islington (bot) [Fri, 12 Jun 2026 11:31:00 +0000 (13:31 +0200)] 
[3.14] gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382) (#151399)

gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea90b9cd694fded6308bc796e324bbacd19)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 weeks ago[3.14] gh-132467: Document and test that generic aliases are not classes (GH-133504...
Abduaziz π [Fri, 12 Jun 2026 00:38:12 +0000 (05:38 +0500)] 
[3.14] gh-132467: Document and test that generic aliases are not classes (GH-133504) (#151116)

(cherry picked from commit 5915a1fb9d8499387e371c6801b40c55cf126dbf)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 weeks ago[3.14] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH...
Miss Islington (bot) [Thu, 11 Jun 2026 22:38:03 +0000 (00:38 +0200)] 
[3.14] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH-151384)

Applies https://github.com/microsoft/mimalloc/commit/d7a72c4912943e8aaf135e465ca5ea229ea96646 to our copy of mimalloc.
(cherry picked from commit 80f9467434cecbc4e97b853b3876de13e75aec38)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2 weeks ago[3.14] gh-151337: Avoid possible memory leak in `_tkinter.c` on Windows. (GH-151340...
Miss Islington (bot) [Thu, 11 Jun 2026 20:22:08 +0000 (22:22 +0200)] 
[3.14] gh-151337: Avoid possible memory leak in `_tkinter.c` on Windows. (GH-151340) (GH-151380)

(cherry picked from commit 71805db4294de9495954571c82a835d94ba67594)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
2 weeks ago[3.14] gh-138991: Update dataclass documentation for new eq behavior in Python 3...
Miss Islington (bot) [Thu, 11 Jun 2026 17:42:38 +0000 (19:42 +0200)] 
[3.14] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151373)

gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)

And add tests.
(cherry picked from commit 402668b2b1a63a2b3cfd7a2ede07f6786f9beb8e)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ ...
Miss Islington (bot) [Thu, 11 Jun 2026 17:21:12 +0000 (19:21 +0200)] 
[3.14] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) (GH-151368)

(cherry picked from commit 65047f2e2fb80e4ad36df56a343d75963a20c110)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339) (...
Miss Islington (bot) [Thu, 11 Jun 2026 16:49:57 +0000 (18:49 +0200)] 
[3.14] gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339) (#151361)

gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339)
(cherry picked from commit 10595b1cb7ac04ba9a3ef3f7da4fa31c9966300d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 weeks ago[3.14] gh-101100: Fix Sphinx nitpick in `unittest.mock.rst` (GH-151302) (#151356)
Miss Islington (bot) [Thu, 11 Jun 2026 15:39:04 +0000 (17:39 +0200)] 
[3.14] gh-101100: Fix Sphinx nitpick in `unittest.mock.rst` (GH-151302) (#151356)

(cherry picked from commit b18168cb32d545ed976b760983478cbd5dde5bdf)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2 weeks ago[3.14] gh-150397: Fix pyexpat bigmem test (GH-151329) (#151349)
Miss Islington (bot) [Thu, 11 Jun 2026 15:17:19 +0000 (17:17 +0200)] 
[3.14] gh-150397: Fix pyexpat bigmem test (GH-151329) (#151349)

gh-150397: Fix pyexpat bigmem test (GH-151329)

Add missing parameter (size).
(cherry picked from commit 0bbde07a0bbad3c79073fd133d6df70837e4cfee)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-151112: Fix crash in `compiler_mod()` when entering the current compilation...
Miss Islington (bot) [Thu, 11 Jun 2026 15:16:58 +0000 (17:16 +0200)] 
[3.14] gh-151112: Fix crash in `compiler_mod()` when entering the current compilation unit fails (GH-151234) (#151351)

(cherry picked from commit 937d89c4d9b7c5fda6730a1127db118d881d13cb)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] gh-150285: Suppress showing the __getstate__() comment in the help for datacla...
Miss Islington (bot) [Thu, 11 Jun 2026 15:16:00 +0000 (17:16 +0200)] 
[3.14] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151332)

(cherry picked from commit 0066fd73a20950dc790d219f4e3cfb07e816df47)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] gh-151238: Check for `_get_resized_exprs` failure in `_PyPegen_{joined,templat...
Miss Islington (bot) [Thu, 11 Jun 2026 14:56:38 +0000 (16:56 +0200)] 
[3.14] gh-151238: Check for `_get_resized_exprs` failure in `_PyPegen_{joined,template}_str` (GH-151259)

(cherry picked from commit 4b44b1e1fd654f3a3fefb02ae7fb26456fe33dc3)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (GH-151239...
sobolevn [Thu, 11 Jun 2026 13:34:41 +0000 (16:34 +0300)] 
[3.14] gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (GH-151239) (#151336)

(cherry picked from commit 9fd1a125bc0ebdc26eae684da6e48ef24ee23b34)

2 weeks ago[3.14] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151317)
Hugo van Kemenade [Thu, 11 Jun 2026 11:34:21 +0000 (14:34 +0300)] 
[3.14] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151317)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-151284: Fix test_capi on UBSan (GH-151286) (#151324)
Miss Islington (bot) [Thu, 11 Jun 2026 11:22:18 +0000 (13:22 +0200)] 
[3.14] gh-151284: Fix test_capi on UBSan (GH-151286) (#151324)

gh-151284: Fix test_capi on UBSan (GH-151286)

Comment two checks relying on undefined behavior in
test_fromwidechar() of test_capi.

Enable test_capi in GitHub Action "Reusable Sanitizer".
(cherry picked from commit d87d77287392b78d36a06660228f6a5ca88888d7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260) (#151327)
Miss Islington (bot) [Thu, 11 Jun 2026 11:20:21 +0000 (13:20 +0200)] 
[3.14] gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260) (#151327)

gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260)

Return 0 if the object is not tracked by the GC.
(cherry picked from commit 72e7eddce6c7137cef06b6eba15641597919e3d4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-151112: Move an `assert` that may fail in `cfg_builder_check` (GH-151153)
Miss Islington (bot) [Thu, 11 Jun 2026 09:42:53 +0000 (11:42 +0200)] 
[3.14] gh-151112: Move an `assert` that may fail in `cfg_builder_check` (GH-151153)

(cherry picked from commit 2d3381035df24fbf512d897daa19a1040f7af3fd)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant...
Miss Islington (bot) [Thu, 11 Jun 2026 08:30:36 +0000 (10:30 +0200)] 
[3.14] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151305)

(cherry picked from commit 84a322aa1555df745a2c115df03bfb7a4ed8c594)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2 weeks ago[3.14] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151300)
Miss Islington (bot) [Thu, 11 Jun 2026 06:37:38 +0000 (08:37 +0200)] 
[3.14] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151300)

(cherry picked from commit 84630e2cb90ef334e41eb9bccd860b3b0a7ff51b)

2 weeks ago[3.14][3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry...
Victor Stinner [Wed, 10 Jun 2026 20:31:29 +0000 (22:31 +0200)] 
[3.14][3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283)

[3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269)

gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)

If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.

(cherry picked from commit 7b6e98911e1485be13817f2aedbbfadb1c4ea876)
(cherry picked from commit 10f616cf3939f87605081d05c1913ba630046c54)

2 weeks ago[3.14] gh-151278: Fix test_faulthandler on UBSan (#151279) (#151282)
Victor Stinner [Wed, 10 Jun 2026 20:30:10 +0000 (22:30 +0200)] 
[3.14] gh-151278: Fix test_faulthandler on UBSan (#151279) (#151282)

gh-151278: Fix test_faulthandler on UBSan (#151279)

* Py_FatalError() no longer calls _PyFaulthandler_Fini() if it
  doesn't hold the GIL.
* Skip test_faulthandler tests raising signals if run with UBSan.
* Enable test_faulthandler in GitHub Action "Reusable Sanitizer".

(cherry picked from commit e60c42dc3f5a8dd9b10bc9a8a028ef2765469650)

2 weeks ago[3.14] GHA: Display output when a sanitizer test fails (#151268) (#151273)
Victor Stinner [Wed, 10 Jun 2026 18:45:59 +0000 (20:45 +0200)] 
[3.14] GHA: Display output when a sanitizer test fails (#151268) (#151273)

GHA: Display output when a sanitizer test fails (#151268)

Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.

(cherry picked from commit 3a8bebd86f36be05442fa2f3adcc83c2a4b00ef2)

2 weeks ago[3.14] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215)...
Harjoth Khara [Wed, 10 Jun 2026 18:12:18 +0000 (11:12 -0700)] 
[3.14] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151264)

(cherry picked from commit 7a014f44c393fda6d1c4bd135608ebcfc21d626c)

2 weeks ago[3.14] add asyncio guide for Free-Threaded Python (GH-150456) (#151258)
Miss Islington (bot) [Wed, 10 Jun 2026 14:10:11 +0000 (16:10 +0200)] 
[3.14] add asyncio guide for Free-Threaded Python (GH-150456) (#151258)

add asyncio guide for Free-Threaded Python (GH-150456)
(cherry picked from commit e2bd50d2e1cfe474f3b1f88a3d2b7e26cfda1295)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 weeks ago[3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into...
Victor Stinner [Wed, 10 Jun 2026 13:57:14 +0000 (15:57 +0200)] 
[3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251)

gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)

Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.

The bug occurs because:

1. PySequence_Fast() returns the original list object when the input
   is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
   callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).

The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.

(cherry picked from commit 896f7fdc7d0ba6d4ace06935b9d67c4da0f9ecbe)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2 weeks ago[3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245)
Victor Stinner [Wed, 10 Jun 2026 13:51:29 +0000 (15:51 +0200)] 
[3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245)

gh-89554: Document socket.SocketType as a class (#150683)

socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.

(cherry picked from commit a621e8ad811e7d51d69b0969a2bd07888a02db1e)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2 weeks ago[3.14] Docs: Fix typos in the "Memory Management" section (GH-151243) (GH-151248)
Miss Islington (bot) [Wed, 10 Jun 2026 13:21:34 +0000 (15:21 +0200)] 
[3.14] Docs: Fix typos in the "Memory Management" section (GH-151243) (GH-151248)

Docs: Fix typos in the "Memory Management" section (GH-151243)
(cherry picked from commit 8c0e2515bb0059b75e264cc5baeb27bb17337c83)

Co-authored-by: Manoj K M <manojkm24dev@gmail.com>
2 weeks agoMerge branch '3.14' of https://github.com/python/cpython into 3.14
Hugo van Kemenade [Wed, 10 Jun 2026 13:09:49 +0000 (16:09 +0300)] 
Merge branch '3.14' of https://github.com/python/cpython into 3.14

2 weeks agoPost 3.14.6
Hugo van Kemenade [Wed, 10 Jun 2026 13:08:54 +0000 (16:08 +0300)] 
Post 3.14.6

2 weeks ago[3.14] gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init_...
Miss Islington (bot) [Wed, 10 Jun 2026 12:53:24 +0000 (14:53 +0200)] 
[3.14] gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990) (#151241)

gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990)
(cherry picked from commit f2a0f82282d6307f7fd2d4ccf52a8fd95ac3922f)

Co-authored-by: Lukas Geiger <lukas.geiger94@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146...
Miss Islington (bot) [Wed, 10 Jun 2026 10:48:16 +0000 (12:48 +0200)] 
[3.14] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146) (GH-151232)

The type of the callback argument is not checked.
(cherry picked from commit 0b6adeb20f5d7c8b81673d14e0a4db41fd2fca2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks agoPython 3.14.6 v3.14.6
Hugo van Kemenade [Wed, 10 Jun 2026 10:03:19 +0000 (13:03 +0300)] 
Python 3.14.6

2 weeks ago[3.14] gh-143008: Fix race re-initializing TextIOWrapper (GH-151203) (#151226)
Miss Islington (bot) [Wed, 10 Jun 2026 09:41:47 +0000 (11:41 +0200)] 
[3.14] gh-143008: Fix race re-initializing TextIOWrapper (GH-151203) (#151226)

[3.15] gh-143008: Fix race re-initializing TextIOWrapper (GH-151203)

__init__() changes multiple variables and may be called more than once
from multiple threads.
(cherry picked from commit 0318867acf72e3acf78f480db73a69982573263a)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2 weeks ago[3.14] gh-150700: Fix class-scope inline comprehensions when nested scopes reference...
Miss Islington (bot) [Tue, 9 Jun 2026 22:48:25 +0000 (00:48 +0200)] 
[3.14] gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (GH-150735) (#151212)

gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (GH-150735)

* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends

In `inline_comprehension()`, when `__class__` / `__classdict__` /
`__conditional_annotations__` appears as `FREE` in a comprehension's
symbol table because a nested scope captured it (e.g. nested lambdas),
this name is still discarded from `comp_free` unconditionally.

This prevents `drop_class_free()` from seeing it, so the appropriate
`ste_needs_(...)` flag is never set on the enclosing class.
That leads to `codegen_make_closure()` throwing `SystemError` when it
couldn't find `__class__` / `__classdict__` /
`__conditional_annotations__` in the class's cellvars.

From now on we just discard from `comp_free` when no child scope
(e.g. a lambda) still needs the name as `FREE`. When a child scope does
need it, keep it in `comp_free` so `drop_class_free()` can set the
appropriate flag and the class creates the implicit cell.

* Fix tests

* Fix typo

* Fix formatting

* Add test checking validity of `__class__` returned

* Prefer 'used' to 'deferred'
(cherry picked from commit ce916dc50644bb1de940f5fb580bd9907cceb959)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2 weeks ago[3.14] gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142...
Miss Islington (bot) [Tue, 9 Jun 2026 20:13:45 +0000 (22:13 +0200)] 
[3.14] gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142) (#151206)

gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142)
(cherry picked from commit 580499177ca91477b53b4a40afcec7d3370265b0)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks ago[3.14] gh-151159: Update CI to use latest SSL library versions (GH-151201)
Zachary Ware [Tue, 9 Jun 2026 18:04:56 +0000 (13:04 -0500)] 
[3.14] gh-151159: Update CI to use latest SSL library versions (GH-151201)

(cherry picked from commit 7053bbd7fd4967b8782bf0c8f6ad00248f0b0c5b)

2 weeks ago[3.14] gh-151159: Bump OpenSSL versions for iOS and Android (GH-151198)
Zachary Ware [Tue, 9 Jun 2026 18:03:09 +0000 (13:03 -0500)] 
[3.14] gh-151159: Bump OpenSSL versions for iOS and Android (GH-151198)

(cherry picked from commit 627dd14346b4c4c13d9203430c32556467b7fbd3)

2 weeks ago[3.14] gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151190)
Zachary Ware [Tue, 9 Jun 2026 17:49:34 +0000 (12:49 -0500)] 
[3.14] gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151190)

(cherry picked from commit 6688b0c71536ac99ed629fbd5ea4b226245ffac6)

2 weeks ago[3.14] gh-151159: Update macOS installer to use OpenSSL 3.5.7. (#151193)
Ned Deily [Tue, 9 Jun 2026 17:39:29 +0000 (13:39 -0400)] 
[3.14] gh-151159: Update macOS installer to use OpenSSL 3.5.7. (#151193)

2 weeks ago[3.14] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151194)
Savannah Ostrowski [Tue, 9 Jun 2026 17:25:41 +0000 (10:25 -0700)] 
[3.14] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151194)

(cherry picked from commit 82cb7d4bf62041b75a08628baa1f9fe761fd6a79)

2 weeks ago[3.14] gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154) (...
Miss Islington (bot) [Tue, 9 Jun 2026 17:07:20 +0000 (19:07 +0200)] 
[3.14] gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154) (#151181)

gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154)
(cherry picked from commit 8d94fa7b8696db6a7942f8a4b930289e69e9b174)

Co-authored-by: sobolevn <mail@sobolevn.me>
2 weeks ago[3.14] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH...
Serhiy Storchaka [Tue, 9 Jun 2026 16:42:57 +0000 (19:42 +0300)] 
[3.14] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151175)

(cherry picked from commit ed2b04248aa1f608099e03437aa280d1be6e80c3)

2 weeks ago[3.14] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) ...
Miss Islington (bot) [Tue, 9 Jun 2026 16:41:06 +0000 (18:41 +0200)] 
[3.14] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (GH-151174)

(cherry picked from commit 0fa06f4d7fb3494a62ba2631362ce8b98a7eec25)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] GH-54732: Tweak wording around empty lines in argument files (GH-150980) ...
Miss Islington (bot) [Tue, 9 Jun 2026 15:44:55 +0000 (17:44 +0200)] 
[3.14] GH-54732: Tweak wording around empty lines in argument files (GH-150980) (#151166)

GH-54732: Tweak wording around empty lines in argument files (GH-150980)
(cherry picked from commit 528550e0e753d64714f65a02d567bdc1d63ae3f1)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2 weeks ago[3.14] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151169)
Miss Islington (bot) [Tue, 9 Jun 2026 15:44:53 +0000 (17:44 +0200)] 
[3.14] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151169)

GH-61082: Clarify nargs='*' positional default behavior (GH-150989)
(cherry picked from commit bc37a227b2f481d0f260f9beae5229e8d432a0cc)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2 weeks ago[3.14] gh-149018: Use `XML_SetHashSalt16Bytes` in `pyexpat`/`_elementtree` when possi...
Stan Ulbrych [Tue, 9 Jun 2026 14:07:36 +0000 (15:07 +0100)] 
[3.14] gh-149018: Use `XML_SetHashSalt16Bytes` in `pyexpat`/`_elementtree` when possible (GH-149023)

(cherry picked from commit 24b8f12544468e4cedf5bfbe25442fcd495391e4)

2 weeks ago[3.14] gh-109503: Fix document for shutil.move() on usage of os.rename() since it...
Miss Islington (bot) [Tue, 9 Jun 2026 13:06:44 +0000 (15:06 +0200)] 
[3.14] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150612)

Nonatomic move might be used even if the files are
on the same filesystem in some cases.
(cherry picked from commit 6ecd197c03c43412fc400235949fd8297f142e89)

Co-authored-by: Fang Li <fangli@users.noreply.github.com>
2 weeks ago[3.14] gh-90949: expose Expat API to tune exponential expansion protections (GH-13936...
Stan Ulbrych [Tue, 9 Jun 2026 12:42:16 +0000 (13:42 +0100)] 
[3.14] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368) (#150496)

Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c37793561d753dd4ca6e7cd658137553,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
(cherry picked from commit 666112376d574c7802646ee1df6244062671cd61)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks ago[3.14] gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module ...
Miss Islington (bot) [Tue, 9 Jun 2026 12:10:49 +0000 (14:10 +0200)] 
[3.14] gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (GH-151044) (#151144)

gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (GH-151044)
(cherry picked from commit 9fdbade99e6bcc607d9f12416bfca5bbf94022b9)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.14] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151141)
Serhiy Storchaka [Tue, 9 Jun 2026 11:45:18 +0000 (14:45 +0300)] 
[3.14] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151141)

(cherry picked from commit c3cd75afdf86f6a811663c71da22cc24c784a6f4)

3 weeks ago[3.14] gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127...
Miss Islington (bot) [Tue, 9 Jun 2026 10:33:08 +0000 (12:33 +0200)] 
[3.14] gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127) (#151135)

gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127)
(cherry picked from commit 3186547c1ec76e1afab82ec32271ec5b9467fdeb)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks ago[3.14] gh-115119: Update macOS installer to use libmpdecimal 4.0.1. (GH-140077) ...
Miss Islington (bot) [Tue, 9 Jun 2026 06:10:49 +0000 (08:10 +0200)] 
[3.14] gh-115119: Update macOS installer to use libmpdecimal 4.0.1. (GH-140077) (#151123)

(cherry picked from commit 8e0bf4fe5d7835ef912758b4eeab6c94794da696)
Co-authored-by: Ned Deily <nad@python.org>
3 weeks ago[3.14] gh-151070: Fix class referencing typo in collections.abc docs (GH-151088)...
Miss Islington (bot) [Mon, 8 Jun 2026 19:46:34 +0000 (21:46 +0200)] 
[3.14] gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) (GH-151109)

(cherry picked from commit 29a920e80e21490b5bdb7178373f80fe606a4403)

Co-authored-by: Arshal Aromal <arshalaromal19@gmail.com>
3 weeks ago[3.14] gh-150633: Properly handle null characters in the name when importing frozen...
Miss Islington (bot) [Mon, 8 Jun 2026 18:56:49 +0000 (20:56 +0200)] 
[3.14] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151101)

(cherry picked from commit 54de5475cd753e2519692c3e54af0f150e0a8b62)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
3 weeks ago[3.14] gh-123853: Update locale.windows_locale (GH-123901) (GH-148876)
Miss Islington (bot) [Mon, 8 Jun 2026 17:57:34 +0000 (19:57 +0200)] 
[3.14] gh-123853: Update locale.windows_locale (GH-123901) (GH-148876)

Update the table of Windows language code identifiers (LCIDs) to
protocol version 16.0 (2024-04-23).
(cherry picked from commit bfe6f9f590849f0d9f08a6fe94a5b4e76d8ed29f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 weeks ago[3.14] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151094)
Miss Islington (bot) [Mon, 8 Jun 2026 17:23:44 +0000 (19:23 +0200)] 
[3.14] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151094)

gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087)

Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit 3ae975f1ac880c47d51cca6c9e305547bd365be7.
(cherry picked from commit a9002349cbe3f2243fe53a9fcadd02318dd0caf9)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-106318: Add examples to the `str.isdigit()` method docs (GH-144721)
Miss Islington (bot) [Mon, 8 Jun 2026 12:58:59 +0000 (14:58 +0200)] 
[3.14] gh-106318: Add examples to the `str.isdigit()` method docs  (GH-144721)

(cherry picked from commit f051c68923b4060b03566d0ea1df06d911ebe238)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks ago[3.14] gh-141623: Clarify operator function descriptions (GH-141846)
Miss Islington (bot) [Mon, 8 Jun 2026 12:20:46 +0000 (14:20 +0200)] 
[3.14] gh-141623: Clarify operator function descriptions (GH-141846)

(cherry picked from commit bd5fa31c5ff47866f0f93ef2a674e78d56d2e44c)

Co-authored-by: Doron Behar <doron.behar@gmail.com>
3 weeks ago[3.14] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation...
Miss Islington (bot) [Mon, 8 Jun 2026 10:33:13 +0000 (12:33 +0200)] 
[3.14] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (GH-151058)

(cherry picked from commit a1873300eebe9c634f59592c3333035768f09de9)

Co-authored-by: Christian Zinck <christian.zinck@gmail.com>
3 weeks ago[3.14] Docs: Fix missing colon in `bisect` example function (GH-151061) (GH-151068)
Miss Islington (bot) [Mon, 8 Jun 2026 09:47:11 +0000 (11:47 +0200)] 
[3.14] Docs: Fix missing colon in `bisect` example function (GH-151061) (GH-151068)

Docs: Fix missing colon in `bisect` example function (GH-151061)
(cherry picked from commit 16ede813ebad81e41874f1c0a1b3c83fc98a38ca)

Co-authored-by: Sergio López Gómez <sergiolopezgmz.dam@gmail.com>
3 weeks ago[3.14] gh-150599: Prevent bz2 decompressor reuse after errors (#150600) (#151054)
Stan Ulbrych [Sun, 7 Jun 2026 18:37:10 +0000 (19:37 +0100)] 
[3.14] gh-150599: Prevent bz2 decompressor reuse after errors (#150600) (#151054)

(cherry picked from commit 5755d0f083949ff3c5bf3a37e673e24e306b036e)