]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 days agogh-152100: Support set operations in character classes (GH-152153)
Serhiy Storchaka [Thu, 25 Jun 2026 07:09:41 +0000 (10:09 +0300)] 
gh-152100: Support set operations in character classes (GH-152153)

Implement set difference [A--B], intersection [A&&B] and union [A||B] in
regular expression character classes (Unicode Technical Standard #18),
including nested, complemented and compound set operands.  Symmetric
difference [A~~B] remains reserved.

Also use the new syntax in the standard library (_strptime, textwrap,
doctest, pkgutil).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agogh-151763: Fix crash in `_interpqueues.create` on `MemoryError` (#152131)
sobolevn [Thu, 25 Jun 2026 07:04:02 +0000 (10:04 +0300)] 
gh-151763: Fix crash in `_interpqueues.create` on `MemoryError` (#152131)

5 days agogh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (#152127)
Victor Stinner [Wed, 24 Jun 2026 23:30:51 +0000 (01:30 +0200)] 
gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (#152127)

GHA: Run test.pythoninfo on the "Cross build Linux" job.

5 days agogh-152093: Fix test_tk_caret() on macOS (GH-152115)
Serhiy Storchaka [Wed, 24 Jun 2026 21:36:57 +0000 (00:36 +0300)] 
gh-152093: Fix test_tk_caret() on macOS (GH-152115)

macOS records the caret only for the key window, so the query reads back
zeros instead of the values set in the test.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agogh-105895: Add `match` and `case` doc to `help()` (#152113)
sobolevn [Wed, 24 Jun 2026 21:31:57 +0000 (00:31 +0300)] 
gh-105895: Add `match` and `case` doc to `help()` (#152113)

Co-authored-by: dzherb <zherbin.dima@yandex.ru>
Co-authored-by: Stan Ulbrych <stan@python.org>
5 days agogh-151776: Add curses state-query functions (GH-151778)
Serhiy Storchaka [Wed, 24 Jun 2026 19:31:50 +0000 (22:31 +0300)] 
gh-151776: Add curses state-query functions (GH-151778)

Add window methods and module functions that report curses state which could
previously only be set: the window getters is_cleared(), is_idcok(),
is_idlok(), is_immedok(), is_keypad(), is_leaveok(), is_nodelay(),
is_notimeout(), is_pad(), is_scrollok(), is_subwin(), is_syncok(),
getdelay(), getparent() and getscrreg(), and the functions is_cbreak(),
is_echo(), is_nl() and is_raw().  They are available when built against an
ncurses with NCURSES_EXT_FUNCS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days agoAdd Jacob to CODEOWNERS for Infra/GHA/CI (#152112)
Jacob Coffee [Wed, 24 Jun 2026 19:12:01 +0000 (21:12 +0200)] 
Add Jacob to CODEOWNERS for Infra/GHA/CI  (#152112)

5 days agogh-151774: Add curses dynamic color-pair functions (GH-151775)
Serhiy Storchaka [Wed, 24 Jun 2026 18:24:11 +0000 (21:24 +0300)] 
gh-151774: Add curses dynamic color-pair functions (GH-151775)

Add alloc_pair(), find_pair(), free_pair() and reset_color_pairs(),
wrapping the ncurses extended-color dynamic pair management.  They are
available only when built against a wide-character ncurses with
extended-color support.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days agogh-86726: Improve the structure of the tkinter reference (GH-152109)
Serhiy Storchaka [Wed, 24 Jun 2026 18:10:16 +0000 (21:10 +0300)] 
gh-86726: Improve the structure of the tkinter reference (GH-152109)

Add short group intros before each cluster of Misc methods.
Group the Tk and Toplevel classes in a new "Toplevel widgets" section, move
the Tcl() function to the module-level functions, and move the "File
handlers" section into the reference.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agoRe-raise unexpected exceptions instead of swallowing them in various tests (#152019)
An Long [Wed, 24 Jun 2026 16:26:34 +0000 (01:26 +0900)] 
Re-raise unexpected exceptions instead of swallowing them in various tests (#152019)

Co-authored-by: Stan Ulbrych <stan@python.org>
5 days agogh-151955: Allow more ParamSpec and TypeVarTuple bounds (#151956)
Jelle Zijlstra [Wed, 24 Jun 2026 16:10:10 +0000 (09:10 -0700)] 
gh-151955: Allow more ParamSpec and TypeVarTuple bounds (#151956)

5 days agogh-151763: Fix NULL dereference in `os._path_normpath()` under OOM (#151779)
Zain Nadeem [Wed, 24 Jun 2026 15:56:10 +0000 (20:56 +0500)] 
gh-151763: Fix NULL dereference in `os._path_normpath()` under OOM (#151779)

5 days agogh-151485: Fix command quoting in subprocess.CalledProcessError.__str__ (#151486)
Benjy Wiener [Wed, 24 Jun 2026 14:11:02 +0000 (17:11 +0300)] 
gh-151485: Fix command quoting in subprocess.CalledProcessError.__str__ (#151486)

CalledProcessError previously formatted cmd as `"... '%s' ..."`. This lead to
unbalanced quoting when cmd contains single-quotes or, more commonly, when cmd
is a list. This change updates the relevant format strings to use %r instead.

Co-authored-by: Benjy Wiener <benjywiener@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 days agogh-90949: Fix copy-paste typo in pyexpat capsule API initialization (#151147)
Stan Ulbrych [Wed, 24 Jun 2026 14:10:46 +0000 (15:10 +0100)] 
gh-90949: Fix copy-paste typo in pyexpat capsule API initialization (#151147)

5 days ago`valgrind-python.supp`: Update suppression for readline leaks (#151783)
Stan Ulbrych [Wed, 24 Jun 2026 13:54:33 +0000 (14:54 +0100)] 
`valgrind-python.supp`: Update suppression for readline leaks (#151783)

5 days agogh-151496: Use process groups in TraceBackend in test_dtrace (#152039)
stratakis [Wed, 24 Jun 2026 13:46:56 +0000 (15:46 +0200)] 
gh-151496: Use process groups in TraceBackend in test_dtrace (#152039)

Run the generic DTrace/SystemTap commands in a new process group and
terminate the whole group on timeout.

This prevents a forked tracer child from keeping stdout/stderr pipes
open after the direct tracer process is killed.

5 days agogh-152060: Fix `_pydatetime.fromisoformat()` raising `AssertionError` on invalid...
tonghuaroot (童话) [Wed, 24 Jun 2026 13:40:46 +0000 (21:40 +0800)] 
gh-152060: Fix `_pydatetime.fromisoformat()` raising `AssertionError` on invalid lengths (#152061)

5 days agogh-151456: Document the show_jit parameter in dis (#151457)
Shardul Deshpande [Wed, 24 Jun 2026 13:05:37 +0000 (18:35 +0530)] 
gh-151456: Document the show_jit parameter in dis (#151457)

show_jit was added to dis.dis(), distb(), disassemble(), get_instructions() and the Bytecode class (gh-150478) but was never documented. Document it across those APIs with a versionchanged:: 3.16 note, and fix a pre-existing show_offset -> show_offsets typo in the distb signature.

6 days agogh-152020: Fix `asyncio.all_tasks()` loosing eager tasks on FT-build (#152022)
Timofei [Wed, 24 Jun 2026 12:21:42 +0000 (15:21 +0300)] 
gh-152020: Fix `asyncio.all_tasks()` loosing eager tasks on FT-build (#152022)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
6 days agogh-151814: Fix unbounded memory growth from repeated empty writes to `io.TextIOWrappe...
Stan Ulbrych [Wed, 24 Jun 2026 11:47:52 +0000 (12:47 +0100)] 
gh-151814: Fix unbounded memory growth from repeated empty writes to `io.TextIOWrapper` (#151817)

6 days agogh-151763: Fix possible crash on `CodeType` deallocation (#152034)
sobolevn [Wed, 24 Jun 2026 11:46:39 +0000 (14:46 +0300)] 
gh-151763: Fix possible crash on `CodeType` deallocation (#152034)

6 days agogh-90092: Support multiple terminals in the curses module (GH-151748)
Serhiy Storchaka [Wed, 24 Jun 2026 11:33:02 +0000 (14:33 +0300)] 
gh-90092: Support multiple terminals in the curses module (GH-151748)

Add the X/Open Curses SCREEN API for driving more than one terminal:
newterm() and set_term(), plus the ncurses extension new_prescr().

A new screen object wraps the C SCREEN.  It exposes the terminal's
standard window as screen.stdscr.  Each window keeps a reference to its
screen (like a subwindow does to its parent window), so the screen is
deleted automatically once it and all of its windows are unreferenced.

The ncurses use_screen()/use_window() locking helpers are exposed as
the screen.use() and window.use() methods.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-151757: Fix curses wide-character tests in non-UTF-8 locales (GH-152062)
Serhiy Storchaka [Wed, 24 Jun 2026 11:16:44 +0000 (14:16 +0300)] 
gh-151757: Fix curses wide-character tests in non-UTF-8 locales (GH-152062)

wcwidth() only classifies combining characters in a locale that can
encode them, so guard the wide-character test operations on encodability.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-140550: Docs additions & fixups for PEP 793 (GH-151661)
Petr Viktorin [Wed, 24 Jun 2026 11:15:25 +0000 (13:15 +0200)] 
gh-140550: Docs additions & fixups for PEP 793 (GH-151661)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
6 days agogh-152056: Compile single-category character sets to a bare CATEGORY opcode (GH-152057)
Pieter Eendebak [Wed, 24 Jun 2026 11:09:50 +0000 (13:09 +0200)] 
gh-152056: Compile single-category character sets to a bare CATEGORY opcode (GH-152057)

A character set containing exactly one category, e.g. [\d] or [^\s], now
compiles to a single CATEGORY opcode (like \d or \S) instead of an IN
block.  The negated form maps to the complementary category.  This speeds
up matching and reduces the size of the compiled byte code.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agoCapitalize first word in `unittest.mock.assert_*` docs and docstrings (#151951)
Hans Yu [Wed, 24 Jun 2026 10:07:21 +0000 (12:07 +0200)] 
Capitalize first word in `unittest.mock.assert_*` docs and docstrings (#151951)

6 days agogh-84008: Document that the LC_NUMERIC locale affects tkinter numeric widgets (GH...
Serhiy Storchaka [Wed, 24 Jun 2026 06:30:17 +0000 (09:30 +0300)] 
gh-84008: Document that the LC_NUMERIC locale affects tkinter numeric widgets (GH-152008)

Spinbox, Scale and ttk.Spinbox format floating-point values according to
the LC_NUMERIC locale, but such values are always parsed with a period, so
a comma-decimal locale breaks DoubleVar.get().

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-87904: Document curses classes (GH-151643)
Serhiy Storchaka [Wed, 24 Jun 2026 06:08:34 +0000 (09:08 +0300)] 
gh-87904: Document curses classes (GH-151643)

Add docstrings for the curses.window, curses.error, curses.panel.panel
and curses.panel.error classes.  Document the panel class and its error
exception in curses.panel.rst, using the real lowercase panel name.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-126219: Fix crash in tkinter.Tk with non-BMP className on Tcl/Tk 8.x (GH-151980)
Serhiy Storchaka [Wed, 24 Jun 2026 05:59:42 +0000 (08:59 +0300)] 
gh-126219: Fix crash in tkinter.Tk with non-BMP className on Tcl/Tk 8.x (GH-151980)

Tcl 8.x crashes when title-casing a non-BMP character during Tk
initialization, so such a className is now rejected with a ValueError.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-151757: Support wide and combining characters in the curses module (GH-151758)
Serhiy Storchaka [Wed, 24 Jun 2026 05:52:10 +0000 (08:52 +0300)] 
gh-151757: Support wide and combining characters in the curses module (GH-151758)

The character-cell window methods now accept a full character cell -- a
spacing character optionally followed by combining characters (up to
CCHARW_MAX wide characters) -- in addition to a single int or byte
character.  This affects addch(), bkgd(), bkgdset(), border(), box(),
echochar(), hline(), insch() and vline(); they dispatch to the ncursesw
wide-character functions (wadd_wch(), wbkgrnd(), wborder_set(),
wecho_wchar(), whline_set(), wins_wch(), wvline_set(), ...) when given a
string.  border() and box() cannot mix integer or byte characters with
wide string characters in a single call.  A cell is one spacing character
optionally followed by combining characters, so an extra spacing or
control character (such as "ab") is rejected with ValueError rather than
being silently truncated by setcchar().

Also add the wide-character read methods get_wstr() and in_wstr(), the
counterparts of getstr() and instr() that return a str rather than a
bytes object, and the module functions erasewchar(), killwchar() and
wunctrl(), the wide-character counterparts of erasechar(), killchar()
and unctrl().

All of this is available only when built against the wide-character
ncursesw library.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-152033: Optimize category escapes outside character sets (GH-152035)
Serhiy Storchaka [Wed, 24 Jun 2026 05:49:14 +0000 (08:49 +0300)] 
gh-152033: Optimize category escapes outside character sets (GH-152035)

Character class escapes (``\d``, ``\D``, ``\s``, ``\S``, ``\w`` and
``\W``) that occur outside a character set are now compiled directly to a
single CATEGORY opcode instead of being wrapped in an IN block.  This
removes the IN wrapper (three code words) and an indirect charset() call,
and makes such an escape a simple repeatable unit so that, for example,
``\d+`` uses the REPEAT_ONE fast path; a CATEGORY case is added to
SRE(count).

The transformation preserves behaviour exactly.  For category-heavy
patterns the compiled byte code is about 20% smaller and matching is up
to ~2x faster, with no effect on patterns that do not use bare category
escapes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-150994: _colorize: modernize typing imports (#151018)
Jelle Zijlstra [Wed, 24 Jun 2026 02:58:00 +0000 (19:58 -0700)] 
gh-150994: _colorize: modernize typing imports (#151018)

6 days agogh-151842: Fix crash upon OOM in `_interpreters.capture_exception` (GH-151843)
Amrutha [Tue, 23 Jun 2026 20:31:47 +0000 (02:01 +0530)] 
gh-151842: Fix crash upon OOM in `_interpreters.capture_exception` (GH-151843)

6 days agogh-150565: Add additional tests for Lazy Imports (#149739)
Brittany Reynoso [Tue, 23 Jun 2026 20:15:11 +0000 (13:15 -0700)] 
gh-150565: Add additional tests for Lazy Imports (#149739)

Add lazy import tests ported from internal test suite

6 days agogh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` (#151582)
Ivy Xu [Tue, 23 Jun 2026 14:48:11 +0000 (22:48 +0800)] 
gh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` (#151582)

Co-authored-by: Stan Ulbrych <stan@python.org>
6 days agogh-151773: Fix NULL dereference in `PyContextVar_Set` (#151836)
dev [Tue, 23 Jun 2026 14:15:15 +0000 (19:45 +0530)] 
gh-151773: Fix NULL dereference in `PyContextVar_Set` (#151836)

6 days agogh-143927: Normalize all line endings (CR, CRLF, and LF) in configparser (GH-143929)
Seth Larson [Tue, 23 Jun 2026 13:33:51 +0000 (08:33 -0500)] 
gh-143927: Normalize all line endings (CR, CRLF, and LF) in configparser (GH-143929)

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

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

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

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

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