]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 hours agogh-151522: Guard against None transport in slow-socket SSL test (#151523) main
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)

13 hours 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.

18 hours 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)

19 hours 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)

19 hours 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>
20 hours 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)

21 hours 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().

21 hours 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>
24 hours 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.

25 hours 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.

26 hours 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.

26 hours 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.

26 hours 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.

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

27 hours 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.

40 hours 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)

43 hours 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)

46 hours 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)

47 hours 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>
47 hours 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)

47 hours 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.

2 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)

2 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)

2 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)

2 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>
2 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)

3 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)

3 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>
3 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>
3 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)

4 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)

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

4 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.

4 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)

4 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)

4 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.

4 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>
4 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)

4 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>
4 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

4 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)

4 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)

4 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)

4 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)

4 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)

4 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)

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

4 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)

4 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)

5 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)

5 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.

5 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".

5 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)

5 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)

5 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)

5 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)

5 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)

5 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)

5 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>
5 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".

5 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.

5 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.

5 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)

5 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.

5 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>
5 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)

5 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)

5 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>
5 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.

5 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>
5 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>
6 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).

6 days agogh-98894: Fix DTrace test_check_probes for shared builds (#151122)
stratakis [Wed, 10 Jun 2026 11:08:25 +0000 (13:08 +0200)] 
gh-98894: Fix DTrace test_check_probes for shared builds (#151122)

When building with --enable-shared, the SystemTap/DTrace notes
live in libpython. Add detection logic to be used by readelf.

Force the C locale on readelf output.

6 days agogh-150285: Wrap long single-line summary in text output in pydoc (GH-151081)
Serhiy Storchaka [Wed, 10 Jun 2026 10:44:35 +0000 (13:44 +0300)] 
gh-150285: Wrap long single-line summary in text output in pydoc (GH-151081)

6 days agogh-80384: Check that callback is callable at weak reference creation (GH-151145)
Serhiy Storchaka [Wed, 10 Jun 2026 10:34:55 +0000 (13:34 +0300)] 
gh-80384: Check that callback is callable at weak reference creation (GH-151145)

* Python functions weakref.ref() and weakref.proxy() now raise TypeError
  if the callback argument is not callable or None.
* C functions PyWeakref_NewRef() and PyWeakref_NewProxy() now raise TypeError
  if the callback argument is not callable, None, or NULL.

Co-authored-by: Maxwell Bernstein <emacs@fb.com>
6 days agogh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters ...
Taeknology [Wed, 10 Jun 2026 10:10:15 +0000 (19:10 +0900)] 
gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters (GH-150053)

Add short code examples mirroring the existing Py_mod_abi example,
so it is clear which slot definition macro (PySlot_DATA, PySlot_INT64,
or PySlot_UINT64) to use for these two slots.

6 days agogh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215)
Harjoth Khara [Wed, 10 Jun 2026 08:48:16 +0000 (01:48 -0700)] 
gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215)

6 days agogh-145239: Colorize `case +` in the REPL (#150979)
Bartosz Sławecki [Wed, 10 Jun 2026 06:36:50 +0000 (08:36 +0200)] 
gh-145239: Colorize `case +` in the REPL (#150979)

6 days agogh-150700: Fix class-scope inline comprehensions when nested scopes reference `__clas...
Bartosz Sławecki [Tue, 9 Jun 2026 22:22:13 +0000 (00:22 +0200)] 
gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (#150735)

* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends

In `inline_comprehension()`, when `__class__` / `__classdict__` /
`__conditional_annotations__` appears as `FREE` in a comprehension's
symbol table because a nested scope captured it (e.g. nested lambdas),
this name is still discarded from `comp_free` unconditionally.

This prevents `drop_class_free()` from seeing it, so the appropriate
`ste_needs_(...)` flag is never set on the enclosing class.
That leads to `codegen_make_closure()` throwing `SystemError` when it
couldn't find `__class__` / `__classdict__` /
`__conditional_annotations__` in the class's cellvars.

From now on we just discard from `comp_free` when no child scope
(e.g. a lambda) still needs the name as `FREE`. When a child scope does
need it, keep it in `comp_free` so `drop_class_free()` can set the
appropriate flag and the class creates the implicit cell.

* Fix tests

* Fix typo

* Fix formatting

* Add test checking validity of `__class__` returned

* Prefer 'used' to 'deferred'

6 days agogh-151112: Fix double free in `assemble_init` when out of memory (#151142)
Stan Ulbrych [Tue, 9 Jun 2026 19:45:54 +0000 (20:45 +0100)] 
gh-151112: Fix double free in `assemble_init` when out of memory (#151142)

6 days agogh-151163: Update Android, macOS installer, and Windows builds to SQLite 3.53.2 ...
Zachary Ware [Tue, 9 Jun 2026 18:27:26 +0000 (13:27 -0500)] 
gh-151163: Update Android, macOS installer, and Windows builds to SQLite 3.53.2 (GH-151187)

6 days agogh-139819: rlcompleter – avoid suggesting attributes not accessible on instances...
Peter [Tue, 9 Jun 2026 18:00:23 +0000 (02:00 +0800)] 
gh-139819: rlcompleter – avoid suggesting attributes not accessible on instances (GH-139820)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
6 days agogh-151159: Update CI to use latest SSL library versions (#151176)
Zachary Ware [Tue, 9 Jun 2026 17:29:36 +0000 (12:29 -0500)] 
gh-151159: Update CI to use latest SSL library versions (#151176)

6 days agogh-151159: Bump OpenSSL versions for iOS and Android (GH-151164)
Zachary Ware [Tue, 9 Jun 2026 17:26:13 +0000 (12:26 -0500)] 
gh-151159: Bump OpenSSL versions for iOS and Android (GH-151164)

6 days agogh-151159: Update macOS installer to use OpenSSL 3.5.7. (#151171)
Ivy Xu [Tue, 9 Jun 2026 17:12:36 +0000 (01:12 +0800)] 
gh-151159: Update macOS installer to use OpenSSL 3.5.7. (#151171)

6 days agogh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151183)
Zachary Ware [Tue, 9 Jun 2026 17:09:19 +0000 (12:09 -0500)] 
gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151183)

6 days agoGH-59633: Clarify dest collisions in argparse docs (#150987)
Savannah Ostrowski [Tue, 9 Jun 2026 17:07:03 +0000 (10:07 -0700)] 
GH-59633: Clarify dest collisions in argparse docs (#150987)

6 days agogh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (#151154)
sobolevn [Tue, 9 Jun 2026 16:42:08 +0000 (19:42 +0300)] 
gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (#151154)

6 days agogh-150285: Fix too long docstrings in the concurrent package (GH-151076)
Serhiy Storchaka [Tue, 9 Jun 2026 16:14:10 +0000 (19:14 +0300)] 
gh-150285: Fix too long docstrings in the concurrent package (GH-151076)

6 days agogh-150285: Fix too long docstrings in the asyncio package (GH-151074)
Serhiy Storchaka [Tue, 9 Jun 2026 16:13:34 +0000 (19:13 +0300)] 
gh-150285: Fix too long docstrings in the asyncio package (GH-151074)

6 days agoGH-61082: Clarify nargs='*' positional default behavior (#150989)
Savannah Ostrowski [Tue, 9 Jun 2026 15:37:24 +0000 (08:37 -0700)] 
GH-61082: Clarify nargs='*' positional default behavior (#150989)

6 days agoGH-54732: Tweak wording around empty lines in argument files (#150980)
Savannah Ostrowski [Tue, 9 Jun 2026 15:37:15 +0000 (08:37 -0700)] 
GH-54732: Tweak wording around empty lines in argument files (#150980)

6 days agoDocs: add cross-references to improve navigation in `getpass.rst` (#151092)
Sergio López Gómez [Tue, 9 Jun 2026 15:36:05 +0000 (17:36 +0200)] 
Docs: add cross-references to improve navigation in `getpass.rst` (#151092)

6 days agogh-150898: Assume OpenSSL supports keylogging (#150870)
Robsdedude [Tue, 9 Jun 2026 14:37:38 +0000 (16:37 +0200)] 
gh-150898: Assume OpenSSL supports keylogging (#150870)

Since version 3.10, CPython requires OpenSSL 1.1.1 or higher.
Therefore, support for keylogging can be assumed.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agoDocs: Only add `profiling-sampling-visualization.{css,js}` to files when necessary...
Stan Ulbrych [Tue, 9 Jun 2026 13:16:03 +0000 (14:16 +0100)] 
Docs: Only add `profiling-sampling-visualization.{css,js}` to files when necessary (#151150)

7 days agogh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (#151044)
sobolevn [Tue, 9 Jun 2026 11:44:37 +0000 (14:44 +0300)] 
gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (#151044)

7 days agogh-151130: Add more tests for PyWeakref_* C API (GH-151131)
Serhiy Storchaka [Tue, 9 Jun 2026 11:11:17 +0000 (14:11 +0300)] 
gh-151130: Add more tests for PyWeakref_* C API (GH-151131)

7 days agogh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access...
Cody Maloney [Tue, 9 Jun 2026 10:31:44 +0000 (03:31 -0700)] 
gh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access (#145957)

TextIOWrapper keeps its underlying stream in a member called
`self->buffer`. That stream can be detached by user code, such as custom
`.flush` implementations resulting in `self->buffer` being set to NULL.
The implementation often checked at the start of functions if
`self->buffer` is in a good state, but did not always recheck after
other Python code was called which could modify `self->buffer`.

The cases which need to be re-checked are hard to spot so rather than
rely on reviewer effort create better safety by making all self->buffer
access go through helper functions.

Thank you yihong0618 for the test, NEWS and initial implementation in
gh-143041.

Co-authored-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
7 days agogh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (#151127)
sobolevn [Tue, 9 Jun 2026 10:03:33 +0000 (13:03 +0300)] 
gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (#151127)

7 days agogh-151070: Fix class referencing typo in collections.abc docs (GH-151088)
Arshal Aromal [Mon, 8 Jun 2026 19:38:14 +0000 (01:08 +0530)] 
gh-151070: Fix class referencing typo in collections.abc docs (GH-151088)