Commit graph

54355 commits

Author SHA1 Message Date
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
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)
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)
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)
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
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
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)
15f9e62df3
[3.13] gh-151678: Add tests for tkinter widget virtual events (GH-151793) (GH-151807)
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 14:56:01 +00:00
Miss Islington (bot)
b9bd1482a5
[3.13] gh-151678: Add interactive tests for tkinter.simpledialog (GH-151794) (GH-151804)
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-20 17:13:18 +03:00
Miss Islington (bot)
90bbdec418
[3.13] gh-151678: Add tests for the remaining tkinter Misc, Wm and Text methods (GH-151782) (GH-151801)
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 13:58:51 +00:00
Miss Islington (bot)
9b503ae848
[3.13] gh-151678: Add tests for tkinter.filedialog (GH-151781) (GH-151797)
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:44:56 +00:00
Miss Islington (bot)
88e213e4d0
[3.13] gh-151678: Add tests for tkinter.dnd (GH-151780) (GH-151792)
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:26:04 +00:00
Miss Islington (bot)
a50207d890
[3.13] gh-151678: Add tests for tkinter.scrolledtext (GH-151753) (GH-151761)
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:03 +03:00
Miss Islington (bot)
ab8322fc3d
[3.13] gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751) (GH-151756)
* 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:09:39 +00:00
Miss Islington (bot)
87a349e3d4
[3.13] gh-151678: Add tests for tkinter.ttk methods (GH-151736) (GH-151743)
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>

* Fix regex in tests.

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 01:27:27 +03:00
Miss Islington (bot)
232764e607
[3.13] gh-151678: Add tests for tkinter Misc, Wm and geometry manager methods (GH-151732) (GH-151739)
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 16:07:18 +00:00
Serhiy Storchaka
cc7043de99
[3.13] gh-151693: Make the curses tests portable to other curses implementations (GH-151729) (GH-151730)
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: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 12:07:24 +00:00
Miss Islington (bot)
92bd69674e
[3.13] gh-151678: Add tests for tkinter.Canvas (GH-151683) (GH-151718)
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 11:14:14 +00:00
Serhiy Storchaka
a8252d557c
[3.13] gh-151678: Add tests for the remaining tkinter widgets (GH-151687) (GH-151727)
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: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:54:03 +00:00
Miss Islington (bot)
b836d40269
[3.13] gh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694) (GH-151721)
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 10:17:22 +00:00
Miss Islington (bot)
8650126189
[3.13] gh-151678: Add tests for tkinter.Text (GH-151681) (GH-151705) (GH-151715)
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)
(cherry picked from commit 22c000eeb4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:28:36 +00:00
Miss Islington (bot)
6e356cc4a7
[3.13] gh-151678: Add tests for tkinter.Listbox (GH-151686) (GH-151714)
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:27:30 +00:00
Miss Islington (bot)
c0c9920560
[3.13] gh-151678: Add tests for tkinter.Menu (GH-151685) (GH-151711)
Cover previously-untested Menu methods in MenuTest: adding, inserting and
deleting items of every type, index resolution, invoking items, entry x/y
positions, and post/unpost/tk_popup mapping.

Also test per-entry configuration options and the errors raised for
invalid indices, entry types, option names and option values.
(cherry picked from commit ef5c32a40b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:23:43 +00:00
Serhiy Storchaka
805830831f
[3.13] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151629) (GH-151630)
(cherry picked from commit 015cc42bc2)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.
(cherry picked from commit 65afcdd8df)
2026-06-18 09:51:51 +00:00
Miss Islington (bot)
2ca9dae148
[3.13] gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666) (#151599)
gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666)
(cherry picked from commit 5ad3c6dfbf)

Co-authored-by: blhsing <blhsing@gmail.com>
2026-06-17 11:49:23 -04:00
Miss Islington (bot)
733411a219
[3.13] gh-151519: Check effective gid in _test_all_chown_common group-0 guard (GH-151521) (#151551)
gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521)

The guard that skips the "chown to gid 0 should fail" assertion used
only `os.getgroups()` (supplementary groups). The kernel also accepts
the effective/filesystem gid for chown, so when a process runs with
egid 0 and a non-zero uid (common in containers and user namespaces),
chown(-1, 0) succeeds and the assertion spuriously fails.

Add an `os.getegid() != 0` check alongside the existing
`0 not in os.getgroups()` guard.
(cherry picked from commit 2ce260033b)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-06-16 09:42:16 -07:00
Miss Islington (bot)
c8e60d5897
[3.13] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151530)
gh-151522: Guard against None transport in slow-socket SSL test (GH-151523)
(cherry picked from commit 11f032f904)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-06-15 22:54:53 -07:00
Miss Islington (bot)
502534ed0b
[3.13] gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904) (#149637)
* gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904)
(cherry picked from commit bc1be4f617)

Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------

Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-15 15:52:47 +02:00
Miss Islington (bot)
ffa440acb4
[3.13] gh-150389: Make perf profiler tests resilient (GH-150437) (GH-151501) (#151503)
[3.14] gh-150389: Make perf profiler tests resilient (GH-150437) (GH-151501)

gh-150389: Make perf profiler tests resilient (GH-150437)

(cherry picked from commit 638754cb85)
(cherry picked from commit d06b473f8f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-06-15 13:39:52 +00:00
Stan Ulbrych
9cbbb07990
[3.13] gh-77328: Update base64 module RFC references to RFC 4648 (GH-151275) (#151441)
(cherry picked from commit e933987688)
2026-06-13 13:27:27 +00:00
Miss Islington (bot)
c606d1518c
[3.13] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (GH-151431) (#151435)
[3.14] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (GH-151431)

* gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)
(cherry picked from commit 3c00ebc2bb)




(cherry picked from commit 4e8c9c6a57)

* Drop the abrupt-exit-code reporting from the 3.14 backport

Reporting the exit codes of processes that died without a known cause
is a new feature, not part of the gh-101267 bugfix. Keep only the
bugfix on 3.14: each failed future gets its own BrokenProcessPool
exception instead of one shared instance.

---------
(cherry picked from commit 27ff2c8c53)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-06-13 02:37:19 -07:00
Miss Islington (bot)
5bc20725e2
[3.13] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151374)
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)

And add tests.
(cherry picked from commit 402668b2b1)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 17:39:04 +00:00
Miss Islington (bot)
8b20bedaf5
[3.13] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151333)
(cherry picked from commit 0066fd73a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-11 18:02:38 +03:00
Hugo van Kemenade
06dce35b5a
[3.13] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151318)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 14:34:40 +03:00
Miss Islington (bot)
003db2ffd0
[3.13] gh-151284: Fix test_capi on UBSan (GH-151286) (#151325)
gh-151284: Fix test_capi on UBSan (GH-151286)

Comment two checks relying on undefined behavior in
test_fromwidechar() of test_capi.

Enable test_capi in GitHub Action "Reusable Sanitizer".
(cherry picked from commit d87d772873)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 11:19:54 +00:00
Serhiy Storchaka
f1c8176636
[3.13] gh-150285: Fix merging error in GH-150458 (GH-151320) 2026-06-11 14:06:27 +03:00
Miss Islington (bot)
5c17ae6c1c
[3.13] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151306)
(cherry picked from commit 84a322aa15)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-11 11:30:49 +03:00
Victor Stinner
db9e7556c3
[3.13] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283) (#151287)
[3.14][3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283)

[3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269)

gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)

If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.

(cherry picked from commit 7b6e98911e)
(cherry picked from commit 10f616cf39)
(cherry picked from commit b3a7758d8a)
2026-06-10 23:24:46 +02:00
Victor Stinner
87b9729522
[3.13][3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251) (#151256)
[3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251)

gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)

Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.

The bug occurs because:

1. PySequence_Fast() returns the original list object when the input
   is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
   callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).

The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.

(cherry picked from commit 896f7fdc7d)



(cherry picked from commit 632daaf5e9)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-10 19:04:04 +02:00
Harjoth Khara
4866da0802
[3.13] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151263) 2026-06-10 17:49:45 +01:00
Thomas Wouters
3a04c62e38 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2026-06-10 18:01:42 +02:00
Miss Islington (bot)
a1f9bd2346
[3.13] gh-150988: Fix refleak in OSError when attrs are set before super().__init__() (GH-150990) (#151242)
gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990)
(cherry picked from commit f2a0f82282)

Co-authored-by: Lukas Geiger <lukas.geiger94@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 12:51:12 +00:00
Thomas Wouters
fd17997c38 Python 3.13.14 2026-06-10 14:24:04 +02:00
Serhiy Storchaka
78ed7ff899
[3.13] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (#151178)
(cherry picked from commit 0fa06f4d7f)
2026-06-09 22:25:09 +02:00
Serhiy Storchaka
52ffdeda1d
[3.13] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151141) (#151148)
(cherry picked from commit cb96d5ea4a)


(cherry picked from commit c3cd75afdf)
2026-06-09 22:24:39 +02:00