]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
8 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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

9 days agogh-150633: Minor improvement of a newly added test (#151103)
Barry Warsaw [Mon, 8 Jun 2026 19:21:00 +0000 (12:21 -0700)] 
gh-150633: Minor improvement of a newly added test (#151103)

Minor improvement of a newly added test.

9 days agogh-150633: Properly handle null characters in the name when importing frozen modules...
Thomas Kowalski [Mon, 8 Jun 2026 18:31:54 +0000 (20:31 +0200)] 
gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634)

9 days agogh-148932: Fix `profiling.sampling` on Windows virtual environments (#150541)
Eduardo Villalpando Mello [Mon, 8 Jun 2026 17:25:43 +0000 (10:25 -0700)] 
gh-148932: Fix `profiling.sampling` on Windows virtual environments (#150541)

9 days agogh-151019: Fix test_os on 32-bit FreeBSD (#151087)
Victor Stinner [Mon, 8 Jun 2026 16:57:07 +0000 (18:57 +0200)] 
gh-151019: Fix test_os on 32-bit FreeBSD (#151087)

Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit 3ae975f1ac880c47d51cca6c9e305547bd365be7.

9 days agoFix a typo in the `SECURITY.md` (#151086)
Stan Ulbrych [Mon, 8 Jun 2026 15:09:20 +0000 (16:09 +0100)] 
Fix a typo in the `SECURITY.md` (#151086)

9 days agogh-106318: Add examples to the `str.isdigit()` method docs (#144721)
Adorilson Bezerra [Mon, 8 Jun 2026 12:51:35 +0000 (13:51 +0100)] 
gh-106318: Add examples to the `str.isdigit()` method docs  (#144721)

Co-authored-by: Stan Ulbrych <stan@python.org>
9 days agogh-141623: operator.rst: don't use term "bitwise" (GH-141846)
Doron Behar [Mon, 8 Jun 2026 12:12:48 +0000 (15:12 +0300)] 
gh-141623: operator.rst: don't use term "bitwise" (GH-141846)

9 days agoMention `frozendict` in `object.__hash__()` documentation (#148867)
Jonathan Dung [Mon, 8 Jun 2026 11:39:41 +0000 (19:39 +0800)] 
Mention `frozendict` in `object.__hash__()` documentation (#148867)

9 days agogh-151059: [perf] Use `PyObject_CallMethodOneArg` in datetime's `call_tzinfo_method...
Pieter Eendebak [Mon, 8 Jun 2026 11:11:36 +0000 (13:11 +0200)] 
gh-151059: [perf] Use `PyObject_CallMethodOneArg` in datetime's `call_tzinfo_method` (#151062)

9 days agogh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (#151058)
Christian Zinck [Mon, 8 Jun 2026 10:24:26 +0000 (06:24 -0400)] 
gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (#151058)

9 days agoDocs: Fix missing colon in `bisect` example function (GH-151061)
Sergio López Gómez [Mon, 8 Jun 2026 09:39:03 +0000 (11:39 +0200)] 
Docs: Fix missing colon in `bisect` example function (GH-151061)

10 days agogh-69619: Clarify "whitespace" in the `str.{l,r}strip()` documentation (#150901)
きょうすけ [Sun, 7 Jun 2026 18:25:50 +0000 (03:25 +0900)] 
gh-69619: Clarify "whitespace" in the `str.{l,r}strip()` documentation (#150901)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 days agoUpdate an error message in the 'Functional Programming HOWTO' (#151047)
saber-bit [Sun, 7 Jun 2026 16:47:50 +0000 (12:47 -0400)] 
Update an error message in the 'Functional Programming HOWTO' (#151047)

10 days agogh-150599: Prevent bz2 decompressor reuse after errors (#150600)
Stan Ulbrych [Sun, 7 Jun 2026 15:19:05 +0000 (16:19 +0100)] 
gh-150599: Prevent bz2 decompressor reuse after errors (#150600)

10 days agogh-150885: Remove unused shutil._ensure_directory (GH-150883)
Bernát Gábor [Sun, 7 Jun 2026 14:40:55 +0000 (07:40 -0700)] 
gh-150885: Remove unused shutil._ensure_directory (GH-150883)

No longer used after gh-146581 (GH-146591).

10 days agogh-151021: Fix mmap empty searches past the end (GH-151023)
esadomer [Sun, 7 Jun 2026 13:01:24 +0000 (16:01 +0300)] 
gh-151021: Fix mmap empty searches past the end (GH-151023)

10 days agogh-150942: Speed up re.findall and re.sub/subn result building (gh-150943)
Pieter Eendebak [Sun, 7 Jun 2026 12:06:36 +0000 (14:06 +0200)] 
gh-150942: Speed up re.findall and re.sub/subn result building (gh-150943)

10 days agogh-150942: Speed up frame local item collection (gh-151002)
Omkar Kabde [Sun, 7 Jun 2026 12:05:53 +0000 (17:35 +0530)] 
gh-150942: Speed up frame local item collection (gh-151002)

11 days agogh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH...
Sanyam Kumat [Sat, 6 Jun 2026 21:38:15 +0000 (03:08 +0530)] 
gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968)

11 days agogh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578)
Zackery Spytz [Sat, 6 Jun 2026 17:14:45 +0000 (10:14 -0700)] 
gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578)

Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 days agogh-150411: fix `gc_generation.count` race in free-threading (#150413)
Edward Xu [Sat, 6 Jun 2026 17:03:04 +0000 (01:03 +0800)] 
gh-150411: fix `gc_generation.count` race in free-threading (#150413)

11 days agogh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612)
Jelle Zijlstra [Sat, 6 Jun 2026 12:47:33 +0000 (05:47 -0700)] 
gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612)

This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.

11 days agoDelete mention encoding and errors for importlib.resources.path() (GH-143111)
Alexander Shadchin [Sat, 6 Jun 2026 11:52:01 +0000 (14:52 +0300)] 
Delete mention encoding and errors for importlib.resources.path() (GH-143111)

11 days agoDoc: fix order of PyLong_FromUnsignedLongLong (#150937)
Inada Naoki [Sat, 6 Jun 2026 11:37:49 +0000 (20:37 +0900)] 
Doc: fix order of PyLong_FromUnsignedLongLong (#150937)

11 days agogh-150534: Add C23 half-turn trigonometric *pi functions (GH-150555)
Jeff Epler [Sat, 6 Jun 2026 10:19:45 +0000 (03:19 -0700)] 
gh-150534: Add C23 half-turn trigonometric *pi functions (GH-150555)

Add the the following functions to the math module:
acospi, asinpi, atanpi, atan2pi, cospi, sinpi, tanpi.

11 days agogh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986)
Thomas Kowalski [Sat, 6 Jun 2026 10:04:23 +0000 (12:04 +0200)] 
gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986)

11 days agogh-84649: Use statx() in TimedRotatingFileHandler if available (ПР-150968)
Serhiy Storchaka [Sat, 6 Jun 2026 08:49:07 +0000 (11:49 +0300)] 
gh-84649: Use statx() in TimedRotatingFileHandler if available (ПР-150968)

This allows to support rotation based on the file birth time on Linux.

11 days agogh-150889: Improve performance of unicodedata.normalize() (GH-150890)
Pieter Eendebak [Sat, 6 Jun 2026 08:34:33 +0000 (10:34 +0200)] 
gh-150889:  Improve performance of unicodedata.normalize() (GH-150890)

Scan the nfc_first/nfc_last reindex tables comparing only .start, range-check
the candidate once, and terminate on a sentinel above every codepoint, so each
entry costs a single comparison. ~2x faster on non-Latin and combining-heavy
NFC/NFKC input; no new data tables.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 days agogh-148832: Use `-icf=0` in BOLT_APPLY_FLAGS (gh-148833)
Shamil [Sat, 6 Jun 2026 07:19:49 +0000 (10:19 +0300)] 
gh-148832: Use `-icf=0` in BOLT_APPLY_FLAGS (gh-148833)

12 days agogh-150662: Stop unbounded memory growth in Tachyon `--gecko` collector (#150845)
Maurycy Pawłowski-Wieroński [Sat, 6 Jun 2026 02:27:41 +0000 (04:27 +0200)] 
gh-150662: Stop unbounded memory growth in Tachyon `--gecko` collector (#150845)

12 days agogh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing...
Grant Herman [Sat, 6 Jun 2026 01:58:35 +0000 (21:58 -0400)] 
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (#150275)

12 days agoUse `time.monotonic` in OrderedDict LRU cache example (#150986)
Ilya Nikolaev [Fri, 5 Jun 2026 22:42:59 +0000 (01:42 +0300)] 
Use `time.monotonic` in OrderedDict LRU cache example (#150986)

12 days agogh-110631: Fix wrong blocks indentation in difflib.rst (GH-110885)
Ezio Melotti [Fri, 5 Jun 2026 17:02:10 +0000 (01:02 +0800)] 
gh-110631: Fix wrong blocks indentation in difflib.rst (GH-110885)

12 days agogh-150436: Check returncode in Win32ProcessTestCase (#150972)
Victor Stinner [Fri, 5 Jun 2026 15:24:46 +0000 (17:24 +0200)] 
gh-150436: Check returncode in Win32ProcessTestCase (#150972)

12 days agogh-149977: Fix extra output of `-m test test_lazy_import`, again (#150965)
sobolevn [Fri, 5 Jun 2026 15:21:10 +0000 (18:21 +0300)] 
gh-149977: Fix extra output of `-m test test_lazy_import`, again (#150965)

12 days agogh-150818: Wire logger parent before publishing it in getLogger() (GH-150941)
Bernát Gábor [Fri, 5 Jun 2026 15:00:56 +0000 (08:00 -0700)] 
gh-150818: Wire logger parent before publishing it in getLogger() (GH-150941)

12 days agogh-146527: Fix memory leak in _PyGC_Fini() (#150969)
Victor Stinner [Fri, 5 Jun 2026 13:43:05 +0000 (15:43 +0200)] 
gh-146527: Fix memory leak in _PyGC_Fini() (#150969)

Free generation_stats allocated by _PyGC_Init().

Fix Python/gc.c: Python/gc_free_threading.c was already fixed.

12 days agogh-53144: Improve charset support in the email package (GH-149942)
Serhiy Storchaka [Fri, 5 Jun 2026 12:53:59 +0000 (15:53 +0300)] 
gh-53144: Improve charset support in the email package (GH-149942)

Defer to the codecs module for all aliases.
Use MIME/IANA names for all IANA registered charsets.
Fix email.contentmanager.set_text_content().

12 days agogh-84649: Fix unstable test_rollover_based_on_st_birthtime_only (GH-150954)
Serhiy Storchaka [Fri, 5 Jun 2026 12:41:51 +0000 (15:41 +0300)] 
gh-84649: Fix unstable test_rollover_based_on_st_birthtime_only (GH-150954)

12 days agogh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (#150914)
Victor Stinner [Fri, 5 Jun 2026 12:11:46 +0000 (14:11 +0200)] 
gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (#150914)

Add extern "C++" scope for the C++ template.

Fix test_cppext when Python is built with --with-valgrind.

12 days agogh-149891: Add more encoding aliases (GH-149892)
Serhiy Storchaka [Fri, 5 Jun 2026 12:08:04 +0000 (15:08 +0300)] 
gh-149891: Add more encoding aliases (GH-149892)

Support all aliases officially registered in IANA, except
Extended_UNIX_Code_Packed_Format_for_Japanese.

New names:
KSC_5601, KS_C_5601-1989, iso-ir-149, GB_2312-80, windows-936, mac,
CCSID00858, CCSID01140, and a number of "cs"-prefixed names.

Fix csHPRoman8, which was not normalized.

12 days agogh-129011: Update docs for Raw I/O read, readinto, and write (#135328)
Cody Maloney [Fri, 5 Jun 2026 12:00:59 +0000 (05:00 -0700)] 
gh-129011: Update docs for Raw I/O read, readinto, and write (#135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
12 days agogh-150899: Do not reset custom `-Xlazy_imports` mode in `test_lazy_imports` (#150900)
sobolevn [Fri, 5 Jun 2026 08:03:57 +0000 (11:03 +0300)] 
gh-150899: Do not reset custom `-Xlazy_imports` mode in `test_lazy_imports` (#150900)

12 days agogh-62825: Fix encoding aliases "KS_C_5601-1987", "KS X 1001", etc (GH-150933)
Serhiy Storchaka [Fri, 5 Jun 2026 07:58:20 +0000 (10:58 +0300)] 
gh-62825: Fix encoding aliases "KS_C_5601-1987", "KS X 1001", etc (GH-150933)

They are now aliases of CP949 instead of EUC-KR.

13 days agogh-145177: Bump emscripten version to 4.0.19 (#150926)
Hood Chatham [Fri, 5 Jun 2026 05:59:43 +0000 (22:59 -0700)] 
gh-145177: Bump emscripten version to 4.0.19 (#150926)

Bumpts the emscripten version to 4.0.19.

13 days agoAdd shebang documentation for PyManager 26.3b1 (GH-150931)
Steve Dower [Thu, 4 Jun 2026 20:37:18 +0000 (21:37 +0100)] 
Add shebang documentation for PyManager 26.3b1 (GH-150931)

13 days agogh-150886: Remove unused importlib._bootstrap._object_name (#150884)
Bernát Gábor [Thu, 4 Jun 2026 20:08:58 +0000 (13:08 -0700)] 
gh-150886: Remove unused importlib._bootstrap._object_name (#150884)

Introduced in GH-23469 (bpo-26131, "Deprecate usage of load_module()")
to render an object's qualified name inside the load_module()
deprecation warnings.

Orphaned by gh-142205 (GH-97850, "Remove all uses and definitions of
load_module() from importlib"), which deleted the warning-building call
sites f"{_object_name(spec.loader)}.exec_module() not found; ..." and
left the helper with no caller.

A word-boundary search across Lib, Modules, Python, Objects and Include
finds zero references outside its own definition, and a GitHub code
search finds no downstream importers. The frozen importlib was
regenerated; importlib._bootstrap._object_name no longer exists at
runtime and the full test_importlib suite passes.

13 days agogh-150817: Speed up Flag bitwise operations (GH-150824)
Bernát Gábor [Thu, 4 Jun 2026 19:58:20 +0000 (12:58 -0700)] 
gh-150817: Speed up Flag bitwise operations (GH-150824)

Flag.__or__, __and__ and __xor__ walked both operands on every call to reject
None values. Run that scan only when one of the operand values is actually
None, so valid combinations skip it. The TypeError and its message are
unchanged for the invalid cases.

13 days agogh-150818: Speed up logging.getLogger() for existing loggers (GH-150825)
Bernát Gábor [Thu, 4 Jun 2026 16:15:12 +0000 (09:15 -0700)] 
gh-150818: Speed up logging.getLogger() for existing loggers (GH-150825)

13 days agoGH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916)
Mark Shannon [Thu, 4 Jun 2026 14:11:33 +0000 (15:11 +0100)] 
GH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916)

13 days agogh-84649: Make TimedRotatingFileHandler use CTIME instead of MTIME (GH-24660)
Ivan Marton [Thu, 4 Jun 2026 13:50:33 +0000 (15:50 +0200)] 
gh-84649: Make TimedRotatingFileHandler use CTIME instead of MTIME (GH-24660)

The TimedRotatingFileHandler previously only used st_mtime attribute of the
log file to detect whether it has to be rotate yet or not. In cases when the
file is changed within the rotatation period the st_mtime is also updated
to the current time and the rotation never happens.

It's more appropriate to check the file creation time (st_ctime) instead.
Whenever available, the more appropriate st_birthtime will be in use. (This
feature is available on FreeBSD, MacOS and Windows at the moment.) If
the st_mtime would be newer than st_ctime (e.g.: because the inode
related to the file has been changed without any file content
modification), then the earliest attribute will be used.

13 days agogh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915)
Jiseok CHOI [Thu, 4 Jun 2026 13:41:47 +0000 (22:41 +0900)] 
gh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915)

ass_subscript_slice() returned early when the computed slice length
was zero, bypassing validation performed for non-empty slices.

13 days agogh-150750: Fix a race condition in `deque.index` with free-threading (#150779)
sobolevn [Thu, 4 Jun 2026 13:31:31 +0000 (16:31 +0300)] 
gh-150750: Fix a race condition in `deque.index` with free-threading (#150779)

13 days agogh-106318: Add doctest role and a 'See also' to the `str.split()` docs (#144367)
Adorilson Bezerra [Thu, 4 Jun 2026 11:39:14 +0000 (12:39 +0100)] 
gh-106318: Add doctest role and a 'See also' to the `str.split()` docs (#144367)

13 days agobpo-38131: Improve messages when generating AST nodes from objects with wrong field...
Batuhan Taskaya [Thu, 4 Jun 2026 10:58:51 +0000 (13:58 +0300)] 
bpo-38131: Improve messages when generating AST nodes from objects with wrong field values (GH-17715)

13 days agoFix 2 broken links in documentation (#150892)
Miro Hrončok [Thu, 4 Jun 2026 09:42:06 +0000 (11:42 +0200)] 
Fix 2 broken links in documentation (#150892)

Co-authored-by: Stan Ulbrych <stan@python.org>
13 days agogh-119670: Add `force` keyword only argument to `shlex.quote` (#148846)
jb2170 [Thu, 4 Jun 2026 09:06:02 +0000 (10:06 +0100)] 
gh-119670: Add `force` keyword only argument to `shlex.quote` (#148846)

There are propositions to add a single-quote-double-quote switch
(gh-90630), so to avoid hiccups of people passing `force` as a
positional and it being used for the single-double switch, we make
kwargs kwargs-only.

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
13 days agoManpage formatting tweaks & lint (GH-132338)
Stefano Rivera [Thu, 4 Jun 2026 07:35:04 +0000 (00:35 -0700)] 
Manpage formatting tweaks & lint (GH-132338)

Following on from GH-132291 this is the second part of the patch from https://bugs.debian.org/1101406

This tweaks the formatting of a few bits of the manpage.

2 weeks agogh-145177: Fix Emscripten help text (#150874)
Hood Chatham [Thu, 4 Jun 2026 00:00:51 +0000 (17:00 -0700)] 
gh-145177: Fix Emscripten help text (#150874)

Removes some stray commas in help text.

2 weeks agogh-150032: Tidy up 3.15 pending removals (#149594)
Stan Ulbrych [Wed, 3 Jun 2026 14:29:13 +0000 (15:29 +0100)] 
gh-150032: Tidy up 3.15 pending removals (#149594)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2 weeks agoDocs: Replace hardcoded `SOURCE_URI` with `patchlevel` check (#150850)
Hugo van Kemenade [Wed, 3 Jun 2026 13:37:09 +0000 (16:37 +0300)] 
Docs: Replace hardcoded `SOURCE_URI` with `patchlevel` check (#150850)

2 weeks agogh-132467: Document and test that generic aliases are not classes (#133504)
Abduaziz π [Wed, 3 Jun 2026 13:35:25 +0000 (18:35 +0500)] 
gh-132467: Document and test that generic aliases are not classes (#133504)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 weeks agoCorrect Stable ABI documentation for METH_FASTCALL (GH-149593)
da-woods [Wed, 3 Jun 2026 13:20:35 +0000 (14:20 +0100)] 
Correct Stable ABI documentation for METH_FASTCALL (GH-149593)

* Correct Stable ABI documentation for METH_FASTCALL

The current documentation says:

>
> METH_FASTCALL
>    Part of the Stable ABI since version 3.7.
>
> [...]
>
>   Added in version 3.7.
>
>    Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.

so is contradictory about when it was added to the Stable ABI.  Looking at the header it seems like 3.10 is right.

2 weeks agogh-105812: Make use of the Sphinx `deco` role in documentation (#139598)
Victorien [Wed, 3 Jun 2026 13:14:47 +0000 (15:14 +0200)] 
gh-105812: Make use of the Sphinx `deco` role in documentation (#139598)

2 weeks agogh-141004: Document unstable perf map functions in `ceval.h` (GH-143492)
Yashraj [Wed, 3 Jun 2026 12:36:25 +0000 (18:06 +0530)] 
gh-141004: Document unstable perf map functions in `ceval.h` (GH-143492)

2 weeks agoFix a typo in `SSLSocket` docs (GH-150839)
Robsdedude [Wed, 3 Jun 2026 12:18:06 +0000 (14:18 +0200)] 
Fix a typo in `SSLSocket` docs (GH-150839)

2 weeks agogh-146636: Add Free-threaded Stable ABI migration guide (GH-150580)
Petr Viktorin [Wed, 3 Jun 2026 12:02:36 +0000 (14:02 +0200)] 
gh-146636: Add Free-threaded Stable ABI migration guide (GH-150580)

Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks agogh-148613: Fix race in `gc_set_threshold` and `gc_get_threshold` (#150356)
Edward Xu [Wed, 3 Jun 2026 11:28:26 +0000 (19:28 +0800)] 
gh-148613: Fix race in `gc_set_threshold` and `gc_get_threshold` (#150356)

2 weeks agogh-150723: Fix perf jitdump files on macOS (#150728)
Nazım Can Altınova [Wed, 3 Jun 2026 00:15:34 +0000 (02:15 +0200)] 
gh-150723: Fix perf jitdump files on macOS (#150728)

The perf jitdump format defines the thread id field of the JR_CODE_LOAD
record as a 32-bit value, but on macOS it was declared as a uint64_t
(since pthread_threadid_np() returns a uint64_t). Those extra 8 bytes
plus alignment padding shifted every following field, so parsers reading
the file by the spec misread code_size as the code address and failed to
resolve any Python frames.

Declare thread_id as uint32_t on all platforms and truncate the macOS
thread id when writing the record. The value is only informational.
Symbols are resolved by address, and not thread ids so truncation is
safe here.

* Use mach_absolute_time for macOS jitdump timestamps

On macOS the jitdump file is consumed by profilers such as samply, which
timestamp their samples using mach_absolute_time(). The jitdump events were
stamped with clock_gettime(CLOCK_MONOTONIC), a different clock domain that
keeps advancing while the system is asleep, so the JIT code mappings could be
off by days relative to the samples and no Python frame would resolve. Stamp
jitdump events with mach_absolute_time() on macOS so they share the sampler's
clock domain. Linux continues to use CLOCK_MONOTONIC to stay aligned with perf.

Exercise the -Xperf_jit (jitdump) backend through samply and assert that
Python frames resolve, exercising the binary jitdump path end to end.
Skipped when samply is not installed.

2 weeks agogh-91099: fix[imaplib]: call Exception with string instance (#31823)
Florian Best [Tue, 2 Jun 2026 20:42:04 +0000 (22:42 +0200)] 
gh-91099: fix[imaplib]: call Exception with string instance (#31823)

* bpo-46943: fix[imaplib]: call Exception with string instance

Adjust the behavior of 'login' to be similar to `authenticate()`,
where self.error is called with a str() instance.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 weeks agogh-150319: Replace all documentation which says "See PEP 585" (#150325)
Stephen Rosen [Tue, 2 Jun 2026 20:13:34 +0000 (15:13 -0500)] 
gh-150319: Replace all documentation which says "See PEP 585" (#150325)

* Replace all documentation which says "See PEP 585"

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)

* Apply suggestions from code review

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Correct several class getitem docs

And expand the text for tuples.

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
* Add notes on generic typing of builtins

* Fix typo in tuple.__class_getitem__ docstring

* Typo fix: malformed refs

Fix `generic` links which weren't marked as `:ref:`.

* Strike unnecessary docs on generic-ness

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
* Apply suggestions from code review

These are applied at both the originally indicated locations and in the
corresponding docstring definitions.

Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
* Update Doc/library/re.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Update Objects/enumobject.c

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Remove tuple generic doc in 'stdtypes' page

This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
`tuple.__class_getitem__` -- is left in place.

* Fix whitespace around new doc of generics

Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.

In most cases, this is a removal of an extra line.

In one case (Arrays), it is the reintroduction of a line.

Additionally, two other minor fixes are included:
- incorrect indent on 'defaultdicts'
- make `mappingproxy.__class_getitem__.__doc__` consistent with other
  mapping type generic docs

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Move placement of memoryview generic note

Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Ensure sphinxdoc does not start sentences lowercase

Lowercase class names at the start of sentences are marked out with the
`class` role. In the case of `deque`, documentation already refers to
these as `Deques`, so this form is preferred.

* Apply suggestions from code review

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Fix line endings and wrap more tightly

Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.

* Use 'ContextVars' style in sphinx doc

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks agoFix description of the function parameter of shutil.register_archive_format() (GH...
Brian Schubert [Tue, 2 Jun 2026 19:12:36 +0000 (15:12 -0400)] 
Fix description of the function parameter of shutil.register_archive_format() (GH-145087)

2 weeks agoAdd link to new security policy (#150800)
Seth Larson [Tue, 2 Jun 2026 18:20:36 +0000 (11:20 -0700)] 
Add link to new security policy (#150800)

2 weeks agogh-141627: Fix BufferedRandom inheritance documentation (GH-141629)
Mohsin Mehmood [Tue, 2 Jun 2026 18:06:39 +0000 (23:06 +0500)] 
gh-141627: Fix BufferedRandom inheritance documentation (GH-141629)

BufferedRandom does not inherit from BufferedReader and BufferedWriter
in the C implementation.

2 weeks agogh-101913: changed wording of docstring for _parsedate_tz (#134446)
Gustaf [Tue, 2 Jun 2026 15:02:19 +0000 (17:02 +0200)] 
gh-101913: changed wording of docstring for _parsedate_tz (#134446)

Fixed incorrect word.

Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2 weeks agogh-148587: Document `sys.lazy_modules` (#150742)
Bartosz Sławecki [Tue, 2 Jun 2026 15:00:45 +0000 (17:00 +0200)] 
gh-148587: Document `sys.lazy_modules` (#150742)

2 weeks agoSilence experimental coroutine deprecation warnings (#150788)
Hugo van Kemenade [Tue, 2 Jun 2026 14:55:28 +0000 (17:55 +0300)] 
Silence experimental coroutine deprecation warnings (#150788)

Co-authored-by: Zachary Ware <zach@python.org>
2 weeks agogh-149187: Document `frozendict()` under 'Built-in Functions' (#149185)
Øyvind Rønningstad [Tue, 2 Jun 2026 13:55:16 +0000 (15:55 +0200)] 
gh-149187: Document `frozendict()` under 'Built-in Functions' (#149185)

2 weeks agogh-150766: export `_PyGC_VisitFrameStack` and `_PyGC_VisitStackRef` functions (#150767)
Kumar Aditya [Tue, 2 Jun 2026 13:08:21 +0000 (18:38 +0530)] 
gh-150766: export `_PyGC_VisitFrameStack` and `_PyGC_VisitStackRef` functions (#150767)

2 weeks agogh-89554: Document _thread.LockType as a class (#150684)
Bernát Gábor [Tue, 2 Jun 2026 12:55:01 +0000 (05:55 -0700)] 
gh-89554: Document _thread.LockType as a class (#150684)

_thread.LockType is a class (the type of lock objects), 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::", move it next to the lock methods, and
document acquire(), release() and locked() as methods of the class.  Keep
the old _thread.lock.* URL fragments working with raw HTML anchors.

2 weeks agogh-115119: Fix libmpdec detection when pkg-config files are missing (#150502)
stratakis [Tue, 2 Jun 2026 09:43:30 +0000 (11:43 +0200)] 
gh-115119: Fix libmpdec detection when pkg-config files are missing (#150502)

The fallback for systems with no mpdecimal .pc files used AC_LINK_IFELSE
directly, which relied on LIBMPDEC_LIBS being set. On failure this was empty
so the link test ran without -lmpdec.

Use AC_CHECK_HEADER and AC_CHECK_LIB instead.

2 weeks agogh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080)
Seth Larson [Tue, 2 Jun 2026 09:39:50 +0000 (02:39 -0700)] 
gh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080)

Replace the insertion sort used for canonical ordering of combining
characters with a hybrid approach: insertion sort for short runs (< 20)
and counting sort for longer runs, reducing worst-case complexity from
O(n^2) to O(n). This prevents denial of service via crafted Unicode
strings with many combining characters in alternating CCC order.

Co-authored-by: ch4n3-yoon <ch4n3.yoon@gmail.com>
Co-authored-by: Seokchan Yoon <13852925+ch4n3-yoon@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2 weeks agogh-149805: Fix `SystemError` when compiling `__classdict__` class annotation (#149806)
Stan Ulbrych [Tue, 2 Jun 2026 09:17:03 +0000 (10:17 +0100)] 
gh-149805: Fix `SystemError` when compiling `__classdict__` class annotation (#149806)