131762 Commits

Author SHA1 Message Date
Miss Islington (bot) 029016654e [3.15] gh-38464: Make tkinter nametowidget() work with cloned menus (GH-152336) (GH-152349)
Map the auto-generated name of a cloned menu (a menu used as a menubar
or a cascade) back to the original widget instead of raising KeyError.
(cherry picked from commit 5c3555bdc5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 23:31:46 +00:00
Miss Islington (bot) 90528ec040 [3.15] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337) (GH-152346)
focus_get(), focus_displayof(), focus_lastfor() and winfo_containing()
now return None instead of raising KeyError when the focused widget was
not created by tkinter (for example a torn-off menu).
(cherry picked from commit 5fed5ce85d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 23:30:32 +00:00
Miss Islington (bot) ba4084fa17 [3.15] IDLE: fix dedent() usage in htest (GH-152256) (#152342)
IDLE: fix dedent() usage in htest (GH-152256)

Fix typos: in GH-112642, initial string concatenation quotes were left when switching to textwrap.dedent().
(cherry picked from commit 74272d4f0b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2026-06-26 23:13:47 +00:00
Miss Islington (bot) d19b93a6fc [3.15] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) (#152300)
gh-98894: Skip test_dtrace when building without dtrace (GH-152239)
(cherry picked from commit 671357691f)

Co-authored-by: stratakis <cstratak@redhat.com>
2026-06-26 22:59:17 +02:00
Miss Islington (bot) 2a3189ce67 [3.15] gh-80937: Fix memory leak in tkinter createcommand (GH-152294) (GH-152327)
A command created with createcommand() held a strong reference to the
interpreter, forming an uncollectable cycle (interpreter -> command ->
interpreter) that kept the interpreter and the callback alive until the
command was removed with deletecommand() or destroy().  The command now
borrows the reference; it cannot outlive the interpreter, which deletes its
commands when finalized.
(cherry picked from commit bbf7786a90)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 19:22:21 +00:00
Donghee Na 073b658dd3 [3.15] gh-152235: Defer GC tracking in set.union and set.difference (gh-152290) (gh-152316)
(cherry picked from commit 5a549e82b8)
2026-06-26 17:54:25 +00:00
Miss Islington (bot) 52bdfcc141 [3.15] gh-139145: Fix tkinter event loop in interactive mode (GH-152257) (GH-152291)
When a Tcl command running its own event loop (such as vwait or
wait_variable) was active and the user typed input on stdin, the event
loop kept spinning at 100% CPU.  The stdin file handler is now removed as
soon as input becomes available.

Also fix gh-139816: an exception raised in a callback no longer stops the
event loop to wait for Enter on a Python built without readline; pending
callbacks keep running until input is actually available on stdin.
(cherry picked from commit 3ffda34f5c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: mdehoon <mjldehoon@yahoo.com>
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:00:56 +03:00
Victor Stinner f2402cba9d [3.15] gh-121249: Soft deprecate F and D struct format types (#149346) (#152274)
gh-121249: Soft deprecate F and D struct format types (#149346)

Remove F/D type codes from table in the struct module documentation.


(cherry picked from commit 5f17434a1e)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-06-26 16:26:52 +02:00
Miss Islington (bot) f3e6bdafd2 [3.15] gh-152052: Fix misleading json error for \uXXXX escape at the end of input (GH-152053) (#152283)
(cherry picked from commit 588be7af08)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-26 14:15:21 +00:00
Miss Islington (bot) a89de4b230 [3.15] gh-152236: Fix skips on _testcapi.set_nomemory tests (GH-152253) (#152281)
gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253)
(cherry picked from commit 1cbe460eb6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-26 14:03:29 +00:00
Miss Islington (bot) 7ed673718b [3.15] gh-152235: Defer GC tracking in more set operations (gh-152273) (gh-152278)
gh-152235: Defer GC tracking in more set operations (gh-152273)
(cherry picked from commit a87d24a69d)

Co-authored-by: Donghee Na <donghee.na@python.org>
2026-06-26 14:02:58 +00:00
Miss Islington (bot) c48673b4b6 [3.15] gh-151722: Defer GC tracking in frozendict.copy() (GH-152230) (#152271)
gh-151722: Defer GC tracking in frozendict.copy() (GH-152230)

Fix _PyDict_Or() and frozendict.copy(): only track the frozendict by
the GC once the dictionary is fully initialized.

Functions modifying frozendict now ensures that the object is not
tracked by the GC (in debug mode).

* can_modify_dict() checks that _PyObject_GC_IS_TRACKED() is false
  for frozendicts.
* dict_merge_api() makes sure that the dictionary is tracked by the
  GC.
(cherry picked from commit 05679f3576)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-26 12:26:17 +00:00
Miss Islington (bot) 62842c9ff5 [3.15] gh-152156: Fix a crash in interpeters.create under limited memory conditions (GH-152163) (#152269)
gh-152156: Fix a crash in `interpeters.create` under limited memory conditions (GH-152163)
(cherry picked from commit 3ad66bf10d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-26 12:11:14 +00:00
Miss Islington (bot) 41f5b920e4 [3.15] gh-152246: Fix pure-Python zoneinfo accepting invalid seperators in POSIX TZ rules (GH-152247) (#152265)
(cherry picked from commit f47acc7f09)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-26 12:08:15 +00:00
Miss Islington (bot) b7a41375ff [3.15] gh-152235: Defer GC tracking of set and frozenset to end of construction (gh-152237) (gh-152242)
gh-152235: Defer GC tracking of set and frozenset to end of construction (gh-152237)
(cherry picked from commit 908f438e19)

Co-authored-by: Donghee Na <donghee.na@python.org>
2026-06-26 03:49:15 +00:00
Miss Islington (bot) 30f9c8a3ef [3.15] gh-151722: Do not track the frozendict in the GC in _PyDict_FromKeys() (GH-152067) (#152225)
gh-151722: Do not track the frozendict in the GC in _PyDict_FromKeys() (GH-152067)

_PyDict_FromKeys() now creates a frozendict copy which is
not tracked by the GC.

dict_merge() no longer requires the dictionary to be tracked by the
GC.
(cherry picked from commit 55bc3126e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2026-06-25 20:48:52 +02:00
Miss Islington (bot) 59e54f5ce9 [3.15] gh-151929: Add pythoninfo commands to Platforms/WASI (GH-152136) (#152222)
gh-151929: Add pythoninfo commands to Platforms/WASI (GH-152136)

The "build" command now also runs "pythoninfo-build" and
"pythoninfo-host" commands.

If no subcommand is provided, display the help.

GitHub Action "WASI":

* Add "pythoninfo-build" and "pythoninfo-host" commands.
* Remove unused and outdated CROSS_BUILD_PYTHON environment variable.
(cherry picked from commit 7c8163719c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-25 17:22:24 +00:00
Miss Islington (bot) 25c7b0c4c8 [3.15] gh-151929: Add pythoninfo-build command to Platforms/emscripten (GH-152210) (#152217)
gh-151929: Add pythoninfo-build command to Platforms/emscripten (GH-152210)

* Add also "pythoninfo-host" command.
* Add pythoninfo to the "build" command.
(cherry picked from commit 7676427cd8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-25 16:51:32 +00:00
Miss Islington (bot) eaf4d73112 [3.15] gh-148825: Fix build error if specialization is disabled (GH-148826) (#152206)
gh-148825: Fix build error if specialization is disabled (GH-148826)
(cherry picked from commit 56ae0b8e4f)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2026-06-25 14:36:04 +00:00
Miss Islington (bot) 0222238e3a [3.15] Don't require _testcapi for test_code (GH-152185) (#152202)
(cherry picked from commit 11c241e1a8)

Co-authored-by: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-25 14:02:49 +00:00
Miss Islington (bot) 06e6515e36 [3.15] gh-152168: Don't skip test_bigmem if _testcapi is missing (GH-152171) (#152198)
(cherry picked from commit 6a82832a0b)

Co-authored-by: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com>
2026-06-25 13:58:50 +00:00
Miss Islington (bot) 1926cf3dc9 [3.15] gh-151929: Get uptime on BSD/macOS in pythoninfo (GH-152189) (#152196)
gh-151929: Get uptime on BSD/macOS in pythoninfo (GH-152189)

* Check sysctlbyname() function and sys/sysctl.h header in
  configure.
* Add _testcapi.uptime_bsd() function.
(cherry picked from commit b6d89edc4a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-25 13:41:18 +00:00
Miss Islington (bot) a53c6ca143 [3.15] gh-127802: Schedule removal of legacy tkinter variable trace methods in 3.17 (GH-152012) (GH-152186)
The tkinter.Variable methods trace_variable(), trace(), trace_vdelete()
and trace_vinfo(), deprecated since Python 3.14, are now scheduled for
removal in Python 3.17.
(cherry picked from commit deeae2ac07)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 12:34:47 +00:00
Victor Stinner ae4c2c126b [3.15] gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146) (#152187)
gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146)

* Replace "linux." prefix with "system." in pythoninfo.
* Add _winapi.GetTickCount64() function.

(cherry picked from commit f9910519af)
2026-06-25 12:34:16 +00:00
Miss Islington (bot) 1deffc37fd [3.15] gh-151678: Add tests for ttk Menubutton and OptionMenu widget options (GH-151960) (GH-151963)
Decorate ttk.MenubuttonTest with add_configure_tests() and make
ttk.OptionMenuTest inherit it to cover the standard widget options.
(cherry picked from commit ce147129c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-25 15:10:18 +03:00
Miss Islington (bot) d6fd5378e3 [3.15] gh-151126: Add missing PyErr_NoMemory in _winapi.c (GH-151588) (#152182)
gh-151126: Add missing `PyErr_NoMemory` in `_winapi.c` (GH-151588)
(cherry picked from commit a580029f11)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-25 11:15:27 +00:00
Miss Islington (bot) 06506197c9 [3.15] gh-151126: Fix missing memory errors in _interpretersmodule.c (GH-151624) (#152169)
gh-151126: Fix missing memory errors in `_interpretersmodule.c` (GH-151624)
(cherry picked from commit 05225aa06a)

Co-authored-by: stevens <lipengyu@kylinos.cn>
2026-06-25 10:35:45 +00:00
Miss Islington (bot) 93ff7c31af [3.15] gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c (GH-152177) (#152179)
gh-151126: Fix missing `PyErr_NoMemory` in `testinternalcapi.c` (GH-152177)
(cherry picked from commit a0093282ea)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-25 13:19:48 +03:00
Miss Islington (bot) cf8051b2e7 [3.15] gh-152079: Fix _datetime.fromisoformat() mishandling a sub-second tz offset (GH-152087) (#152174)
(cherry picked from commit 6f9c76d8d8)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-25 09:41:48 +00:00
Miss Islington (bot) 703c9bf976 [3.15] gh-151763: Fix crash in _interpqueues.create on MemoryError (GH-152131) (#152158)
gh-151763: Fix crash in `_interpqueues.create` on `MemoryError` (GH-152131)
(cherry picked from commit a6c2d4ae3b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-25 07:32:24 +00:00
Miss Islington (bot) 7d5e2dd398 [3.15] gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (GH-152127) (#152134)
gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (GH-152127)
(cherry picked from commit 3db3bba4d1)


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

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-25 00:00:32 +00:00
Miss Islington (bot) ab8434a3dc [3.15] gh-105895: Add match and case doc to help() (GH-152113) (#152126)
gh-105895: Add `match` and `case` doc to `help()` (GH-152113)
(cherry picked from commit 1d55b3778c)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: dzherb <zherbin.dima@yandex.ru>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 22:02:21 +00:00
Serhiy Storchaka 2d5187116b [3.15] gh-86726: Improve the structure of the tkinter reference (GH-152109 (GH-152111)
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.
(cherry picked from commit c7faa6936e)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:41:27 +03:00
Miss Islington (bot) 14d23fddd9 [3.15] Re-raise unexpected exceptions instead of swallowing them in various tests (GH-152019) (#152102)
(cherry picked from commit 6c3da17d1f)

Co-authored-by: An Long <aisk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 16:53:16 +00:00
Miss Islington (bot) 4e7843ea3e [3.15] gh-151763: Fix NULL dereference in os._path_normpath() under OOM (GH-151779) (#152096)
(cherry picked from commit ce8b81fff4)

Co-authored-by: Zain Nadeem <zainnadeemzainnadeem80@gmail.com>
2026-06-24 16:25:28 +00:00
Miss Islington (bot) d4836f4d99 [3.15] gh-90949: Fix copy-paste typo in pyexpat capsule API initialization (GH-151147) (#152088)
(cherry picked from commit 15696a69d6)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 14:40:44 +00:00
Miss Islington (bot) c93039d453 [3.15] gh-151496: Use process groups in TraceBackend in test_dtrace (GH-152039) (#152082)
gh-151496: Use process groups in TraceBackend in test_dtrace (GH-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.
(cherry picked from commit 1785f4b35f)

Co-authored-by: stratakis <cstratak@redhat.com>
2026-06-24 14:15:43 +00:00
Miss Islington (bot) 8146fa4727 [3.15] gh-152060: Fix _pydatetime.fromisoformat() raising AssertionError on invalid lengths (GH-152061) (#152081)
(cherry picked from commit ff781d52d4)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-24 14:10:54 +00:00
Miss Islington (bot) 9fb286eae9 [3.15] valgrind-python.supp: Update suppression for readline leaks (GH-151783) (#152084)
`valgrind-python.supp`: Update suppression for readline leaks (GH-151783)
(cherry picked from commit 28b63d301d)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 16:02:44 +02:00
Miss Islington (bot) c3129e692f [3.15] gh-152020: Fix asyncio.all_tasks() loosing eager tasks on FT-build (GH-152022) (#152076)
gh-152020: Fix `asyncio.all_tasks()` loosing eager tasks on FT-build (GH-152022)
(cherry picked from commit ad2cabfccb)

Co-authored-by: Timofei <128279579+deadlovelll@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-06-24 12:47:07 +00:00
Miss Islington (bot) e8b34391e5 [3.15] gh-151763: Fix possible crash on CodeType deallocation (GH-152034) (#152069)
gh-151763: Fix possible crash on `CodeType` deallocation (GH-152034)
(cherry picked from commit 22dd5b5b37)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-24 12:17:41 +00:00
Miss Islington (bot) 6bad84d64c [3.15] gh-151814: Fix unbounded memory growth from repeated empty writes to io.TextIOWrapper (GH-151817)
(cherry picked from commit c61307222e)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 12:14:01 +00:00
Miss Islington (bot) bc52a01e71 [3.15] gh-140550: Docs additions & fixups for PEP 793 (GH-151661) (GH-152064)
gh-140550: Docs additions & fixups for PEP 793 (GH-151661)
(cherry picked from commit 763cc2209d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-06-24 14:00:28 +02:00
Miss Islington (bot) dcbcf09fe9 [3.15] Capitalize first word in unittest.mock.assert_* docs and docstrings (GH-151951) (#152059)
(cherry picked from commit a46db4f8ba)

Co-authored-by: Hans Yu <github@shauny.anonaddy.me>
2026-06-24 10:35:55 +00:00
Miss Islington (bot) 0adb386f6e [3.15] gh-143927: Normalize all line endings (CR, CRLF, and LF) in configparser (GH-143929) (GH-152002)
gh-143927: Normalize all line endings (CR, CRLF, and LF) in configparser (GH-143929)
(cherry picked from commit 5858e42c53)

Co-authored-by: Seth Larson <seth@python.org>
2026-06-24 11:35:18 +02:00
Miss Islington (bot) 1ba0d6ef4c [3.15] GH-150605: use windows-2025 in GitHub Actions (GH-150606) (#151939)
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-06-24 12:22:39 +03:00
Miss Islington (bot) 72554b378e [3.15] gh-151497: Avoid huge pre-allocation for oversized tarfile extended headers (GH-151498) (GH-151977)
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.
(cherry picked from commit da99711d37)

Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
2026-06-24 11:21:41 +02:00
Miss Islington (bot) f84299087f [3.15] gh-87904: Document curses classes (GH-151643) (GH-152048)
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.
(cherry picked from commit 560ff8e202)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:19:09 +03:00
Miss Islington (bot) 9bd0199e5b [3.15] gh-84008: Document that the LC_NUMERIC locale affects tkinter numeric widgets (GH-152008) (GH-152049)
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().
(cherry picked from commit ee78d4323c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 06:38:52 +00:00
Miss Islington (bot) dbc9b686e0 [3.15] gh-126219: Fix crash in tkinter.Tk with non-BMP className on Tcl/Tk 8.x (GH-151980) (GH-152045)
Tcl 8.x crashes when title-casing a non-BMP character during Tk
initialization, so such a className is now rejected with a ValueError.
(cherry picked from commit 124c7cd91b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 06:32:05 +00:00