]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 weeks agogh-151881: Add tkinter Menu.postcascade, Misc.tk_scaling and tk_inactive (GH-151882)
Serhiy Storchaka [Mon, 22 Jun 2026 13:53:02 +0000 (16:53 +0300)] 
gh-151881: Add tkinter Menu.postcascade, Misc.tk_scaling and tk_inactive (GH-151882)

Wrap three long-standing Tk commands that had no tkinter wrapper:

* Menu.postcascade() posts the submenu of a cascade entry (Tk 8.5),
  complementing the existing post() and unpost() methods.
* Misc.tk_scaling() queries or sets the scaling factor in pixels per
  point used to convert between physical units and pixels (Tk 8.4).
* Misc.tk_inactive() returns the user idle time in milliseconds, and can
  reset that timer (Tk 8.5).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151876: Add tkinter Canvas methods rotate and rchars (GH-151877)
Serhiy Storchaka [Mon, 22 Jun 2026 13:51:50 +0000 (16:51 +0300)] 
gh-151876: Add tkinter Canvas methods rotate and rchars (GH-151877)

Wrap the Tk canvas commands "rchars" (replace the text or coordinates of
items, since Tk 8.6) and "rotate" (rotate the coordinates of items about
an origin, new in Tk 9.0) as the methods Canvas.rchars() and
Canvas.rotate(), complementing the existing dchars/insert and move/scale
methods.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151910: Add tkinter.ttk.Treeview methods for the Tk 9.1 enhanced treeview (GH...
Serhiy Storchaka [Mon, 22 Jun 2026 13:08:53 +0000 (16:08 +0300)] 
gh-151910: Add tkinter.ttk.Treeview methods for the Tk 9.1 enhanced treeview (GH-151911)

Wrap the enhanced ttk::treeview widget commands added in Tk 9.1 (TIP 740),
and the detached query added in Tk 9.0, as tkinter.ttk.Treeview methods:
item navigation and queries (after_item, before_item, depth, haschildren,
visible, size, range, identifier, current), opening, hiding, sorting and
searching (expand, collapse, hide, unhide, sort, search, search_all,
search_cell, search_all_cells), cell focus, selection and tagging
(cellfocus, cellselection and its set/add/remove cell-list and *_range
rectangle forms, anchor/includes/present, tag_cell_add/remove/has), and the
detached query (detached, detached_all).

The expand() and collapse() methods, without recurse, also work on Tk older
than 9.1, where they are emulated via the item -open option.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151878: Add tkinter Entry and Spinbox validate methods (GH-151879)
Serhiy Storchaka [Mon, 22 Jun 2026 12:52:50 +0000 (15:52 +0300)] 
gh-151878: Add tkinter Entry and Spinbox validate methods (GH-151879)

Wrap the Tk "validate" widget command of the entry and spinbox widgets as
the methods Entry.validate() and Spinbox.validate(), forcing an evaluation
of the validatecommand independently of the validate option and returning
whether the value is valid.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-86726: Document tkinter method-name conflicts (GH-151917)
Serhiy Storchaka [Mon, 22 Jun 2026 12:14:10 +0000 (15:14 +0300)] 
gh-86726: Document tkinter method-name conflicts (GH-151917)

Document where widget methods shadow inherited Misc, geometry-manager and
Wm methods, correct the inaccurate "size/bbox is an alias of
grid_size/grid_bbox" claims, and add "# overrides X" comments at the
definitions.

Also document the geometry-manager ambiguity: the short names forget, info,
slaves, content and propagate are defined by Pack, Place and Grid but
resolve to the pack variant.

Cross-reference the window-manager methods grid, forget and state with the
same-named grid geometry manager, Pack.forget and ttk.Widget.state.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151874: Add tkinter wm_stackorder, wm_iconbadge and winfo_isdark (GH-151875)
Serhiy Storchaka [Mon, 22 Jun 2026 12:13:50 +0000 (15:13 +0300)] 
gh-151874: Add tkinter wm_stackorder, wm_iconbadge and winfo_isdark (GH-151875)

Wrap the Tk commands "wm stackorder" (toplevel stacking order, since
Tk 8.4), "wm iconbadge" (application icon badge, new in Tk 9.0) and
"winfo isdark" (dark mode detection, new in Tk 9.0) as the methods
Wm.wm_stackorder(), Wm.wm_iconbadge() and Misc.winfo_isdark(), with the
usual stackorder and iconbadge short aliases.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-144133: Add a warning to the `encodings.punycode` documentation (#151812)
Stan Ulbrych [Mon, 22 Jun 2026 11:54:26 +0000 (12:54 +0100)] 
gh-144133: Add a warning to the `encodings.punycode` documentation (#151812)

4 weeks agogh-151914: Copyedit "What's new in Python 3.16" (#151915)
Hugo van Kemenade [Mon, 22 Jun 2026 11:13:24 +0000 (14:13 +0300)] 
gh-151914: Copyedit "What's new in Python 3.16" (#151915)

4 weeks agogh-151905: fix memory error handling in PyFrame_GetBack (#151906)
Prakash Sellathurai [Mon, 22 Jun 2026 11:11:31 +0000 (16:41 +0530)] 
gh-151905: fix memory error handling in PyFrame_GetBack (#151906)

4 weeks agogh-151042: venv: Pass VIRTUAL_ENV through cygpath inside fish on Windows (GH-151043)
LuNoX [Mon, 22 Jun 2026 04:21:00 +0000 (06:21 +0200)] 
gh-151042: venv: Pass VIRTUAL_ENV through cygpath inside fish on Windows (GH-151043)

4 weeks agogh-142387: Revert Android testbed to API level 35 (#151816)
Malcolm Smith [Sun, 21 Jun 2026 22:49:54 +0000 (23:49 +0100)] 
gh-142387: Revert Android testbed to API level 35 (#151816)

Revert Android testbed to API level 35

4 weeks agogh-151665: Fix inspect.signature() on type alias and type parameter evaluators (...
Timofei [Sun, 21 Jun 2026 22:08:01 +0000 (01:08 +0300)] 
gh-151665: Fix inspect.signature() on type alias and type parameter evaluators (#151837)

4 weeks agogh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase...
saber-bit [Sun, 21 Jun 2026 18:51:04 +0000 (14:51 -0400)] 
gh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase.readline` (GH-151679)

4 weeks agogh-151845: Fix formatfloat() return-value contract in unicode_format.c (#151846)
AN Long [Sun, 21 Jun 2026 17:16:30 +0000 (02:16 +0900)] 
gh-151845: Fix formatfloat() return-value contract in unicode_format.c (#151846)

Fix formatfloat() return-value contract in unicode_format.c

4 weeks agogh-151678: Add tests for tkinter.simpledialog (GH-151856)
Serhiy Storchaka [Sun, 21 Jun 2026 16:25:20 +0000 (19:25 +0300)] 
gh-151678: Add tests for tkinter.simpledialog (GH-151856)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-86726: Document tkinter.simpledialog query options and Dialog.result (GH-151851)
Serhiy Storchaka [Sun, 21 Jun 2026 14:55:03 +0000 (17:55 +0300)] 
gh-86726: Document tkinter.simpledialog query options and Dialog.result (GH-151851)

4 weeks agoRTD Previews: Get correct base branch for backports (#150690)
Stan Ulbrych [Sun, 21 Jun 2026 13:33:42 +0000 (14:33 +0100)] 
RTD Previews: Get correct base branch for backports (#150690)

4 weeks agogh-150831: docs: clarify generator, generator function, and generator iterator in...
Aniket [Sun, 21 Jun 2026 11:26:14 +0000 (16:56 +0530)] 
gh-150831: docs: clarify generator, generator function, and generator iterator in glossary (#150905)

4 weeks agogh-84649: Fix unstable test_rollover_at_midnight (GH-151813)
Serhiy Storchaka [Sat, 20 Jun 2026 22:26:53 +0000 (01:26 +0300)] 
gh-84649: Fix unstable test_rollover_at_midnight (GH-151813)

The test forced a rollover by back-dating the file modification time, but
the rollover time is now based also on the creation time, which cannot be
changed.  Instead, set the rollover time one second after the file
creation time and wait until the clock reaches it.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-51067: Add `remove()` and `repack()` to `ZipFile` (GH-134627)
Danny Lin [Sat, 20 Jun 2026 19:45:53 +0000 (03:45 +0800)] 
gh-51067: Add `remove()` and `repack()` to `ZipFile` (GH-134627)

The docs included in the commit do the best job of describing this.

Much discussion on the PR and issue.

thank you to to core team folks jaraco, emmatyping, gpshead, and all others who added their constructive comments along the way.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
4 weeks agogh-151770: Fix `datetime.fromisoformat()` on an out-of-range month w/ a 24:00 time...
tonghuaroot (童话) [Sat, 20 Jun 2026 16:33:16 +0000 (00:33 +0800)] 
gh-151770: Fix `datetime.fromisoformat()` on an out-of-range month w/ a 24:00 time (#151771)

Co-authored-by: Stan Ulbrych <stan@python.org>
4 weeks agogh-151678: Add tests for tkinter widget virtual events (GH-151793)
Serhiy Storchaka [Sat, 20 Jun 2026 14:31:40 +0000 (17:31 +0300)] 
gh-151678: Add tests for tkinter widget virtual events (GH-151793)

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151675: Add tkinter Text.sync() and Text.pendingsync() (GH-151677)
Serhiy Storchaka [Sat, 20 Jun 2026 14:11:21 +0000 (17:11 +0300)] 
gh-151675: Add tkinter Text.sync() and Text.pendingsync() (GH-151677)

Wrap the Tk text widget "sync" and "pendingsync" subcommands, which
control and report the synchronization of the displayed view with the
underlying text when line heights have not yet been computed.

4 weeks agogh-151678: Add interactive tests for tkinter.simpledialog (GH-151794)
Serhiy Storchaka [Sat, 20 Jun 2026 13:46:39 +0000 (16:46 +0300)] 
gh-151678: Add interactive tests for tkinter.simpledialog (GH-151794)

Drive the modal query dialogs with generated events to exercise the
<Return> and <Escape> key bindings and the value validation: accepting
an integer, float or string, cancelling, rejecting a non-numeric value
and rejecting a value outside the allowed range.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for the remaining tkinter Misc, Wm and Text methods (GH-151782)
Serhiy Storchaka [Sat, 20 Jun 2026 13:42:53 +0000 (16:42 +0300)] 
gh-151678: Add tests for the remaining tkinter Misc, Wm and Text methods (GH-151782)

Cover Misc.wait_variable and wait_window, tk_focusFollowsMouse,
selection_handle, the error paths of grab_set_global, send, the
X11-specific Wm methods iconposition, iconmask, iconwindow,
colormapwindows and manage/forget, and the Text.window_config alias and
deprecated yview_pickplace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.filedialog (GH-151781)
Serhiy Storchaka [Sat, 20 Jun 2026 13:21:19 +0000 (16:21 +0300)] 
gh-151678: Add tests for tkinter.filedialog (GH-151781)

Exercise the native dialogs (Open, SaveAs and Directory) through the
_test_callback seam without opening them, and test the pure-Python
FileDialog selection, filter and ok/cancel logic without entering its
modal loop.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.dnd (GH-151780)
Serhiy Storchaka [Sat, 20 Jun 2026 13:08:55 +0000 (16:08 +0300)] 
gh-151678: Add tests for tkinter.dnd (GH-151780)

Drive the drag-and-drop protocol (dnd_start and the DndHandler enter/
motion/commit, leave/cancel and end callbacks).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 weeks agogh-151674: Add tkinter Text.edit_canundo() and Text.edit_canredo() (GH-151676)
Serhiy Storchaka [Sat, 20 Jun 2026 06:39:09 +0000 (09:39 +0300)] 
gh-151674: Add tkinter Text.edit_canundo() and Text.edit_canredo() (GH-151676)

Wrap the Tk text widget "edit canundo" and "edit canredo" subcommands,
which report whether the undo and redo stacks are non-empty.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.scrolledtext (GH-151753)
Serhiy Storchaka [Fri, 19 Jun 2026 23:39:34 +0000 (02:39 +0300)] 
gh-151678: Add tests for tkinter.scrolledtext (GH-151753)

Add a test for the ScrolledText widget, which had no tests: that it is
a Text widget held in a Frame with a Scrollbar, that Text methods work,
that the geometry manager methods are redirected to the frame while
configure is not, and that the scrollbar tracks the text view.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751)
Serhiy Storchaka [Fri, 19 Jun 2026 22:45:47 +0000 (01:45 +0300)] 
gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751)

* font: copy(), the config alias, the displayof argument of measure and
  metrics, and the errors raised for invalid options and a wrong number
  of arguments;
* image: the cget method and the config alias, and the errors raised by
  transparency_get and transparency_set;
* variable: that initialize is an alias of set and the deprecated trace
  is an alias of trace_variable;
* Misc: tk_focusNext, tk_focusPrev, tk_strictMotif, tk_bisque and
  option_readfile;
* Wm: wm_iconphoto.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151744: Add curses.nofilter() (GH-151747)
Serhiy Storchaka [Fri, 19 Jun 2026 17:49:26 +0000 (20:49 +0300)] 
gh-151744: Add curses.nofilter() (GH-151747)

Wrap the ncurses nofilter() function, which undoes the effect of
filter().  Without it there is no way to restore normal screen sizing
after a curses.filter() call in the same process.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.ttk methods (GH-151736)
Serhiy Storchaka [Fri, 19 Jun 2026 15:45:39 +0000 (18:45 +0300)] 
gh-151678: Add tests for tkinter.ttk methods (GH-151736)

Cover previously-untested ttk methods:

* Progressbar.step, start and stop;
* Treeview.parent, next, prev, see and identify_element;
* Style.theme_settings;
* OptionMenu.set_menu.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH-151732)
Serhiy Storchaka [Fri, 19 Jun 2026 14:38:32 +0000 (17:38 +0300)] 
gh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH-151732)

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.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-150836: Mount embedded Tk ZIP in _tkinter on Windows (GH-151562)
Jonathan J. Helmus [Fri, 19 Jun 2026 14:23:01 +0000 (09:23 -0500)] 
gh-150836: Mount embedded Tk ZIP in _tkinter on Windows (GH-151562)

Tcl/Tk 9 may embed the Tk script library in the Tk DLL on Windows. This embedded library is not found by Tcl by default.

Mount the loaded Tk DLL as a zipfs archive before calling Tk_Init(), so Tk can find its embedded tk_library using its existing library discovery logic.

Preserve Tk_Init()'s normal path if the library is not embedded.

4 weeks agogh-151693: Make the curses tests portable to other curses implementations (GH-151729)
Serhiy Storchaka [Fri, 19 Jun 2026 11:32:02 +0000 (14:32 +0300)] 
gh-151693: Make the curses tests portable to other curses implementations (GH-151729)

Make the curses tests portable to other curses implementations

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

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for the remaining tkinter widgets (GH-151687)
Serhiy Storchaka [Fri, 19 Jun 2026 10:23:38 +0000 (13:23 +0300)] 
gh-151678: Add tests for the remaining tkinter widgets (GH-151687)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694)
Serhiy Storchaka [Fri, 19 Jun 2026 09:35:36 +0000 (12:35 +0300)] 
gh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.Canvas (GH-151683)
Serhiy Storchaka [Fri, 19 Jun 2026 09:13:41 +0000 (12:13 +0300)] 
gh-151678: Add tests for tkinter.Canvas (GH-151683)

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.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.Listbox (GH-151686)
Serhiy Storchaka [Fri, 19 Jun 2026 09:04:10 +0000 (12:04 +0300)] 
gh-151678: Add tests for tkinter.Listbox (GH-151686)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.Menu (GH-151685)
Serhiy Storchaka [Fri, 19 Jun 2026 08:59:14 +0000 (11:59 +0300)] 
gh-151678: Add tests for tkinter.Menu (GH-151685)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-141510 Add frozendict fast paths to abstract.c (#150692)
da-woods [Fri, 19 Jun 2026 08:41:00 +0000 (09:41 +0100)] 
gh-141510 Add frozendict fast paths to abstract.c (#150692)

Add frozendict to the fast paths of PyMapping_GetOptionalItem(),
PyMapping_Keys(), PyMapping_Values(), and PyMapping_Items().

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 weeks agogh-151695: Fix use-after-free of the curses screen encoding (GH-151696)
Serhiy Storchaka [Fri, 19 Jun 2026 08:38:15 +0000 (11:38 +0300)] 
gh-151695: Fix use-after-free of the curses screen encoding (GH-151696)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agogh-151678: Add tests for tkinter.Text (GH-151681)
Serhiy Storchaka [Fri, 19 Jun 2026 08:38:02 +0000 (11:38 +0300)] 
gh-151678: Add tests for tkinter.Text (GH-151681)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks ago gh-151427: add 'not macOS' and 'not iOS' restrictions on availability state of...
Duprat [Fri, 19 Jun 2026 08:08:53 +0000 (10:08 +0200)] 
 gh-151427: add  'not macOS' and 'not iOS' restrictions on availability state of some functions in `os` module. (#151537)

4 weeks agogh-101100: Document os.uname_result and os.statvfs_result with related constants...
Cody Maloney [Fri, 19 Jun 2026 06:50:22 +0000 (23:50 -0700)] 
gh-101100: Document os.uname_result and os.statvfs_result with related constants (GH-151301)

4 weeks agogh-145177: Bump Emscripten to 6.0.0 (#151611)
Hood Chatham [Thu, 18 Jun 2026 23:29:33 +0000 (19:29 -0400)] 
gh-145177: Bump Emscripten to 6.0.0 (#151611)

Bumps Emscripten to 6.0.0, and fixes related issues in getentropy() and umask().

4 weeks agogh-151229: Add CI to prevent JIT stress test regression (#151647)
Donghee Na [Thu, 18 Jun 2026 19:57:41 +0000 (04:57 +0900)] 
gh-151229: Add CI to prevent JIT stress test regression (#151647)

4 weeks agodocs: Fix broken reference of parameter type in `library/logging.rst` (GH-151645)
mushitoriami [Thu, 18 Jun 2026 17:45:04 +0000 (02:45 +0900)] 
docs: Fix broken reference of parameter type in `library/logging.rst` (GH-151645)

4 weeks agogh-146353: Document `PyBytesWriter_GetData` pointer validity (GH-151418)
Harjoth Khara [Thu, 18 Jun 2026 16:55:06 +0000 (09:55 -0700)] 
gh-146353: Document `PyBytesWriter_GetData` pointer validity (GH-151418)

4 weeks agogh-86726: Add few missing versionadded directives (GH-151662)
Serhiy Storchaka [Thu, 18 Jun 2026 15:46:57 +0000 (18:46 +0300)] 
gh-86726: Add few missing versionadded directives (GH-151662)

Pack.pack_content, Place.place_content and Grid.grid_content were
added in 3.15.

4 weeks agogh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)
Serhiy Storchaka [Thu, 18 Jun 2026 14:34:57 +0000 (17:34 +0300)] 
gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)

It returns a sys.version_info-like named tuple, not a string.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 weeks agoGH-150516: Reduce the work done to spill and reload the stack around calls (GH-151587)
Mark Shannon [Thu, 18 Jun 2026 14:14:30 +0000 (15:14 +0100)] 
GH-150516: Reduce the work done to spill and reload the stack around calls (GH-151587)

4 weeks agogh-86726: Fix "deprecated" directive for wm_attributes (GH-151652)
Serhiy Storchaka [Thu, 18 Jun 2026 13:26:58 +0000 (16:26 +0300)] 
gh-86726: Fix "deprecated" directive for wm_attributes (GH-151652)

4 weeks agogh-141510 Document and test frozendict class matching behaviour (#150799)
da-woods [Thu, 18 Jun 2026 12:53:09 +0000 (13:53 +0100)] 
gh-141510 Document and test frozendict class matching behaviour (#150799)

Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering.

4 weeks agogh-86726: Document the full public API of tkinter (GH-151579)
Serhiy Storchaka [Thu, 18 Jun 2026 12:39:06 +0000 (15:39 +0300)] 
gh-86726: Document the full public API of tkinter (GH-151579)

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.

--------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 weeks agogh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609)
Donghee Na [Thu, 18 Jun 2026 11:58:12 +0000 (20:58 +0900)] 
gh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609)

4 weeks agogh-151623: Add missing curses docstrings and document intrflush() (#151632)
Serhiy Storchaka [Thu, 18 Jun 2026 10:52:26 +0000 (13:52 +0300)] 
gh-151623: Add missing curses docstrings and document intrflush() (#151632)

4 weeks agogh-151623: Improve curses documentation style (#151635)
Hugo van Kemenade [Thu, 18 Jun 2026 09:43:33 +0000 (12:43 +0300)] 
gh-151623: Improve curses documentation style (#151635)

4 weeks agogh-151623: Improve curses documentation and docstrings (GH-151625)
Serhiy Storchaka [Thu, 18 Jun 2026 08:20:03 +0000 (11:20 +0300)] 
gh-151623: Improve curses documentation and docstrings (GH-151625)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.

5 weeks agodocs: Fix indent misalignment in `library/logging.config.rst` (GH-151617)
mushitoriami [Thu, 18 Jun 2026 07:21:24 +0000 (16:21 +0900)] 
docs: Fix indent misalignment in `library/logging.config.rst` (GH-151617)

5 weeks agogh-150942: Optimize PicklerMemoProxy.copy() with _PyDict_SetItem_Take2 (gh-151608)
Donghee Na [Thu, 18 Jun 2026 00:08:00 +0000 (09:08 +0900)] 
gh-150942: Optimize PicklerMemoProxy.copy() with _PyDict_SetItem_Take2 (gh-151608)

5 weeks agogh-151436: Fix missing `tstate->last_profiled_frame` updates (#151437)
Maurycy Pawłowski-Wieroński [Wed, 17 Jun 2026 20:49:23 +0000 (22:49 +0200)] 
gh-151436: Fix missing `tstate->last_profiled_frame` updates (#151437)

5 weeks agogh-151510: Fix __lazy_import__ without frame (#151511)
AN Long [Wed, 17 Jun 2026 18:09:51 +0000 (03:09 +0900)] 
gh-151510: Fix __lazy_import__ without frame (#151511)

5 weeks agogh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)
Petr Viktorin [Wed, 17 Jun 2026 13:27:02 +0000 (15:27 +0200)] 
gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)

The initial implementation of PEP 820 worsened the error message
when non-types are given as base types in Py_tp_bases & Py_tp_base.
Bring back the 'bases must be types' wording and add a 'got' note for
easier debugging.

Improve slot ID documentation, and soft-deprecate Py_tp_base
(as per the PEP).

5 weeks agogh-150966: Fix live profiling error tests (GH-151020)
Pablo Galindo Salgado [Wed, 17 Jun 2026 13:17:16 +0000 (14:17 +0100)] 
gh-150966: Fix live profiling error tests (GH-151020)

5 weeks agogh-151584: Remove `PyUnstable_Module_SetGIL` call in `_remote_debugging` (#151585)
sobolevn [Wed, 17 Jun 2026 12:37:08 +0000 (15:37 +0300)] 
gh-151584: Remove `PyUnstable_Module_SetGIL` call in `_remote_debugging` (#151585)

5 weeks agogh-120665: make unittest loaders avoid loading test cases that are abstract base...
blhsing [Wed, 17 Jun 2026 11:48:09 +0000 (04:48 -0700)] 
gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (#120666)

5 weeks agogh-151593: Use timeout on GitHub Action TSan jobs (#151594)
Victor Stinner [Wed, 17 Jun 2026 11:02:22 +0000 (13:02 +0200)] 
gh-151593: Use timeout on GitHub Action TSan jobs (#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.

5 weeks agogh-151496: Use process groups in test_dtrace (#151512)
Victor Stinner [Wed, 17 Jun 2026 08:58:22 +0000 (10:58 +0200)] 
gh-151496: Use process groups in test_dtrace (#151512)

Create a new process group to run bpftrace commands, so it's possible
to kill also child processes on timeout.

5 weeks agogh-151546: Fix stack limits on musl (#151548)
Victor Stinner [Wed, 17 Jun 2026 08:23:57 +0000 (10:23 +0200)] 
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.

5 weeks agogh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup...
Steve Dower [Tue, 16 Jun 2026 23:16:06 +0000 (00:16 +0100)] 
gh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup.local for discovering sources in getpath.py (GH-151545)

5 weeks agogh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the...
Daniele Parmeggiani [Tue, 16 Jun 2026 16:56:37 +0000 (17:56 +0100)] 
gh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the current CS2

This mimics an optimization already present for the single-mutex critical section.

5 weeks agogh-118158: Fix missing newline in py_compile CLI error output (#149008)
Xiao Yuan [Tue, 16 Jun 2026 16:41:52 +0000 (19:41 +0300)] 
gh-118158: Fix missing newline in py_compile CLI error output (#149008)

Restore trailing newline in error messages from `python -m py_compile`,
lost when `main()` was refactored to use argparse.

5 weeks agogh-151428: Remove unused imports from stdlib (#151478)
Hugo van Kemenade [Tue, 16 Jun 2026 16:31:01 +0000 (19:31 +0300)] 
gh-151428: Remove unused imports from stdlib (#151478)

5 weeks agogh-151218: Replace sys.flags in PyConfig_Set() (#151402)
Victor Stinner [Tue, 16 Jun 2026 16:17:33 +0000 (18:17 +0200)] 
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.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 weeks agogh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (#151521)
Itamar Oren [Tue, 16 Jun 2026 16:05:21 +0000 (09:05 -0700)] 
gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (#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.

5 weeks agogh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120)
dev [Tue, 16 Jun 2026 11:49:54 +0000 (17:19 +0530)] 
gh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120)

Encode the payload with output_charset instead of input_charset.

5 weeks agogh-151522: Guard against None transport in slow-socket SSL test (#151523)
Itamar Oren [Tue, 16 Jun 2026 04:51:39 +0000 (21:51 -0700)] 
gh-151522: Guard against None transport in slow-socket SSL test (#151523)

5 weeks agogh-151422: Don't link libffi into _ctypes_test.so (#151423)
Hood Chatham [Mon, 15 Jun 2026 22:16:16 +0000 (15:16 -0700)] 
gh-151422: Don't link libffi into _ctypes_test.so (#151423)

_ctypes_test doesn't use libffi directly, and linking it into the module
causes emscripten tests to fail.

5 weeks agogh-151128: Improve SyntaxError message for cross language keywords (GH-151129)
Langyan [Mon, 15 Jun 2026 17:55:57 +0000 (01:55 +0800)] 
gh-151128: Improve SyntaxError message for cross language keywords (GH-151129)

5 weeks agogh-151223: fix tsan data races in load global specializations (#151393)
Kumar Aditya [Mon, 15 Jun 2026 16:39:49 +0000 (22:09 +0530)] 
gh-151223: fix tsan data races in load global specializations (#151393)

5 weeks agogh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433)
Weilin Du [Mon, 15 Jun 2026 16:11:10 +0000 (00:11 +0800)] 
gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433)

Co-authored-by: Stan Ulbrych <stan@python.org>
5 weeks agogh-92455: Respect case-sensitive mimetype suffixes (GH-148782)
Xiao Yuan [Mon, 15 Jun 2026 15:05:29 +0000 (18:05 +0300)] 
gh-92455: Respect case-sensitive mimetype suffixes (GH-148782)

5 weeks agogh-149079: Optimize sorting in unicodedata.normalize() (GH-150782)
Serhiy Storchaka [Mon, 15 Jun 2026 14:36:50 +0000 (17:36 +0300)] 
gh-149079: Optimize sorting in unicodedata.normalize() (GH-150782)

Sort the Py_UCS4 buffer instead of PyUnicodeObject. This allows to avoid
the use of PyUnicode_READ() and PyUnicode_WRITE().

5 weeks agogh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (#148854)
Nick Begg [Mon, 15 Jun 2026 14:25:08 +0000 (16:25 +0200)] 
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (#148854)

/run/ on my FreeBSD install is not readable causing failing test.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 weeks agoFix issues reported by cpython-review-toolkit in faulthandler (#151341)
Victor Stinner [Mon, 15 Jun 2026 11:11:26 +0000 (13:11 +0200)] 
Fix issues reported by cpython-review-toolkit in faulthandler (#151341)

* snprintf() is not async-signal-safe: replace it with
  _Py_DumpDecimal().
* Fix tid type from 'long' to 'unsigned long'.
* Replace PyLong_AsLong() with PyLong_AsInt().
* Avoid unnecessary narrowing cast on _Py_write_noraise() call.

5 weeks agogh-139227: Remove unused _PyRuntime.imports.pkgcontext (#151490)
Victor Stinner [Mon, 15 Jun 2026 10:23:04 +0000 (12:23 +0200)] 
gh-139227: Remove unused _PyRuntime.imports.pkgcontext (#151490)

The global variable has been replaced by a new thread local variable
"pkgcontext" in Python/import.c.

5 weeks agogh-146102: Fix type slot_bf_getbuffer() error handling (#151346)
Victor Stinner [Mon, 15 Jun 2026 09:47:58 +0000 (11:47 +0200)] 
gh-146102: Fix type slot_bf_getbuffer() error handling (#151346)

Call PyBuffer_Release() if PyObject_GC_New() fails.

Fix also bytes_join(): only call Py_DECREF(item) after formatting the
error message which uses item.

5 weeks agogh-146102: Don't clear exception on success in odictobject.c (#151347)
Victor Stinner [Mon, 15 Jun 2026 09:46:52 +0000 (11:46 +0200)] 
gh-146102: Don't clear exception on success in odictobject.c (#151347)

Calling PyErr_Clear() on success can mask a pending exception.
Replace it with an assertion checking that no exception is set.

5 weeks agogh-137759: Replace _PyObject_HashFast() with PyObject_Hash() in setobject.c (#137828)
JasonMendoza2008 [Mon, 15 Jun 2026 09:31:04 +0000 (11:31 +0200)] 
gh-137759: Replace _PyObject_HashFast() with PyObject_Hash() in setobject.c (#137828)

Replace also _PyObject_HashFast() with PyObject_Hash()
in _collections._count_elements().

Rename _PyObject_HashFast() to _PyObject_HashDictKey(),
and mark it as Py_ALWAYS_INLINE.

Only use _PyObject_HashDictKey() on dictionaries.

5 weeks agoAdd `.toml` to `.editorconfig` (#151481)
sobolevn [Mon, 15 Jun 2026 09:14:11 +0000 (12:14 +0300)] 
Add `.toml` to `.editorconfig` (#151481)

5 weeks agogh-149671: Restore compatibility with setuptools -nspkg.pth files in site module...
Victor Stinner [Mon, 15 Jun 2026 08:29:52 +0000 (10:29 +0200)] 
gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (#151319)

Inject the "sitedir" variable in the frame which executes ".pth" code.

5 weeks agogh-130197: Test `pygettext`'s `--version` CLI option (#133022)
Stan Ulbrych [Sun, 14 Jun 2026 19:17:45 +0000 (20:17 +0100)] 
gh-130197: Test `pygettext`'s `--version` CLI option (#133022)

5 weeks agogh-151390: Colorize `match +` and `match -` in the REPL (#151391)
Bartosz Sławecki [Sun, 14 Jun 2026 16:06:30 +0000 (18:06 +0200)] 
gh-151390: Colorize `match +` and `match -` in the REPL (#151391)

5 weeks agogh-151428: Remove unused imports from `Tools/` (#151442)
Ivy Xu [Sun, 14 Jun 2026 13:12:30 +0000 (21:12 +0800)] 
gh-151428: Remove unused imports from `Tools/` (#151442)

5 weeks agogh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH...
Aniket [Sun, 14 Jun 2026 12:39:33 +0000 (18:09 +0530)] 
gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)

Co-authored-by: Victor Stinner <vstinner@python.org>
5 weeks agogh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462)
Bartosz Sławecki [Sun, 14 Jun 2026 12:33:03 +0000 (14:33 +0200)] 
gh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462)

5 weeks agoSkip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)
Gregory P. Smith [Sun, 14 Jun 2026 12:29:26 +0000 (05:29 -0700)] 
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.

5 weeks agogh-151428: Remove unused imports in the stdlib (#151440)
Ivy Xu [Sun, 14 Jun 2026 12:00:28 +0000 (20:00 +0800)] 
gh-151428: Remove unused imports in the stdlib (#151440)

5 weeks agogh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True...
Maurycy Pawłowski-Wieroński [Sat, 13 Jun 2026 23:10:56 +0000 (01:10 +0200)] 
gh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True)` by copying chunks on cache miss (#151426)