Commit graph

131719 commits

Author SHA1 Message Date
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
Miss Islington (bot)
4677e25714
[3.15] gh-150994: _colorize: modernize typing imports (GH-151018) (#152041)
gh-150994: _colorize: modernize typing imports (GH-151018)
(cherry picked from commit fcda96fbf3)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-24 03:27:00 +00:00
Miss Islington (bot)
415e218ed5
[3.15] gh-151842: Fix crash upon OOM in _interpreters.capture_exception (GH-151843) (GH-152031)
(cherry picked from commit 5e0747db2f)

Co-authored-by: Amrutha <amruthamodela06@gmail.com>
2026-06-23 20:58:10 +00:00
Miss Islington (bot)
bd39eea0db
[3.15] gh-151596: Add missing argument 'size' to pure-Python implementation of TextIOBase.readline (GH-151679) (GH-151870)
(cherry picked from commit 30aeeb375b)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
2026-06-23 12:41:17 -04:00
Miss Islington (bot)
2ff445be4e
[3.15] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582) (#152016)
(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:15:00 +00:00
Miss Islington (bot)
7b765a47b8
[3.15] gh-151773: Fix NULL dereference in PyContextVar_Set (GH-151836) (#152009)
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:46:05 +00:00
Miss Islington (bot)
672825e2f3
[3.15] gh-151558: Fix symlink escape via tarfile hardlink-extraction fallback (GH-151559) (#151997)
(cherry picked from commit 27dd970bf6)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 13:58:57 +00:00
Miss Islington (bot)
4ce6bf7c8a
[3.15] gh-151981: Make tarfile._Stream.seek break at EOF (GH-151982) (#151991)
(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:28 +01:00
Hugo van Kemenade
660d7928c4 Merge branch '3.15' of https://github.com/python/cpython into 3.15 2026-06-23 16:28:14 +03:00
Hugo van Kemenade
2b414580b6 Post 3.15.0b3 2026-06-23 16:25:59 +03:00
Miss Islington (bot)
b34a86f282
[3.15] gh-151556: Show example CSV file content in the csv module docs (GH-151563)
(cherry picked from commit 7915c4a8dd)

Co-authored-by: Lucas <lucasefernandes333@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-23 12:09:29 +00:00
Hugo van Kemenade
cf16a33fad Python 3.15.0b3 2026-06-23 12:35:49 +03:00
Miss Islington (bot)
fe5dc86f1f
[3.15] gh-151905: fix memory error handling in PyFrame_GetBack (GH-151906) (#151919)
Co-authored-by: Prakash Sellathurai <prakashsellathurai@gmail.com>
2026-06-23 09:28:59 +03:00
Miss Islington (bot)
752e23ec90
[3.15] gh-75666: Fix a reference leak in tkinter event bindings (GH-151808) (GH-151958)
The Tcl commands created for event callbacks are now deleted when a
binding is replaced or unbound, instead of being leaked.
(cherry picked from commit 3f09a175ad)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-23 04:26:53 +00:00
Miss Islington (bot)
2957ff721b
[3.15] gh-151722: Defer GC tracking of frozendict to end of construction (gh-151740) (gh-151954)
gh-151722: Defer GC tracking of frozendict to end of construction (gh-151740)
(cherry picked from commit 6920036f28)

Co-authored-by: Donghee Na <donghee.na@python.org>
2026-06-23 00:13:20 +00:00
Miss Islington (bot)
e187964a90
[3.15] gh-62480: De-personalize docs on using the C API (GH-151784) (#151936)
(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:09:28 +00:00
Miss Islington (bot)
59706a6d9a
[3.15] gh-86726: Document tkinter method-name conflicts (GH-151917) (GH-151926)
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.

(cherry picked from commit 4de5683f21)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:42:45 +00:00
Miss Islington (bot)
ef171b603d
[3.15] gh-144133: Add a warning to the encodings.punycode documentation (GH-151812) (#151922)
(cherry picked from commit 7ec70e1df3)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-22 12:02:32 +00:00
Stan Ulbrych
21f96ea807
[3.15] Remove 3.15 pending-removals from deprecations index (#151873) 2026-06-22 11:43:29 +03:00
Miss Islington (bot)
a940f933af
[3.15] gh-142387: Revert Android testbed to API level 35 (GH-151816) (#151883)
Revert Android testbed to API level 35
(cherry picked from commit 24828e57e1)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-06-22 00:29:07 +00:00
Timofei
453714a2dc
[3.15] gh-151665: Fix inspect.signature() on type alias and type parameter evaluators (#151787) 2026-06-21 15:08:37 -07:00
Miss Islington (bot)
2e4dddfa17
[3.15] gh-151678: Add tests for tkinter.simpledialog (GH-151856) (GH-151869)
(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 18:59:26 +00:00
Miss Islington (bot)
a2d2ee8e9e
[3.15] RTD Previews: Get correct base branch for backports (GH-150690) (#151867)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-21 18:14:04 +00:00
Miss Islington (bot)
f5119a536a
[3.15] gh-151845: Fix formatfloat() return-value contract in unicode_format.c (GH-151846) (#151865)
gh-151845: Fix formatfloat() return-value contract in unicode_format.c (GH-151846)

Fix formatfloat() return-value contract in unicode_format.c
(cherry picked from commit c2661e6189)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-06-21 17:43:01 +00:00
Miss Islington (bot)
f43f4384cc
[3.15] gh-151678: Add interactive tests for tkinter.simpledialog (GH-151794) (GH-151802)
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.
(cherry picked from commit 706238e764)

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-21 18:10:43 +03:00
Miss Islington (bot)
37aa97330d
[3.15] gh-150831: docs: clarify generator, generator function, and generator iterator in glossary (GH-150905) (#151840)
gh-150831: docs: clarify generator, generator function, and generator iterator in glossary (GH-150905)
(cherry picked from commit 1de86e1492)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
2026-06-21 07:35:52 -04:00
Miss Islington (bot)
45a0043971
[3.15] gh-151770: Fix datetime.fromisoformat() on an out-of-range month w/ a 24:00 time (GH-151771) (#151809)
(cherry picked from commit 1fb874cc07)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-20 17:01:40 +00:00
Miss Islington (bot)
ba8548ca82
[3.15] gh-151678: Add tests for tkinter widget virtual events (GH-151793) (GH-151805)
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).
(cherry picked from commit e51b616eff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 15:00:38 +00:00
Miss Islington (bot)
86cdbd8e44
[3.15] gh-151678: Add tests for the remaining tkinter Misc, Wm and Text methods (GH-151782) (GH-151799)
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.
(cherry picked from commit aa71eb287f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 14:12:08 +00:00
Miss Islington (bot)
70d495aab0
[3.15] gh-151678: Add tests for tkinter.filedialog (GH-151781) (GH-151795)
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.
(cherry picked from commit 58fd9ec3cf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:49:16 +00:00
Miss Islington (bot)
3618730de3
[3.15] gh-151678: Add tests for tkinter.dnd (GH-151780) (GH-151790)
Drive the drag-and-drop protocol (dnd_start and the DndHandler enter/
motion/commit, leave/cancel and end callbacks).
(cherry picked from commit 2a126a534b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:37:55 +00:00
Miss Islington (bot)
88f79419a8
[3.15] gh-151678: Add tests for tkinter.scrolledtext (GH-151753) (GH-151759)
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.
(cherry picked from commit a9db5cb52f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:17:52 +03:00
Miss Islington (bot)
b83a217558
[3.15] gh-150836: Mount embedded Tk ZIP in _tkinter on Windows (GH-151735)
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.
(cherry picked from commit c4eb3adbb4)

Co-authored-by: Jonathan J. Helmus <jjhelmus@gmail.com>
2026-06-19 18:31:12 -05:00
Miss Islington (bot)
a30acf2495
[3.15] gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751) (GH-151754)
* 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.
(cherry picked from commit 66cc048551)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 23:12:25 +00:00
Miss Islington (bot)
ba0cae13ce
[3.15] gh-151678: Add tests for tkinter.ttk methods (GH-151736) (GH-151741)
Cover previously-untested ttk methods:

* Progressbar.step, start and stop;
* Treeview.parent, next, prev, see and identify_element;
* Style.theme_settings;
* OptionMenu.set_menu.
(cherry picked from commit 7d4a0aad7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 16:12:13 +00:00
Miss Islington (bot)
81ceb56629
[3.15] gh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH-151732) (GH-151737)
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.
(cherry picked from commit 23793ac211)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 18:06:42 +03:00
Miss Islington (bot)
80d7626c74
[3.15] gh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the current CS2 (gh-151554)
This mimics an optimization already present for the single-mutex critical section.
(cherry picked from commit c2ca7724af)

Co-authored-by: Daniele Parmeggiani <8658291+dpdani@users.noreply.github.com>
2026-06-19 09:52:07 -04:00
Miss Islington (bot)
b010116e26
[3.15] gh-151693: Make the curses tests portable to other curses implementations (GH-151729) (GH-151733)
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).
(cherry picked from commit 64fab74bd7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 12:37:43 +00:00
Miss Islington (bot)
d81cc86341
[3.15] gh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694) (GH-151719)
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.
(cherry picked from commit b4cfb992ed)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 12:01:54 +00:00
Miss Islington (bot)
13529d43c9
[3.15] gh-151678: Add tests for the remaining tkinter widgets (GH-151687) (GH-151725)
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.
(cherry picked from commit 93b9e7666f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 11:52:05 +00:00
Miss Islington (bot)
be26b8d67f
[3.15] gh-151678: Add tests for tkinter.Canvas (GH-151683) (GH-151716)
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.
(cherry picked from commit bb127c5a96)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:47:36 +00:00
Miss Islington (bot)
81e9c08518
[3.15] gh-151678: Add tests for tkinter.Text (GH-151681) (GH-151702)
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.
(cherry picked from commit 4ac809e10b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:41:03 +00:00
Miss Islington (bot)
1495415cb4
[3.15] gh-151678: Add tests for tkinter.Listbox (GH-151686) (GH-151712)
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.
(cherry picked from commit cf3b3c1148)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:30:55 +00:00