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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

11 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().

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

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

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

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

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

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

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

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

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

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

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

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