]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
80 min agogh-154271: Enable socket ancillary data and forkserver on illumos (GH-154273) main
Serhiy Storchaka [Tue, 28 Jul 2026 17:35:26 +0000 (20:35 +0300)] 
gh-154271: Enable socket ancillary data and forkserver on illumos (GH-154273)

illumos declares the socket ancillary-data API (CMSG_*, sendmsg(),
recvmsg()) only under _XOPEN_SOURCE >= 600.  __EXTENSIONS__ keeps the
other platform features.  This enables the forkserver start method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
101 min agogh-154324: Fix os.sendfile() error reporting on illumos (GH-154327)
Serhiy Storchaka [Tue, 28 Jul 2026 17:14:00 +0000 (20:14 +0300)] 
gh-154324: Fix os.sendfile() error reporting on illumos (GH-154327)

illumos sendfile(3EXT) returns the number of transferred bytes by adding
it to the offset without initializing it, so the offset cannot be used to
detect a partial write.  Use sendfilev(3EXT), which reports the number of
transferred bytes in an explicit out parameter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 hours agogh-154821: fix data races on function attributes (#154826)
Kumar Aditya [Tue, 28 Jul 2026 16:54:27 +0000 (22:24 +0530)] 
gh-154821: fix data races on function attributes (#154826)

2 hours agogh-154822: Fix racy assertion during finalization (GH-154824)
Peter Bierma [Tue, 28 Jul 2026 16:06:52 +0000 (12:06 -0400)] 
gh-154822: Fix racy assertion during finalization (GH-154824)

7 hours agogh-152674: Avoid quadratic behavior in xml.etree.ElementPath index predicates (GH...
Petr Viktorin [Tue, 28 Jul 2026 11:36:47 +0000 (13:36 +0200)] 
gh-152674: Avoid quadratic behavior in xml.etree.ElementPath index predicates (GH-152676)

Co-authored-by: Alexis <alexis.challande@trailofbits.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
8 hours agogh-132604: Track deprecation related to runtime-checkable protocols (3.20) (#154790)
Bartosz Sławecki [Tue, 28 Jul 2026 10:27:31 +0000 (12:27 +0200)] 
gh-132604: Track deprecation related to runtime-checkable protocols (3.20) (#154790)

* Track deprecation related to runtime-checkable protocols until 3.20

* Add deprecation note to 3.15 what's new

9 hours agogh-142349: Clarify lazy import filters have positional-only parameters (GH-144856)
Bartosz Sławecki [Tue, 28 Jul 2026 09:14:51 +0000 (11:14 +0200)] 
gh-142349: Clarify lazy import filters have positional-only parameters (GH-144856)

9 hours agogh-154661: Reorganize difflib documentation (GH-154662)
Petr Viktorin [Tue, 28 Jul 2026 09:04:23 +0000 (11:04 +0200)] 
gh-154661: Reorganize difflib documentation (GH-154662)

- Put common information in an intro section at the beginning, rather
  than in a duplicate doc entry for `SequenceMatcher`
- Merge the two doc entries for `Differ`
- Document timing as a CPython implementation detail
- Group examples together

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 hours agogh-154775: Don't accept duplicate plus sign when matching complex number (GH-154776)
Petr Viktorin [Tue, 28 Jul 2026 07:19:46 +0000 (09:19 +0200)] 
gh-154775: Don't accept duplicate plus sign when matching complex number (GH-154776)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
11 hours agogh-150866: Fix asyncio shutdown_asyncgens to report BaseException (#150867)
Timofei Ivankov [Tue, 28 Jul 2026 06:59:49 +0000 (09:59 +0300)] 
gh-150866: Fix asyncio shutdown_asyncgens to report BaseException (#150867)

13 hours agogh-154786: Fix crashes on a screen without a terminal (GH-154787)
Serhiy Storchaka [Tue, 28 Jul 2026 05:00:39 +0000 (08:00 +0300)] 
gh-154786: Fix crashes on a screen without a terminal (GH-154787)

screen.use() makes its screen current for the callback, so a new_prescr()
screen, which has no terminal, can be current without set_term().
Operations that need a terminal then crashed inside curses.

Raise curses.error instead, checking that stdscr exists.

17 hours agogh-154746: Update docstring for `collections.Counter` (GH-154792)
Dan Shernicoff [Tue, 28 Jul 2026 01:41:17 +0000 (21:41 -0400)] 
gh-154746: Update docstring for `collections.Counter` (GH-154792)

Added a note to `collections.Counter`'s docstring that initializing a `Counter` from a `Mapping` or `Counter` will have different behaviour than initializing from other `Iterable`s.

This behaviour was already documented in the canonical docs but is missing from the help() output.

22 hours agogh-154467: Fix empty (Pdb) prompt when attaching to a process with pdb -p (#154469)
Łukasz Langa [Mon, 27 Jul 2026 20:45:40 +0000 (13:45 -0700)] 
gh-154467: Fix empty (Pdb) prompt when attaching to a process with pdb -p (#154469)

_PdbServer inherits _cmdloop, which wraps cmdloop() in
_maybe_use_pyrepl_as_stdin(). That context manager blanks self.prompt to ''
so that a local pyrepl draws the prompt itself. The remote server, however,
never reads from a local pyrepl -- it transmits self.prompt to the client
over the socket -- so the blanking made it send an empty prompt whenever the
target process had a pyrepl-capable terminal (pyrepl_input is set).

Override _maybe_use_pyrepl_as_stdin() in _PdbServer to a no-op, keeping the
real prompt. Add an integration test that attaches to a target running under
a pty, so PyREPL is genuinely enabled inside it, and asserts the transmitted
prompt is "(Pdb) ".

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 hours agogh-154675: reorganize some imports in importlib (#154657)
Brett Cannon [Mon, 27 Jul 2026 20:18:53 +0000 (13:18 -0700)] 
gh-154675: reorganize some imports in importlib (#154657)

23 hours agogh-152912: Fix audit hook exception check in sys.addaudithook() (GH-152913)
k00shi [Mon, 27 Jul 2026 19:35:40 +0000 (03:35 +0800)] 
gh-152912: Fix audit hook exception check in sys.addaudithook() (GH-152913)

23 hours agogh-152548: Add a test.support.isolation.runInSubprocess() decorator (GH-152551)
Serhiy Storchaka [Mon, 27 Jul 2026 19:02:59 +0000 (22:02 +0300)] 
gh-152548: Add a test.support.isolation.runInSubprocess() decorator (GH-152551)

Run a test in a fresh interpreter subprocess, so that it does not share global
or interpreter state with the rest of the test run.  It can decorate a test
method (only that method runs in a subprocess) or a TestCase subclass (the
whole class runs in one subprocess, with its setUpClass()/setUp()/tearDown()/
tearDownClass() running there rather than in the parent).

Failures, errors and skips, including those of individual subtests, are
reported for the test; a failure or an error shows the original subprocess
traceback.  The subprocess inherits the parent's resource, memory, verbosity
and failfast configuration, so that requires_resource(), bigmemtest() and
similar behave the same in both processes.  A decorated test is skipped where
subprocesses are unavailable, since it must spawn one.

The test.support.isolation.runningInSubprocess flag is true in the subprocess,
so that fixtures can choose what to run there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 hours agogh-154749: Reject a terminal-less screen in curses.set_term() (GH-154750)
Vyron Vasileiadis [Mon, 27 Jul 2026 18:59:46 +0000 (21:59 +0300)] 
gh-154749: Reject a terminal-less screen in curses.set_term() (GH-154750)

set_term() accepted a screen returned by new_prescr(), which has no
terminal, and the next refresh crashed inside curses.  Raise
curses.error instead.

24 hours agogh-154751: Fix use-after-free in curses.initscr() after newterm() (GH-154752)
Vyron Vasileiadis [Mon, 27 Jul 2026 18:24:10 +0000 (21:24 +0300)] 
gh-154751: Fix use-after-free in curses.initscr() after newterm() (GH-154752)

initscr() called while a newterm() screen is current returned a second
window object over that screen's standard window, with no reference to
the screen.  Either wrapper could then free the window used by the other.

Return the screen's own standard window instead.

27 hours agogh-154744: Improve detection of skipinitialspace in csv.Sniffer (GH-154745)
Serhiy Storchaka [Mon, 27 Jul 2026 15:03:17 +0000 (18:03 +0300)] 
gh-154744: Improve detection of skipinitialspace in csv.Sniffer (GH-154745)

Detect the padding by parsing the sample both with and without
skipinitialspace and comparing the two readings, instead of testing
whether every field following a delimiter starts with a space.

28 hours agogh-154431: Revert "gh-154431: Fix data race in `sys.audithook` (#154462)" (GH-154769)
Petr Viktorin [Mon, 27 Jul 2026 14:00:20 +0000 (16:00 +0200)] 
gh-154431: Revert "gh-154431: Fix data race in `sys.audithook` (#154462)" (GH-154769)

This commit caused a refleak.

This reverts commit 596cd5c5d7b6ada3e50c6499447eb90a065769ad.

29 hours agogh-122931: Allow stable abi3 API extensions to include a multiarch tuple in the filen...
Stefano Rivera [Mon, 27 Jul 2026 13:05:40 +0000 (06:05 -0700)] 
gh-122931: Allow stable abi3 API extensions to include a multiarch tuple in the filename (GH-152461)

This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.

It is listed before the current platform-less suffixes since it's more
specific.

The platform is stored in a new pyconfig.h define & sysconfig
variable, SOABI_PLATFORM.
On some known architectures (FreeBSD, Windows), this
will be undefined/zero; these won't have the new tag (yet).

Add SOABI_PLATFORM & ALT_SOABI the info to
`make pythoninfo` as well.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
31 hours agoUpdate mypy to 2.3 (#154764)
sobolevn [Mon, 27 Jul 2026 11:31:02 +0000 (14:31 +0300)] 
Update mypy to 2.3 (#154764)

31 hours agogh-154070: Build the curses module wide by capability, not by name (GH-154071)
Serhiy Storchaka [Mon, 27 Jul 2026 11:04:51 +0000 (14:04 +0300)] 
gh-154070: Build the curses module wide by capability, not by name (GH-154071)

configure built the module wide (HAVE_NCURSESW) only for a backend named
ncursesw.  Probe for the wide API in the ncurses and auto backends too, so
a widec-built ncurses keeping the plain name (pkgsrc, macOS) is built wide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 hours agogh-145177: Upgrade to Emscripten 6.0.4 (#154743)
Hood Chatham [Sun, 26 Jul 2026 22:37:20 +0000 (00:37 +0200)] 
gh-145177: Upgrade to Emscripten 6.0.4 (#154743)

Bumps Emscripten version for builds to 6.0.4.

2 days agogh-93251: Decode localized socket error messages from the locale encoding (GH-154683)
Serhiy Storchaka [Sun, 26 Jul 2026 09:31:26 +0000 (12:31 +0300)] 
gh-93251: Decode localized socket error messages from the locale encoding (GH-154683)

The gai_strerror() and hstrerror() messages were decoded as UTF-8, so
gaierror and herror could be replaced with UnicodeDecodeError if the
message is localized and the locale encoding is not UTF-8.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2 days agogh-148736: Use ag_frame when walking async generators in asyncio.graph (#148737)
Raj Kripal Danday [Sun, 26 Jul 2026 09:08:51 +0000 (02:08 -0700)] 
gh-148736: Use ag_frame when walking async generators in asyncio.graph (#148737)

2 days agogh-153862: Fix spurious color pair in curses window.inch() on a wide build (GH-154703)
Serhiy Storchaka [Sun, 26 Jul 2026 08:02:50 +0000 (11:02 +0300)] 
gh-153862: Fix spurious color pair in curses window.inch() on a wide build (GH-154703)

winch() returns the whole code point, so inch() replacing only its low
8 bits left the high bits in the color field.  Rebuild from
getcchar()'s attributes and color pair.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 days agogh-154695: fix asyncio.Task eager_start=True with no explicit loop (#154697)
Timofei [Sun, 26 Jul 2026 04:56:24 +0000 (07:56 +0300)] 
gh-154695: fix asyncio.Task eager_start=True with no explicit loop (#154697)

3 days agoFix a stale link to the `math.integer.isqrt()` correctness proof (#154685)
Mark Dickinson [Sat, 25 Jul 2026 14:42:44 +0000 (15:42 +0100)] 
Fix a stale link to the `math.integer.isqrt()` correctness proof (#154685)

3 days agoAdd the free-threaded Windows build output dirs to `.gitignore` (#154641)
Jason G [Sat, 25 Jul 2026 14:28:10 +0000 (21:28 +0700)] 
Add the free-threaded Windows build output dirs to `.gitignore` (#154641)

3 days agogh-154199: Soft-deprecate `ctypes.util.find_msvcrt` (GH-154553)
Peter Bierma [Sat, 25 Jul 2026 14:08:55 +0000 (10:08 -0400)] 
gh-154199: Soft-deprecate `ctypes.util.find_msvcrt` (GH-154553)

3 days agogh-150621: avoid quadratic bytes slicing in `asyncio.protocols._feed_data_to_buffered...
Timofei [Sat, 25 Jul 2026 13:14:49 +0000 (16:14 +0300)] 
gh-150621: avoid quadratic bytes slicing in `asyncio.protocols._feed_data_to_buffered_proto` (#150622)

3 days agogh-154493: Add the UCD license to `Doc/license.rst` (#154651)
Stan Ulbrych [Sat, 25 Jul 2026 13:13:58 +0000 (15:13 +0200)] 
gh-154493: Add the UCD license to `Doc/license.rst` (#154651)

3 days agogh-153296: Fix thread-safety data race in io.StringIO iterator (#153368)
Rishit Agnihotri [Sat, 25 Jul 2026 08:35:25 +0000 (01:35 -0700)] 
gh-153296: Fix thread-safety data race in io.StringIO iterator (#153368)

3 days agogh-154043: Fix a data race when iterating a shared `types.GenericAlias` iterator...
Ivy Xu [Sat, 25 Jul 2026 08:29:59 +0000 (16:29 +0800)] 
gh-154043: Fix a data race when iterating a shared `types.GenericAlias` iterator in FT build (#154108)

3 days agogh-120866: Document behavior change of asyncio.Server.wait_closed() since 3.12 (...
Kumar Aditya [Sat, 25 Jul 2026 06:40:22 +0000 (12:10 +0530)] 
gh-120866: Document behavior change of asyncio.Server.wait_closed() since 3.12 (#154676)

3 days agogh-153290: Fix data race in BytesIO.__setstate__ installing __dict__ (#153376)
Bhuvi [Sat, 25 Jul 2026 05:56:33 +0000 (11:26 +0530)] 
gh-153290: Fix data race in BytesIO.__setstate__ installing __dict__ (#153376)

3 days agoGH-153809: Untrack TaskObj from GC before calling unregister_task (#154563)
Sergey Miryanov [Sat, 25 Jul 2026 03:31:06 +0000 (08:31 +0500)] 
GH-153809: Untrack TaskObj from GC before calling unregister_task (#154563)

3 days agogh-118150: warn in doc about results asymmetry for difflib junk (GH-153892)
Lenormand Julien [Fri, 24 Jul 2026 23:40:32 +0000 (01:40 +0200)] 
gh-118150: warn in doc about results asymmetry for difflib junk (GH-153892)

3 days agogh-134745: Remove dead code in `thread_nt.h` left by gh-134747 (#154338)
Ivy Xu [Fri, 24 Jul 2026 22:33:29 +0000 (06:33 +0800)] 
gh-134745: Remove dead code in `thread_nt.h` left by gh-134747 (#154338)

3 days agogh-154189: Fix use-after-free in `functools.partial_vectorcall` (GH-154508)
Brij Kapadia [Fri, 24 Jul 2026 21:32:07 +0000 (17:32 -0400)] 
gh-154189: Fix use-after-free in `functools.partial_vectorcall` (GH-154508)

3 days agoGH-154638: Use lazy imports in argparse (#154639)
Savannah Ostrowski [Fri, 24 Jul 2026 20:33:26 +0000 (13:33 -0700)] 
GH-154638: Use lazy imports in argparse (#154639)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 days agoGH-142035: Fix wrapping of colorized argparse help text (#154634)
Savannah Ostrowski [Fri, 24 Jul 2026 19:50:09 +0000 (12:50 -0700)] 
GH-142035: Fix wrapping of colorized argparse help text (#154634)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 days agogh-70990: Support bytes addresses of Unix sockets in SysLogHandler (GH-154500)
Serhiy Storchaka [Fri, 24 Jul 2026 16:54:01 +0000 (19:54 +0300)] 
gh-70990: Support bytes addresses of Unix sockets in SysLogHandler (GH-154500)

Only a str address was recognized as a Unix domain socket.  A bytes
address, which socket.bind() accepts, fell through to the (host, port)
branch and raised ValueError.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 days agogh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF-8 locales...
Serhiy Storchaka [Fri, 24 Jul 2026 16:11:15 +0000 (19:11 +0300)] 
gh-154580: Fix python-gdb.py pretty-printing non-ASCII strings in non-UTF-8 locales (GH-154581)

The gdb pretty-printer used locale.getpreferredencoding() to decide whether to
escape a character, but gdb writes its output in its host charset.  Use
gdb.host_charset() instead.  test_strings had the same problem.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 days agogh-153419: Fix several issues around bytearray __init__ (#153498)
Steve Stagg [Fri, 24 Jul 2026 15:25:11 +0000 (16:25 +0100)] 
gh-153419: Fix several issues around bytearray __init__ (#153498)

Introduce a bytearray_new() function to ensure that
ob_bytes_object is always set on a bytearray.

Resizing a bytearray to 0 length now explicitly sets
the ob_bytes_object to the empty constant immortal.

Add a check in the 'bytearray init from string'
fast path to ensure there are no active exports.

This fixes asserts/crashes on the following:
 - bytearray(1).__init__()
 - bytearray().__new__(bytearray).append(1)
 - a = bytearray(); b = memoryview(a); a.__init__('x', 'ascii')

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
4 days agogh-76595: Add tests for PyCapsule_Import() (GH-154588)
Serhiy Storchaka [Fri, 24 Jul 2026 15:01:56 +0000 (18:01 +0300)] 
gh-76595: Add tests for PyCapsule_Import() (GH-154588)

Add _testcapi helpers to create a capsule with an arbitrary name and to call PyCapsule_Import(), and Python tests covering the current behavior: only the first component of the dotted name is imported, the rest are attribute lookups.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days agogh-73458: Fix logging.config.listen() on a host without an IPv4 address (GH-154491)
Serhiy Storchaka [Fri, 24 Jul 2026 15:00:40 +0000 (18:00 +0300)] 
gh-73458: Fix logging.config.listen() on a host without an IPv4 address (GH-154491)

The server is created in a thread which set the "ready" event only after a
successful start, so a failure to start left the caller waiting for that
event forever.  Set it also on failure.

The receiver always used AF_INET, which fails if the host has no IPv4
address, for example if "localhost" is only aliased to ::1.  Use the family
of the first resolved address in such case.

Also fixes gh-82076.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 days agogh-145107: simplify asyncio staggered race using eager_start=False (#145108)
Thomas Grainger [Fri, 24 Jul 2026 14:40:25 +0000 (15:40 +0100)] 
gh-145107: simplify asyncio staggered race using eager_start=False (#145108)

4 days agogh-140326: disable the relative import in asyncio REPL (#140327)
Locked-chess-official [Fri, 24 Jul 2026 14:39:57 +0000 (22:39 +0800)] 
gh-140326: disable the relative import in asyncio REPL (#140327)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
4 days agogh-150361: add test for FlowControlMixin pause_writing exception handling (#150362)
Mohammad Reza [Fri, 24 Jul 2026 14:04:04 +0000 (17:34 +0330)] 
gh-150361: add test for FlowControlMixin pause_writing exception handling (#150362)

4 days agogh-145030: Fix asyncio write pipe transport for named FIFOs on macOS (#154222)
Bhuvi [Fri, 24 Jul 2026 13:53:51 +0000 (19:23 +0530)] 
gh-145030: Fix asyncio write pipe transport for named FIFOs on macOS (#154222)

4 days agogh-91484: Allow memoryview cast for F-contiguous (GH-137803)
Jaemin Park [Fri, 24 Jul 2026 13:17:06 +0000 (22:17 +0900)] 
gh-91484: Allow memoryview cast for F-contiguous (GH-137803)

4 days agogh-154582: Fix test_invalid_utf8_arg in non-UTF-8 multibyte locales (GH-154584)
Serhiy Storchaka [Fri, 24 Jul 2026 12:22:45 +0000 (15:22 +0300)] 
gh-154582: Fix test_invalid_utf8_arg in non-UTF-8 multibyte locales (GH-154584)

Arbitrary bytes round-trip through surrogateescape only in UTF-8 and
single-byte encodings, not in a stateful multibyte encoding such as EUC-JP.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 days agogh-146011: Fix use-after-free in `signaldict_repr` after deletion (#153784)
Brij Kapadia [Fri, 24 Jul 2026 12:21:43 +0000 (08:21 -0400)] 
gh-146011: Fix use-after-free in `signaldict_repr` after deletion (#153784)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
4 days agogh-154592: Fix test_peg_generator in non-UTF-8 locales with a non-ASCII work dir...
Serhiy Storchaka [Fri, 24 Jul 2026 12:20:21 +0000 (15:20 +0300)] 
gh-154592: Fix test_peg_generator in non-UTF-8 locales with a non-ASCII work dir (GH-154593)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 days agogh-153785: Generate `AttributeError` messages from context (#153786)
Bartosz Sławecki [Fri, 24 Jul 2026 12:14:47 +0000 (14:14 +0200)] 
gh-153785: Generate `AttributeError` messages from context (#153786)

Co-authored-by: Victor Stinner <vstinner@python.org>
4 days agogh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549)
stevens [Fri, 24 Jul 2026 11:42:29 +0000 (19:42 +0800)] 
gh-150546: Fix cleanup for replacement_locations in _PyCode_New() (#150549)

4 days agogh-153570: Fix use-after-free in bytearray.take_bytes() with a reentrant __index__...
tonghuaroot (童话) [Fri, 24 Jul 2026 10:15:01 +0000 (18:15 +0800)] 
gh-153570: Fix use-after-free in bytearray.take_bytes() with a reentrant __index__ (#153572)

bytearray.take_bytes() cached the size before the argument's __index__ call and
used it for the bounds check and the buffer reads, so an __index__ that resizes
the bytearray left it reading freed memory. Re-read the size after __index__,
matching bytearray.__setitem__ (GH-91153).

4 days agogh-152433: Windows: modernize and refactor stat emulation APIs (GH-153700)
thexai [Fri, 24 Jul 2026 09:56:48 +0000 (11:56 +0200)] 
gh-152433: Windows: modernize and refactor stat emulation APIs (GH-153700)

This allows build on more API sets (e.g. UWP) without excluding any currently supported desktop OS.

4 days agogh-152263: Fix test_set_wide for locales with wide characters (GH-154583)
Serhiy Storchaka [Fri, 24 Jul 2026 07:58:42 +0000 (10:58 +0300)] 
gh-152263: Fix test_set_wide for locales with wide characters (GH-154583)

The soft label can be truncated to fit the soft label width, e.g. in the
EUC-JP locale, where "Å" and "ö" are double-width JIS X 0212 characters.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 days agogh-153176: Fix destroy_interpreter() test helper clearing a non-current thread state...
Jiucheng(Oliver) [Fri, 24 Jul 2026 04:41:08 +0000 (00:41 -0400)] 
gh-153176: Fix destroy_interpreter() test helper clearing a non-current thread state (#153307)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Xiaowei Lu <weixlu420302@gmail.com>
5 days agogh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales (GH-154552)
Serhiy Storchaka [Thu, 23 Jul 2026 17:28:39 +0000 (20:28 +0300)] 
gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales (GH-154552)

_findLib_ld() failed to decode the localized "ld" stderr in the locale
encoding.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agogh-153903: Copy docstrings and other metadata in `ctypes.util.wrap_dll_function`...
Brian Ward [Thu, 23 Jul 2026 16:57:55 +0000 (12:57 -0400)] 
gh-153903: Copy docstrings and other metadata in `ctypes.util.wrap_dll_function` (GH-154495)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
5 days agogh-69573: Check the return value of msvcrt._putch() and _putwch() (GH-154364)
Jason G [Thu, 23 Jul 2026 15:52:42 +0000 (22:52 +0700)] 
gh-69573: Check the return value of msvcrt._putch() and _putwch() (GH-154364)

5 days agogh-154525: Skip ncurses find_pair()/alloc_pair() reuse checks before 6.3 (GH-154543)
Serhiy Storchaka [Thu, 23 Jul 2026 15:37:43 +0000 (18:37 +0300)] 
gh-154525: Skip ncurses find_pair()/alloc_pair() reuse checks before 6.3 (GH-154543)

find_pair() and reuse in alloc_pair() were fixed in ncurses 6.3 (patch
20200411).  On earlier versions find_pair() returns -1 and alloc_pair()
allocates a fresh pair instead of reusing an equal one, so
test_dynamic_color_pairs failed on ncurses 6.1 and 6.2.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days agogh-154525: Fix curses getcchar() failure on ncurses older than 6.3 (GH-154526)
Serhiy Storchaka [Thu, 23 Jul 2026 14:48:17 +0000 (17:48 +0300)] 
gh-154525: Fix curses getcchar() failure on ncurses older than 6.3 (GH-154526)

getcchar() rejected a non-NULL opts argument before ncurses 6.3, so read
the color pair through the short slot instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days agogh-139445: Skip pyrepl tests if the terminal is not supported (GH-154497)
Serhiy Storchaka [Thu, 23 Jul 2026 07:44:26 +0000 (10:44 +0300)] 
gh-139445: Skip pyrepl tests if the terminal is not supported (GH-154497)

They were only skipped if TERM was unset or "dumb", but pyrepl also
needs the terminal to have several capabilities.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agogh-154502: Disable junk filling in the OpenBSD allocator in test_capi (GH-154503)
Serhiy Storchaka [Wed, 22 Jul 2026 22:58:39 +0000 (01:58 +0300)] 
gh-154502: Disable junk filling in the OpenBSD allocator in test_capi (GH-154503)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
5 days agogh-154401: Skip fetching the thread state for non-GC types in `_Py_Dealloc` (GH-154430)
John [Wed, 22 Jul 2026 22:43:18 +0000 (23:43 +0100)] 
gh-154401: Skip fetching the thread state for non-GC types in `_Py_Dealloc` (GH-154430)

_Py_Dealloc() fetched the current thread state and computed the C
recursion margin on every deallocation, but both are only used by the
trashcan mechanism, which applies only to GC-tracked types. Gate them
behind the Py_TPFLAGS_HAVE_GC check so the common non-GC case (int,
float, str and similar atomic types) skips them.

On platforms where _PyThreadState_GET() reads a _Thread_local via a
function call (e.g. macOS TLV), this removes a call from every non-GC
deallocation.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-154272: Skip more forkserver tests if the start method is unavailable (GH-154499)
Serhiy Storchaka [Wed, 22 Jul 2026 18:25:37 +0000 (21:25 +0300)] 
gh-154272: Skip more forkserver tests if the start method is unavailable (GH-154499)

Two tests were still not skipped: they were only guarded against Cygwin
and Windows.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agoRemove `from stat import *` recommendation from `stat.py` docstring (#154486)
anthony sottile [Wed, 22 Jul 2026 13:41:05 +0000 (09:41 -0400)] 
Remove `from stat import *` recommendation from `stat.py` docstring (#154486)

6 days agogh-150076: Fix the documented signature of warnings.deprecated (#153879)
Vyron Vasileiadis [Wed, 22 Jul 2026 13:08:34 +0000 (15:08 +0200)] 
gh-150076: Fix the documented signature of warnings.deprecated (#153879)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
6 days agogh-80678: Document the preferred delimiters of csv.Sniffer (#154336)
Serhiy Storchaka [Wed, 22 Jul 2026 12:20:08 +0000 (15:20 +0300)] 
gh-80678: Document the preferred delimiters of csv.Sniffer (#154336)

The delimiters which win when several combinations fit the sample
equally well were not documented.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-153872: macOS: free-threading support is installed by default on Python 3.15 ...
Hugo van Kemenade [Wed, 22 Jul 2026 12:09:55 +0000 (15:09 +0300)] 
gh-153872: macOS: free-threading support is installed by default on Python 3.15 (#154103)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
6 days agogh-154431: Fix data race in `sys.audithook` (#154462)
sobolevn [Wed, 22 Jul 2026 12:09:20 +0000 (15:09 +0300)] 
gh-154431: Fix data race in `sys.audithook` (#154462)

6 days agogh-154460: Do not use wcsftime() on OpenBSD (#154461)
Serhiy Storchaka [Wed, 22 Jul 2026 12:07:08 +0000 (15:07 +0300)] 
gh-154460: Do not use wcsftime() on OpenBSD (#154461)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
6 days agogh-154465: Add configure flag to exclude emscripten_syscalls.c (#154466)
Hood Chatham [Wed, 22 Jul 2026 12:06:00 +0000 (14:06 +0200)] 
gh-154465: Add configure flag to exclude emscripten_syscalls.c (#154466)

Pyodide doesn't want to include emscripten_syscalls.c in the build since it
links a different version of it. This adds a configure flag to drop it.

6 days agogh-154272: Skip forkserver tests when the start method is unavailable (GH-154274)
Serhiy Storchaka [Wed, 22 Jul 2026 11:15:41 +0000 (14:15 +0300)] 
gh-154272: Skip forkserver tests when the start method is unavailable (GH-154274)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-84649: Fix unstable test_rollover_at_midnight (GH-154463)
Serhiy Storchaka [Wed, 22 Jul 2026 10:35:42 +0000 (13:35 +0300)] 
gh-84649: Fix unstable test_rollover_at_midnight (GH-154463)

Create the log file in a fresh directory under a name which has never
been used.  On Windows, NTFS file tunneling restored the original
creation time of a file recreated with the same name, which made the
rollover time earlier than the current time and caused an unwanted
rollover.

Also check that the rollover does not happen before the specified time.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 days agogh-154014: Initialize cold executor vm_data fields (GH-154142)
Bhuvansh [Wed, 22 Jul 2026 09:17:47 +0000 (14:47 +0530)] 
gh-154014: Initialize cold executor vm_data fields (GH-154142)

6 days agogh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438)
Serhiy Storchaka [Wed, 22 Jul 2026 09:05:06 +0000 (12:05 +0300)] 
gh-154437: Fix test_getcwd_long_path on DragonFly BSD (GH-154438)

DragonFly BSD raises EFAULT instead of ENAMETOOLONG when the path
exceeds PATH_MAX.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154435: Fix os.posix_fadvise() and os.posix_fallocate() on DragonFly BSD (GH-154436)
Serhiy Storchaka [Wed, 22 Jul 2026 08:39:11 +0000 (11:39 +0300)] 
gh-154435: Fix os.posix_fadvise() and os.posix_fallocate() on DragonFly BSD (GH-154436)

They return -1 and set errno instead of returning the error number, so
OSError was raised with a meaningless error code.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154443: Fix test_makedev on DragonFly BSD (GH-154444)
Serhiy Storchaka [Wed, 22 Jul 2026 08:36:49 +0000 (11:36 +0300)] 
gh-154443: Fix test_makedev on DragonFly BSD (GH-154444)

major() and minor() do not preserve NODEV on DragonFly BSD.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154441: Skip the scheduler tests if the API requires privileges (GH-154442)
Serhiy Storchaka [Wed, 22 Jul 2026 08:15:22 +0000 (11:15 +0300)] 
gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442)

DragonFly BSD requires privileges to use the scheduler API, even for
the calling process.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154007: Improve test coverage for the `shlex` module (#154009)
Piotr Kaznowski [Wed, 22 Jul 2026 08:08:03 +0000 (10:08 +0200)] 
gh-154007: Improve test coverage for the `shlex` module (#154009)

6 days agogh-154427: Check the access time in UtimeTests only if it is stored (GH-154428)
Serhiy Storchaka [Wed, 22 Jul 2026 07:00:11 +0000 (10:00 +0300)] 
gh-154427: Check the access time in UtimeTests only if it is stored (GH-154428)

HAMMER2 on DragonFly BSD does not store the access time and os.stat()
returns the modification time instead.  Probe the file system, like it
is already done for the timestamp resolution.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154419: Find the fish shell in test_venv (GH-154420)
Serhiy Storchaka [Wed, 22 Jul 2026 05:53:27 +0000 (08:53 +0300)] 
gh-154419: Find the fish shell in test_venv (GH-154420)

shutil.which('fish') can find the unrelated "Go Fish" game, which is
shipped on several BSD systems.  Search PATH for an executable which
behaves like the fish shell instead.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154416: Fix hanging test_tcflow on DragonFly BSD (GH-154417)
Serhiy Storchaka [Wed, 22 Jul 2026 05:07:53 +0000 (08:07 +0300)] 
gh-154416: Fix hanging test_tcflow on DragonFly BSD (GH-154417)

TCIOFF and TCION transmit STOP and START characters, and closing the
pseudo-terminal waits until they are read.  Discard them.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154414: Skip test_tcsendbreak on DragonFly BSD (GH-154415)
Serhiy Storchaka [Wed, 22 Jul 2026 05:01:25 +0000 (08:01 +0300)] 
gh-154414: Skip test_tcsendbreak on DragonFly BSD (GH-154415)

tcsendbreak() is not supported for pseudo-terminals on DragonFly BSD.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-153291: Fix data race in readline.get_completer() and get_pre_input_hook() (gh...
Harjoth Khara [Wed, 22 Jul 2026 04:42:14 +0000 (21:42 -0700)] 
gh-153291: Fix data race in readline.get_completer() and get_pre_input_hook() (gh-153362)

The setters store these hooks while holding the module critical section
(via set_hook's Py_XSETREF), but the getters read and Py_NewRef the same
fields without it. Annotate both getters with @critical_section, matching
the other readline functions (gh-126895).

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
6 days agogh-154395: Skip test_environment_is_not_modified without rl_change_environment (GH...
Serhiy Storchaka [Wed, 22 Jul 2026 04:25:24 +0000 (07:25 +0300)] 
gh-154395: Skip test_environment_is_not_modified without rl_change_environment (GH-154396)

readline sets LINES and COLUMNS if rl_change_environment is not
available, which is the case with readline older than 6.3.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154394: Skip test_tcsendbreak on OpenBSD (GH-154397)
Serhiy Storchaka [Wed, 22 Jul 2026 04:09:38 +0000 (07:09 +0300)] 
gh-154394: Skip test_tcsendbreak on OpenBSD (GH-154397)

tcsendbreak() is not supported for pseudo-terminals on OpenBSD.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-154399: Fix venv activate.csh in a non-interactive shell (GH-154400)
Serhiy Storchaka [Wed, 22 Jul 2026 04:05:10 +0000 (07:05 +0300)] 
gh-154399: Fix venv activate.csh in a non-interactive shell (GH-154400)

activate.csh saved the prompt unconditionally, but the prompt variable
only exists in interactive shells, and csh fails on an undefined
variable.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
6 days agogh-152902: Add Intel `icx` compiler to `configure.ac` (GH-152825)
hpkfft.com [Wed, 22 Jul 2026 01:25:47 +0000 (18:25 -0700)] 
gh-152902: Add Intel `icx` compiler to `configure.ac` (GH-152825)

6 days agogh-153741: Harden IDLE GUI tests for newer Tk and display scaling (#153742)
Serhiy Storchaka [Wed, 22 Jul 2026 01:16:50 +0000 (04:16 +0300)] 
gh-153741: Harden IDLE GUI tests for newer Tk and display scaling (#153742)

In test_sidebar.test_mousewheel, only use the X11 <Button-4>/<Button-5> events when testing on
x11 Tk before 8.7.  Otherwise, use <Mousewheel> as on other systems.

In test_configdialog, assert the 'disabled' state flag alone instead of
the exact ttk state tuple (which transient pointer states break), and
restore the tests' method masks with addCleanup().

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7 days agogh-103847: fix some asyncio subprocess cancellation bugs (#146571)
Kumar Aditya [Tue, 21 Jul 2026 18:15:59 +0000 (23:45 +0530)] 
gh-103847: fix some asyncio subprocess cancellation bugs (#146571)

7 days agogh-154389: Do not use uuid_create() on OpenBSD (GH-154390)
Serhiy Storchaka [Tue, 21 Jul 2026 18:05:41 +0000 (21:05 +0300)] 
gh-154389: Do not use uuid_create() on OpenBSD (GH-154390)

Like NetBSD, OpenBSD generates version 4 UUIDs in uuid_create(), so it
cannot be used for uuid.uuid1().

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agogh-154379: Fix test_epoll on Solaris (GH-154380)
Serhiy Storchaka [Tue, 21 Jul 2026 16:02:51 +0000 (19:02 +0300)] 
gh-154379: Fix test_epoll on Solaris (GH-154380)

A non-blocking connect() can be completed immediately, and unregistering
a closed file descriptor succeeds on Solaris.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
7 days agoTest `object_hook` and pickleability of some JSON components (GH-154155)
David [Tue, 21 Jul 2026 15:08:01 +0000 (17:08 +0200)] 
Test `object_hook` and pickleability of some JSON components (GH-154155)