]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 days agogh-151558: Fix symlink escape via `tarfile` hardlink-extraction fallback (GH-151559)
Stan Ulbrych [Tue, 23 Jun 2026 13:31:38 +0000 (14:31 +0100)] 
gh-151558: Fix symlink escape via `tarfile` hardlink-extraction fallback (GH-151559)

6 days agogh-151981: Make tarfile._Stream.seek break at EOF (GH-151982)
Petr Viktorin [Tue, 23 Jun 2026 13:13:30 +0000 (15:13 +0200)] 
gh-151981: Make tarfile._Stream.seek break at EOF (GH-151982)

Co-authored-by: Stan Ulbrych <stan@python.org>
6 days agogh-151556: Show example CSV file content in the `csv` module docs (#151563)
Lucas [Tue, 23 Jun 2026 12:01:21 +0000 (09:01 -0300)] 
gh-151556: Show example CSV file content in the `csv` module docs (#151563)

Co-authored-by: Stan Ulbrych <stan@python.org>
6 days agoClarify `multiprocessing.Queue.get_nowait()` documentation (#150863)
Jack Harper [Tue, 23 Jun 2026 11:29:20 +0000 (12:29 +0100)] 
Clarify `multiprocessing.Queue.get_nowait()` documentation (#150863)

7 days agogh-151497: Avoid huge pre-allocation for oversized tarfile extended headers (GH-151498)
Shardul Deshpande [Tue, 23 Jun 2026 09:32:31 +0000 (15:02 +0530)] 
gh-151497: Avoid huge pre-allocation for oversized tarfile extended headers (GH-151498)

tarfile reads a member's extended header (a GNU long name/link or a pax
header) with a single read sized by the header's size field:

    buf = tarfile.fileobj.read(self._block(self.size))

The size is taken from the archive and is not validated, so a ~512-byte
crafted file can claim several gigabytes (or, via base-256 encoding, far
more) and make read() pre-allocate that much memory -- on open/iterate,
before any extraction filter runs.

Read the extended-header data in bounded chunks instead, so an oversized
or truncated header can no longer force a huge allocation. The bytes
returned for valid archives are unchanged.

7 days agogh-59396: Modernize tkinter.simpledialog (GH-151848)
Serhiy Storchaka [Tue, 23 Jun 2026 08:01:10 +0000 (11:01 +0300)] 
gh-59396: Modernize tkinter.simpledialog (GH-151848)

Rework SimpleDialog and Dialog to match the look and feel of the native Tk
dialogs ::tk_dialog and ::tk::MessageBox.

* SimpleDialog is a Python port of ::tk_dialog and Dialog a base class
  modelled on ::tk::MessageBox.  Both adopt the message-box keyboard
  conventions: button accelerators, a default ring that follows the keyboard
  focus, and a <Return> binding that invokes the focused button.
* Both classes gain a use_ttk parameter that selects the classic Tk or the
  themed ttk widgets.  It controls the widget set and the appearance that the
  two procedures style differently, but not the keyboard behaviour.
* Update _place_window with the Tk 9.1 placement refinements.
* The new helpers _temp_grab_focus (a modal grab/focus context manager),
  _underline_ampersand and _find_alt_key_target (ports of the Tk
  accelerator-key procedures) can be reused by other tkinter dialogs, as
  _setup_dialog already is.
* Fix several defects uncovered while comparing with the Tcl sources.
* Improve the simpledialog demo.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-101284: Allow passing Menubutton options to tkinter.OptionMenu (GH-151959)
Serhiy Storchaka [Tue, 23 Jun 2026 06:24:17 +0000 (09:24 +0300)] 
gh-101284: Allow passing Menubutton options to tkinter.OptionMenu (GH-151959)

Arbitrary keyword arguments are now forwarded to the underlying
Menubutton and can override OptionMenu's default appearance options.
The positional API is unchanged.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-151678: Add tests for ttk Menubutton and OptionMenu widget options (GH-151960)
Serhiy Storchaka [Tue, 23 Jun 2026 06:17:16 +0000 (09:17 +0300)] 
gh-151678: Add tests for ttk Menubutton and OptionMenu widget options (GH-151960)

Decorate ttk.MenubuttonTest with add_configure_tests() and make
ttk.OptionMenuTest inherit it to cover the standard widget options.

7 days agogh-75666: Fix a reference leak in tkinter event bindings (GH-151808)
Serhiy Storchaka [Tue, 23 Jun 2026 03:59:25 +0000 (06:59 +0300)] 
gh-75666: Fix a reference leak in tkinter event bindings (GH-151808)

The Tcl commands created for event callbacks are now deleted when a
binding is replaced or unbound, instead of being leaked.

7 days agogh-151722: Defer GC tracking of frozendict to end of construction (gh-151740)
Donghee Na [Mon, 22 Jun 2026 23:45:55 +0000 (08:45 +0900)] 
gh-151722: Defer GC tracking of frozendict to end of construction (gh-151740)

7 days agoGH-150605: use windows-2025 in GitHub Actions (#150606)
Chris Eibl [Mon, 22 Jun 2026 20:21:08 +0000 (22:21 +0200)] 
GH-150605: use windows-2025 in GitHub Actions (#150606)

use windows-2025 in GitHub Actions

7 days agogh-62480: De-personalize docs on using the C API (#151784)
Rafael Weingartner-Ortner [Mon, 22 Jun 2026 20:01:09 +0000 (22:01 +0200)] 
gh-62480: De-personalize docs on using the C API (#151784)

Co-authored-by: Stan Ulbrych <stan@python.org>
7 days agogh-151920: Add the ttk.Style.theme_styles() method (GH-151921)
Serhiy Storchaka [Mon, 22 Jun 2026 17:43:43 +0000 (20:43 +0300)] 
gh-151920: Add the ttk.Style.theme_styles() method (GH-151921)

Wrap the Tk 9.0 ``ttk::style theme styles ?themeName?`` subcommand as
ttk.Style.theme_styles(themename=None), returning the list of styles
defined in a theme (the current theme if themename is omitted).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-151886: Add tkinter Misc.tk_appname, tk_useinputmethods and tk_caret (GH-151887)
Serhiy Storchaka [Mon, 22 Jun 2026 17:31:25 +0000 (20:31 +0300)] 
gh-151886: Add tkinter Misc.tk_appname, tk_useinputmethods and tk_caret (GH-151887)

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

* Misc.tk_appname() queries or sets the name used to communicate with the
  application through the send command (Tk 8.5).
* Misc.tk_useinputmethods() queries or sets whether Tk uses the X Input
  Methods (XIM) for filtering events (Tk 8.5).
* Misc.tk_caret() sets or queries the per-display caret location used for
  accessibility and for placing the input method window (Tk 8.5).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-151890: Support more photo image options in tkinter.PhotoImage methods (GH-151891)
Serhiy Storchaka [Mon, 22 Jun 2026 16:35:39 +0000 (19:35 +0300)] 
gh-151890: Support more photo image options in tkinter.PhotoImage methods (GH-151891)

Add parameters mapping to Tk photo image options that previously had no
tkinter equivalent:

* the format parameter of PhotoImage.put() (Tk 8.6),
* the metadata parameter of PhotoImage.put(), read(), write() and data()
  (Tk 9.0),
* the withalpha parameter of PhotoImage.get() (Tk 9.0).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-150162: Fix sysconfig cross-compile impermanence (#150164)
hetmankp [Mon, 22 Jun 2026 15:59:03 +0000 (01:59 +1000)] 
gh-150162: Fix sysconfig cross-compile impermanence (#150164)

Fixes issue #150162 by improving the code introduced by 70154855cf69
(GH-127729) while retaining the original documented intent. The
aforementioned code has a side effect when used in a virtual environment
context, on posix platforms, with the cross-compiling environment
variable _PYTHON_PROJECT_BASE present. In this case, every single
sysconfig.get_config_vars() and sysconfig.get_config_var() call, forces
the _CONFIG_VARS dictionary to be reinitialised from scratch. This is
inefficient, but also means no changes to the dictionary returned by
sysconfig.get_config_vars() persist, which can be useful in certain
situations.

This commit tracks changes to sys.prefix and sys.exec_prefix more
directly rather than relying on a misalignment with the corresponding
sysconfig variables.

7 days agogh-140006: Harden fish prompt against shadowed builtins (#150936)
Bernát Gábor [Mon, 22 Jun 2026 15:39:08 +0000 (08:39 -0700)] 
gh-140006: Harden fish prompt against shadowed builtins (#150936)

A user function that shadows the `.`/`source` builtin hijacks the
activate.fish prompt. fish resolves functions ahead of builtins, so the
`echo "exit $status" | .` line that restores the exit status pipes into
the user function instead of sourcing. Dot-style directory navigators
redefine `.`, which made the prompt list the directory on every command
and dropped the exit status handed to the original prompt.

Route every builtin the prompt path uses (`source`, `echo`, `printf`,
`set_color`, `functions`) through `builtin` so no user function can
intercept them. These have all been fish builtins with a stable
interface since fish 2.0.0, the version the script already required
through `functions --copy`, so the minimum supported fish version does
not change.

7 days agogh-151888: Add tkinter PhotoImage.redither method (GH-151889)
Serhiy Storchaka [Mon, 22 Jun 2026 15:19:56 +0000 (18:19 +0300)] 
gh-151888: Add tkinter PhotoImage.redither method (GH-151889)

Wrap the photo image "redither" Tk command (since Tk 8.5) as the method
PhotoImage.redither(), which recalculates the dithered image in each
window where it is displayed (useful when the image data was supplied in
pieces), completing the wrapping of the photo image subcommands.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-111501: venv: do not export PS1 in activate (#105279)
Ronan Pigott [Mon, 22 Jun 2026 14:40:23 +0000 (07:40 -0700)] 
gh-111501: venv: do not export PS1 in activate (#105279)

PS1 is a parameter special to the current interactive shell. It does not
need to be exported to the environment. Exporting PS1 is not useful, and
will break different shells spawned by the current interactive shell.

7 days agogh-127727: Warn when running a virtual environment created for a different minor...
Sepehr Rasouli [Mon, 22 Jun 2026 14:29:15 +0000 (17:59 +0330)] 
gh-127727: Warn when running a virtual environment created for a different minor Python version (#149715)

7 days agogh-151560: fix `AttributeError` when running `test.test_importlib.resources.test_reso...
U2A2U2A1 [Mon, 22 Jun 2026 14:17:26 +0000 (23:17 +0900)] 
gh-151560: fix `AttributeError` when running `test.test_importlib.resources.test_resource` (#151561)

* [gh-151560]
import MetaPathFinder, Loader from importlib.abc
+ make it used

* sort import alphabetically

7 days agogh-151866: Remove unneeded `zlib` dependency in `test_zipfile.test_core` (#135631)
Danny Lin [Mon, 22 Jun 2026 14:11:24 +0000 (22:11 +0800)] 
gh-151866: Remove unneeded `zlib` dependency in `test_zipfile.test_core` (#135631)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
7 days agoCorrect typos in `runpy.run_path` documentation (#151230)
_andthereitgoes [Mon, 22 Jun 2026 14:07:39 +0000 (00:07 +1000)] 
Correct typos in `runpy.run_path` documentation (#151230)

*file_path* -> *path_name* in runpy.rst

The documentation for runpy.run_path refers to a parameter called *file_path*, which doesn't exist in the call spec. However, *path_name* exists, and it is implied that *file_path* actually refers to *path_name*.

7 days agogh-124113: Clarify venv target directory reuse (#151419)
Harjoth Khara [Mon, 22 Jun 2026 14:05:03 +0000 (07:05 -0700)] 
gh-124113: Clarify venv target directory reuse (#151419)

* gh-124113: Clarify venv target directory reuse

* gh-124113: Refine venv reuse wording

* gh-124113: State that --clear also deletes non-venv files

7 days agogh-151126: Fix missing `PyErr_NoMemory` in `getpath.c` (#151590)
Ivy Xu [Mon, 22 Jun 2026 13:59:22 +0000 (21:59 +0800)] 
gh-151126: Fix missing `PyErr_NoMemory` in `getpath.c` (#151590)

7 days 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>
7 days 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>
7 days 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>
7 days 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>
7 days 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>
7 days 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>
7 days 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)

7 days 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)

7 days 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)

8 days 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)

8 days 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

8 days 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)

8 days 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)

8 days 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

8 days 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>
8 days 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)

8 days 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)

8 days 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)

9 days 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>
9 days 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>
9 days 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>
9 days 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>
9 days 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.

9 days 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>
9 days 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>
9 days 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>
9 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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>
10 days 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.

10 days 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>
10 days 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>
11 days 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>
11 days 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>
11 days 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>
11 days 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>
11 days 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>
11 days 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>
11 days 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>
11 days 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)

11 days 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)

11 days 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().

11 days 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)

11 days 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)

11 days 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)

11 days 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.

11 days 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>
11 days 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)

11 days 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)

11 days 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.

11 days 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>
11 days 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)

11 days 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)

12 days 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)

12 days 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.

12 days 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)

12 days 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)

12 days 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)

12 days 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)

12 days 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).

12 days 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)

12 days 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)

12 days 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)

12 days 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.

13 days 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.

13 days 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.

13 days 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)

13 days 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.

13 days 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.

13 days 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)

13 days 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>