summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.14.0rc2v3.14.0rc2Hugo van Kemenade2025-08-141-2/+2
|
* [3.14] gh-137288: Update version in magic number log (GH-137665) (#137667)Petr Viktorin2025-08-121-1/+1
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* [3.14] gh-137288: Fix bug where boolean expressions are not associated with ↵Irit Katriel2025-08-121-1/+2
| | | | | | | the correct exception handler (GH-137310). (#137427) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* Post 3.14.0rc1Hugo van Kemenade2025-07-221-1/+1
|
* Python 3.14.0rc1v3.14.0rc1Hugo van Kemenade2025-07-221-3/+3
|
* [3.14] gh-134009: Expose `PyMutex_IsLocked` in the public C API (gh-134365) ↵Hugo van Kemenade2025-07-222-7/+11
| | | | | | (#136971) Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.14] gh-133296: Publicly expose critical section API that accepts PyMutex ↵Miss Islington (bot)2025-07-222-12/+22
| | | | | | | (gh-135899) (#136969) Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* [3.14] gh-136421: Load `_datetime` static types during interpreter ↵Miss Islington (bot)2025-07-211-0/+1
| | | | | | | | | | initialization (GH-136583) (GH-136943) gh-136421: Load `_datetime` static types during interpreter initialization (GH-136583) `_datetime` is a special module, because it's the only non-builtin C extension that contains static types. As such, it would initialize static types in the module's execution function, which can run concurrently. Since static type initialization is not thread-safe, this caused crashes. This fixes it by moving the initialization of `_datetime`'s static types to interpreter startup (where all other static types are initialized), which is already properly protected through other locks. (cherry picked from commit a10960699a2b3e4e62896331c4f9cfd162ebf440) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.14] GH-133136: Revise QSBR to reduce excess memory held (gh-135473) (#135912)Miss Islington (bot)2025-07-082-7/+26
| | | | | | | | | | | | | | | | | | | | The free threading build uses QSBR to delay the freeing of dictionary keys and list arrays when the objects are accessed by multiple threads in order to allow concurrent reads to proceed with holding the object lock. The requests are processed in batches to reduce execution overhead, but for large memory blocks this can lead to excess memory usage. Take into account the size of the memory block when deciding when to process QSBR requests. Also track the amount of memory being held by QSBR for mimalloc pages. Advance the write sequence if this memory exceeds a limit. Advancing the sequence will allow it to be freed more quickly. Process the held QSBR items from the "eval breaker", rather than from `_PyMem_FreeDelayed()`. This gives a higher chance that the global read sequence has advanced enough so that items can be freed. (cherry picked from commit 113de8545ffe74a4a1dddb9351fa1cbd3562b621) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
* Post 3.14.0b4Hugo van Kemenade2025-07-081-1/+1
|
* Python 3.14.0b4v3.14.0b4Hugo van Kemenade2025-07-081-2/+2
|
* [3.14] gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892) ↵Miss Islington (bot)2025-07-072-3/+3
| | | | | | | | | | | | | | (GH-136392) gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- (cherry picked from commit fe187fae8d8321f1b8d3c9560a35efe904de4217) Co-authored-by: Charlie Lin <tuug@gmx.us> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.14] GH-133932: Tagged ints are heap safe (GH-134244) (#134494)Miss Islington (bot)2025-07-071-13/+7
| | | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.14] gh-127705: Move Py_INCREF_MORTAL() to the internal C API (GH-136178) ↵Miss Islington (bot)2025-07-033-18/+18
| | | | | | | | | | | (#136206) gh-127705: Move Py_INCREF_MORTAL() to the internal C API (GH-136178) Rename Py_INCREF_MORTAL() to _Py_INCREF_MORTAL() and move it to pycore_object.h internal header. (cherry picked from commit fa43a1e0f8caf00a15898fa719e31767c866bd90) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.14] gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers ↵Miss Islington (bot)2025-07-013-24/+26
| | | | | | | | | | | | | (GH-135928) (#136173) gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers (GH-135928) Move PYOS_LOG2_STACK_MARGIN, PYOS_STACK_MARGIN, PYOS_STACK_MARGIN_BYTES and PYOS_STACK_MARGIN_SHIFT macros to pycore_pythonrun.h internal header. Add underscore (_) prefix to the names to make them private. Rename _PYOS to _PyOS. (cherry picked from commit 28940e8e4884eb3444a8ea15a5634f76b154d7ed) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.14] gh-135755: Use private names (_Py*) for header file guards new in ↵Miss Islington (bot)2025-07-013-9/+9
| | | | | | | | 3.14 (GH-135921) (GH-135976) These are private API; let's name new ones accordingly. (cherry picked from commit 6be17baeb5bcfc78f0b7fcfe5221df0744c865e8) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.14] gh-135607: remove null checking of weakref list in dealloc of ↵Victor Stinner2025-06-301-0/+14
| | | | | | | | | | extension modules and objects (#135614) (#136119) gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (cherry picked from commit b1056c2a446b43452e457d5fd5f1bde66afd3883) Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* [3.14] Doc: fix duplicated words (GH-136086) (#136108)Miss Islington (bot)2025-06-292-2/+2
| | | | | | | | | Doc: fix duplicated words (GH-136086) --------- (cherry picked from commit 698bab5a4031c8f54e04e1dd42bcbe3e4564eba5) Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.14] gh-91048: Fix external inspection multi-threaded performance ↵Pablo Galindo Salgado2025-06-284-0/+7
| | | | | (GH-136005) (#136080) (cherry picked from commit 5334732f9c8a44722e4b339f4bb837b5b0226991)
* [3.14] gh-135755: Move `PyFunction_GET_BUILTINS` to the private API ↵Miss Islington (bot)2025-06-262-5/+5
| | | | | | | (GH-135938) (GH-135972) (cherry picked from commit 10a3d431881bb9169abde97f85ea6a670e1ef3cc) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.14] gh-131591: Add Py_ prefix to MAX_SCRIPT_PATH_SIZE; remove unprefixed ↵Miss Islington (bot)2025-06-262-4/+4
| | | | | | | | | struct tag (GH-135924) (GH-135969) Names/macros defined in public headers should have `Py`/`_Py` prefixes. (cherry picked from commit a1da208eec3028b1ecae804d4c0dc6b43cdddae9) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.14] gh-135755: Move SPECIAL_ constants to a private header (GH-135922) ↵Petr Viktorin2025-06-252-7/+7
| | | | | | (GH-135926) Macros without a `Py`/`_Py` prefix should not be defined in public headers. (cherry picked from commit 1b1ae82fab0093924b8b89eb1c7eea11d7be7b18)
* Post 3.14.0b3Hugo van Kemenade2025-06-171-1/+1
|
* Python 3.14.0b3v3.14.0b3Hugo van Kemenade2025-06-171-2/+2
|
* [3.14] gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals ↵Miss Islington (bot)2025-06-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | (gh-135593) For several builtin functions, we now fall back to __main__.__dict__ for the globals when there is no current frame and _PyInterpreterState_IsRunningMain() returns true. This allows those functions to be run with Interpreter.call(). The affected builtins: * exec() * eval() * globals() * locals() * vars() * dir() We take a similar approach with "stateless" functions, which don't use any global variables. (cherry picked from commit a450a0ddec, AKA gh-135491) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.14] gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135492)Miss Islington (bot)2025-06-141-17/+20
| | | | | | | | | | | | | | In this refactor we: * move some code around * make a couple of typedefs opaque * decouple errors from session state * improve tracebacks for propagated exceptions This change helps simplify several upcoming changes. (cherry picked from commit c7f4a80079, AKA gh-135369) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.14] gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973) (#134974)Victor Stinner2025-06-091-0/+4
| | | | | | | | | | | gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973) Replace most PyUnicodeWriter_WriteUTF8() calls with PyUnicodeWriter_WriteASCII(). (cherry picked from commit f49a07b531543dd8a42d90f5b1c89c0312fbf806) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.14] gh-134889: Fix handling of a few opcodes when optimizing `LOAD_FAST` ↵mpage2025-06-051-1/+2
| | | | | | | (#134958) (#135187) We were incorrectly handling a few opcodes that leave their operands on the stack. Treat all of these conservatively; assume that they always leave operands on the stack. (cherry picked from commit 6b77af257c25d31f1f137e477cb23e63692ddf29)
* [3.14] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135178)Miss Islington (bot)2025-06-052-5/+17
| | | | | | | | | | gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) Fix Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE macros in the limited C API 3.11 and older: Don't treat Py_None, Py_True and Py_False as immortal. (cherry picked from commit 9258f3da9175134d03f2c8c7c7eed223802ad945) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.14] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C ↵Miss Islington (bot)2025-06-041-2/+12
| | | | | | | | API (GH-135021) (#135133) gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (cherry picked from commit c21113072cd1f0da83729f99d3576647db85d816) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.14] gh-134875: Fix mimallc build error for the old compilers (gh-134994) ↵Miss Islington (bot)2025-06-031-2/+2
| | | | | | | | (gh-135053) gh-134875: Fix mimallc build error for the old compilers (gh-134994) (cherry picked from commit b525e31b7fc50e7a498f8b9b16437cb7b9656f6f) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.14] gh-132775: Expand the Capability of Interpreter.call() (gh-134933)Miss Islington (bot)2025-05-301-8/+27
| | | | | | | It now supports most callables, full args, and return values. (cherry picked from commit 52deabe, AKA gh-133484) Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
* [3.14] GH-133912: Fix `PyObject_GenericSetDict` to handle inline values ↵Miss Islington (bot)2025-05-291-0/+2
| | | | (GH-134725) (#134859)
* Merge branch '3.14' of https://github.com/python/cpython into 3.14Hugo van Kemenade2025-05-264-0/+7
|\
| * [3.14] gh-91048: Add better error messages for remote debugging for CI ↵Miss Islington (bot)2025-05-264-0/+7
| | | | | | | | builds (GH-134682) (#134719)
* | Post 3.14.0b2Hugo van Kemenade2025-05-261-1/+1
| |
* | Python 3.14.0b2v3.14.0b2Hugo van Kemenade2025-05-261-2/+2
|/
* [3.14] gh-91048: Refactor and optimize remote debugging module (#134652) ↵Pablo Galindo Salgado2025-05-257-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#134673) gh-91048: Refactor and optimize remote debugging module (#134652) Completely refactor Modules/_remote_debugging_module.c with improved code organization, replacing scattered reference counting and error handling with centralized goto error paths. This cleanup improves maintainability and reduces code duplication throughout the module while preserving the same external API. Implement memory page caching optimization in Python/remote_debug.h to avoid repeated reads of the same memory regions during debugging operations. The cache stores previously read memory pages and reuses them for subsequent reads, significantly reducing system calls and improving performance. Add code object caching mechanism with a new code_object_generation field in the interpreter state that tracks when code object caches need invalidation. This allows efficient reuse of parsed code object metadata and eliminates redundant processing of the same code objects across debugging sessions. Optimize memory operations by replacing multiple individual structure copies with single bulk reads for the same data structures. This reduces the number of memory operations and system calls required to gather debugging information from the target process. Update Makefile.pre.in to include Python/remote_debug.h in the headers list, ensuring that changes to the remote debugging header force proper recompilation of dependent modules and maintain build consistency across the codebase. Also, make the module compatible with the free threading build as an extra :) Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 42b25ad4d3d6bcdc28ddfe07d2bf8831378bb0d1)
* [3.14] gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286) ↵Miss Islington (bot)2025-05-251-0/+8
| | | | | | | | | (#134348) gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (GH-134286) (cherry picked from commit dd7f1130570d50461b2a0f81ab01c55b9ce93700) Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.14] GH-130397: remove special-casing of C stack depth for WASI ↵Miss Islington (bot)2025-05-221-3/+0
| | | | | | | | | | | | (GH-134469) (GH-134547) GH-130397: remove special-casing of C stack depth for WASI (GH-134469) Removed special-casing for WASI when setting C stack depth limits. Since WASI has its own C stack checking this isn't a security risk. Also disabled some tests that stopped passing. They all happened to have already been disabled under Emscripten. (cherry picked from commit ad42dc1909bdf8ec775b63fb22ed48ff42797a17) Co-authored-by: Brett Cannon <brett@python.org>
* [3.14] gh-132775: Make _PyXI_session Opaque (gh-134522)Miss Islington (bot)2025-05-221-50/+8
| | | | | | | | | | | | | This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code. Making the session opaque requires adding the following internal-only functions: * _PyXI_NewSession() * _PyXI_FreeSession() * _PyXI_GetMainNamespace() (cherry picked from commit 4a4ac3ab4d, gh-134452) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.14] gh-132775: Use _PyFunction_VerifyStateless() and ↵Miss Islington (bot)2025-05-211-2/+2
| | | | | | | _PyCode_VerifyStateless() (gh-134465) (cherry picked from commit a66bae8bb, AKA gh-134439) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.14] gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-134418)Miss Islington (bot)2025-05-212-4/+25
| | | | | | | | It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`. There's also room for other fallback modes if that later makes sense. (cherry picked from commit 88f8102a8f, AKA gh-133482) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.14] gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx ↵Miss Islington (bot)2025-05-202-5/+5
| | | | | | | | (GH-134238) (gh-134352) gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (GH-134238) (cherry picked from commit 317c49622397222b7c7fb49837e6b1fd7e82a80d) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.14] gh-132983: Convert zstd ``__new__`` methods to Argument Clinic ↵Miss Islington (bot)2025-05-204-7/+0
| | | | | (GH-133860) (#133915) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a ↵Steve Dower2025-05-191-0/+13
| | | | | | static header. (GH-133966) Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds. This was usually the case already, but this change guarantees it in all circumstances.
* [3.14] gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044) ↵Miss Islington (bot)2025-05-191-0/+29
| | | | | (#134228) * gh-128045: Mark unknown opcodes as deopting to themselves (GH-128044)
* [3.14] gh-132641: fix race in `lru_cache` under free-threading (GH-133787) ↵Miss Islington (bot)2025-05-141-0/+2
| | | | | | | | | | (#133979) gh-132641: fix race in `lru_cache` under free-threading (GH-133787) Fix race in `lru_cache` by acquiring critical section on the cache object itself and call the lock held variant of dict functions to modify the underlying dict. (cherry picked from commit 9ad0c7b0f14c5fcda6bfae6692c88abb95502d38) Co-authored-by: Peter Hawkins <phawkins@google.com>
* [3.14] gh-133767: Fix use-after-free in the unicode-escape decoder with an ↵Miss Islington (bot)2025-05-132-6/+11
| | | | | | | | | | | | | | | | | error handler (GH-129648) (GH-133942) If the error handler is used, a new bytes object is created to set as the object attribute of UnicodeDecodeError, and that bytes object then replaces the original data. A pointer to the decoded data will became invalid after destroying that temporary bytes object. So we need other way to return the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal(). _PyBytes_DecodeEscape() does not have such issue, because it does not use the error handlers registry, but it should be changed for compatibility with _PyUnicode_DecodeUnicodeEscapeInternal(). (cherry picked from commit 9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.14] gh-132775: Add _PyFunction_GetXIData() (gh-133955)Miss Islington (bot)2025-05-121-0/+7
| | | | | (cherry picked from commit 8cf4947b0f, AKA gh-133481) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>