134010 Commits
Author SHA1 Message Date
6c695bfad4 gh-160561: Close the duplicated descriptor when socket.fromfd() fails (#160579)
Co-authored-by: wlkr73 <86650480+wlkr73@users.noreply.github.com>
Co-authored-by: lumenyr <86650480+lumenyr@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-27 22:56:42 +00:00
Cary Hawkins 926b0bf311 gh-159652: Fix import lock leak when the C stack is nearly exhausted (GH-159660)
When an import failed with a stack overflow RecursionError, releasing the import locks on the error path could itself raise RecursionError, because the cleanup runs in a new C frame. This left the global import lock or a module lock held forever, and later imports in other threads blocked indefinitely.

_imp.acquire_lock() now raises RecursionError when there is not enough stack left to release the lock. importlib calls it before taking any import lock, so this covers the per-module locks too. The module lock weakref callback skips cleanup in that case instead of
reporting an unraisable exception.
2026-10-27 14:43:36 -07:00
Brett Cannon 4521718ca5 GH-160135: Make sure the target triple makes it through configure (GH-160739) 2026-10-27 14:40:17 -07:00
techi101 d54c2d89b7 gh-126031: Mark argparse parameter headings as code (#160632) 2026-10-27 09:29:58 -07:00
Inada NaokiandStan Ulbrych 085d3665b1 Doc: Fix errors in documentation examples (#160742)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-27 19:54:33 +09:00
b5660533cc gh-141674: Docs: Add 'Python' to the <title> of the landing page (#141868)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-27 10:27:48 +00:00
Inada Naoki 085b291748 Docs: Fix indentation that produced unintended definition lists and block quotes (#160740)
* Fix documentation markup for translation
* Fix more documentation markup for translation
2026-10-27 18:47:20 +09:00
Jelle Zijlstra d9825d504a gh-160279: Keep the venv directory off the import path when running pip (#160282) 2026-10-27 05:02:50 +00:00
Itamar Oren 0e35313484 gh-160689 : Link only the bootstrap modules into the build helper programs (#160537)
The build-helper programs (`Programs/_freeze_module` and `_bootstrap_python`) don't need to link extension modules that they don't need.

This PR makes sure the helper programs get only the modules they need to do their job, regardless of what the build configuration sets for the final built runtime and interpreter.

This follows the same pattern as what `PCbuild/_freeze_module.vcxproj` does with `PC/config_minimal.c`, and lets "extra" builtin modules (from `Setup.local` or `MODULE_BUILDTYPE=static`) depend on frozen modules or `getpath`.
2026-10-26 15:09:33 -07:00
Rafael Fontenelle 3acc941f2b gh-130662: Remove unnecessary plus sign from a news entry (#160723) 2026-10-26 17:48:40 +00:00
Stan Ulbrych 862d5e5ed8 gh-159612: Remove macOS x86_64 from tail-call CI due to LLVM timeouts (#160713) 2026-10-26 16:38:45 +00:00
Alex Grönholm f4043ab1be gh-160659: Add tests for except* handlers that raise a BaseException (#160660) 2026-10-26 15:18:01 +00:00
Manoj K M 210e7ab2a5 Docs: Fix mimalloc allocator values and typos in C API init docs (#160666) 2026-10-26 15:04:54 +00:00
Vankudothu Adhi Naik b3683c0ffd gh-160682: Track running function objects in free-threaded GC (#160707) 2026-10-26 20:15:13 +05:30
Stan Ulbrych c5d09789ea Fix ignored error returns in sys initialization, _ctypes and _interpchannels (#160614) 2026-10-26 14:37:44 +00:00
mpage a9049ee4fb gh-160496: Clear inline values with atomic release stores (#160510) 2026-10-26 19:46:46 +05:30
Hugo van Kemenade c436e8d835 gh-159612: Remove macOS x86_64 from JIT CI due to LLVM timeouts (#160033) 2026-10-26 06:49:54 +02:00
Inada Naoki fbcc278daf Docs: remove incorrect GIL runtime flag requirement from glossary (#160661) 2026-10-26 13:32:26 +09:00
1c327a4464 gh-144650: Support vectorcall for _decimal.Decimal (#158207)
Co-authored-by: Cody Maloney <cmaloney@theoreticalchaos.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-10-26 00:29:42 +00:00
Gregory P. Smith d9cfd309f2 gh-160513: Call connection_lost() when start_tls() handshake is lost (GH-160514)
SSLProtocol.connection_lost() did not notify the application protocol
while a handshake was in progress, even when start_tls() had handed
over a protocol that had already seen connection_made().  With streams
this left StreamWriter.wait_closed() waiting forever.

ANT-2026-A6ZIAFVT
ANT-2026-4SKWM05E
2026-10-25 16:24:59 -07:00
sobolevn 7b12a415c8 gh-152631: Fix ast.parse on lazy imports with older feature_version (#152632) 2026-10-25 20:35:59 +00:00
tonghuaroot (童话)andStan Ulbrych bb7e16ace9 gh-153605: Fix gettext.GNUTranslations raising struct.error on a malformed .mo file (#153606)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-25 18:06:47 +00:00
Pengyu LeeandStan Ulbrych efbd165392 gh-151947: Fix all Sphinx reference warnings in email.{charset,parser}.rst (#152178)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-25 17:43:56 +00:00
Thomas KowalskiandStan Ulbrych d441a118fa gh-151126: Set MemoryError on allocation failure in CJK codec macros (#156292)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-10-25 17:36:04 +00:00
Ivy Xu b63ab245ec gh-110721: Remove undefined _Py_Offer_Suggestions in pycore_pyerrors.h (#154664) 2026-10-25 17:29:03 +00:00
Lysandros Nikolaou aa0e4109a8 gh-153568: Use a managed dict for AST nodes (#160616)
AST nodes had an explicit `__dict__` slot, so every node built by
`ast.parse` allocated its own dict. With `Py_TPFLAGS_MANAGED_DICT`,
node attributes are stored as inline values with shared keys instead.

`ast.parse` is ~15.8% faster, walking trees is ~15.9% faster, and
the memory used by the AST trees is reduced by ~51.6%.
2026-10-25 10:08:26 -07:00
An Long 2468c35c3b gh-150582: Use _winapi for _pyrepl console handles and waits (#150584) 2026-10-25 10:11:43 +00:00
Pengyu Lee ea3a97f245 gh-157354: Honor --with-<name>-sanitizer=no and --without-<name>-sanitizer in configure (#157355) 2026-10-25 09:56:45 +00:00
Gregory P. Smith d59d96853b gh-160300: Reject cookies with a negative version in http.cookiejar (GH-160301)
DefaultCookiePolicy only applied its domain checks to cookies with
version 0 or a positive version.

ANT-2026-TA36I7V7
2026-10-25 07:01:05 +00:00
Gregory P. Smith 9a235416c1 gh-159188: Do not immortalize constants in compile() of an AST (GH-159198)
In the free-threaded build, compile() of a source string sets
suppress_co_const_immortalization so that its output is the same as in
the default build.  The branch for AST objects returned before that, so
constants were replaced by the immortal ones of the interpreter's table
while a tuple of names (such as co_names) which was the same object was
not, and the marshal output depended on the code objects created before
in the process.
2026-10-24 23:59:27 -07:00
Gregory P. Smith ffe13151c0 gh-160520: Apply asyncio ssl_shutdown_timeout after peer EOF (GH-160521)
Keep the SSL shutdown timer running until connection_lost(), and start
it when the peer shuts down first, so that a peer which sends EOF but
does not read cannot keep a closed transport open indefinitely.

ANT-2026-81HUBBJ7
2026-10-24 22:53:46 -07:00
Gregory P. Smith 23a5ba1c93 gh-160549: Fix crash when freeing a busy multi-threaded ZstdCompressor (GH-160550)
ZSTD_freeCCtx() frees a dictionary loaded with ZSTD_CCtx_loadDictionary()
before it stops the worker threads.  Make libzstd wait for unfinished
jobs before freeing the compression context of a ZstdCompressor that
uses worker threads and a ZstdDict.

Works around https://github.com/facebook/zstd/issues/4862
2026-10-24 22:38:04 -07:00
Gregory P. Smith b949033ae8 gh-160535: Keep the ZstdDict alive until the zstd context is freed (GH-160536)
The garbage collector could release a ZstdCompressor's dictionary, or
the digested dictionaries cached by the ZstdDict, while worker threads
of the compression context were still reading them.  They are now only
released on deallocation, after the context has been freed.

ANT-2026-CT3P1CSJ

+ Visit the type in the compressor and decompressor traverse; move NEWS to Library
2026-10-24 22:31:45 -07:00
Inada NaokiandEmma Smith b26fc41b5c Remove obsolete and unused configure macros (#159513)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2026-10-25 05:18:16 +00:00
Gregory P. Smith 7159b152a0 gh-159963: Don't hold parent package import locks while a submodule executes (GH-159965)
Since gh-83065 (3.15.0), the first import of pkg.mod kept pkg's module
lock until pkg/mod.py had finished executing.  Threads that needed only
the finished pkg stayed blocked for that long, and concurrent first
imports could raise _DeadlockError or a spurious "partially initialized
module" ImportError, or hang, with no import cycle involved.

Parent packages are now imported, or waited for if another thread is
initializing them, before the submodule's module lock is taken, so only
that lock is held while the submodule executes.  The lock ordering
deadlock fixed by gh-83065 stays fixed.

importlib.import_module() now returns the partially initialized module
in a circular import split across threads, as the import statement
already did, instead of raising _DeadlockError.  That was long-standing
behavior rather than part of the 3.15.0 regression.
2026-10-24 17:06:37 -07:00
Gregory P. Smith 081f6fba35 gh-129724: improve the news entry wording for gh-159192 and gh-159193 (gh-160628)
improve the news entry wording for gh-159192 and gh-159193
2026-10-24 23:47:27 +00:00
Jelle Zijlstra 656af533dc gh-159739: Keep sqlite3 cursor metadata and factories valid during queries (#160403)
A cursor exposed its description tuple before filling in all the columns, so an allocation failure or a reader on a free-threaded build could encounter an unset tuple entry. An allocation failure could also clear lastrowid and crash the next execute. Build new metadata before replacing the old values and synchronize reads and writes. Keep a strong reference to each row or text factory while it is called so replacing the factory during a fetch cannot destroy an active callable.
2026-10-24 13:46:15 -07:00
Jelle Zijlstra 665bda98e8 gh-159739: Keep text I/O state valid across reentrant callbacks (#160398)
A raw read can reinitialize a TextIOWrapper as write-only, and codec callbacks or finalizers can release an encoder, decoder, or decoded chunk while a read or write still needs it. This can crash the interpreter. Check that a decoder is still available after reading, keep codecs alive across calls, and read the chunk length before transferring ownership. Also recheck StringIO after converting the truncate size because __index__() can close the stream.
2026-10-24 13:45:41 -07:00
Christian Heimes e2a9dd97ef gh-160040: Add ssl eMudhra distrust entry to whatsnew (#160583)
Signed-off-by: Christian Heimes <christian@python.org>
2026-10-24 12:50:02 -07:00
tonghuaroot (童话) 0d606d674d gh-153679: Raise ZipImportError for an invalid UTF-8 file name in zipimport (#153680) 2026-10-24 19:20:44 +00:00
Davi de Jesus 34889af658 gh-160588: Restore the gh-123022 check in the vendored mimalloc (#160589) 2026-10-24 20:49:51 +03:00
Zachary Ware f39dfa707b gh-159102: Shrink and optimize Tachyon example GIFs (#160540) 2026-10-24 18:31:32 +01:00
Nice Zombies 1063adbe90 gh-160586: Document version changes for pprint.pp (#160595) 2026-10-24 18:27:17 +01:00
An Long 11598362a3 gh-160596: Fix error message in asyncio.proactor_events.sendto() (#160597) 2026-10-24 15:12:39 +00:00
Neil Schemenauer 00c54508c6 gh-159564: Make weakref dereference lock-free. (#159578) 2026-10-24 14:56:31 +00:00
Aslan Osmanov 763fb33915 gh-160239: Remove dead _repr_info() methods from asyncio.windows_events (#160241) 2026-10-24 19:11:15 +05:30
Pieter Eendebak 0dd6a4d417 gh-87613: Use AC vectorcall for weakref.ref() (#159470) 2026-10-24 13:31:45 +00:00
Inada Naoki 94d16d2e13 gh-89977: Keep the GIL for short socket calls (#157981) 2026-10-24 20:51:24 +09:00
Christian Aurich Zanettini Martins eaab974e8a gh-159244: Fix crash in dict() on a concurrently mutated key/value pair (#159245)
In the free-threaded build, dict() and dict.update() checked that a
list key/value pair had two items and then read them with borrowed
references without holding its lock, so another thread could empty
the list in between and the items were read from a freed or NULL
array.
2026-10-24 20:02:10 +09:00
Michael Newman 94942ba7d9 Fix typo in C API Introduction documentation (#160563) 2026-10-24 09:42:11 +01:00