]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
43 min agogh-86726: Add few missing versionadded directives (GH-151662) main
Serhiy Storchaka [Thu, 18 Jun 2026 15:46:57 +0000 (18:46 +0300)] 
gh-86726: Add few missing versionadded directives (GH-151662)

Pack.pack_content, Place.place_content and Grid.grid_content were
added in 3.15.

115 min agogh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)
Serhiy Storchaka [Thu, 18 Jun 2026 14:34:57 +0000 (17:34 +0300)] 
gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)

It returns a sys.version_info-like named tuple, not a string.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 hours agoGH-150516: Reduce the work done to spill and reload the stack around calls (GH-151587)
Mark Shannon [Thu, 18 Jun 2026 14:14:30 +0000 (15:14 +0100)] 
GH-150516: Reduce the work done to spill and reload the stack around calls (GH-151587)

3 hours agogh-86726: Fix "deprecated" directive for wm_attributes (GH-151652)
Serhiy Storchaka [Thu, 18 Jun 2026 13:26:58 +0000 (16:26 +0300)] 
gh-86726: Fix "deprecated" directive for wm_attributes (GH-151652)

3 hours agogh-141510 Document and test frozendict class matching behaviour (#150799)
da-woods [Thu, 18 Jun 2026 12:53:09 +0000 (13:53 +0100)] 
gh-141510 Document and test frozendict class matching behaviour (#150799)

Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering.

3 hours agogh-86726: Document the full public API of tkinter (GH-151579)
Serhiy Storchaka [Thu, 18 Jun 2026 12:39:06 +0000 (15:39 +0300)] 
gh-86726: Document the full public API of tkinter (GH-151579)

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.

--------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 hours agogh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609)
Donghee Na [Thu, 18 Jun 2026 11:58:12 +0000 (20:58 +0900)] 
gh-151229: Finalize JIT tracer in test eval-frame stub (gh-151609)

5 hours agogh-151623: Add missing curses docstrings and document intrflush() (#151632)
Serhiy Storchaka [Thu, 18 Jun 2026 10:52:26 +0000 (13:52 +0300)] 
gh-151623: Add missing curses docstrings and document intrflush() (#151632)

6 hours agogh-151623: Improve curses documentation style (#151635)
Hugo van Kemenade [Thu, 18 Jun 2026 09:43:33 +0000 (12:43 +0300)] 
gh-151623: Improve curses documentation style (#151635)

8 hours agogh-151623: Improve curses documentation and docstrings (GH-151625)
Serhiy Storchaka [Thu, 18 Jun 2026 08:20:03 +0000 (11:20 +0300)] 
gh-151623: Improve curses documentation and docstrings (GH-151625)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.

9 hours agodocs: Fix indent misalignment in `library/logging.config.rst` (GH-151617)
mushitoriami [Thu, 18 Jun 2026 07:21:24 +0000 (16:21 +0900)] 
docs: Fix indent misalignment in `library/logging.config.rst` (GH-151617)

16 hours agogh-150942: Optimize PicklerMemoProxy.copy() with _PyDict_SetItem_Take2 (gh-151608)
Donghee Na [Thu, 18 Jun 2026 00:08:00 +0000 (09:08 +0900)] 
gh-150942: Optimize PicklerMemoProxy.copy() with _PyDict_SetItem_Take2 (gh-151608)

19 hours agogh-151436: Fix missing `tstate->last_profiled_frame` updates (#151437)
Maurycy Pawłowski-Wieroński [Wed, 17 Jun 2026 20:49:23 +0000 (22:49 +0200)] 
gh-151436: Fix missing `tstate->last_profiled_frame` updates (#151437)

22 hours agogh-151510: Fix __lazy_import__ without frame (#151511)
AN Long [Wed, 17 Jun 2026 18:09:51 +0000 (03:09 +0900)] 
gh-151510: Fix __lazy_import__ without frame (#151511)

27 hours agogh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)
Petr Viktorin [Wed, 17 Jun 2026 13:27:02 +0000 (15:27 +0200)] 
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).

27 hours agogh-150966: Fix live profiling error tests (GH-151020)
Pablo Galindo Salgado [Wed, 17 Jun 2026 13:17:16 +0000 (14:17 +0100)] 
gh-150966: Fix live profiling error tests (GH-151020)

27 hours agogh-151584: Remove `PyUnstable_Module_SetGIL` call in `_remote_debugging` (#151585)
sobolevn [Wed, 17 Jun 2026 12:37:08 +0000 (15:37 +0300)] 
gh-151584: Remove `PyUnstable_Module_SetGIL` call in `_remote_debugging` (#151585)

28 hours agogh-120665: make unittest loaders avoid loading test cases that are abstract base...
blhsing [Wed, 17 Jun 2026 11:48:09 +0000 (04:48 -0700)] 
gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (#120666)

29 hours agogh-151593: Use timeout on GitHub Action TSan jobs (#151594)
Victor Stinner [Wed, 17 Jun 2026 11:02:22 +0000 (13:02 +0200)] 
gh-151593: Use timeout on GitHub Action TSan jobs (#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.

31 hours agogh-151496: Use process groups in test_dtrace (#151512)
Victor Stinner [Wed, 17 Jun 2026 08:58:22 +0000 (10:58 +0200)] 
gh-151496: Use process groups in test_dtrace (#151512)

Create a new process group to run bpftrace commands, so it's possible
to kill also child processes on timeout.

32 hours agogh-151546: Fix stack limits on musl (#151548)
Victor Stinner [Wed, 17 Jun 2026 08:23:57 +0000 (10:23 +0200)] 
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.

41 hours agogh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup...
Steve Dower [Tue, 16 Jun 2026 23:16:06 +0000 (00:16 +0100)] 
gh-151544: Fixes CVE-2026-12003 by removing the fallback to %VPATH%/Modules/Setup.local for discovering sources in getpath.py (GH-151545)

47 hours agogh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the...
Daniele Parmeggiani [Tue, 16 Jun 2026 16:56:37 +0000 (17:56 +0100)] 
gh-150902: Optimize PyCriticalSection2 to skip locking the same locks held by the current CS2

This mimics an optimization already present for the single-mutex critical section.

47 hours agogh-118158: Fix missing newline in py_compile CLI error output (#149008)
Xiao Yuan [Tue, 16 Jun 2026 16:41:52 +0000 (19:41 +0300)] 
gh-118158: Fix missing newline in py_compile CLI error output (#149008)

Restore trailing newline in error messages from `python -m py_compile`,
lost when `main()` was refactored to use argparse.

47 hours agogh-151428: Remove unused imports from stdlib (#151478)
Hugo van Kemenade [Tue, 16 Jun 2026 16:31:01 +0000 (19:31 +0300)] 
gh-151428: Remove unused imports from stdlib (#151478)

2 days agogh-151218: Replace sys.flags in PyConfig_Set() (#151402)
Victor Stinner [Tue, 16 Jun 2026 16:17:33 +0000 (18:17 +0200)] 
gh-151218: Replace sys.flags in PyConfig_Set() (#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.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 days agogh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (#151521)
Itamar Oren [Tue, 16 Jun 2026 16:05:21 +0000 (09:05 -0700)] 
gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (#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.

2 days agogh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120)
dev [Tue, 16 Jun 2026 11:49:54 +0000 (17:19 +0530)] 
gh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120)

Encode the payload with output_charset instead of input_charset.

2 days agogh-151522: Guard against None transport in slow-socket SSL test (#151523)
Itamar Oren [Tue, 16 Jun 2026 04:51:39 +0000 (21:51 -0700)] 
gh-151522: Guard against None transport in slow-socket SSL test (#151523)

2 days agogh-151422: Don't link libffi into _ctypes_test.so (#151423)
Hood Chatham [Mon, 15 Jun 2026 22:16:16 +0000 (15:16 -0700)] 
gh-151422: Don't link libffi into _ctypes_test.so (#151423)

_ctypes_test doesn't use libffi directly, and linking it into the module
causes emscripten tests to fail.

2 days agogh-151128: Improve SyntaxError message for cross language keywords (GH-151129)
Langyan [Mon, 15 Jun 2026 17:55:57 +0000 (01:55 +0800)] 
gh-151128: Improve SyntaxError message for cross language keywords (GH-151129)

2 days agogh-151223: fix tsan data races in load global specializations (#151393)
Kumar Aditya [Mon, 15 Jun 2026 16:39:49 +0000 (22:09 +0530)] 
gh-151223: fix tsan data races in load global specializations (#151393)

3 days agogh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433)
Weilin Du [Mon, 15 Jun 2026 16:11:10 +0000 (00:11 +0800)] 
gh-140145: Use repr of the key in `zoneinfo` "No time zone found" error (#140433)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 days agogh-92455: Respect case-sensitive mimetype suffixes (GH-148782)
Xiao Yuan [Mon, 15 Jun 2026 15:05:29 +0000 (18:05 +0300)] 
gh-92455: Respect case-sensitive mimetype suffixes (GH-148782)

3 days agogh-149079: Optimize sorting in unicodedata.normalize() (GH-150782)
Serhiy Storchaka [Mon, 15 Jun 2026 14:36:50 +0000 (17:36 +0300)] 
gh-149079: Optimize sorting in unicodedata.normalize() (GH-150782)

Sort the Py_UCS4 buffer instead of PyUnicodeObject. This allows to avoid
the use of PyUnicode_READ() and PyUnicode_WRITE().

3 days agogh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (#148854)
Nick Begg [Mon, 15 Jun 2026 14:25:08 +0000 (16:25 +0200)] 
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (#148854)

/run/ on my FreeBSD install is not readable causing failing test.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 days agoFix issues reported by cpython-review-toolkit in faulthandler (#151341)
Victor Stinner [Mon, 15 Jun 2026 11:11:26 +0000 (13:11 +0200)] 
Fix issues reported by cpython-review-toolkit in faulthandler (#151341)

* snprintf() is not async-signal-safe: replace it with
  _Py_DumpDecimal().
* Fix tid type from 'long' to 'unsigned long'.
* Replace PyLong_AsLong() with PyLong_AsInt().
* Avoid unnecessary narrowing cast on _Py_write_noraise() call.

3 days agogh-139227: Remove unused _PyRuntime.imports.pkgcontext (#151490)
Victor Stinner [Mon, 15 Jun 2026 10:23:04 +0000 (12:23 +0200)] 
gh-139227: Remove unused _PyRuntime.imports.pkgcontext (#151490)

The global variable has been replaced by a new thread local variable
"pkgcontext" in Python/import.c.

3 days agogh-146102: Fix type slot_bf_getbuffer() error handling (#151346)
Victor Stinner [Mon, 15 Jun 2026 09:47:58 +0000 (11:47 +0200)] 
gh-146102: Fix type slot_bf_getbuffer() error handling (#151346)

Call PyBuffer_Release() if PyObject_GC_New() fails.

Fix also bytes_join(): only call Py_DECREF(item) after formatting the
error message which uses item.

3 days agogh-146102: Don't clear exception on success in odictobject.c (#151347)
Victor Stinner [Mon, 15 Jun 2026 09:46:52 +0000 (11:46 +0200)] 
gh-146102: Don't clear exception on success in odictobject.c (#151347)

Calling PyErr_Clear() on success can mask a pending exception.
Replace it with an assertion checking that no exception is set.

3 days agogh-137759: Replace _PyObject_HashFast() with PyObject_Hash() in setobject.c (#137828)
JasonMendoza2008 [Mon, 15 Jun 2026 09:31:04 +0000 (11:31 +0200)] 
gh-137759: Replace _PyObject_HashFast() with PyObject_Hash() in setobject.c (#137828)

Replace also _PyObject_HashFast() with PyObject_Hash()
in _collections._count_elements().

Rename _PyObject_HashFast() to _PyObject_HashDictKey(),
and mark it as Py_ALWAYS_INLINE.

Only use _PyObject_HashDictKey() on dictionaries.

3 days agoAdd `.toml` to `.editorconfig` (#151481)
sobolevn [Mon, 15 Jun 2026 09:14:11 +0000 (12:14 +0300)] 
Add `.toml` to `.editorconfig` (#151481)

3 days agogh-149671: Restore compatibility with setuptools -nspkg.pth files in site module...
Victor Stinner [Mon, 15 Jun 2026 08:29:52 +0000 (10:29 +0200)] 
gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (#151319)

Inject the "sitedir" variable in the frame which executes ".pth" code.

3 days agogh-130197: Test `pygettext`'s `--version` CLI option (#133022)
Stan Ulbrych [Sun, 14 Jun 2026 19:17:45 +0000 (20:17 +0100)] 
gh-130197: Test `pygettext`'s `--version` CLI option (#133022)

4 days agogh-151390: Colorize `match +` and `match -` in the REPL (#151391)
Bartosz Sławecki [Sun, 14 Jun 2026 16:06:30 +0000 (18:06 +0200)] 
gh-151390: Colorize `match +` and `match -` in the REPL (#151391)

4 days agogh-151428: Remove unused imports from `Tools/` (#151442)
Ivy Xu [Sun, 14 Jun 2026 13:12:30 +0000 (21:12 +0800)] 
gh-151428: Remove unused imports from `Tools/` (#151442)

4 days agogh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH...
Aniket [Sun, 14 Jun 2026 12:39:33 +0000 (18:09 +0530)] 
gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 days agogh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462)
Bartosz Sławecki [Sun, 14 Jun 2026 12:33:03 +0000 (14:33 +0200)] 
gh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462)

4 days agoSkip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)
Gregory P. Smith [Sun, 14 Jun 2026 12:29:26 +0000 (05:29 -0700)] 
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.

4 days agogh-151428: Remove unused imports in the stdlib (#151440)
Ivy Xu [Sun, 14 Jun 2026 12:00:28 +0000 (20:00 +0800)] 
gh-151428: Remove unused imports in the stdlib (#151440)

4 days agogh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True...
Maurycy Pawłowski-Wieroński [Sat, 13 Jun 2026 23:10:56 +0000 (01:10 +0200)] 
gh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True)` by copying chunks on cache miss (#151426)

4 days agogh-151443: Fix documented default of `unittest.mock.mock_open`'s `read_data` paramet...
Shardul Deshpande [Sat, 13 Jun 2026 18:31:03 +0000 (00:01 +0530)] 
gh-151443: Fix documented default of  `unittest.mock.mock_open`'s `read_data` parameter (#151444)

4 days agogh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404)
tonghuaroot (童话) [Sat, 13 Jun 2026 17:23:44 +0000 (01:23 +0800)] 
gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404)

---------

Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
5 days agogh-77328: Update `base64` module RFC references to RFC 4648 (#151275)
Stan Ulbrych [Sat, 13 Jun 2026 12:21:54 +0000 (13:21 +0100)] 
gh-77328: Update `base64` module RFC references to RFC 4648 (#151275)

5 days agoDocs: Fix method directive signatures in `enum` docs (#151429)
Jonathan Dung [Sat, 13 Jun 2026 08:47:23 +0000 (16:47 +0800)] 
Docs: Fix method directive signatures in `enum` docs (#151429)

5 days agogh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among...
Daniel Shields [Sat, 13 Jun 2026 08:23:39 +0000 (03:23 -0500)] 
gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
6 days agoFix typos in the `curses.ascii` module documentation (#129300)
Rafael Fontenelle [Fri, 12 Jun 2026 16:02:33 +0000 (13:02 -0300)] 
Fix typos in the `curses.ascii` module documentation (#129300)

Co-authored-by: Stan Ulbrych <stan@python.org>
6 days agoDocs: avoid repetitions of class references in functions.rst (#150891)
Maciej Olko [Fri, 12 Jun 2026 14:53:06 +0000 (16:53 +0200)] 
Docs: avoid repetitions of class references in functions.rst (#150891)

6 days agogh-151126: Fix crash on unset memory error in `ctypes.get_errno` (#151382)
sobolevn [Fri, 12 Jun 2026 11:03:21 +0000 (14:03 +0300)] 
gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (#151382)

6 days agogh-151297: Fix undefined behavior in `_PyObject_MiRealloc` (GH-151358)
Matt Wozniski [Fri, 12 Jun 2026 01:21:04 +0000 (21:21 -0400)] 
gh-151297: Fix undefined behavior in `_PyObject_MiRealloc` (GH-151358)

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))`.

6 days agogh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066)
Peter Bierma [Thu, 11 Jun 2026 22:11:52 +0000 (18:11 -0400)] 
gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066)

Applies https://github.com/microsoft/mimalloc/commit/d7a72c4912943e8aaf135e465ca5ea229ea96646 to our copy of mimalloc.

6 days agogh-151337: Avoid possible memory leak in `_tkinter.c` on Windows. (GH-151340)
Ivy Xu [Thu, 11 Jun 2026 19:55:11 +0000 (03:55 +0800)] 
gh-151337: Avoid possible memory leak in `_tkinter.c` on Windows. (GH-151340)

6 days agoCorrect the docstring of `logging.config` (GH-151353)
Ivy Xu [Thu, 11 Jun 2026 18:29:20 +0000 (02:29 +0800)] 
Correct the docstring of `logging.config` (GH-151353)

6 days agogh-150285: Fix overflow in too long lines for class data in pydoc (GH-151366)
Serhiy Storchaka [Thu, 11 Jun 2026 17:50:00 +0000 (20:50 +0300)] 
gh-150285: Fix overflow in too long lines for class data in pydoc (GH-151366)

Use all available space (80 columns) for formatting reprs
of module and class data, but ensure that they do not overflow.

6 days agogh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (#139007)
Aniket [Thu, 11 Jun 2026 17:15:29 +0000 (22:45 +0530)] 
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (#139007)

And add tests.

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agogh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354)
Serhiy Storchaka [Thu, 11 Jun 2026 16:52:58 +0000 (19:52 +0300)] 
gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354)

6 days agogh-150942: Speed up json.loads array and object decoding (GH-150945)
Pieter Eendebak [Thu, 11 Jun 2026 16:38:49 +0000 (18:38 +0200)] 
gh-150942: Speed up json.loads array and object decoding (GH-150945)

Append parsed values to the result list with _PyList_AppendTakeRef and
insert key/value pairs with _PyDict_SetItem_Take2, which take ownership of
the references instead of incref-ing on insert and then decref-ing the
local.  This removes a reference-count round-trip per element (and, on the
free-threaded build, a per-append lock).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-150490: Raise PyType_Modified for insertion into split dictionary (#150489)
Dino Viehland [Thu, 11 Jun 2026 16:38:31 +0000 (09:38 -0700)] 
gh-150490: Raise PyType_Modified for insertion into split dictionary (#150489)

Raise PyType_Modified for insertion into split dictionary

7 days agogh-151228: fix data race on clearing embedded dict values (#151330)
Kumar Aditya [Thu, 11 Jun 2026 16:07:00 +0000 (21:37 +0530)] 
gh-151228: fix data race on clearing embedded dict values (#151330)

7 days agogh-151126: Fix missing memory error in `os._path_splitroot` (#151339)
sobolevn [Thu, 11 Jun 2026 15:48:08 +0000 (18:48 +0300)] 
gh-151126: Fix missing memory error in `os._path_splitroot` (#151339)

7 days agogh-101100: Fix Sphinx nitpick in `unittest.mock.rst` (#151302)
Cody Maloney [Thu, 11 Jun 2026 15:29:40 +0000 (08:29 -0700)] 
gh-101100: Fix Sphinx nitpick in `unittest.mock.rst` (#151302)

7 days agogh-139588: Fix nondeterministic `make latex` doc build under parallel make (#151343)
Maciej Olko [Thu, 11 Jun 2026 15:13:22 +0000 (17:13 +0200)] 
gh-139588: Fix nondeterministic `make latex` doc build under parallel make (#151343)

7 days agogh-150858: fix data race while changing `__qualname__` of a type object(#150859)
Thomas Kowalski [Thu, 11 Jun 2026 15:07:36 +0000 (17:07 +0200)] 
gh-150858: fix data race while changing `__qualname__` of a type object(#150859)

7 days agogh-151112: Fix crash in `compiler_mod()` when entering the current compilation unit...
Stan Ulbrych [Thu, 11 Jun 2026 14:52:11 +0000 (15:52 +0100)] 
gh-151112: Fix crash in `compiler_mod()` when entering the current compilation unit fails (#151234)

7 days agogh-150397: Fix pyexpat bigmem test (#151329)
Victor Stinner [Thu, 11 Jun 2026 14:45:44 +0000 (16:45 +0200)] 
gh-150397: Fix pyexpat bigmem test (#151329)

Add missing parameter (size).

7 days agogh-151238: Check for `_get_resized_exprs` failure in `_PyPegen_{joined,template}_str...
Stan Ulbrych [Thu, 11 Jun 2026 14:26:46 +0000 (15:26 +0100)] 
gh-151238: Check for `_get_resized_exprs` failure in `_PyPegen_{joined,template}_str` (#151259)

7 days agogh-150285: Suppress showing the __getstate__() comment in the help for dataclasses...
Serhiy Storchaka [Thu, 11 Jun 2026 12:23:19 +0000 (15:23 +0300)] 
gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328)

7 days agogh-151179: Fix pidfd leak in asyncio _PidfdChildWatcher (#151186)
Timofei [Thu, 11 Jun 2026 11:43:46 +0000 (14:43 +0300)] 
gh-151179: Fix pidfd leak in asyncio _PidfdChildWatcher (#151186)

7 days agogh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (#151260)
Victor Stinner [Thu, 11 Jun 2026 10:55:13 +0000 (12:55 +0200)] 
gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (#151260)

Return 0 if the object is not tracked by the GC.

7 days agogh-151284: Fix test_capi on UBSan (#151286)
Victor Stinner [Thu, 11 Jun 2026 10:55:09 +0000 (12:55 +0200)] 
gh-151284: Fix test_capi on UBSan (#151286)

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

Enable test_capi in GitHub Action "Reusable Sanitizer".

7 days agoRemove unused internal _Py_REF_IS_QUEUED() function (#151236)
Victor Stinner [Thu, 11 Jun 2026 10:54:36 +0000 (12:54 +0200)] 
Remove unused internal _Py_REF_IS_QUEUED() function (#151236)

7 days agogh-151112: Move an `assert` that may fail in `cfg_builder_check` (#151153)
Stan Ulbrych [Thu, 11 Jun 2026 09:16:27 +0000 (10:16 +0100)] 
gh-151112: Move an `assert` that may fail in `cfg_builder_check` (#151153)

7 days agogh-151177: Fix race condition in `_testembed` (GH-151293)
Peter Bierma [Thu, 11 Jun 2026 09:06:48 +0000 (05:06 -0400)] 
gh-151177: Fix race condition in `_testembed` (GH-151293)

7 days agoDrop historical `:author:`s from HOWTOs (#151091)
Stan Ulbrych [Thu, 11 Jun 2026 08:46:39 +0000 (09:46 +0100)] 
Drop historical `:author:`s from HOWTOs (#151091)

7 days agogh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffe...
tonghuaroot (童话) [Thu, 11 Jun 2026 07:51:43 +0000 (15:51 +0800)] 
gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296)

7 days agogh-136880: Add warning about PYTHONPATH (GH-151098)
glennglazer [Thu, 11 Jun 2026 06:14:34 +0000 (23:14 -0700)] 
gh-136880: Add warning about PYTHONPATH (GH-151098)

7 days agogh-139819: Use builtin `sentinel` in `rlcompleter` (GH-151222)
Victorien [Wed, 10 Jun 2026 20:43:09 +0000 (22:43 +0200)] 
gh-139819: Use builtin `sentinel` in `rlcompleter` (GH-151222)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
7 days agogh-151278: Fix test_faulthandler on UBSan (#151279)
Victor Stinner [Wed, 10 Jun 2026 19:39:03 +0000 (21:39 +0200)] 
gh-151278: Fix test_faulthandler on UBSan (#151279)

* Py_FatalError() no longer calls _PyFaulthandler_Fini() if it
  doesn't hold the GIL.
* Skip test_faulthandler tests raising signals if run with UBSan.
* Enable test_faulthandler in GitHub Action "Reusable Sanitizer".

7 days agoGHA: Display output when a sanitizer test fails (#151268)
Victor Stinner [Wed, 10 Jun 2026 17:07:51 +0000 (19:07 +0200)] 
GHA: Display output when a sanitizer test fails (#151268)

Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.

7 days agogh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure...
Victor Stinner [Wed, 10 Jun 2026 16:43:38 +0000 (18:43 +0200)] 
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.

8 days agogh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (#151239)
sobolevn [Wed, 10 Jun 2026 15:59:11 +0000 (18:59 +0300)] 
gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (#151239)

8 days agogh-62259: Add Tools/unicode/gen_expat_table.py (GH-150503)
Serhiy Storchaka [Wed, 10 Jun 2026 15:04:03 +0000 (18:04 +0300)] 
gh-62259: Add Tools/unicode/gen_expat_table.py (GH-150503)

It was used to generate the _expat_decoding_table attribute of CodecInfo.

8 days agogh-141984: Reword the Generator expressions section (GH-150518)
Petr Viktorin [Wed, 10 Jun 2026 14:45:30 +0000 (16:45 +0200)] 
gh-141984: Reword the Generator expressions section (GH-150518)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
8 days agoadd asyncio guide for Free-Threaded Python (#150456)
Kumar Aditya [Wed, 10 Jun 2026 14:02:11 +0000 (19:32 +0530)] 
add asyncio guide for Free-Threaded Python (#150456)

8 days agoDocs: Fix typos in the "Memory Management" section (GH-151243)
Manoj K M [Wed, 10 Jun 2026 13:13:17 +0000 (18:43 +0530)] 
Docs: Fix typos in the "Memory Management" section (GH-151243)

8 days agogh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)
tonghuaroot (童话) [Wed, 10 Jun 2026 13:03:49 +0000 (21:03 +0800)] 
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.

Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
8 days agogh-89554: Document socket.SocketType as a class (#150683)
Bernát Gábor [Wed, 10 Jun 2026 13:01:01 +0000 (06:01 -0700)] 
gh-89554: Document socket.SocketType as a class (#150683)

socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.

8 days agogh-150671: Deprecate `PyAsyncGen_New`, `PyCoro_New`, `PyGen_New`, `PyGen_NewWithQualN...
sobolevn [Wed, 10 Jun 2026 12:57:09 +0000 (15:57 +0300)] 
gh-150671: Deprecate `PyAsyncGen_New`, `PyCoro_New`, `PyGen_New`, `PyGen_NewWithQualName` functions (#150672)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
8 days agogh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__(...
Lukas Geiger [Wed, 10 Jun 2026 12:27:11 +0000 (13:27 +0100)] 
gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (#150990)

Co-authored-by: Victor Stinner <vstinner@python.org>
8 days agoAdd yet one assertion in test_set_text_charset_cp949 (GH-151224)
Serhiy Storchaka [Wed, 10 Jun 2026 11:36:14 +0000 (14:36 +0300)] 
Add yet one assertion in test_set_text_charset_cp949 (GH-151224)

Check bytes(m), not only str(m).