summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.13.7v3.13.7Thomas Wouters2025-08-141-2/+2
|
* Post 3.13.6Thomas Wouters2025-08-061-1/+1
|
* Python 3.13.6v3.13.6Thomas Wouters2025-08-061-2/+2
|
* [3.13] gh-136823: Update documentation on excluded headers in Python.h ↵Miss Islington (bot)2025-08-051-0/+1
| | | | | | | (GH-136824) (#137438) Co-authored-by: Sina Zel taat <111974143+SZeltaat@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* [3.13] Doc: fix duplicated words (GH-136086) (#137357)Brian Schubert2025-08-031-1/+1
| | | | | | (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.13] GH-133136: Revise QSBR to reduce excess memory held (gh-135473) ↵Neil Schemenauer2025-07-302-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | (gh-136480) 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>
* [3.13] gh-136759: revert rename `lock.h` to `pylock.h` (GH-137041) (#137075) ↵Kumar Aditya2025-07-284-3/+3
| | | | | | | (#137166) Revert "[3.13] gh-136759: rename `lock.h` to `pylock.h` (GH-137041) (#137075)" This reverts commit 74503acba7d6c563aeef307ccf2d0cee141838b0.
* [3.13] gh-136759: rename `lock.h` to `pylock.h` (GH-137041) (#137075)AN Long2025-07-244-3/+3
| | | | Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects. (cherry picked from commit ec02db5caa546cb4759999453bd6efc1d517b95c)
* [3.13] gh-135607: remove null checking of weakref list in dealloc of ↵Victor Stinner2025-07-011-0/+14
| | | | | | | | | | extension modules and objects (#135614) (#136126) 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.13] gh-125723: Fix crash with f_locals when generator frame outlive their ↵Mikhail Efimov2025-06-131-1/+1
| | | | | | | generator (GH-135453) Backport of 8e20e42cc63321dacc500d7670bfc225ca04e78b from GH-126956 Closes GH-125723
* Post 3.13.5Thomas Wouters2025-06-111-1/+1
|
* Python 3.13.5v3.13.5Thomas Wouters2025-06-111-2/+2
|
* [3.13] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135182)Victor Stinner2025-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)
* [3.13] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C ↵Victor Stinner2025-06-041-2/+12
| | | | | | | API (GH-135021) (#135134) gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (cherry picked from commit c21113072cd1f0da83729f99d3576647db85d816)
* [3.13] gh-133256: Add _Py_NONSTRING macro (#133257) (#135135)Victor Stinner2025-06-042-1/+25
| | | | | | | | | | | | | | | gh-133256: Add _Py_NONSTRING macro (#133257) Fix GCC 15 compiler warnings such as: In file included from Python/pylifecycle.c:26: Include/internal/pycore_runtime.h:47:26: warning: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (9 chars into 8 available) [-Wunterminated-string-initialization] 47 | #define _Py_Debug_Cookie "xdebugpy" | ^~~~~~~~~~ (cherry picked from commit e26bafd107aa86a4bdd6051848640f36a56d0efb)
* Post 3.13.4Thomas Wouters2025-06-031-1/+1
|
* Python 3.13.4v3.13.4Thomas Wouters2025-06-031-2/+2
|
* [3.13] gh-134875: Fix mimallc build error for the old compilers (gh-134994) ↵Miss Islington (bot)2025-06-031-2/+2
| | | | | | | | (gh-135054) 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.13] gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx ↵Miss Islington (bot)2025-05-202-5/+5
| | | | | | | | (GH-134238) (gh-134353) 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.13] gh-133767: Fix use-after-free in the unicode-escape decoder with an ↵Serhiy Storchaka2025-05-202-0/+17
| | | | | | | | | | | | | | | | | error handler (GH-129648) (GH-133944) 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.13] bpo-44172: Keep reference to original window in curses subwindow ↵Serhiy Storchaka2025-05-041-1/+2
| | | | | | | | | | | | | | | | | | | objects (GH-26226) (GH-133370) The X/Open curses specification[0] and ncurses documentation[1] both state that subwindows must be deleted before the main window. Deleting the windows in the wrong order causes a double-free with NetBSD's curses implementation. To fix this, keep track of the original window object in the subwindow object, and keep a reference to the original for the lifetime of the subwindow. [0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html [1] https://invisible-island.net/ncurses/man/curs_window.3x.html (cherry picked from commit 0af61fe2f41048d66b0a973bbff056690446d3df) Co-authored-by: Michael Forney <mforney@mforney.org>
* [3.13] gh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject ↵Donghee Na2025-04-291-0/+17
| | | | | | | | | | | | | | | | | | | (gh-133039) (gh-133126) * gh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject (gh-133039) --------- (cherry picked from commit 75cbb8d89e7e92ccaba5c615c72459f241dca8b1) Co-authored-by: Donghee Na <donghee.na@python.org> Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Add _PyObject_IsUniquelyReferenced --------- Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-131927: Prevent emitting compiler warnings twice (GH-131993) ↵Tomas R.2025-04-131-0/+6
| | | | | | (GH-132463) (cherry picked from commit 3d08c8ad20dfabd4864be139cd9c2eb5602ccdfe)
* Post 3.13.3Thomas Wouters2025-04-081-1/+1
|
* Python 3.13.3v3.13.3Thomas Wouters2025-04-081-2/+2
|
* [3.13] GH-127953: Make line number lookup O(1) regardless of the size of the ↵Mark Shannon2025-04-071-4/+5
| | | | | code object (#129127) GH-127953: Make line number lookup O(1) regardless of the size of the code object (GH-128350)
* [3.13] gh-131675: Fix `mi_atomic_yield` in mimalloc on 32-bit ARM ↵Miss Islington (bot)2025-03-311-7/+10
| | | | | | | | | | | | | (gh-131784) (gh-131954) Use the standard `__ARM_ARCH` macro, which is supported by GCC and Clang. The branching logic for of `__ARMEL__` has been removed so if the target architecture supports v7+ instructions, a yield is emitted, otherwise a nop is emitted. This covers both big and little endian scenarios. (cherry picked from commit 03f6c8e239723637811fd8d278661f5292351197) Signed-off-by: Vincent Fazio <vfazio@gmail.com> Co-authored-by: Vincent Fazio <vfazio@gmail.com>
* [3.13] gh-130940: Remove PyConfig.use_system_logger (#131129)Russell Keith-Magee2025-03-131-3/+0
| | | | | | | Removes ``PyConfig.use_system_logger``, resolving an ABI incompatibility introduced in 3.13.2. Changes the default behavior of iOS to *always* direct stdout/stderr to the system log.
* [3.13] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (GH-131044) ↵Miss Islington (bot)2025-03-112-2/+6
| | | | | | | (#131084) (cherry picked from commit de8818ae233b8e7722aa5d6f91d4b5a04bd039df) Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
* [3.13] gh-129296: Fix `pyatomic.h` include paths (GH-129320) (#130667)Miss Islington (bot)2025-02-282-4/+4
| | | | | | | | | | | | gh-129296: Fix `pyatomic.h` include paths (GH-129320) Use relative includes in Include/cpython/pyatomic.h for pyatomic_gcc.h, pyatomic_std.h and pyatomic_msc.h. Do a similar change in Include/cpython/pythread.h for pthread_stubs.h include. (cherry picked from commit 3a974e39d54902699f360bc4db2fd351a6baf3ef) Co-authored-by: Zanie Blue <contact@zanie.dev>
* [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) ↵Serhiy Storchaka2025-02-251-2/+5
| | | | | | | | | | (GH-130556) The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffeefd1737c18dc9326133c7894d58108c2e)
* [3.13] gh-130230: Fix crash in pow() with only Decimal third argument ↵Miss Islington (bot)2025-02-181-0/+1
| | | | | | | | (GH-130237) (GH-130246) (cherry picked from commit b93b7e566e5a4efe7f077af2083140e50bd2b08f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-128759: Fix accesses to `tp_version_tag`. (GH-129750) (GH-130042)Sam Gross2025-02-121-1/+72
| | | | | | | | | | We should use a relaxed atomic load in the free threading build in `PyType_Modified()` because that's called without the type lock held. It's not necessary to use atomics in `type_modified_unlocked()`. We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the `UINT32` variant because `tp_version_tag` is declared as `unsigned int`. (cherry picked from commit 57f45ee2d8ee23c2a1d1daba4095a5a044169419)
* [3.13] gh-129668: Fix thread-safety of MemoryError freelist in free threaded ↵Sam Gross2025-02-061-0/+3
| | | | | | | | | build (gh-129704) (gh-129742) The MemoryError freelist was not thread-safe in the free threaded build. Use a mutex to protect accesses to the freelist. Unlike other freelists, the MemoryError freelist is not performance sensitive. (cherry picked from commit 51b4edb1a4092f60d84f7d14eb41c12085e39c31)
* Post 3.13.2Thomas Wouters2025-02-041-1/+1
|
* Python 3.13.2v3.13.2Thomas Wouters2025-02-041-2/+2
|
* [3.13] gh-128679: Fix tracemalloc.stop() race conditions (#128897)Victor Stinner2025-01-181-1/+1
| | | | | | | | | | | | | tracemalloc_alloc(), tracemalloc_realloc(), PyTraceMalloc_Track(), PyTraceMalloc_Untrack() and _PyTraceMalloc_TraceRef() now check tracemalloc_config.tracing after calling TABLES_LOCK(). _PyTraceMalloc_Stop() now protects more code with TABLES_LOCK(), especially setting tracemalloc_config.tracing to 1. Add a test using PyTraceMalloc_Track() to test tracemalloc.stop() race condition. Call _PyTraceMalloc_Init() at Python startup.
* [3.13] gh-127599: Fix _Py_RefcntAdd missing calls to ↵Ed Nutting2025-01-182-0/+10
| | | | | | | | | _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (GH-127717) (#128713) Previously, `_Py_RefcntAdd` hasn't called `_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. Now it has been fixed. (cherry picked from commit ab05beb8cea62636bd86f6f7cf1a82d7efca7162)
* [3.13] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror ↵Miss Islington (bot)2024-12-171-0/+12
| | | | | | | | | | messages (GH-126746) (GH-128023) - Add a helper to set an error from locale-encoded `char*` - Use the helper for gdbm & dlerror messages (cherry picked from commit 7303f06846b69016a075bca7ad7c6055f29ad024) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows (#127994)Victor Stinner2024-12-161-1/+1
| | | | | | gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a compiler warning about an unnamed structure.
* [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) ↵Peter Bierma2024-12-111-0/+1
| | | | | | | | | | (#127819) * Fix merge conflicts. * [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) (cherry picked from commit d5d84c3f13fe7fe591b375c41979d362bc11957a) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-126076: Account for relocated objects in tracemalloc (GH-126077) ↵Pablo Galindo Salgado2024-12-111-5/+9
| | | | | (#127823) (cherry picked from commit 30aeb00d367d0cc9e5a7603371636cddea09f1c0)
* [3.13] Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772) (#127815)Miss Islington (bot)2024-12-111-0/+6
| | | | | | | | | Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772) Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61b57e638ae46a04386330a12abe9cddf2c) Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
* [3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)Russell Keith-Magee2024-12-091-0/+3
| | | | | | | | Adds a `use_system_log` config item to enable stdout/stderr redirection for Apple platforms. This log streaming is then used by a new iOS test runner script, allowing the display of test suite output at runtime. The iOS test runner script can be used by any Python project, not just the CPython test suite. (cherry picked from commit 2041a95e68ebf6d13f867e214ada28affa830669)
* [3.13] gh-127582: Make object resurrection thread-safe for free threading. ↵Sam Gross2024-12-051-0/+44
| | | | | | | | | | | | | | | (GH-127612) (GH-127659) Objects may be temporarily "resurrected" in destructors when calling finalizers or watcher callbacks. We previously undid the resurrection by decrementing the reference count using `Py_SET_REFCNT`. This was not thread-safe because other threads might be accessing the object (modifying its reference count) if it was exposed by the finalizer, watcher callback, or temporarily accessed by a racy dictionary or list access. This adds internal-only thread-safe functions for temporary object resurrection during destructors. (cherry picked from commit f4f530804b9d8f089eba0f157ec2144c03b13651)
* Post 3.13.1Thomas Wouters2024-12-031-1/+1
|
* Python 3.13.1v3.13.1Thomas Wouters2024-12-031-2/+2
|
* [3.13] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) ↵Miss Islington (bot)2024-12-031-0/+4
| | | | | | | | | | | (#122984) gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately. (cherry picked from commit ee1b8ce26e700350e47a5f65201097121c41912e) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.13] gh-126914: Store the Preallocated Thread State's Pointer in a ↵Eric Snow2024-12-021-0/+2
| | | | | | | PyInterpreterState Field (gh-127114) This approach eliminates the originally reported race. It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then. This is mostly a cherry-pick of 1c0a104 (AKA gh-126989). The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated. That avoids ABI disruption.
* [3.13] gh-125703: Correctly honour tracemalloc hooks on specialized DECREF ↵Miss Islington (bot)2024-12-021-0/+5
| | | | | | | | paths (GH-125704) (#125705) gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704) (cherry picked from commit f8ba9fb2ce6690d2dd05b356583e8e4790badad7) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>