]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 months agogh-80620: Support negative timestamps on windows in `time.gmtime`, `time.localtime... 143862/head
Peter Gessler [Thu, 15 Jan 2026 09:51:11 +0000 (03:51 -0600)] 
gh-80620: Support negative timestamps on windows in `time.gmtime`, `time.localtime`, and `datetime` module (#143463)

Previously, negative timestamps (representing dates before 1970-01-01) were
not supported on Windows due to platform limitations. The changes introduce a
fallback implementation using the Windows FILETIME API, allowing negative
timestamps to be correctly handled in both UTC and local time conversions.
Additionally, related test code is updated to remove Windows-specific skips
and error handling, ensuring consistent behavior across platforms.

Co-authored-by: Victor Stinner <vstinner@python.org>
2 months agoAdd regression test for add() after remove() with hash collision in set (GH-143781)
Serhiy Storchaka [Thu, 15 Jan 2026 08:41:08 +0000 (10:41 +0200)] 
Add regression test for add() after remove() with hash collision in set (GH-143781)

2 months agogh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840)
Muneeb Ullah [Thu, 15 Jan 2026 08:22:01 +0000 (13:22 +0500)] 
gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding  (GH-143840)

2 months agogh-143635: Fix crash in `ga_repr_items_list` (#143670)
sobolevn [Thu, 15 Jan 2026 03:50:47 +0000 (06:50 +0300)] 
gh-143635: Fix crash in `ga_repr_items_list` (#143670)

2 months agogh-141504: Refactor policy object into a single opt_config (gh-143644)
Donghee Na [Thu, 15 Jan 2026 00:53:00 +0000 (09:53 +0900)] 
gh-141504: Refactor policy object into a single opt_config (gh-143644)

2 months agogh-143632: Skip unittest for mmap.set_name at musl environment (gh-143839)
Donghee Na [Thu, 15 Jan 2026 00:52:29 +0000 (09:52 +0900)] 
gh-143632: Skip unittest for mmap.set_name at musl environment (gh-143839)

2 months agogh-141805: Fix crash after concurrent addition objects with the same hash to set...
Serhiy Storchaka [Wed, 14 Jan 2026 21:29:17 +0000 (23:29 +0200)] 
gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815)

This happens when the set contained several elements with the same hash,
and then some of them were removed.

2 months agogh-143825: Micro-optimizations to _make_key. (gh-143844)
Raymond Hettinger [Wed, 14 Jan 2026 21:20:53 +0000 (15:20 -0600)] 
gh-143825: Micro-optimizations to _make_key. (gh-143844)

2 months agoGH-143842: Make optimizer color table static (GH-143846)
Mohammad Miadh Angkad [Wed, 14 Jan 2026 20:37:13 +0000 (04:37 +0800)] 
GH-143842: Make optimizer color table static (GH-143846)

2 months agoAdd Savannah to CODEOWNERS for WASI (#143847)
Savannah Ostrowski [Wed, 14 Jan 2026 20:08:32 +0000 (12:08 -0800)] 
Add Savannah to CODEOWNERS for WASI (#143847)

2 months agoFix refleaks in new unicodedata classes added in gh-74902 (GH-143843)
Serhiy Storchaka [Wed, 14 Jan 2026 19:55:11 +0000 (21:55 +0200)] 
Fix refleaks in new unicodedata classes added in gh-74902 (GH-143843)

2 months agogh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc (gh-143730)
Priyanshu Singh [Wed, 14 Jan 2026 17:47:55 +0000 (23:17 +0530)] 
gh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc (gh-143730)

2 months agoPost 3.15.0a5
Hugo van Kemenade [Wed, 14 Jan 2026 17:30:22 +0000 (19:30 +0200)] 
Post 3.15.0a5

2 months agoPython 3.15.0a5 v3.15.0a5
Hugo van Kemenade [Wed, 14 Jan 2026 14:41:12 +0000 (16:41 +0200)] 
Python 3.15.0a5

2 months agogh-74902: Add Unicode Grapheme Cluster Break algorithm (GH-143076)
Serhiy Storchaka [Wed, 14 Jan 2026 14:37:57 +0000 (16:37 +0200)] 
gh-74902: Add Unicode Grapheme Cluster Break algorithm (GH-143076)

Add the unicodedata.iter_graphemes() function to iterate over grapheme
clusters according to rules defined in Unicode Standard Annex #29.

Add unicodedata.grapheme_cluster_break(), unicodedata.indic_conjunct_break()
and unicodedata.extended_pictographic() functions to get the properties
of the character which are related to the above algorithm.

Co-authored-by: Guillaume "Vermeille" Sanchez <guillaume.v.sanchez@gmail.com>
2 months agogh-141004: Document several soft-deprecated C APIs (GH-141634)
Peter Bierma [Wed, 14 Jan 2026 13:20:33 +0000 (08:20 -0500)] 
gh-141004: Document several soft-deprecated C APIs (GH-141634)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 months agogh-143214: Add the wrapcol parameter in binascii.b2a_base64() and base64.b64encode...
Serhiy Storchaka [Wed, 14 Jan 2026 12:44:53 +0000 (14:44 +0200)] 
gh-143214: Add the wrapcol parameter in binascii.b2a_base64() and base64.b64encode() (GH-143216)

2 months agogh-143123: Protect against recursive tracer calls/finalization (GH-143126)
Ken Jin [Wed, 14 Jan 2026 12:23:14 +0000 (20:23 +0800)] 
gh-143123: Protect against recursive tracer calls/finalization (GH-143126)

* Stronger check for recursive traces

* Add a stop_tracing field

* Stop early when tracing exceptions

2 months agoGH-143613: Add colours and some more edges to executor visualization graph (GH-143809)
Mark Shannon [Wed, 14 Jan 2026 11:34:58 +0000 (11:34 +0000)] 
GH-143613: Add colours and some more edges to executor visualization graph (GH-143809)

2 months agogh-106287: Do not write objects after an unmarshalling error (GH-132715)
Duane Griffin [Wed, 14 Jan 2026 11:25:46 +0000 (00:25 +1300)] 
gh-106287: Do not write objects after an unmarshalling error (GH-132715)

Writing out an object may involve a slot lookup, which is not safe to do with
an exception raised. In debug mode an assertion failure will occur if this
happens.

2 months agogh-138050: Use cold flag instead of warm flag in `MAKE_WARM` (GH-143827)
Hai Zhu [Wed, 14 Jan 2026 10:27:33 +0000 (18:27 +0800)] 
gh-138050: Use cold flag instead of warm flag in `MAKE_WARM` (GH-143827)

2 months agogh-141004: Document old provisional names for vectorcall/code API (GH-143568)
Petr Viktorin [Wed, 14 Jan 2026 09:54:45 +0000 (10:54 +0100)] 
gh-141004: Document old provisional names for vectorcall/code API (GH-143568)

gh-141004: Document old provisional names for vectorcall & code API

For vectorcall API, the underscore-prefixed provisional names
continue to be available per PEP 590:
https://peps.python.org/pep-0590/#finalizing-the-api
Use `versionadded`, `versionchanged`, and `:no-typesetting:`
to mark this up.

For PyCode API, use `:no-typesetting:` rather than `index::` so that
these are semantically documented as C functions.

2 months agogh-143460: Correct unlimited stack size skip for Emscripten (#143765)
Russell Keith-Magee [Tue, 13 Jan 2026 22:03:04 +0000 (06:03 +0800)] 
gh-143460: Correct unlimited stack size skip for Emscripten (#143765)

Modifies the test skip for unlimited stack size to add Emscripten to the
exclusion list.

2 months agogh-131798: JIT optimizer: Support custom binary op and property frames (GH-143735)
Ken Jin [Tue, 13 Jan 2026 19:11:53 +0000 (03:11 +0800)] 
gh-131798: JIT optimizer: Support custom binary op and property frames (GH-143735)

2 months agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Tue, 13 Jan 2026 18:44:19 +0000 (20:44 +0200)] 
Merge branch 'main' of https://github.com/python/cpython

2 months agoPost 3.15.0a4
Hugo van Kemenade [Tue, 13 Jan 2026 18:39:00 +0000 (20:39 +0200)] 
Post 3.15.0a4

2 months agogh-116738: Make `lzma` module thread-safe (#142947)
Alper [Tue, 13 Jan 2026 14:02:27 +0000 (06:02 -0800)] 
gh-116738: Make `lzma` module thread-safe (#142947)

2 months agogh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702)
Bartosz Sławecki [Tue, 13 Jan 2026 13:52:29 +0000 (14:52 +0100)] 
gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702)

2 months agoBump GitHub Actions (#143757)
Hugo van Kemenade [Tue, 13 Jan 2026 13:43:26 +0000 (15:43 +0200)] 
Bump GitHub Actions (#143757)

2 months agoremove duplicate error constants in `_winapi` (#143684)
Yongtao Huang [Tue, 13 Jan 2026 13:41:38 +0000 (21:41 +0800)] 
remove duplicate error constants in `_winapi` (#143684)

2 months agogh-141045: Document that shutil.Error is a subclass of OSError (#141152)
Lakshya Upadhyaya [Tue, 13 Jan 2026 13:38:26 +0000 (19:08 +0530)] 
gh-141045: Document that shutil.Error is a subclass of OSError (#141152)

2 months agogh-143249: Fix buffer leak when overlapped operation fails to start on windows (...
Yongtao Huang [Tue, 13 Jan 2026 13:31:24 +0000 (21:31 +0800)] 
gh-143249: Fix buffer leak when overlapped operation fails to start on windows (#143250)

2 months agogh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt...
Stan Ulbrych [Tue, 13 Jan 2026 13:28:09 +0000 (13:28 +0000)] 
gh-141004: Don't trigger `run-tests` when `Tools/check-c-api-docs/ignored_c_api.txt` is changed (GH-143583)

2 months agogh-143054: Disallow non-top-level Cut for now (GH-143622)
Petr Viktorin [Tue, 13 Jan 2026 12:21:59 +0000 (13:21 +0100)] 
gh-143054: Disallow non-top-level Cut for now (GH-143622)

The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.

And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).

Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.

2 months agogh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCA...
Yashraj [Tue, 13 Jan 2026 12:15:02 +0000 (17:45 +0530)] 
gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 months agoPython 3.15.0a4 v3.15.0a4
Hugo van Kemenade [Tue, 13 Jan 2026 10:26:31 +0000 (12:26 +0200)] 
Python 3.15.0a4

2 months agogh-132108: Add Buffer Protocol support to int.from_bytes to improve performance ...
Cody Maloney [Tue, 13 Jan 2026 09:33:26 +0000 (01:33 -0800)] 
gh-132108: Add Buffer Protocol support to int.from_bytes to improve performance (#132109)

Speed up conversion from `bytes-like` objects like `bytearray` while
keeping conversion from `bytes` stable.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 months agogh-141004: GHA: Run `check-c-api-docs` check on docs-only PRs (GH-143573)
Stan Ulbrych [Tue, 13 Jan 2026 09:18:48 +0000 (09:18 +0000)] 
gh-141004: GHA: Run `check-c-api-docs` check on docs-only PRs (GH-143573)

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2 months agogh-143658: importlib.metadata: Use `str.translate` to improve performance of `importl...
Hugo van Kemenade [Tue, 13 Jan 2026 06:54:15 +0000 (08:54 +0200)] 
gh-143658: importlib.metadata: Use `str.translate` to improve performance of `importlib.metadata.Prepared.normalized` (#143660)

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2 months agoUpdate random combinatoric recipes and add tests (gh-143762)
Raymond Hettinger [Mon, 12 Jan 2026 23:55:02 +0000 (17:55 -0600)] 
Update random combinatoric recipes and add tests (gh-143762)

2 months agogh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload...
Gregory P. Smith [Mon, 12 Jan 2026 23:47:21 +0000 (15:47 -0800)] 
gh-143706: Fix sys.argv not set during multiprocessing forkserver `__main__` preload (#143717)

The forkserver was not passing sys.argv to its main() function, causing
sys.argv to be empty during `__main__` module import in child processes. This
fixes a non-obvious regression inadvertently introduced by the gh-126631 main
preloading fix.

2 months agoBump automatic certificate update on Windows during builds (GH-143741)
Łukasz Langa [Mon, 12 Jan 2026 23:01:01 +0000 (00:01 +0100)] 
Bump automatic certificate update on Windows during builds (GH-143741)

Without this, OpenSSL that we use to download external dependencies might use a stale certificate store and be unable to connect to servers. We need to use a Windows-specific HTTP client that uses CryptoAPI directly to trigger certificate updates.

We only do it on failure to avoid hitting servers twice. And we only do it once per each URL.

2 months agoAdd Savannah to optimizer CODEOWNERS (#143761)
Savannah Ostrowski [Mon, 12 Jan 2026 22:56:05 +0000 (14:56 -0800)] 
Add Savannah to optimizer CODEOWNERS (#143761)

2 months agogh-134584: Add more contributors for JIT refcounting work (GH-143760)
Ken Jin [Mon, 12 Jan 2026 22:14:52 +0000 (06:14 +0800)] 
gh-134584: Add more contributors for JIT refcounting work (GH-143760)

2 months agogh-134584: Eliminate redundant refcounting in TO_BOOL_INT, TO_BOOL_LIST (GH-143759)
reiden [Mon, 12 Jan 2026 21:56:26 +0000 (22:56 +0100)] 
gh-134584: Eliminate redundant refcounting in TO_BOOL_INT, TO_BOOL_LIST (GH-143759)

2 months agoMinor readability/usability improvement to the recipes section (gh-143753)
Raymond Hettinger [Mon, 12 Jan 2026 20:12:23 +0000 (14:12 -0600)] 
Minor readability/usability improvement to the recipes section (gh-143753)

2 months agoGH-43374: Revert "GH-43374: Fix urlretrieve reporthook to report actual bytes r…...
Savannah Ostrowski [Mon, 12 Jan 2026 19:03:42 +0000 (11:03 -0800)] 
GH-43374: Revert "GH-43374: Fix urlretrieve reporthook to report actual bytes r… (#143711)

Revert "GH-43374: Fix urlretrieve reporthook to report actual bytes read (#142653)"

This reverts commit 68a01f901f446f71aac88431e01bb18b9fa35bd0.

2 months agogh-143196: Fix crash in non-standard use of internal JSON encoder object (GH-143618)
Serhiy Storchaka [Mon, 12 Jan 2026 18:23:05 +0000 (20:23 +0200)] 
gh-143196: Fix crash in non-standard use of internal JSON encoder object (GH-143618)

The internal encoder object returned by undocumented function
json.encoder.c_make_encoder() (aka _json.make_encoder()) crashed
when it was called with non-zero second argument.

2 months agogh-142461: Move misplaced NEWS entries to an appropriate section (GH-143411)
Aniket [Mon, 12 Jan 2026 18:13:44 +0000 (23:43 +0530)] 
gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143411)

2 months agogh-139707: Copy-strip change to idle.rst into idlelib (#143718)
Terry Jan Reedy [Mon, 12 Jan 2026 17:55:06 +0000 (12:55 -0500)] 
gh-139707: Copy-strip change to idle.rst into idlelib (#143718)

On Windows, running `python -c "from idlelib.help import copy_strip;
copy_strip()"` after idle.html is built results in
`f:\dev\3x\Doc\build\html\library\idle.html
copied to f:\dev\3x\Lib\idlelib\help.html`
This PR commits the html change to idlelib/help.html.

2 months agogh-140795: Remove 'exc' field in SSLObject (gh-143491)
Sam Gross [Mon, 12 Jan 2026 17:14:13 +0000 (12:14 -0500)] 
gh-140795: Remove 'exc' field in SSLObject (gh-143491)

The 'exc' field was used by our debug SSL callbacks. Keep the exception
in the normal per-thread state to avoid shared mutable state between
threads.

This also avoids a reference count leak if the Python callback raised an
exception because it can be called multiple times per SSL operation.

2 months agogh-142518: Document thread-safety guarantees of list operations (#142519)
Lysandros Nikolaou [Mon, 12 Jan 2026 16:43:05 +0000 (17:43 +0100)] 
gh-142518: Document thread-safety guarantees of list operations (#142519)

* Add everything to code blocks
* Improve wording around atomicity; specify exact types
* Better explain lock-free and atomicity

2 months agogh-134584: Eliminate redundant refcounting from `_CONTAINS_{OP|OP_SET|OP_DICT}` ...
Nadeshiko Manju [Mon, 12 Jan 2026 15:47:31 +0000 (23:47 +0800)] 
gh-134584: Eliminate redundant refcounting from `_CONTAINS_{OP|OP_SET|OP_DICT}` (GH-143731)

Signed-off-by: Manjusaka <me@manjusaka.me>
2 months agogh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disap...
VanshAgarwal24036 [Mon, 12 Jan 2026 15:39:32 +0000 (21:09 +0530)] 
gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (#143561)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 months agogh-143253: Add libabigail suppression file for internal types (#143254)
Pablo Galindo Salgado [Mon, 12 Jan 2026 15:37:43 +0000 (15:37 +0000)] 
gh-143253: Add libabigail suppression file for internal types (#143254)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 months agogh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142)
Kuang Yu Heng [Mon, 12 Jan 2026 15:30:35 +0000 (07:30 -0800)] 
gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142)

Add a note to the readline module documentation stating that
Python 3.13 and later no longer supports readline in the default REPL,
as per gh-118840. Includes workaround using PYTHON_BASIC_REPL.

Update tutorial to remove the reference, and use a different key to
test things out.

Signed-off-by: Kuang Yu Heng <yuheng3107@gmail.com>
2 months agogh-134584: JIT: Remove redundant refcount for _BINARY_OP_SUBSCR_DICT (GH-143724)
Cajetan Rodrigues [Mon, 12 Jan 2026 14:13:55 +0000 (15:13 +0100)] 
gh-134584: JIT: Remove redundant refcount for _BINARY_OP_SUBSCR_DICT (GH-143724)

2 months agogh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH...
Yashraj [Mon, 12 Jan 2026 12:59:59 +0000 (18:29 +0530)] 
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494)

2 months agogh-140806: add docs for `enum.bin` function (#140807)
Guo Ci [Mon, 12 Jan 2026 11:34:18 +0000 (06:34 -0500)] 
gh-140806: add docs for `enum.bin` function (#140807)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 months agogh-143189: fix insertdict() for non-Unicode key (#143285)
Inada Naoki [Mon, 12 Jan 2026 11:21:23 +0000 (20:21 +0900)] 
gh-143189: fix insertdict() for non-Unicode key (#143285)

2 months ago gh-143578: Restore note about patchlevel.h (#143596)
Petr Viktorin [Mon, 12 Jan 2026 11:21:14 +0000 (12:21 +0100)] 
 gh-143578: Restore note about patchlevel.h (#143596)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-142306: Improve errors for Element.remove() (GH-142308)
Serhiy Storchaka [Mon, 12 Jan 2026 09:49:18 +0000 (11:49 +0200)] 
gh-142306: Improve errors for Element.remove() (GH-142308)

* Raise TypeError for non-element argument in the Python implementation
  too.
* Include the repr of the elements in the ValueError error message.

2 months agogh-142881: Fix concurrent and reentrant call of atexit.unregister() (GH-142901)
Serhiy Storchaka [Mon, 12 Jan 2026 08:45:10 +0000 (10:45 +0200)] 
gh-142881: Fix concurrent and reentrant call of atexit.unregister() (GH-142901)

2 months agogh-143346: Fix calculation of the line width for wrapped Base64 in plistlib (GH-143347)
Serhiy Storchaka [Mon, 12 Jan 2026 08:40:06 +0000 (10:40 +0200)] 
gh-143346: Fix calculation of the line width for wrapped Base64 in plistlib (GH-143347)

It was incorrect in case of mixed tabs and spaces in indentation.

2 months agogh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704)
Ken Jin [Sun, 11 Jan 2026 20:42:55 +0000 (04:42 +0800)] 
gh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704)

2 months agogh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025)
Bartosz Sławecki [Sun, 11 Jan 2026 19:36:47 +0000 (20:36 +0100)] 
gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025)

2 months agogh-128335: Make slice generic at runtime (#128336)
James Hilton-Balfe [Sun, 11 Jan 2026 19:27:24 +0000 (19:27 +0000)] 
gh-128335: Make slice generic at runtime (#128336)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 months agogh-127750: Fix annotations in singledispatchmethod signature tests (GH-143571)
Bartosz Sławecki [Sun, 11 Jan 2026 19:24:19 +0000 (20:24 +0100)] 
gh-127750: Fix annotations in singledispatchmethod signature tests (GH-143571)

These tests relied on a bug -- gh-84644, which is that singledispatch
doesn't verify the annotation is on the "first" parameter.

2 months agogh-139038: Update JIT perf figures for 3.14a4 (GH-143705)
Ken Jin [Sun, 11 Jan 2026 18:55:05 +0000 (02:55 +0800)] 
gh-139038: Update JIT perf figures for 3.14a4 (GH-143705)

2 months agogh-143420: Clarify sequence behavior for slice indexes (#143422)
Sergey B Kirpichev [Sun, 11 Jan 2026 17:17:47 +0000 (20:17 +0300)] 
gh-143420: Clarify sequence behavior for slice indexes (#143422)

2 months agogh-86139: Correct NamedTuple and TypedDict's type in typing.rst (#143692)
AN Long [Sun, 11 Jan 2026 15:53:25 +0000 (00:53 +0900)] 
gh-86139: Correct NamedTuple and TypedDict's type in typing.rst (#143692)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 months agogh-78724: Raise RuntimeError's when calling methods on non-ready Struct()'s (GH-143643)
Sergey B Kirpichev [Sun, 11 Jan 2026 15:52:01 +0000 (18:52 +0300)] 
gh-78724: Raise RuntimeError's when calling methods on non-ready Struct()'s (GH-143643)

2 months agogh-143638: Forbid cuncurrent use of the Pickler and Unpickler objects in C implementa...
Serhiy Storchaka [Sun, 11 Jan 2026 12:01:13 +0000 (14:01 +0200)] 
gh-143638: Forbid cuncurrent use of the Pickler and Unpickler objects in C implementation (GH-143664)

Previously, this could cause crash or data corruption, now concurrent calls
of methods of the same object raise RuntimeError.

2 months agoRemove outdated comment about `excess_args` warning in `object.__init__` (#143669)
Manuel Jacob [Sun, 11 Jan 2026 07:27:11 +0000 (08:27 +0100)] 
Remove outdated comment about `excess_args` warning in `object.__init__` (#143669)

The code emitting a warning was removed in 96384b93aae1d1e45dda21c4024d7d083c91626d.

2 months agoSync the batched() example with the grouper() example. (gh-143676)
Raymond Hettinger [Sun, 11 Jan 2026 04:00:13 +0000 (22:00 -0600)] 
Sync the batched() example with the grouper() example. (gh-143676)

2 months agoAdd derangements() recipe (gh-143671)
Raymond Hettinger [Sun, 11 Jan 2026 01:47:27 +0000 (19:47 -0600)] 
Add derangements() recipe (gh-143671)

2 months agoDoc: remove duplicate GitHub issue reference in "What's New in Python 3.13" (#143654)
emmanuel [Sat, 10 Jan 2026 13:34:30 +0000 (22:34 +0900)] 
Doc: remove duplicate GitHub issue reference in "What's New in Python 3.13" (#143654)

2 months agogh-143377: fix crashes in `_interpreters.capture_exception` (#143418)
Bénédikt Tran [Sat, 10 Jan 2026 11:37:54 +0000 (12:37 +0100)] 
gh-143377: fix crashes in `_interpreters.capture_exception` (#143418)

2 months agogh-143604: Hold strong reference to executor during JIT tracing (GH-143646)
Nadeshiko Manju [Sat, 10 Jan 2026 11:15:48 +0000 (19:15 +0800)] 
gh-143604: Hold strong reference to executor during JIT tracing (GH-143646)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2 months agogh-143641: Make `ready_to_import` always remove tempdir from `sys.path` (#143642)
Jeong, YunWon [Sat, 10 Jan 2026 09:51:42 +0000 (18:51 +0900)] 
gh-143641: Make `ready_to_import` always remove tempdir from `sys.path` (#143642)

Make ready_to_import always remove tempdir from sys.path

2 months agogh-143586: Add Counter comparison tests to enforce missing element semantics (gh...
Heikki Toivonen [Sat, 10 Jan 2026 06:17:57 +0000 (22:17 -0800)] 
gh-143586: Add Counter comparison tests to enforce missing element semantics (gh-143587)

2 months agogh-142764: Restore REPLACE_OPCODE_IF_EVALUATES_PURE optimization for some ops (GH...
Ken Jin [Fri, 9 Jan 2026 23:18:22 +0000 (07:18 +0800)] 
gh-142764: Restore REPLACE_OPCODE_IF_EVALUATES_PURE optimization for some ops (GH-143335)

2 months agogh-143421: Allocate all JIT state in one go (GH-143626)
Ken Jin [Fri, 9 Jan 2026 19:00:49 +0000 (03:00 +0800)] 
gh-143421: Allocate all JIT state in one go (GH-143626)

2 months agogh-141004: Document remaining constants from patchlevel.h (GH-143598)
Petr Viktorin [Fri, 9 Jan 2026 17:40:07 +0000 (18:40 +0100)] 
gh-141004: Document remaining constants from patchlevel.h (GH-143598)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 months agogh-136438: Make sure `test_interpreters` pass with all optimization levels (GH-136499)
Semyon Moroz [Fri, 9 Jan 2026 17:06:54 +0000 (17:06 +0000)] 
gh-136438: Make sure `test_interpreters` pass with all optimization levels (GH-136499)

2 months agogh-143006: Fix and optimize mixed comparison of float and int (GH-143084)
Serhiy Storchaka [Fri, 9 Jan 2026 17:06:45 +0000 (19:06 +0200)] 
gh-143006: Fix and optimize mixed comparison of float and int (GH-143084)

When comparing negative non-integer float and int with the same number
of bits in the integer part, __neg__() in the int subclass returning
not an int caused an assertion error.

Now the integer is no longer negated. Also, reduced the number of
temporary created Python objects.

2 months agogh-143421: Lazily allocate tracer code and opt buffers (GH-143597)
Ken Jin [Fri, 9 Jan 2026 16:56:19 +0000 (00:56 +0800)] 
gh-143421: Lazily allocate tracer code and opt buffers (GH-143597)

2 months agogh-143460: Skip infinite recusion tests for infinite stack size (#143606)
Jan André Reuter [Fri, 9 Jan 2026 16:11:37 +0000 (17:11 +0100)] 
gh-143460: Skip infinite recusion tests for infinite stack size (#143606)

Avoid tests being killed due to OOM on Linux if a system is configured with
'ulimit -s unlimited' by skipping tests relying on infinite recursion.

While unclear if Python should support 'ulimit -s unlimited', we should at
least try to avoid failing a PGO build running tests due to an unlimited
stack size being set.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
3 months agogh-106318: Add examples for str.rfind() method (#143582)
Adorilson Bezerra [Fri, 9 Jan 2026 15:24:31 +0000 (15:24 +0000)] 
gh-106318: Add examples for str.rfind() method (#143582)

3 months ago gh-106318: Improve str.removeprefix() and str.removesuffix() docs (#143580)
Adorilson Bezerra [Fri, 9 Jan 2026 15:22:50 +0000 (15:22 +0000)] 
 gh-106318: Improve str.removeprefix() and str.removesuffix() docs (#143580)

Add doctest role and 'See also'.

3 months agogh-143191: Use _PyOS_MIN_STACK_SIZE in _thread.stack_size() (#143601)
Victor Stinner [Fri, 9 Jan 2026 15:08:40 +0000 (16:08 +0100)] 
gh-143191: Use _PyOS_MIN_STACK_SIZE in _thread.stack_size() (#143601)

The stack size must be at least _PyOS_MIN_STACK_SIZE+SYSTEM_PAGE_SIZE
bytes.

3 months agogh-142829: Fix use-after-free in `Context.__eq__` via re-entrant `ContextVar.set...
A.Ibrahim [Fri, 9 Jan 2026 12:27:34 +0000 (13:27 +0100)] 
gh-142829: Fix use-after-free in `Context.__eq__` via re-entrant `ContextVar.set` (#142905)

3 months agogh-72239: Add note distinguishing concurrent.futures.Future from asyncio.Future ...
AN Long [Fri, 9 Jan 2026 12:18:32 +0000 (21:18 +0900)] 
gh-72239: Add note distinguishing concurrent.futures.Future from asyncio.Future (#143288)

3 months agogh-143547: Fix PyErr_FormatUnraisable() fallback (#143557)
Victor Stinner [Fri, 9 Jan 2026 12:16:22 +0000 (13:16 +0100)] 
gh-143547: Fix PyErr_FormatUnraisable() fallback (#143557)

Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

Fix test_sys.UnraisableHookTest: use the right decorator function to
disable colors. Previously, tests were always skipped.

3 months agogh-143378: Fix use-after-free when BytesIO is concurrently mutated during write opera...
zhong [Fri, 9 Jan 2026 11:50:56 +0000 (03:50 -0800)] 
gh-143378: Fix use-after-free when BytesIO is concurrently mutated during write operations (GH-143408)

PyObject_GetBuffer() can execute user code (e.g. via __buffer__), which may
close or otherwise mutate a BytesIO object while write() or writelines()
is in progress. This could invalidate the internal buffer and lead to a
use-after-free.

Ensure that PyObject_GetBuffer() is called before validation checks.

3 months agogh-143429: Use compile-time NaN encoding detection for test_struct (#143432)
Henry Chen [Fri, 9 Jan 2026 10:46:48 +0000 (18:46 +0800)] 
gh-143429: Use compile-time NaN encoding detection for test_struct (#143432)

3 months agogh-141004: Improve `make check-c-api-docs` (GH-143564)
Petr Viktorin [Fri, 9 Jan 2026 10:16:50 +0000 (11:16 +0100)] 
gh-141004: Improve `make check-c-api-docs` (GH-143564)

- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

3 months agoTest: remove unintended unittest.main() in live collector tests (#143590)
Yongtao Huang [Fri, 9 Jan 2026 08:49:54 +0000 (16:49 +0800)] 
Test: remove unintended unittest.main() in live collector tests (#143590)

3 months agogh-106318: Add examples for str.replace() method (GH-143581)
Adorilson Bezerra [Fri, 9 Jan 2026 08:01:00 +0000 (08:01 +0000)] 
gh-106318: Add examples for str.replace() method (GH-143581)

3 months agoGH-43374: Fix urlretrieve reporthook to report actual bytes read (#142653)
Savannah Ostrowski [Fri, 9 Jan 2026 00:32:05 +0000 (16:32 -0800)] 
GH-43374: Fix urlretrieve reporthook to report actual bytes read (#142653)