]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 weeks agoSynced docs and docstring for `sysconfig.get_platform` (#135530) 138982/head
ivan [Tue, 16 Sep 2025 11:16:48 +0000 (08:16 -0300)] 
Synced docs and docstring  for `sysconfig.get_platform` (#135530)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Ned Deily <nad@python.org>
7 weeks agogh-135329: prevent infinite traceback loop on Ctrl-C for strace (GH-138133)
yihong [Tue, 16 Sep 2025 10:39:03 +0000 (18:39 +0800)] 
gh-135329: prevent infinite traceback loop on Ctrl-C  for strace (GH-138133)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: dura0ok <slpmcf@gmail.com>
Co-authored-by: graymon <greyschwinger@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
7 weeks agoGH-129805: Clean up some changes from GH-129806 (GH-133540)
Brandt Bucher [Tue, 16 Sep 2025 10:29:09 +0000 (11:29 +0100)] 
GH-129805: Clean up some changes from GH-129806 (GH-133540)

7 weeks agogh-88473: Implement fast path in date.today() for date types (#130980)
Stan Ulbrych [Tue, 16 Sep 2025 09:28:54 +0000 (10:28 +0100)] 
gh-88473: Implement fast path in date.today() for date types (#130980)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 weeks agogh-129813, PEP 782: Soft deprecate _PyBytes_Resize() (#138964)
Victor Stinner [Tue, 16 Sep 2025 08:38:43 +0000 (09:38 +0100)] 
gh-129813, PEP 782: Soft deprecate _PyBytes_Resize() (#138964)

Soft deprecate _PyBytes_Resize() and
PyBytes_FromStringAndSize(NULL, size).

7 weeks agogh-138013: Remove load_tests in test_io.test_general (#138771)
Cody Maloney [Tue, 16 Sep 2025 08:37:28 +0000 (01:37 -0700)] 
gh-138013: Remove load_tests in test_io.test_general (#138771)

Rely on default test discovery.

Validation:
```bash
 # Run before commit
./python -m test test_io -uall,walltime,largefile,cpu,extralargefile -M25G -o --fail-env-changed -j0 --list-cases | sort > old_cases.txt
 # Run after commit
./python -m test test_io -uall,walltime,largefile,cpu,extralargefile -M25G -o --fail-env-changed -j0 --list-cases | sort > new_cases.txt

diff new_cases.txt old_cases.
 # <outputs no changes in case list>
```

7 weeks agogh-137433: Fix deadlock with stop-the-world and daemon threads (gh-137735)
Sam Gross [Tue, 16 Sep 2025 08:21:58 +0000 (09:21 +0100)] 
gh-137433: Fix deadlock with stop-the-world and daemon threads (gh-137735)

There was a deadlock originally seen by Memray when a daemon thread
enabled or disabled profiling while the interpreter was shutting down.
I think this could also happen with garbage collection, but I haven't
seen that in practice.

The daemon thread could be hung while trying acquire the global rwmutex
that prevents overlapping global and per-interpreter stop-the-world events.
Since it already held the main interpreter's stop-the-world lock, it
also deadlocked the main thread, which is trying to perform interpreter
finalization.

Swap the order of lock acquisition to prevent this deadlock.
Additionally, refactor `_PyParkingLot_Park` so that the global buckets
hashtable is left in a clean state if the thread is hung in
`PyEval_AcquireThread`.

7 weeks agogh-138958: remove unused variable in Lib/asyncio/streams.py (#138959)
yihong [Tue, 16 Sep 2025 03:18:41 +0000 (11:18 +0800)] 
gh-138958: remove unused variable in Lib/asyncio/streams.py (#138959)

7 weeks agoRe-order Modules/makesetup in CODEOWNERS and update owners (#138628)
Emma Smith [Tue, 16 Sep 2025 02:52:59 +0000 (19:52 -0700)] 
Re-order Modules/makesetup in CODEOWNERS and update owners (#138628)

* Re-order Modules/makesetup in CODEOWNERS and add Adam Turner
* Add Erlend to Modules/makesetup in CODEOWNERS

7 weeks agogh-129813, PEP 782: Add PyBytesWriter.overallocate (#138941)
Victor Stinner [Mon, 15 Sep 2025 22:15:32 +0000 (23:15 +0100)] 
gh-129813, PEP 782: Add PyBytesWriter.overallocate (#138941)

Disable overallocation in _PyBytes_FormatEx() at the last write.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#138954)
Victor Stinner [Mon, 15 Sep 2025 21:50:09 +0000 (22:50 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#138954)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in FileIO.read() (#138955)
Victor Stinner [Mon, 15 Sep 2025 21:49:28 +0000 (22:49 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in FileIO.read() (#138955)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _sha3 (#138923)
Victor Stinner [Mon, 15 Sep 2025 20:53:03 +0000 (21:53 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _sha3 (#138923)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _io.FileIO.readall (#138901)
Cody Maloney [Mon, 15 Sep 2025 20:38:01 +0000 (13:38 -0700)] 
gh-129813, PEP 782: Use PyBytesWriter in _io.FileIO.readall (#138901)

Performance about the same, using the benchmark from gh-120754:

```
pyperf compare_to main.json pep782.json
read_file_small: Mean +- std dev: [main] 5.71 us +- 0.05 us -> [pep782] 5.68 us +- 0.05 us: 1.01x faster
read_file_large: Mean +- std dev: [main] 89.7 us +- 0.9 us -> [pep782] 86.9 us +- 0.8 us: 1.03x faster
read_all_rst_bytes: Mean +- std dev: [main] 926 us +- 8 us -> [pep782] 920 us +- 12 us: 1.01x faster
read_all_rst_text: Mean +- std dev: [main] 2.24 ms +- 0.02 ms -> [pep782] 2.17 ms +- 0.04 ms: 1.03x faster

Benchmark hidden because not significant (1): read_all_py_bytes

Geometric mean: 1.01x faster
```

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _winapi.PeekNamedPipe() (#138930)
Victor Stinner [Mon, 15 Sep 2025 20:25:47 +0000 (21:25 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _winapi.PeekNamedPipe() (#138930)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-97517: Add documentation links to datetime strftime/strptime docstrings (#138559)
Mehdi Hassan [Mon, 15 Sep 2025 18:50:46 +0000 (19:50 +0100)] 
gh-97517: Add documentation links to datetime strftime/strptime docstrings (#138559)

* Add documentation links to datetime strftime/strptime docstrings

- Add links to format codes documentation for all strftime methods
- Add links to format codes documentation for all strptime methods
- Addresses issue #97517

* Update C extension docstrings with format codes documentation

* Regenerate clinic code for updated docstrings

* Add clinic-generated header file for updated docstrings

* Fix docstring spacing consistency in both Python and C files

* Update Lib/_pydatetime.py

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
7 weeks agogh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, colle...
Loïc Simon [Mon, 15 Sep 2025 16:51:34 +0000 (18:51 +0200)] 
gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) (GH-138268)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138922)
Victor Stinner [Mon, 15 Sep 2025 16:41:43 +0000 (17:41 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138922)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

7 weeks agogh-37817: Allow assignment to __bases__ of direct subclasses of builtin classes ...
Serhiy Storchaka [Mon, 15 Sep 2025 16:40:28 +0000 (19:40 +0300)] 
gh-37817: Allow assignment to __bases__ of direct subclasses of builtin classes (GH-137585)

7 weeks agogh-134953: Make the True/False/None check more efficient (GH-138931)
Łukasz Langa [Mon, 15 Sep 2025 16:27:37 +0000 (17:27 +0100)] 
gh-134953: Make the True/False/None check more efficient (GH-138931)

7 weeks agogh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value...
yihong [Mon, 15 Sep 2025 16:26:23 +0000 (00:26 +0800)] 
gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 weeks agogh-132732: Clear errors in JIT optimizer on error (GH-136048)
Ken Jin [Mon, 15 Sep 2025 16:24:37 +0000 (17:24 +0100)] 
gh-132732: Clear errors in JIT optimizer on error (GH-136048)

7 weeks agogh-138239: Fix incorrect highlighting of "type" in type statements in the REPL (GH...
00ll00 [Mon, 15 Sep 2025 16:21:41 +0000 (00:21 +0800)] 
gh-138239: Fix incorrect highlighting of "type" in type statements in the REPL (GH-138241)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 weeks agogh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523)
Serhiy Storchaka [Mon, 15 Sep 2025 16:20:31 +0000 (19:20 +0300)] 
gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523)

Handle ECANCELED in the same way as EINTR to work around the Posix
violation in the NetBSD's implementation.

7 weeks agoGH-132732: Remove textwrap import (#138933)
Savannah Bailey [Mon, 15 Sep 2025 16:09:51 +0000 (17:09 +0100)] 
GH-132732: Remove textwrap import (#138933)

7 weeks agoGH-132732: Use pure op machinery to optimize various instructions with `_POP_TOP...
Savannah Bailey [Mon, 15 Sep 2025 15:29:45 +0000 (16:29 +0100)] 
GH-132732: Use pure op machinery to optimize various instructions with `_POP_TOP` and `_POP_TWO`  (#137577)

7 weeks agogh-137992: fix `PyRefTracer_SetTracer` to start world before returning (#138925)
Kumar Aditya [Mon, 15 Sep 2025 14:39:15 +0000 (20:09 +0530)] 
gh-137992: fix `PyRefTracer_SetTracer` to start world before returning  (#138925)

fix deadlock in PyRefTracer_SetTracer

7 weeks agogh-138712: Add os.NODEV (GH-138728)
Serhiy Storchaka [Mon, 15 Sep 2025 14:36:32 +0000 (17:36 +0300)] 
gh-138712: Add os.NODEV (GH-138728)

7 weeks agogh-134953: Expand theming for `True`/`False`/`None` (#135000)
Stan Ulbrych [Mon, 15 Sep 2025 14:36:17 +0000 (15:36 +0100)] 
gh-134953: Expand theming for `True`/`False`/`None` (#135000)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _codecs.escape_decode() (#138919)
Victor Stinner [Mon, 15 Sep 2025 14:32:43 +0000 (15:32 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _codecs.escape_decode() (#138919)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _curses (#138920)
Victor Stinner [Mon, 15 Sep 2025 14:24:34 +0000 (15:24 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _curses (#138920)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Init small_buffer in PyBytesWriter_Create() (#138924)
Victor Stinner [Mon, 15 Sep 2025 14:23:11 +0000 (15:23 +0100)] 
gh-129813, PEP 782: Init small_buffer in PyBytesWriter_Create() (#138924)

Fill small_buffer with 0xFF byte pattern to detect the usage of
uninitialized bytes in debug build.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in fcntl (#138921)
Victor Stinner [Mon, 15 Sep 2025 14:21:43 +0000 (15:21 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in fcntl (#138921)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

Don't build the fcntl with the limited C API anymore, since
the PyBytesWriter API is not part of the limited C API.

7 weeks agogh-138779: Use the dev_t converter for st_rdev (GH-138780)
Serhiy Storchaka [Mon, 15 Sep 2025 14:07:34 +0000 (17:07 +0300)] 
gh-138779: Use the dev_t converter for st_rdev (GH-138780)

This allows to support device numbers larger than 2**63-1.

7 weeks agogh-137956: Guard against non-free-threaded extensions in free-threaded builds (GH...
Petr Viktorin [Mon, 15 Sep 2025 11:24:16 +0000 (13:24 +0200)] 
gh-137956: Guard against non-free-threaded extensions in free-threaded builds (GH-137957)

7 weeks agogh-137017: Ensure `Thread.is_alive()` only returns False after the underlying OS...
Abdul [Mon, 15 Sep 2025 11:13:37 +0000 (12:13 +0100)] 
gh-137017: Ensure `Thread.is_alive()` only returns False after the underlying OS thread exits (gh-137315)

7 weeks agogh-138902: Fix generator send arg name (#138905)
Marat Khagazheev [Mon, 15 Sep 2025 11:05:36 +0000 (14:05 +0300)] 
gh-138902: Fix generator send arg name (#138905)

Co-authored-by: marat <khagazheev@artlebedev.ru>
7 weeks agogh-137992: Stop the world when calling PyRefTracer_SetTracer (#137994)
Pablo Galindo Salgado [Mon, 15 Sep 2025 10:39:41 +0000 (11:39 +0100)] 
gh-137992: Stop the world when calling PyRefTracer_SetTracer (#137994)

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _PyBytes_FormatEx() (#138839)
Victor Stinner [Mon, 15 Sep 2025 10:23:36 +0000 (11:23 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _PyBytes_FormatEx() (#138839)

Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.

7 weeks agogh-138794: Communicate to PyRefTracer when they are being replaced (#138797)
Pablo Galindo Salgado [Mon, 15 Sep 2025 10:12:09 +0000 (11:12 +0100)] 
gh-138794: Communicate to PyRefTracer when they are being replaced (#138797)

7 weeks agogh-138886: Remove deprecated `PySys_ResetWarnOptions` C-API function (#138887)
sobolevn [Mon, 15 Sep 2025 09:01:33 +0000 (12:01 +0300)] 
gh-138886: Remove deprecated `PySys_ResetWarnOptions` C-API function (#138887)

7 weeks agoFix typo in stack_protection.md (GH-138876)
Bartosz Sławecki [Mon, 15 Sep 2025 08:53:13 +0000 (10:53 +0200)] 
Fix typo in stack_protection.md (GH-138876)

7 weeks agogh-138871: Clarify NameError exception in 'del' (#138881)
Kian Eliasi [Mon, 15 Sep 2025 06:11:01 +0000 (09:41 +0330)] 
gh-138871: Clarify NameError exception in 'del' (#138881)

7 weeks agogh-135953: Reduce memory usage of stack collectors (#138875)
László Kiss Kollár [Sun, 14 Sep 2025 22:47:14 +0000 (23:47 +0100)] 
gh-135953: Reduce memory usage of stack collectors (#138875)

The stack collector base class keeps all frames until export() is
called, which causes significant unnecessary memory usage. Instead, we
can process the frames on the fly in the collect call by dispatching the
aggregation logic to the subclass through the process_frames method.

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
7 weeks agogh-135953: Prevent overflow in the profiler flamegraph hover boxes (#138880)
Pablo Galindo Salgado [Sun, 14 Sep 2025 20:50:18 +0000 (21:50 +0100)] 
gh-135953: Prevent overflow in the profiler flamegraph hover boxes (#138880)

7 weeks agogh-136355: Deprecate `-b` and `-bb` CLI flags in 3.15 (#136363)
sobolevn [Sun, 14 Sep 2025 17:00:03 +0000 (20:00 +0300)] 
gh-136355: Deprecate `-b` and `-bb` CLI flags in 3.15 (#136363)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
7 weeks agogh-71810: Fix _PyLong_AsByteArray() undefined behavior (#138873)
Victor Stinner [Sun, 14 Sep 2025 09:25:53 +0000 (11:25 +0200)] 
gh-71810: Fix _PyLong_AsByteArray() undefined behavior (#138873)

Don't read p[-1] when p is an empty string: when n==0.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in lzma and zlib (#138832)
Victor Stinner [Sat, 13 Sep 2025 17:27:04 +0000 (19:27 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in lzma and zlib (#138832)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _PyBytes_FromList() (#138837)
Victor Stinner [Sat, 13 Sep 2025 17:23:57 +0000 (19:23 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in _PyBytes_FromList() (#138837)

Use the new public PyBytesWriter API in:

* _PyBytes_FromHex()
* _PyBytes_FromBuffer()
* _PyBytes_FromList()
* _PyBytes_FromTuple()
* _PyBytes_FromIterator()

Add _PyBytesWriter_ResizeAndUpdatePointer() and
_PyBytesWriter_GetAllocated() helper functions.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in posix extension (#138829)
Victor Stinner [Sat, 13 Sep 2025 16:57:46 +0000 (18:57 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in posix extension (#138829)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in memoryview (#138836)
Victor Stinner [Sat, 13 Sep 2025 16:36:05 +0000 (18:36 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in memoryview (#138836)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in socket and mmap (#138831)
Victor Stinner [Sat, 13 Sep 2025 16:31:26 +0000 (18:31 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in socket and mmap (#138831)

Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize()
with the new public PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#138830)
Victor Stinner [Sat, 13 Sep 2025 16:30:25 +0000 (18:30 +0200)] 
gh-129813, PEP 782: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#138830)

Replace PyBytes_FromStringAndSize(NULL, 0) with
Py_GetConstant(Py_CONSTANT_EMPTY_BYTES). Py_GetConstant() cannot
fail.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _PyBytes_DecodeEscape2() (#138838)
Victor Stinner [Sat, 13 Sep 2025 16:28:08 +0000 (18:28 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in _PyBytes_DecodeEscape2() (#138838)

Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in pickle and struct (#138833)
Victor Stinner [Sat, 13 Sep 2025 16:26:49 +0000 (18:26 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in pickle and struct (#138833)

Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in binascii (#138825)
Victor Stinner [Sat, 13 Sep 2025 16:25:16 +0000 (18:25 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in binascii (#138825)

Replace the private _PyBytesWriter API with the new public
PyBytesWriter API.

8 weeks agoGH-128520: pathlib ABCs: improve protocol for 'openable' objects (#134101)
Barney Gale [Fri, 12 Sep 2025 21:25:18 +0000 (22:25 +0100)] 
GH-128520: pathlib ABCs: improve protocol for 'openable' objects (#134101)

Rename `pathlib._os.magic_open()` to `vfsopen()`. The new name is a bit
less abstract, and it aligns with the `vfspath()` method added in 5dbd27d.

Per discussion on discourse[^1], adjust `vfsopen()` so that the following
methods may be called:

- `__open_reader__()`
- `__open_writer__(mode)`
- `__open_updater__(mode)`

These three methods return readable, writable, and full duplex file objects
respectively. In the 'writer' method, *mode* is either 'a', 'w' or 'x'. In
the 'updater' method, *mode* is either 'r' or 'w'.

In the pathlib ABCs, replace `ReadablePath.__open_rb__()` with
`__open_reader__()`, and replace `WritablePath.__open_wb__()` with
`__open_writer__()`.

[^1]: https://discuss.python.org/t/open-able-objects/90238

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 weeks agogh-71648: Optimize PNG files (GH-138842)
Stan Ulbrych [Fri, 12 Sep 2025 20:13:05 +0000 (21:13 +0100)] 
gh-71648: Optimize PNG files (GH-138842)

* Only keep > 1 kb savings

8 weeks agogh-138804: Check type in `shlex.quote` (GH-138809)
Christoph Walcher [Fri, 12 Sep 2025 18:26:21 +0000 (20:26 +0200)] 
gh-138804: Check type in `shlex.quote` (GH-138809)

8 weeks agogh-71648: Remove unused image `Doc/faq/python-video-icon.png` (GH-138841)
Stan Ulbrych [Fri, 12 Sep 2025 16:16:51 +0000 (17:16 +0100)] 
gh-71648: Remove unused image `Doc/faq/python-video-icon.png` (GH-138841)

8 weeks agogh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138835)
Victor Stinner [Fri, 12 Sep 2025 13:39:16 +0000 (15:39 +0200)] 
gh-129813, PEP 782: Use PyBytesWriter in _hashopenssl (#138835)

Replace PyBytes_FromStringAndSize(NULL, size) with the new public
PyBytesWriter API.

8 weeks agogh-138661: fix data race in `PyCode_Addr2Line` (#138664)
Kumar Aditya [Fri, 12 Sep 2025 12:34:55 +0000 (18:04 +0530)] 
gh-138661: fix data race in `PyCode_Addr2Line` (#138664)

8 weeks agogh-129813, PEP 782: Add PyBytesWriter_Format() (#138824)
Victor Stinner [Fri, 12 Sep 2025 12:21:57 +0000 (14:21 +0200)] 
gh-129813, PEP 782: Add PyBytesWriter_Format() (#138824)

Modify PyBytes_FromFormatV() to use the public PyBytesWriter API
rather than the _PyBytesWriter private API.

8 weeks agoImprove permission error messages in pdb and asyncio.tools (#134290)
ivonastojanovic [Fri, 12 Sep 2025 11:54:04 +0000 (12:54 +0100)] 
Improve permission error messages in pdb and asyncio.tools (#134290)

8 weeks agogh-129813, PEP 782: Add PyBytesWriter C API (#138822)
Victor Stinner [Fri, 12 Sep 2025 11:41:59 +0000 (13:41 +0200)] 
gh-129813, PEP 782: Add PyBytesWriter C API (#138822)

8 weeks agogh-138756: Fix leak of inittab memory in PyInitConfig_Free() (GH-138792)
Victor Stinner [Fri, 12 Sep 2025 09:46:02 +0000 (11:46 +0200)] 
gh-138756: Fix leak of inittab memory in PyInitConfig_Free() (GH-138792)

8 weeks agogh-138163: skip failures if tests are run with `SCHED_BATCH` on glibc (GH-138576)
jxes993409 [Fri, 12 Sep 2025 09:37:53 +0000 (17:37 +0800)] 
gh-138163: skip failures if tests are run with `SCHED_BATCH` on glibc (GH-138576)

8 weeks agogh-138669: Increase test coverage for difflib (GH-138670)
Jan-Eric Nitschke [Fri, 12 Sep 2025 09:33:38 +0000 (11:33 +0200)] 
gh-138669: Increase test coverage for difflib (GH-138670)

8 weeks agogh-138801: re-enable `pyrepl` tests on Windows (#138802)
Chris Eibl [Fri, 12 Sep 2025 07:47:43 +0000 (09:47 +0200)] 
gh-138801: re-enable `pyrepl` tests on Windows (#138802)

8 weeks agoRemove unused prototype `_PyPegen_set_source_in_metadata` (#138810)
Christoph Walcher [Fri, 12 Sep 2025 00:40:49 +0000 (02:40 +0200)] 
Remove unused prototype `_PyPegen_set_source_in_metadata` (#138810)

Remove unused prototype

8 weeks agoRevert "gh-116946: fully implement GC protocol for `_tkinter.Tk{app,tt}Object` (...
Peter Bierma [Thu, 11 Sep 2025 21:05:37 +0000 (17:05 -0400)] 
Revert "gh-116946: fully implement GC protocol for `_tkinter.Tk{app,tt}Object` (#138331)" (#138807)

This reverts commit 283380a9417eebf1bf9d3a1e941cef94149712bb.

8 weeks agocloses gh-138706: update Unicode to 17.0.0 (#138719)
Benjamin Peterson [Thu, 11 Sep 2025 16:58:39 +0000 (09:58 -0700)] 
closes gh-138706: update Unicode to 17.0.0 (#138719)

8 weeks agogh-138005: Document that CSV `skipinitialspace=True` and `delimiter=' '` require...
Maurycy Pawłowski-Wieroński [Thu, 11 Sep 2025 15:11:33 +0000 (17:11 +0200)] 
gh-138005: Document that CSV `skipinitialspace=True` and `delimiter=' '` require quotation for empty fields (#138006)

8 weeks agogh-116738: add multi-threaded tests for `resource` module on free-threading builds...
Alper [Thu, 11 Sep 2025 13:38:08 +0000 (06:38 -0700)] 
gh-116738: add multi-threaded tests for `resource` module on free-threading builds (#138504)

8 weeks agogh-138704: Add PermissionError messages to profiling.sampling (#138705)
Pablo Galindo Salgado [Thu, 11 Sep 2025 13:32:08 +0000 (14:32 +0100)] 
gh-138704: Add PermissionError messages to profiling.sampling (#138705)

8 weeks agogh-116946: fully implement GC protocol for `_tkinter.Tk{app,tt}Object` (#138331)
Bénédikt Tran [Thu, 11 Sep 2025 10:59:30 +0000 (12:59 +0200)] 
gh-116946: fully implement GC protocol for `_tkinter.Tk{app,tt}Object` (#138331)

8 weeks agogh-138756: Fix memory leak in PyInitConfig_Free() (#138759)
Victor Stinner [Thu, 11 Sep 2025 10:46:19 +0000 (12:46 +0200)] 
gh-138756: Fix memory leak in PyInitConfig_Free() (#138759)

Clear also memory of PyConfig members.

8 weeks agogh-138013: Move I/O test infrastructre to test_io.utils (#138475)
Cody Maloney [Thu, 11 Sep 2025 10:45:30 +0000 (03:45 -0700)] 
gh-138013: Move I/O test infrastructre to test_io.utils (#138475)

This moves test support code to `test_io.utils` via copy/paste
code movement then adjusts imports as needed
(remove unneded + add all required).

8 weeks agogh-138479: Ensure that `__typing_subst__` returns a tuple (GH-138482)
Peter Bierma [Thu, 11 Sep 2025 10:39:09 +0000 (06:39 -0400)] 
gh-138479: Ensure that `__typing_subst__` returns a tuple (GH-138482)

Raise an exception if __typing_subst__ returns a non-tuple object.

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
8 weeks agogh-71810: Fix corner case (length==0) for int.to_bytes() (#138739)
Sergey B Kirpichev [Thu, 11 Sep 2025 10:30:53 +0000 (13:30 +0300)] 
gh-71810: Fix corner case (length==0) for int.to_bytes() (#138739)

```pycon
>>> (0).to_bytes(0, 'big', signed=True)
b''
>>> (-1).to_bytes(0, 'big', signed=True)  # was b''
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    (-1).to_bytes(0, 'big', signed=True)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: int too big to convert
```

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
8 weeks agogh-138081: fix some dead links in InternalDocs (#138082)
yihong [Thu, 11 Sep 2025 08:54:16 +0000 (16:54 +0800)] 
gh-138081: fix some dead links in InternalDocs (#138082)

8 weeks agogh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types (#138582)
Bénédikt Tran [Thu, 11 Sep 2025 07:56:20 +0000 (09:56 +0200)] 
gh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types (#138582)

The following types are now immutable:

* `_curses_panel.panel`,
* `[posix,nt].ScandirIterator`, `[posix,nt].DirEntry` (exposed in `os.py`),
* `_remote_debugging.RemoteUnwinder`,
* `_tkinter.Tcl_Obj`, `_tkinter.tkapp`, `_tkinter.tktimertoken`,
* `zlib.Compress`, and `zlib.Decompress`.

8 weeks agogh-138432: Improved invalid path checking in zoneinfo.reset_tzpath() (GH-138433)
Stephen Morton [Thu, 11 Sep 2025 07:08:53 +0000 (00:08 -0700)] 
gh-138432: Improved invalid path checking in zoneinfo.reset_tzpath() (GH-138433)

* Improve error messages for path-like relative paths and path-like bytes paths.
* TZPATH is now always a tuple of strings.

8 weeks agoGH-138562: Remove ``sort()`` from the common sequence methods in the data model ...
Adam Turner [Wed, 10 Sep 2025 15:52:57 +0000 (16:52 +0100)] 
GH-138562: Remove ``sort()`` from the common sequence methods in the data model (#138563)

8 weeks agogh-138744: GitHub Actions: pin to `windows-2022` (#138743)
Hugo van Kemenade [Wed, 10 Sep 2025 14:28:27 +0000 (17:28 +0300)] 
gh-138744: GitHub Actions: pin to `windows-2022` (#138743)

8 weeks agogh-138349: Fix crash when combining module-level annotation and listcomp (#138363)
Jelle Zijlstra [Wed, 10 Sep 2025 13:18:39 +0000 (06:18 -0700)] 
gh-138349: Fix crash when combining module-level annotation and listcomp (#138363)

8 weeks agogh-138729: Cover `inspect.formatannotationrelativeto` with tests (#138730)
sobolevn [Wed, 10 Sep 2025 13:06:16 +0000 (16:06 +0300)] 
gh-138729: Cover `inspect.formatannotationrelativeto` with tests (#138730)

8 weeks agogh-138716: Fix `assert a := b` syntax error message (#138718)
sobolevn [Wed, 10 Sep 2025 13:05:16 +0000 (16:05 +0300)] 
gh-138716: Fix `assert a := b` syntax error message (#138718)

8 weeks agogh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285)
Dung Nguyen [Wed, 10 Sep 2025 12:01:19 +0000 (19:01 +0700)] 
gh-138008: Fix segfaults in _ctypes due to invalid argtypes (GH-138285)

Signed-off-by: Nguyen Viet Dung <29406816+magnified103@users.noreply.github.com>
Signed-off-by: Nguyen Viet Dung <dung@ekluster.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
8 weeks agogh-136006: fix `Py_NAN` expansion on Solaris systems (#136575)
Bénédikt Tran [Wed, 10 Sep 2025 09:11:04 +0000 (11:11 +0200)] 
gh-136006: fix `Py_NAN` expansion on Solaris systems (#136575)

On Solaris, `Py_NAN` may expand as a function address instead of a floating-point number.
This amends commit 7a3b03509e5e3e72d8c47137579cccb52548a318.

8 weeks agogh-134531: use `EVP_MAC` API for `_hashlib.HMAC` when possible (#135235)
Bénédikt Tran [Wed, 10 Sep 2025 08:35:01 +0000 (10:35 +0200)] 
gh-134531: use `EVP_MAC` API for `_hashlib.HMAC` when possible (#135235)

Use `EVP_MAC` API for HMAC on builds with OpenSSL 3.0 or later.

8 weeks agogh-137371: refactor and fortify `test.support.hashlib_helper` (#137375)
Bénédikt Tran [Wed, 10 Sep 2025 07:14:38 +0000 (09:14 +0200)] 
gh-137371: refactor and fortify `test.support.hashlib_helper` (#137375)

8 weeks agogh-138230: Remove dead code in code gen - codegen_check_annotation is only calle...
Dino Viehland [Wed, 10 Sep 2025 01:17:00 +0000 (18:17 -0700)] 
gh-138230: Remove dead code in code gen - codegen_check_annotation is only calle… (#138228)

Remove dead code in code gen - codegen_check_annotation is only called if future annotations are enabled, and if future annotations are enabled it does nothing.

8 weeks agogh-135953: Fix refleak in cache method (#138721)
Pablo Galindo Salgado [Wed, 10 Sep 2025 00:08:09 +0000 (01:08 +0100)] 
gh-135953: Fix refleak in cache method (#138721)

8 weeks agogh-135953: Add flamegraph reporter to sampling profiler (#138715)
László Kiss Kollár [Tue, 9 Sep 2025 22:06:45 +0000 (23:06 +0100)] 
gh-135953: Add flamegraph reporter to sampling profiler (#138715)

8 weeks agogh-136616: Improve `assert` syntax error messages (#136653)
sobolevn [Tue, 9 Sep 2025 20:26:22 +0000 (23:26 +0300)] 
gh-136616: Improve `assert` syntax error messages (#136653)

8 weeks agogh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662)
Samuel Sloniker [Tue, 9 Sep 2025 19:52:00 +0000 (12:52 -0700)] 
gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662)

8 weeks agogh-88886: Remove excessive encoding name normalization (GH-137167)
Serhiy Storchaka [Tue, 9 Sep 2025 18:07:21 +0000 (21:07 +0300)] 
gh-88886: Remove excessive encoding name normalization (GH-137167)

The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"

This reverts commit 20f59fe1f7748ae899aceee4cb560e5e1f528a1f.

8 weeks agogh-138535: Pass directly state to posix fill_time() (#138693)
Victor Stinner [Tue, 9 Sep 2025 14:31:13 +0000 (16:31 +0200)] 
gh-138535: Pass directly state to posix fill_time() (#138693)

Pass directly the module state instead of passing the module to avoid
a call to get_posix_state().

8 weeks agogh-133143: Use _Py_ID for the other literals in sys (GH-138698)
Petr Viktorin [Tue, 9 Sep 2025 12:57:07 +0000 (14:57 +0200)] 
gh-133143: Use _Py_ID for the other literals in sys (GH-138698)

Follow-up refactoring after GH-133143, where we use `_Py_ID` for "big" and "little"
in `abi_info.byteorder`.
This uses `_Py_ID` for `sys.byteorder`, but also `float_repr_style` and a module name.