Commit graph

126068 commits

Author SHA1 Message Date
Miss Islington (bot)
8744d058ea
[3.13] gh-152212: Reject a POSIX TZ footer with a missing std offset in pure-Python zoneinfo (GH-152213) (#152377)
(cherry picked from commit 93454fe0da)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-27 09:41:23 +00:00
Miss Islington (bot)
8d8be61a28
[3.13] gh-71880: Allow editing the last cell in curses.textpad.Textbox (GH-152363) (GH-152366)
Textbox.edit() ignored typing in the lower-right cell of the window.  It is
now written with insch(), which fills the cell without moving the cursor out
of the window (addch() there raises an error and scrolls a scrollable window).
(cherry picked from commit 11b394381f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:46:08 +03:00
Miss Islington (bot)
0bc5aad8cc
[3.13] gh-151678: Add more tests for tkinter.dnd (GH-152362) (GH-152369)
Cover the drag cursor, the Motion and ButtonRelease bindings, switching
between targets, the target search up the master chain, dnd_accept()
returning None, and restarting after a drag has finished.
(cherry picked from commit 389e00f13f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 10:38:28 +03:00
Miss Islington (bot)
cee72326ff
[3.13] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337) (GH-152348)
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:31:09 +00:00
Miss Islington (bot)
7a835cbbfb
[3.13] gh-38464: Make tkinter nametowidget() work with cloned menus (GH-152336) (GH-152351)
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:27:42 +00:00
Miss Islington (bot)
fd6562e226
[3.13] IDLE: fix dedent() usage in htest (GH-152256) (#152344)
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:11:27 +00:00
Miss Islington (bot)
26ccc733c7
[3.13] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) (#152302)
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 21:16:42 +00:00
Miss Islington (bot)
2895ce779f
[3.13] gh-80937: Fix memory leak in tkinter createcommand (GH-152294) (GH-152329)
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:15:14 +00:00
Donghee Na
668860b846
[3.13] gh-152235: Defer GC tracking in set.union and set.difference (gh-152290) (gh-152319)
(cherry picked from commit 5a549e82b8)
2026-06-26 17:54:19 +00:00
Miss Islington (bot)
80dddd23cd
[3.13] gh-152235: Defer GC tracking in more set operations (gh-152273) (gh-152280)
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-27 01:47:23 +09:00
sobolevn
8c6f547f45
[3.13] gh-152236: Fix skips on _testcapi.set_nomemory tests (GH-152253) (#152286)
* [3.13] 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 15:03:05 +00:00
Miss Islington (bot)
fba87d7f68
[3.13] gh-139145: Fix tkinter event loop in interactive mode (GH-152257) (GH-152293)
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:01:22 +03:00
Miss Islington (bot)
ac3b2ab3c9
[3.13] gh-152052: Fix misleading json error for \uXXXX escape at the end of input (GH-152053) (#152285)
(cherry picked from commit 588be7af08)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-26 14:11:27 +00:00
Donghee Na
998587cd74
[3.13] gh-152235: Defer GC tracking of set and frozenset to end of connstruction (gh-152272)
[3.13] gh-152235: Defer GC tracking of set and frozenset to end of construction (gh-152237)
(cherry picked from commit 908f438e19)
2026-06-26 12:35:30 +00:00
Miss Islington (bot)
82a54898ed
[3.13] gh-152246: Fix pure-Python zoneinfo accepting invalid seperators in POSIX TZ rules (GH-152247) (#152267)
(cherry picked from commit f47acc7f09)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-26 12:04:35 +00:00
Victor Stinner
d740050c99
[3.13] gh-151929: Add pythoninfo commands to Tools/wasm/wasi.py (#152136) (#152224) (#152226)
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" command.
* Remove unused and outdated CROSS_BUILD_PYTHON environment variable.

(cherry picked from commit 7c8163719c)
(cherry picked from commit 6426887ba3)
2026-06-25 18:30:43 +00:00
Miss Islington (bot)
640c5f4a97
[3.13] gh-151678: Add tests for ttk Menubutton and OptionMenu widget options (GH-151960) (GH-151965)
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 16:58:14 +00:00
Victor Stinner
704c4c79e8
[3.13] gh-151929: Get uptime on BSD/macOS in pythoninfo (#152189) (#152197) (#152207)
[3.14] gh-151929: Get uptime on BSD/macOS in pythoninfo (#152189) (#152197)

gh-151929: Get uptime on BSD/macOS in pythoninfo (#152189)

* Check sysctlbyname() function and sys/sysctl.h header in
  configure.
* Add _testcapi.uptime_bsd() function.

(cherry picked from commit b6d89edc4a)
(cherry picked from commit d25cf02a71)
2026-06-25 15:24:36 +00:00
Victor Stinner
5b5f372e4a
[3.13] gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146) (#152187) (#152193) (#152195)
[3.14] gh-151929: Get machine ID and uptime on Windows in pythoninfo (#152146) (#152187) (#152193)

[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)
(cherry picked from commit ae4c2c126b)
(cherry picked from commit be65a38eb7)
2026-06-25 13:34:27 +00:00
Miss Islington (bot)
8feedccc11
[3.13] gh-151126: Add missing PyErr_NoMemory in _winapi.c (GH-151588) (#152184)
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:11:16 +00:00
Miss Islington (bot)
b43507911b
[3.13] gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c (GH-152177) (#152181)
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:26 +03:00
Miss Islington (bot)
c5ac8251b5
[3.13] gh-152079: Fix _datetime.fromisoformat() mishandling a sub-second tz offset (GH-152087) (#152176)
(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:13 +00:00
Miss Islington (bot)
e09bc5f0be
[3.13] gh-151763: Fix crash in _interpqueues.create on MemoryError (GH-152131) (#152160)
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:29:31 +00:00
Victor Stinner
7ca8f3667c
[3.13] gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (#152127) (#152137)
gh-151929: Get boot ID, machine ID and uptime in test.pythoninfo (#152127)

GHA: Run test.pythoninfo on the "Cross build Linux" job.
(cherry picked from commit 3db3bba4d1)
2026-06-25 00:25:40 +00:00
sobolevn
f74dbc82fe
[3.13] gh-105895: Add match and case doc to help() (GH-152113) (#152128)
(cherry picked from commit 1d55b3778c)

Co-authored-by: dzherb <zherbin.dima@yandex.ru>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 22:05:05 +00:00
Jelle Zijlstra
d43f47bdca
[3.13] gh-151955: Allow more ParamSpec bounds (#152122)
gh-151955: Allow more ParamSpec and TypeVarTuple bounds (#151956)

(cherry picked from commit 0fb82b46df)
2026-06-24 20:08:56 +00:00
Serhiy Storchaka
c2bc0e3ac8
[3.13] gh-86726: Improve the structure of the tkinter reference (GH-152109 (GH-152111) (GH-152119)
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)
(cherry picked from commit 2d5187116b)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 19:36:14 +00:00
Miss Islington (bot)
bc690c4b5f
[3.13] Re-raise unexpected exceptions instead of swallowing them in various tests (GH-152019) (#152104)
(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:50:36 +00:00
Miss Islington (bot)
58476e8cbb
[3.13] gh-151763: Fix NULL dereference in os._path_normpath() under OOM (GH-151779) (#152094)
(cherry picked from commit ce8b81fff4)

Co-authored-by: Zain Nadeem <zainnadeemzainnadeem80@gmail.com>
2026-06-24 16:22:23 +00:00
Miss Islington (bot)
f5ff45a386
[3.13] valgrind-python.supp: Update suppression for readline leaks (GH-151783) (#152086)
`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:51 +02:00
Miss Islington (bot)
36fd455ab6
[3.13] gh-151814: Fix unbounded memory growth from repeated empty writes to io.TextIOWrapper (GH-151817) (#152073)
(cherry picked from commit c61307222e)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-24 12:19:03 +00:00
Prakash Sellathurai
117b76a190
[3.13] gh-151905: fix memory error handling in PyFrame_GetBack (GH-151906) (#152065)
[3.13] gh-151905: fix memory error handling in PyFrame_GetBack
(pythonGH-151906)

Signed-off-by: Prakash Sellathurai <prakashsellathurai@gmail.com>
2026-06-24 11:40:07 +00:00
Miss Islington (bot)
aaf850fd33
[3.13] gh-143927: Normalize all line endings (CR, CRLF, and LF) in configparser (GH-143929) (GH-152004)
(cherry picked from commit 5858e42c53)

Co-authored-by: Seth Larson <seth@python.org>
2026-06-24 11:46:43 +02:00
Miss Islington (bot)
b83961ade8
[3.13] gh-151497: Avoid huge pre-allocation for oversized tarfile extended headers (GH-151498) (GH-151978)
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:23:45 +02:00
Miss Islington (bot)
43c188d0d2
[3.13] gh-84008: Document that the LC_NUMERIC locale affects tkinter numeric widgets (GH-152008) (GH-152051)
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:36:53 +00:00
Miss Islington (bot)
32546b728e
[3.13] gh-126219: Fix crash in tkinter.Tk with non-BMP className on Tcl/Tk 8.x (GH-151980) (GH-152047)
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 09:31:24 +03:00
Miss Islington (bot)
0ba3fcdf2f
[3.13] gh-151596: Add missing argument 'size' to pure-Python implementation of TextIOBase.readline (GH-151679) (GH-151872)
(cherry picked from commit 30aeeb375b)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
2026-06-23 12:41:37 -04:00
Miss Islington (bot)
abf5016b4d
[3.13] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582)
(cherry picked from commit 7928a8b730)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 15:12:29 +00:00
Miss Islington (bot)
a1f31af280
[3.13] gh-151773: Fix NULL dereference in PyContextVar_Set (GH-151836) (#152011)
gh-151773: Fix NULL dereference in `PyContextVar_Set` (GH-151836)
(cherry picked from commit d35b1719a5)

Co-authored-by: dev <b.chouksey27@gmail.com>
2026-06-23 14:39:29 +00:00
Miss Islington (bot)
771d12dda5
[3.13] gh-151558: Fix symlink escape via tarfile hardlink-extraction fallback (GH-151559)
(cherry picked from commit 27dd970bf6)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 13:56:51 +00:00
Miss Islington (bot)
3f031d431f
[3.13] gh-151981: Make tarfile._Stream.seek break at EOF (GH-151982) (#151993)
(cherry picked from commit f50bf13566)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 14:46:38 +01:00
Miss Islington (bot)
82e023fc3c
[3.13] gh-151556: Show example CSV file content in the csv module docs (GH-151563) (#151986)
(cherry picked from commit 7915c4a8dd)

Co-authored-by: Lucas <lucasefernandes333@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 12:08:09 +00:00
Miss Islington (bot)
da45740756
[3.13] gh-62480: De-personalize docs on using the C API (GH-151784) (#151938)
(cherry picked from commit 1c5a11018a)

Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-22 20:08:29 +00:00
Serhiy Storchaka
d4a953acc0
[3.13] gh-86726: Document tkinter method-name conflicts (GH-151917) (GH-151934)
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 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.

(cherry picked from commit 4de5683f21)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 19:44:03 +00:00
Steve Dower
16c40f944b
gh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup.local for discovering sources in getpath.py (GH-151928) 2026-06-22 17:31:25 +01:00
Miss Islington (bot)
3e256401c0
[3.13] gh-144133: Add a warning to the encodings.punycode documentation (GH-151812) (#151924)
(cherry picked from commit 7ec70e1df3)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-22 12:02:09 +00:00
Miss Islington (bot)
a7f5e4e983
[3.13] gh-142387: Revert Android testbed to API level 35 (GH-151816) (#151885)
Revert Android testbed to API level 35
(cherry picked from commit 24828e57e1)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-06-21 22:55:19 +00:00
Miss Islington (bot)
bae0ba9ec7
[3.13] gh-150484: Fix mock_open __exit__ with contextlib.ExitStack (GH-151829) (GH-151861)
mock_open's _exit_side_effect had a fixed 3-arg signature, but
  contextlib.ExitStack calls __exit__ with 4 args (self + 3 exc info).
  Use *args to accept any number of arguments.
(cherry picked from commit 85fa295073)

Co-authored-by: Zang Peiyu <166481866+factnn@users.noreply.github.com>
2026-06-21 17:02:30 +00:00
Miss Islington (bot)
de8d7bb11e
[3.13] gh-151678: Add tests for tkinter.simpledialog (GH-151856) (GH-151860)
(cherry picked from commit f28ef858f5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 16:48:54 +00:00
Miss Islington (bot)
426e21d290
[3.13] gh-86726: Document tkinter.simpledialog query options and Dialog.result (GH-151851) (GH-151854)
(cherry picked from commit 8270ae560c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-21 18:10:08 +03:00