Commit graph

131662 commits

Author SHA1 Message Date
Miss Islington (bot)
3b38caf2fe
[3.15] gh-101100: Document os.uname_result and os.statvfs_result with related constants (GH-151301) (GH-151692)
(cherry picked from commit 9688d252d3)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-06-19 10:34:16 +03:00
Miss Islington (bot)
fd3c510827
[3.15] gh-146353: Document PyBytesWriter_GetData pointer validity (GH-151418) (GH-151664)
gh-146353: Document `PyBytesWriter_GetData` pointer validity (GH-151418)
(cherry picked from commit e99b319682)

Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
2026-06-18 17:39:20 +00:00
Miss Islington (bot)
cafe39f78a
[3.15] gh-86726: Add few missing versionadded directives (GH-151662) (GH-151663)
Pack.pack_content, Place.place_content and Grid.grid_content were
added in 3.15.
(cherry picked from commit bfecfcc2a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-18 15:56:14 +00:00
Miss Islington (bot)
821e97b999
[3.15] gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655) (GH-151658)
It returns a sys.version_info-like named tuple, not a string.
(cherry picked from commit 3cd02a1c2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:44:51 +00:00
Miss Islington (bot)
0125168a81
[3.15] gh-86726: Fix "deprecated" directive for wm_attributes (GH-151652) (GH-151654)
(cherry picked from commit d47c27e47a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-18 13:44:12 +00:00
Miss Islington (bot)
82b757071e
[3.15] gh-86726: Document the full public API of tkinter (GH-151579) (GH-151649)
Replace the previously sparse reference documentation with full coverage of
the public API of the tkinter package, written from the Tcl/Tk manual pages,
the existing documentation and the module docstrings.

* Doc/library/tkinter.rst gains a "Reference" section documenting every public
  class, method, function and constant of the core module -- the widgets, the
  Misc, Wm, Pack, Place, Grid, XView and YView mix-ins, the Variable and image
  classes, the module-level functions and the symbolic constants.
* Doc/library/tkinter.ttk.rst, dialog.rst, tkinter.font.rst and the other
  module pages document their remaining classes, methods and functions.

The descriptions are Python-oriented (correct return types -- tuples rather
than Tcl lists, booleans, integers, None on cancellation, and so on) and were
checked against the Tcl/Tk 9.1 manual pages and the implementation.

versionadded, versionchanged and deprecated directives are added for the
public API, determined from the git history relative to Python 3.0: the
tkinter.ttk module (3.1); the Text, Wm, Menu and Misc methods exposing Tk 8.5
features (3.3); and the many later additions and behavior changes up to 3.15.
The Tk version required by features added after Tk 8.6 is noted as well.  The
bundled Tcl/Tk version is updated to 9.0 and the manual-page links point at
the tcl9.0 reference.

--------
(cherry picked from commit 8b270b72a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-06-18 12:47:36 +00:00
Miss Islington (bot)
c0582dbe7f
[3.15] gh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609) (gh-151648)
gh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609)
(cherry picked from commit 3fa92e7c55)

Co-authored-by: Donghee Na <donghee.na@python.org>
2026-06-18 12:45:25 +00:00
Miss Islington (bot)
d9a1bff40b
[3.15] gh-151623: Add missing curses docstrings and document intrflush() (GH-151632) (GH-151641)
(cherry picked from commit 12add3822f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-18 14:23:06 +03:00
Miss Islington (bot)
7170c951a1
[3.15] gh-151623: Improve curses documentation style (GH-151635) (#151636)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-06-18 12:57:03 +03:00
Miss Islington (bot)
7aa41c406b
[3.15] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151628)
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)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-18 08:48:56 +00:00
Miss Islington (bot)
e9c7cc1f0b
[3.15] gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252) (GH-151606)
gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)

The initial implementation of PEP 820 worsened the error message
when non-types are given as base types in Py_tp_bases & Py_tp_base.
Bring back the 'bases must be types' wording and add a 'got' note for
easier debugging.

Improve slot ID documentation, and soft-deprecate Py_tp_base
(as per the PEP).
(cherry picked from commit 16185e9fe2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-06-18 10:17:15 +02:00
Miss Islington (bot)
8fe5897853
[3.15] gh-151510: Fix __lazy_import__ without frame (GH-151511) (#151610)
gh-151510: Fix __lazy_import__ without frame (GH-151511)
(cherry picked from commit eff805b7a7)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-06-17 18:40:33 +00:00
Miss Islington (bot)
6d29a08d15
[3.15] gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666) (#151601)
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:47:27 -04:00
Miss Islington (bot)
a86de0bc23
[3.15] gh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup.local for discovering sources in getpath.py (GH-151545)
(cherry picked from commit 9e863fab28)

Co-authored-by: Steve Dower <steve.dower@python.org>
2026-06-17 16:42:35 +01:00
Miss Islington (bot)
1e7fb93df7
[3.15] gh-150966: Fix live profiling error tests (GH-151020) (#151604)
gh-150966: Fix live profiling error tests (GH-151020)
(cherry picked from commit 6b142ab9a0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-06-17 16:58:42 +02:00
Miss Islington (bot)
821e5d79fa
[3.15] gh-151584: Remove PyUnstable_Module_SetGIL call in _remote_debugging (GH-151585) (#151603)
gh-151584: Remove `PyUnstable_Module_SetGIL` call in `_remote_debugging` (GH-151585)
(cherry picked from commit a173a6d65b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-17 14:10:31 +00:00
Miss Islington (bot)
2a5ed22923
[3.15] gh-151593: Use timeout on GitHub Action TSan jobs (GH-151594) (#151597)
gh-151593: Use timeout on GitHub Action TSan jobs (GH-151594)

Use a timeout of 15 minutes for --tsan command and a timeout of 10
minutes for --tsan-parallel command. Display also the slowest tests
to help adjusting these timeouts later if needed.
(cherry picked from commit 460dec2651)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-17 11:28:42 +00:00
Miss Islington (bot)
d7e7d85609
[3.15] gh-151496: Use process groups in test_dtrace (GH-151512) (#151589)
gh-151496: Use process groups in test_dtrace (GH-151512)

Create a new process group to run bpftrace commands, so it's possible
to kill also child processes on timeout.
(cherry picked from commit a064b323f4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-17 09:28:34 +00:00
Victor Stinner
a5c5edddbc
[3.15] gh-151546: Fix stack limits on musl (#151548) (#151583)
gh-151546: Fix stack limits on musl (#151548)

If the thread stack size is set by linker flags, pass the stack size
to Python/ceval.c via the new _Py_LINKER_THREAD_STACK_SIZE variable
to set Py_C_STACK_SIZE macro.

(cherry picked from commit 9a61d1c0c8)
2026-06-17 11:13:40 +02:00
Miss Islington (bot)
ff6e973c3b
[3.15] gh-151218: Replace sys.flags in PyConfig_Set() (GH-151402) (#151552)
gh-151218: Replace sys.flags in PyConfig_Set() (GH-151402)

PyConfig_Set() and sys.set_int_max_str_digits() now replace
sys.flags (create a new object), instead of modifying sys.flags in-place.

Modifying sys.flags in-place can lead to data races when multiple
threads are reading or writing sys.flags in parallel.

Use _Py_atomic functions to get and set max_str_digits members.
(cherry picked from commit b16d23fc9f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-16 16:48:56 +00:00
Miss Islington (bot)
19bf6a3fa1
[3.15] gh-151519: Check effective gid in _test_all_chown_common group-0 guard (GH-151521) (#151549)
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:24 -07:00
Miss Islington (bot)
ab61101f96
[3.15] gh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120) (GH-151541)
Encode the payload with output_charset instead of input_charset.
(cherry picked from commit 0777a58d80)

Co-authored-by: dev <b.chouksey27@gmail.com>
2026-06-16 12:18:56 +00:00
Miss Islington (bot)
488a03bd2b
[3.15] gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters (GH-150053) (#151322)
Co-authored-by: Taeknology <20297177+Taeknology@users.noreply.github.com>
2026-06-16 14:52:39 +03:00
Miss Islington (bot)
1a8e7435a5
[3.15] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151528)
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:42 -07:00
Miss Islington (bot)
e2c7fa7ff6
[3.15] gh-151422: Don't link libffi into _ctypes_test.so (GH-151423) (#151516)
_ctypes_test doesn't use libffi directly, and linking it into the module
causes emscripten tests to fail.
(cherry picked from commit 8646385076)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2026-06-15 22:45:45 +00:00
Miss Islington (bot)
255b3fff97
[3.15] gh-151223: fix tsan data races in load global specializations (GH-151393) (#151513)
gh-151223: fix tsan data races in load global specializations (GH-151393)
(cherry picked from commit e9d5280f6c)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-06-15 22:52:52 +05:30
Miss Islington (bot)
b5eea71702
[3.15] gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854) (#151506)
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854)

/run/ on my FreeBSD install is not readable causing failing test.
(cherry picked from commit 35ce2e5f98)

Co-authored-by: Nick Begg <nick@stunttruck.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-06-15 14:55:27 +00:00
Miss Islington (bot)
cc91b26ce1
[3.15] Add .toml to .editorconfig (GH-151481) (#151491)
Add `.toml` to `.editorconfig` (GH-151481)
(cherry picked from commit 7a70afa199)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-15 09:42:09 +00:00
Miss Islington (bot)
f7ab7c4462
[3.15] gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (GH-151319) (#151489)
gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (GH-151319)

Inject the "sitedir" variable in the frame which executes ".pth" code.
(cherry picked from commit 18f3ffec43)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-15 09:01:30 +00:00
Miss Islington (bot)
1b457d3bbc
[3.15] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460) (#151468)
Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)

Since the recursion guard tracks real C-stack bounds (gh-91079), this test
asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack
(some Nix build envs use one that large), the optimized interpreter uses ~160
bytes/level (raises at ~420k levels) so the assertion holds with only ~16%
margin; the PGO *instrumented* stage inlines less, its per-level scanner frames
are smaller, and the 500k-deep decode completes -- "RecursionError not raised"
fails the profile run and aborts `make profile-opt`. Upstream's
skip_if_unlimited_stack_size (gh-143460) only covers RLIM_INFINITY, not
large-finite stacks like ours.

We could also keep playing whack a mole and raise the 500k to a much larger
number... but there's little value in PGO training on this test anyways.
(cherry picked from commit e91f68ab40)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-06-14 11:37:23 -07:00
Bartosz Sławecki
114a7a86a9
[3.15] gh-151390: Colorize match + and match - in the REPL (GH-151391) (#151476)
(cherry picked from commit a7007322c2)
2026-06-14 16:38:07 +00:00
Miss Islington (bot)
89e178d78c
[3.15] gh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462) (GH-151470)
(cherry picked from commit f1a5f68e37)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-06-14 12:58:37 +00:00
Miss Islington (bot)
03873bb5f0
[3.15] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (GH-151472)
(cherry picked from commit 47b7dc788c)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-14 12:47:39 +00:00
Miss Islington (bot)
75289a92df
[3.15] gh-151424: Fix impossible stack traces in RemoteUnwinder(..., cache_frames=True) by copying chunks on cache miss (GH-151426) (#151459)
gh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True)` by copying chunks on cache miss (GH-151426)
(cherry picked from commit 6ce088e20a)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-06-13 23:40:19 +00:00
Miss Islington (bot)
5dd32176a1
[3.15] gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404) (#151445)
gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404)

---------
(cherry picked from commit 6679ac07d8)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-13 14:32:48 -07:00
Miss Islington (bot)
56ad6505e1
[3.15] gh-151443: Fix documented default of unittest.mock.mock_open's read_data parameter (GH-151444) (#151450)
(cherry picked from commit 9ad6ba0324)

Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
2026-06-13 18:39:44 +00:00
Miss Islington (bot)
5156e8fb0d
[3.15] gh-77328: Update base64 module RFC references to RFC 4648 (GH-151275) (#151438)
(cherry picked from commit e933987688)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-13 14:00:54 +01:00
Miss Islington (bot)
5d7cf16f3f
[3.15] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (#151430)
gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)
(cherry picked from commit 3c00ebc2bb)

Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-06-13 09:06:55 +00:00
Miss Islington (bot)
8b291463e3
[3.15] Docs: Fix method directive signatures in enum docs (GH-151429) (#151434)
(cherry picked from commit 5b38519762)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-06-13 08:55:30 +00:00
Miss Islington (bot)
04973e705b
[3.15] Fix typos in the curses.ascii module documentation (GH-129300) (#151413)
(cherry picked from commit f4f102027a)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-12 16:11:06 +00:00
Miss Islington (bot)
bdb53b5553
[3.15] Docs: avoid repetitions of class references in functions.rst (GH-150891) (#151405)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2026-06-12 15:01:30 +00:00
Miss Islington (bot)
5caef8590a
[3.15] gh-151284: Fix test_capi on UBSan (GH-151286) (#151323)
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-12 13:10:41 +00:00
Miss Islington (bot)
3603bd318b
[3.15] gh-151126: Fix crash on unset memory error in ctypes.get_errno (GH-151382) (#151398)
gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea90b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-12 11:31:51 +00:00
Miss Islington (bot)
a2e551610f
[3.15] gh-151297: Fix undefined behavior in _PyObject_MiRealloc (GH-151358) (GH-151388)
The standard says that a call to `memcpy` must pass a valid source and
destination pointer even if the size is 0, so we must avoid calling
`memcpy` when our source pointer is NULL. If we don't, an optimizing
compiler can decide that the pointer must be non-NULL based on the
presence of UB, and optimize out checks for null pointers.

Specifically, note that the standard says:

    Where an argument declared as size_t n specifies the length of the
    array for a function, n can have the value zero on a call to that
    function. Unless explicitly stated otherwise in the description of
    a particular function in this subclause, pointer arguments on such
    a call shall still have valid values, as described in 7.1.4.

And section 7.1.4 says:

    If an argument to a function has an invalid value (such as a value
    outside the domain of the function, or a pointer outside the address
    space of the program, or a null pointer, or a pointer to
    non-modifiable storage when the corresponding parameter is not
    const-qualified) or a type (after default argument promotion) not
    expected by a function with a variable number of arguments, the
    behavior is undefined.

The specification for `memcpy` doesn't state that it's allowed to be
called with null pointers, and Linux's `/usr/include/string.h` declares
`memcpy` as `__nonnull ((1, 2))`.
(cherry picked from commit c37599200f)

Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
2026-06-12 01:47:01 +00:00
Miss Islington (bot)
a12a0e9529
[3.15] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH-151383)
Applies d7a72c4912 to our copy of mimalloc.
(cherry picked from commit 80f9467434)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-06-11 22:39:37 +00:00
Miss Islington (bot)
e87e732fda
[3.15] gh-151337: Avoid possible memory leak in _tkinter.c on Windows. (GH-151340) (GH-151379)
(cherry picked from commit 71805db429)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
2026-06-11 20:25:05 +00:00
Miss Islington (bot)
f3632b47ce
[3.15] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151372)
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:45:30 +00:00
Miss Islington (bot)
f3fd7b8529
[3.15] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) (GH-151367)
(cherry picked from commit 65047f2e2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-11 17:22:52 +00:00
Miss Islington (bot)
b53743fb78
[3.15] gh-151126: Fix missing memory error in os._path_splitroot (GH-151339) (#151360)
gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339)
(cherry picked from commit 10595b1cb7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2026-06-11 16:55:19 +00:00
Miss Islington (bot)
85404a02ba
[3.15] gh-151228: fix data race on clearing embedded dict values (GH-151330) (#151359)
gh-151228: fix data race on clearing embedded dict values (GH-151330)
(cherry picked from commit 6112d70abe)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-06-11 16:34:26 +00:00