]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 weeks agoGH-137218: Update `make` for JIT stencils (#137265)
Savannah Bailey [Fri, 19 Sep 2025 09:36:42 +0000 (10:36 +0100)] 
GH-137218: Update `make` for JIT stencils (#137265)

7 weeks agogh-129813, PEP 782: Fix refleak in sock_recvfrom() (GH-139151)
Victor Stinner [Fri, 19 Sep 2025 09:30:11 +0000 (10:30 +0100)] 
gh-129813, PEP 782: Fix refleak in sock_recvfrom() (GH-139151)

7 weeks agogh-121237: Add `%:z` directive to datetime.strptime (#136961)
Semyon Moroz [Fri, 19 Sep 2025 09:25:31 +0000 (13:25 +0400)] 
gh-121237: Add `%:z` directive to datetime.strptime (#136961)

7 weeks agogh-119494: Fix error messages for deleting/setting type attributes (#119495)
da-woods [Thu, 18 Sep 2025 21:08:49 +0000 (22:08 +0100)] 
gh-119494: Fix error messages for deleting/setting type attributes (#119495)

7 weeks agogh-136003: Skip non-daemon threads when exceptions occur during finalization (GH...
Peter Bierma [Thu, 18 Sep 2025 20:04:01 +0000 (16:04 -0400)] 
gh-136003: Skip non-daemon threads when exceptions occur during finalization (GH-139129)

During finalization, we need to mark all non-daemon threads as daemon to quickly shut down threads when sending CTRL^C to the process. This was a minor regression from GH-136004.

7 weeks agogh-118803: Make `ByteString` deprecations louder; remove `ByteString` from `typing...
Alex Waygood [Thu, 18 Sep 2025 18:58:16 +0000 (19:58 +0100)] 
gh-118803: Make `ByteString` deprecations louder; remove `ByteString` from `typing.__all__` and `collections.abc.__all__` (#139127)

7 weeks agogh-118803: Improve documentation around `ByteString` deprecation (#139115)
Alex Waygood [Thu, 18 Sep 2025 17:29:59 +0000 (18:29 +0100)] 
gh-118803: Improve documentation around `ByteString` deprecation (#139115)

7 weeks agogh-137976: Explicitly exclude `localtime` from `available_timezones` (#138012)
Nicholas Tindle [Thu, 18 Sep 2025 16:32:14 +0000 (11:32 -0500)] 
gh-137976: Explicitly exclude `localtime` from `available_timezones` (#138012)

* fix: available_timezones is reporting an invalid IANA zone name

* đŸ“œđŸ€– Added by blurb_it.

* correct rst format for backticks

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
7 weeks agogh-129813, PEP 782: Use PyBytesWriter in socket recvmsg() (#139131)
Victor Stinner [Thu, 18 Sep 2025 15:57:04 +0000 (16:57 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in socket recvmsg() (#139131)

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

7 weeks agofixes gh-139090: add os.RWF_DONTCACHE (#139091)
Benjamin Peterson [Thu, 18 Sep 2025 15:13:23 +0000 (08:13 -0700)] 
fixes gh-139090: add os.RWF_DONTCACHE (#139091)

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#139121)
Victor Stinner [Thu, 18 Sep 2025 15:00:10 +0000 (16:00 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in bufferedio.c (#139121)

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

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _ssl (#138929)
Victor Stinner [Thu, 18 Sep 2025 14:54:18 +0000 (15:54 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _ssl (#138929)

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

7 weeks agogh-73487: Convert `_decimal` to use Argument Clinic (part 7) (#138221)
Sergey B Kirpichev [Thu, 18 Sep 2025 14:08:27 +0000 (17:08 +0300)] 
gh-73487: Convert `_decimal` to use Argument Clinic (part 7) (#138221)

Use "defining class" converter, where possible.

7 weeks agogh-64490: Argument Clinic: Add support for ``**kwds`` (#138344)
Adam Turner [Thu, 18 Sep 2025 13:31:42 +0000 (14:31 +0100)] 
gh-64490: Argument Clinic: Add support for ``**kwds`` (#138344)

This adds a scaffold of support, initially only working with
strictly positional-only arguments. The FASTCALL calling
convention is not yet supported.

7 weeks agogh-137242: Mention Android binary releases in documentation (#138305)
Malcolm Smith [Thu, 18 Sep 2025 13:25:30 +0000 (14:25 +0100)] 
gh-137242: Mention Android binary releases in documentation (#138305)

Adds a mention of binary releases to the Android documentation.

---------
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 weeks agogh-139109: Dynamic opcode targets (GH-139111)
Ken Jin [Thu, 18 Sep 2025 13:12:07 +0000 (21:12 +0800)] 
gh-139109: Dynamic opcode targets (GH-139111)

Make opcode targets table dynamic

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _sqlite (#138956)
Victor Stinner [Thu, 18 Sep 2025 12:58:35 +0000 (13:58 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _sqlite (#138956)

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

7 weeks agogh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Victor Stinner [Thu, 18 Sep 2025 12:33:07 +0000 (13:33 +0100)] 
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)

Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.

7 weeks agogh-136003: Execute pre-finalization callbacks in a loop (GH-136004)
Peter Bierma [Thu, 18 Sep 2025 12:29:12 +0000 (08:29 -0400)] 
gh-136003: Execute pre-finalization callbacks in a loop (GH-136004)

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in ssl.MemoryBIO (#139113)
Victor Stinner [Thu, 18 Sep 2025 12:25:31 +0000 (13:25 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in ssl.MemoryBIO (#139113)

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

7 weeks agoDocument `Py_AddPendingCall()` change with subinterpreters in 3.12 (GH-139117)
Peter Bierma [Thu, 18 Sep 2025 12:10:41 +0000 (08:10 -0400)] 
Document `Py_AddPendingCall()` change with subinterpreters in 3.12 (GH-139117)

Prior to 3.9, Py_AddPendingCall() would always run pending calls in the main interpreter, but then each interpreter got their own ceval state, and they were scheduled for any interpreter. In GH-104813, this was undone, so Py_AddPendingCall() would always schedule for the main interpreter.

7 weeks agogh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)
Peter Bierma [Thu, 18 Sep 2025 11:17:51 +0000 (07:17 -0400)] 
gh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)

7 weeks agogh-138970: Adjust tests for pegen rule flags (#139107)
Petr Viktorin [Thu, 18 Sep 2025 11:08:44 +0000 (13:08 +0200)] 
gh-138970: Adjust tests for pegen rule flags (#139107)

7 weeks agogh-139098: Use multiphase initialization in `_testcapi` (GH-139102)
Peter Bierma [Thu, 18 Sep 2025 11:00:50 +0000 (07:00 -0400)] 
gh-139098: Use multiphase initialization in `_testcapi` (GH-139102)

Use multiphase initialization in the _testcapi module to allow loading in subinterpreters. The isolation here isn't perfect as there's still some use of globals, but _testcapi should generally work in other interpreters.

7 weeks agogh-138998: `expat/refresh.sh`: Fail if Step 3 is not completed (GH-139049)
Stan Ulbrych [Thu, 18 Sep 2025 10:47:42 +0000 (11:47 +0100)] 
gh-138998: `expat/refresh.sh`: Fail if Step 3 is not completed (GH-139049)

7 weeks agogh-137838: Add CI for no-opt JIT (#139081)
Donghee Na [Thu, 18 Sep 2025 10:46:03 +0000 (11:46 +0100)] 
gh-137838: Add CI for no-opt JIT (#139081)

* gh-137838: Add CI for no-opt JIT

* nit

7 weeks agoMake Android streams respect the unbuffered (`-u`) option (#138806)
Malcolm Smith [Thu, 18 Sep 2025 10:41:21 +0000 (11:41 +0100)] 
Make Android streams respect the unbuffered (`-u`) option (#138806)

Android pipes stdout/stderr to the log, which means every write to the log
becomes a separate log line. As a result, most practical uses of stdout/stderr
should be buffered; but it doesn't hurt to preserve unbuffered handling in case
it's useful.

7 weeks agogh-138720: Make Buffered closed check match flush (GH-138724)
Cody Maloney [Thu, 18 Sep 2025 10:02:29 +0000 (03:02 -0700)] 
gh-138720: Make Buffered closed check match flush (GH-138724)

In `_io__Buffered_flush_impl` the macro `CHECK_CLOSED` is used to check
the `buffered*` is in a good state to be flushed. That differs slightly
from `buffered_closed`.

In some cases, that difference would result in `close()` thinking the
file needed to be flushed and closed while `flush()` thought the file
was already closed.

This could happen during GC and would result in an unraisable exception.

7 weeks agogh-129813, PEP 782: Optimize byteswriter_resize() (#139101)
Victor Stinner [Thu, 18 Sep 2025 09:52:16 +0000 (10:52 +0100)] 
gh-129813, PEP 782: Optimize byteswriter_resize() (#139101)

There is no need to copy the small_buffer in PyBytesWriter_Create().

7 weeks agogh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100)
Erlend E. Aasland [Thu, 18 Sep 2025 09:25:01 +0000 (10:25 +0100)] 
gh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100)

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _socket (#139097)
Victor Stinner [Thu, 18 Sep 2025 09:20:56 +0000 (10:20 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _socket (#139097)

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

7 weeks agoGH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)
Mark Shannon [Thu, 18 Sep 2025 09:09:59 +0000 (10:09 +0100)] 
GH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)

7 weeks agoRemove unmatched closing parenthesis (GH-139082)
Rafael Fontenelle [Thu, 18 Sep 2025 09:01:09 +0000 (06:01 -0300)] 
Remove unmatched closing parenthesis (GH-139082)

7 weeks agoRevert gh-139075. The sumprod fix needs more work. (gh-139092)
Raymond Hettinger [Thu, 18 Sep 2025 07:05:27 +0000 (02:05 -0500)] 
Revert gh-139075.  The sumprod fix needs more work. (gh-139092)

7 weeks agoRemove unnecessary slice in heapq.py (gh-139087)
Oleksandr Kravets [Thu, 18 Sep 2025 05:52:46 +0000 (01:52 -0400)] 
Remove unnecessary slice in heapq.py (gh-139087)

7 weeks agogh-138970: Add general metadata system to the peg generator (#138971)
Pablo Galindo Salgado [Thu, 18 Sep 2025 01:17:04 +0000 (02:17 +0100)] 
gh-138970: Add general metadata system to the peg generator (#138971)

7 weeks agogh-139074: Fix missing high precision case in sumprod() (gh-139075)
Raymond Hettinger [Wed, 17 Sep 2025 21:50:15 +0000 (16:50 -0500)] 
gh-139074: Fix missing high precision case in sumprod() (gh-139075)

7 weeks agogh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProc...
Denis Sergeev [Wed, 17 Sep 2025 21:45:52 +0000 (00:45 +0300)] 
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)

* gh-138813: Default `BaseProcess` `kwargs` to `None` (#138814)

Set `BaseProcess.__init__(..., kwargs=None)` and initialize `kwargs` with
`dict(kwargs) if kwargs else {}`. This avoids a shared mutable default and
matches threading.Thread behavior.

Co-authored-by: Dmitrii Chuprov <cheese@altlinux.org>
* DummyProcess kwargs=None (which threading.Thread accepts properly)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 weeks agoGH-138355: Remove trash_delete_later from _gc_runtime_state (#138767)
Sergey Miryanov [Wed, 17 Sep 2025 20:25:24 +0000 (13:25 -0700)] 
GH-138355: Remove trash_delete_later from _gc_runtime_state (#138767)

Remove trash_delete_later and trash_delete_nesting from _gc_runtime_state.

7 weeks agogh-137838: Move _PyUOpInstruction buffer to PyInterpreterState (gh-138918)
Donghee Na [Wed, 17 Sep 2025 17:50:16 +0000 (18:50 +0100)] 
gh-137838: Move _PyUOpInstruction buffer to PyInterpreterState (gh-138918)

7 weeks agogh-86819: Add ISO-TP CAN socket constants (#23794)
Stefan Tatschner [Wed, 17 Sep 2025 17:18:04 +0000 (19:18 +0200)] 
gh-86819: Add ISO-TP CAN socket constants (#23794)

Co-authored-by: Stefan Tatschner <stefan@rumpelsepp.org>
Co-authored-by: Patrick Menschel <menschel.p@posteo.de>
7 weeks agogh-138714: Don't assume next block has instructions when propagating line numbers...
Dino Viehland [Wed, 17 Sep 2025 16:52:56 +0000 (17:52 +0100)] 
gh-138714: Don't assume next block has instructions when propagating line numbers (#138770)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
7 weeks agoGH-137630: Convert ``_interpqueues`` to use Argument Clinic (#137685)
Adam Turner [Wed, 17 Sep 2025 16:35:00 +0000 (17:35 +0100)] 
GH-137630: Convert ``_interpqueues`` to use Argument Clinic (#137685)

7 weeks agoGH-139067: Add example for `argparse`'s `append` action (#131389)
Moshe Kaplan [Wed, 17 Sep 2025 16:24:20 +0000 (12:24 -0400)] 
GH-139067: Add example for `argparse`'s `append` action (#131389)

7 weeks agogh-129813, PEP 782: Set invalid bytes in PyBytesWriter (#139054)
Victor Stinner [Wed, 17 Sep 2025 15:58:32 +0000 (16:58 +0100)] 
gh-129813, PEP 782: Set invalid bytes in PyBytesWriter (#139054)

Initialize the buffer with 0xFF byte pattern when creating a writer
object, but also when resizing/growing the writer.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _testclinic (#139048)
Victor Stinner [Wed, 17 Sep 2025 15:55:30 +0000 (16:55 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _testclinic (#139048)

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

7 weeks agogh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738)
chiri [Wed, 17 Sep 2025 15:51:14 +0000 (18:51 +0300)] 
gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738)

The 'row' parameter represents a ROWID. Clarify this in docs and docstrings.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _multiprocessing (#139047)
Victor Stinner [Wed, 17 Sep 2025 15:44:13 +0000 (16:44 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _multiprocessing (#139047)

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

Change also 'read' variable type from int to Py_ssize_t.

7 weeks agogh-129813, PEP 782: Use PyBytesWriter in _Py_bytes_maketrans() (#139044)
Victor Stinner [Wed, 17 Sep 2025 15:43:30 +0000 (16:43 +0100)] 
gh-129813, PEP 782: Use PyBytesWriter in _Py_bytes_maketrans() (#139044)

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

7 weeks agogh-132558: Improve `argparse` docs on combining `type` and `choices` (#133827)
Hans Then [Wed, 17 Sep 2025 15:25:17 +0000 (17:25 +0200)] 
gh-132558: Improve `argparse` docs on combining `type` and `choices` (#133827)

Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
7 weeks agoGH-92266: Remove embedded tabs from ``c-analyzer/cpython/_parser.py`` (#137622)
Adam Turner [Wed, 17 Sep 2025 15:25:04 +0000 (16:25 +0100)] 
GH-92266: Remove embedded tabs from ``c-analyzer/cpython/_parser.py`` (#137622)

7 weeks agoAdd pganssle to CODEOWNERS for ``zoneinfo`` (#139032)
Paul Ganssle [Wed, 17 Sep 2025 15:17:27 +0000 (16:17 +0100)] 
Add pganssle to CODEOWNERS for ``zoneinfo`` (#139032)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 weeks agogh-137988: Fix const description in argparse.add_argument() docs (#138315)
PrinceNaroliya [Wed, 17 Sep 2025 15:15:57 +0000 (20:45 +0530)] 
gh-137988: Fix const description in argparse.add_argument() docs (#138315)

Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
7 weeks agogh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon...
Peter Bierma [Wed, 17 Sep 2025 15:14:19 +0000 (11:14 -0400)] 
gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606)

This reapplies GH-128640.

7 weeks agogh-131776: Expose functions called from the interpreter loop via PyAPI_FUNC (#134242)
Dino Viehland [Wed, 17 Sep 2025 15:04:02 +0000 (16:04 +0100)] 
gh-131776: Expose functions called from the interpreter loop via PyAPI_FUNC (#134242)

7 weeks agogh-138952: Document platform.machine() output casing inconsistency across platforms...
Aniket [Wed, 17 Sep 2025 14:56:21 +0000 (20:26 +0530)] 
gh-138952:  Document platform.machine() output casing inconsistency across platforms (#138962)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
7 weeks agogh-129368: In PyRun C API docs, clarify what a "start token" is (#129935)
Rajhans Jadhao [Wed, 17 Sep 2025 14:51:20 +0000 (20:21 +0530)] 
gh-129368: In PyRun C API docs, clarify what a "start token" is (#129935)

7 weeks agogh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten trampoli...
Hood Chatham [Wed, 17 Sep 2025 14:33:55 +0000 (16:33 +0200)] 
gh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten trampoline (#137470)

With https://github.com/llvm/llvm-project/pull/150201 being merged, there is
now a better way to generate the Emscripten trampoline, instead of including
hand-generated binary WASM content. Requires Emscripten 4.0.12.

7 weeks agogh-139006: Doc: Clarify html.escape function description (#139016)
PrinceNaroliya [Wed, 17 Sep 2025 13:45:34 +0000 (19:15 +0530)] 
gh-139006: Doc: Clarify html.escape function description (#139016)

Doc: Clarify html.escape function description (GH-139006)

7 weeks agogh-107862: Add property-based round-trip tests for base64 (#119406)
Petr Viktorin [Wed, 17 Sep 2025 13:40:35 +0000 (15:40 +0200)] 
gh-107862: Add property-based round-trip tests for base64 (#119406)

* Add property-based tests to test_base64

* Allow multiple positional arguments in @hypothesis.example stub

* Simplify the altchars strategy

7 weeks agogh-138896: Fix error installing C runtime on non-updated Windows machines (GH-138932)
adang1345 [Wed, 17 Sep 2025 13:32:52 +0000 (09:32 -0400)] 
gh-138896: Fix error installing C runtime on non-updated Windows machines (GH-138932)

7 weeks agogh-76760: test that `uuid.uuid1()` sets the version field (#139033)
BĂ©nĂ©dikt Tran [Wed, 17 Sep 2025 13:31:51 +0000 (15:31 +0200)] 
gh-76760: test that `uuid.uuid1()` sets the version field (#139033)

7 weeks agogh-134466: Don't run when termios is inaccessible (GH-138911)
Ɓukasz Langa [Wed, 17 Sep 2025 10:59:49 +0000 (11:59 +0100)] 
gh-134466: Don't run when termios is inaccessible (GH-138911)

Without the ability to set required capabilities, the REPL cannot
function properly (syntax highlighting and multiline editing can't
work).

We refuse to work in this degraded state.

7 weeks agogh-138998: Upgrade vendored expat to 2.7.2 (#138999)
Stan Ulbrych [Wed, 17 Sep 2025 10:46:35 +0000 (11:46 +0100)] 
gh-138998: Upgrade vendored expat to 2.7.2 (#138999)

7 weeks agogh-99948: Support ctypes.util.find_library in emscripten environment (#138519)
Gyeongjae Choi [Wed, 17 Sep 2025 10:17:56 +0000 (19:17 +0900)] 
gh-99948: Support ctypes.util.find_library in emscripten environment (#138519)

Adds support for ctypes loading .so files directly.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
7 weeks agoGH-123299: Copyedit 3.14 What's New: C API (#138987)
Adam Turner [Wed, 17 Sep 2025 10:14:57 +0000 (11:14 +0100)] 
GH-123299: Copyedit 3.14 What's New: C API (#138987)

7 weeks agogh-138966: Add description for `gi_suspended` attribute (GH-139008)
Donghoon Nam [Wed, 17 Sep 2025 08:21:52 +0000 (17:21 +0900)] 
gh-138966: Add description for `gi_suspended` attribute (GH-139008)

7 weeks agogh-71679: Share the repr implementation between bytes and bytearray (GH-138181)
Serhiy Storchaka [Wed, 17 Sep 2025 08:10:29 +0000 (11:10 +0300)] 
gh-71679: Share the repr implementation between bytes and bytearray (GH-138181)

This allows to use the smart quotes algorithm in the bytearray's repr.

7 weeks agogh-134716: Support regular expressions in -W and PYTHONWARNINGS (GH-138149)
Serhiy Storchaka [Tue, 16 Sep 2025 17:06:44 +0000 (20:06 +0300)] 
gh-134716: Support regular expressions in -W and PYTHONWARNINGS (GH-138149)

7 weeks agoRevert "gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804...
Alex Waygood [Tue, 16 Sep 2025 15:48:19 +0000 (16:48 +0100)] 
Revert "gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)" (#138990)

7 weeks agogh-137226: Fix get_type_hints() on generic TypedDict with stringified annotations...
Jelle Zijlstra [Tue, 16 Sep 2025 14:28:39 +0000 (07:28 -0700)] 
gh-137226: Fix get_type_hints() on generic TypedDict with stringified annotations (#138953)

This issue appears specifically for TypedDicts because the TypedDict constructor
code converts string annotations to ForwardRef objects, and those are not evaluated
properly by the get_type_hints() stack because of other shenanigans with type
parameters.

This issue does not affect normal generic classes because their annotations are not
pre-converted to ForwardRefs.

The fix attempts to restore the pre- #137227 behavior in the narrow scenario where
the issue manifests. It mostly makes changes only in the paths accessible from get_type_hints(),
ensuring that newer APIs (such as evaluate_forward_ref() and annotationlib) are not affected
by get_type_hints()'s past odd choices. This PR does not fix issue #138949, an older issue I
discovered while playing around with this one; we'll need a separate and perhaps more
invasive fix for that, but it should wait until after 3.14.0.

7 weeks agogh-138514: getpass: restrict `echo_char` to a single ASCII character (#138591)
Benjamin Johnson [Tue, 16 Sep 2025 14:21:55 +0000 (08:21 -0600)] 
gh-138514: getpass: restrict `echo_char` to a single ASCII character (#138591)

This amends commit bf8bbe9a813dd9fc2dd14be06df172b7d26ca1af by
restricting `echo_char` in `getpass.getpass` to single printable
ASCII characters as it would be uncommon to use long strings or
multi-byte characters for keyboard feedback.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
7 weeks agogh-129813, PEP 782: Add doc reference link (#138986)
Victor Stinner [Tue, 16 Sep 2025 13:51:45 +0000 (14:51 +0100)] 
gh-129813, PEP 782: Add doc reference link (#138986)

7 weeks agoAdds support for building with VisualStudioVersion = 18.0 (GH-138980)
Steve Dower [Tue, 16 Sep 2025 13:41:36 +0000 (14:41 +0100)] 
Adds support for building with VisualStudioVersion = 18.0 (GH-138980)

7 weeks agofix some typos (#138977)
AN Long [Tue, 16 Sep 2025 13:03:39 +0000 (22:03 +0900)] 
fix some typos (#138977)

7 weeks agogh-135629: rewrite language reference section on except* to improve clarity (#136150)
Irit Katriel [Tue, 16 Sep 2025 12:56:51 +0000 (13:56 +0100)] 
gh-135629: rewrite language reference section on except* to improve clarity (#136150)

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.