| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
descriptor in a specialized code path (GH-132000) (#132262)
(cherry picked from commit ac3c439cdfee8452f2bcceacd67a1f4e423ac3cf)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
| |
|
|
|
| |
(cherry picked from commit bc5233b6a5cdd8f77a4737ce317f94110869c082)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
| |
code object (#129127)
GH-127953: Make line number lookup O(1) regardless of the size of the code object (GH-128350)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
gh-131988: Fix a multithreaded scaling regression
The 3.13 free threaded build immortalizes certain objects to avoid
reference count contention. In gh-127114 the condition was
unintentionally changed to happen when the first thread was created
instead of the first non-main thread. The `interp->gc.immortalize` field
is then cleared again during `_PyGC_Init()`.
Change the condition so that we check if we should immortalize objects
using deferred reference counting whenever a non-main thread is created.
|
| |
|
|
|
|
|
|
|
|
| |
(GH-132018) (#132161)
* [3.13] gh-132011: Fix crash on invalid `CALL_LIST_APPEND` deoptimization (GH-132018)
(cherry picked from commit c0661df42ad20e488dbfa3e0fec22462833fc3d6)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CPython's pthread-based thread identifier relies on pthread_t being able
to be represented as an unsigned integer type.
This is true in most Linux libc implementations where it's defined as an
unsigned long, however musl typedefs it as a struct *.
If the pointer has the high bit set and is cast to PyThread_ident_t, the
resultant value can be sign-extended [0]. This can cause issues when
comparing against threading._MainThread's identifier. The main thread's
identifier value is retrieved via _get_main_thread_ident which is backed
by an unsigned long which truncates sign extended bits.
>>> hex(threading.main_thread().ident)
'0xb6f33f3c'
>>> hex(threading.current_thread().ident)
'0xffffffffb6f33f3c'
Work around this by conditionally compiling in some code for non-glibc
based Linux platforms that are at risk of sign-extension to return a
PyLong based on the main thread's unsigned long thread identifier if the
current thread is the main thread.
[0]: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Arrays-and-pointers-implementation.html
---------
(cherry picked from commit 72123063ddee84bb2c9d591a23f420997e35af5a)
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Co-authored-by: Vincent Fazio <vfazio@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-128744) (#132085)
(cherry picked from commit 891c61c1fa480928dd60cce8bbc8764630c95025)
Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-132003) (#132007)
gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (GH-132003)
(cherry picked from commit ab2a3dda1d3b6668162a847bf5b6aca2855a3416)
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| |
|
|
|
|
| |
gh-131818: Add imply `-P` in `-I`'s help message (GH-131819)
(cherry picked from commit 8bd88e2827b2a887c2ea8e5ed0c0575704bfacdf)
Co-authored-by: Hang <bebound@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
(gh-131754)
* [3.13] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)
(cherry picked from commit 7bb41aef4b7b8f3c3f07c11b801c5b7f8afaac7f)
* fix
|
| |
|
|
|
|
|
|
|
| |
(GH-131682) (#131686)
gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682)
(cherry picked from commit 929afd1d6ee4fb89ac818037effe6577947103de)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
(gh-131561) (#131564)
The `sys_tracing_threads` variable should be read inside `LOCK_SETUP()`.
(cherry picked from commit 0de5e0c5442abddbe17481ef450e4abc992058f5)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-130689) (#131195)
(cherry picked from commit c5abded09995f208b21ebaf012185ca5acb0180b)
Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
|
| |
|
|
| |
callback (#131166)
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
(#131084)
(cherry picked from commit de8818ae233b8e7722aa5d6f91d4b5a04bd039df)
Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
|
| |
|
|
|
|
|
|
| |
code (GH-117500) (#131060)
gh-117174: Add a new route in linecache to fetch interactive source code (GH-117500)
(cherry picked from commit a931a8b32415f311008dbb3f09079aae1e6d7a3d)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
| |
|
|
|
|
|
| |
(gh-130808) (#130857)
This avoids a case where the interpreter's queue of memory to be freed
could grow rapidly if there are many short lived threads.
(cherry picked from commit 2f6e0e9f7001769be746ee96356656d3ebdc7f96)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#130756)
gh-130740: Move some `stdbool.h` includes after `Python.h` (#130738)
Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not
included first and when we are in a platform-agnostic context. This is to avoid having
features defined by `stdbool.h` before those decided by `Python.h` (this caused some
build failures when compiling CPython with `zig cc`).
(cherry-picked from commit 214562ed4ddc248b007f718ed92ebcc0c3669611)
---------
Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Postpone <stdbool.h> inclusion after Python.h (#130641)
Remove inclusions prior to Python.h.
<stdbool.h> will cause <features.h> to be included before Python.h can
define some macros to enable some additional features, causing multiple
types not to be defined down the line.
(cherry picked from commit 830f04b5056db92ba96387db0a778dcd19a39522)
Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
|
| |
|
|
|
|
|
|
|
|
| |
(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)
|
| |
|
|
|
|
|
| |
(GH-129623) (#130078)
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
operat… (gh-129756)
gh-129533: Update PyGC_Enable/Disable/IsEnabled to use atomic operation (gh-129563)
(cherry picked from commit b184abf074c0e1f379a238f07da5616460f36b93)
|
| |
|
|
|
|
|
|
| |
free-threading (gh-129738) (gh-129747)
The read of `shared->array` should happen under the lock to avoid a race.
(cherry picked from commit b4ff8b22b3066b814c3758f87eaddfa923e657ed)
Co-authored-by: Peter Hawkins <phawkins@google.com>
|
| |
|
|
|
|
|
|
| |
`PySys_AddWarnOptionUnicode` (GH-126118) (#129520)
gh-126108: Fix potential null pointer dereference in `PySys_AddWarnOptionUnicode` (GH-126118)
(cherry picked from commit fad36bf38248130bc48b81a5e7c31a7649a6456e)
Co-authored-by: Valery Fedorenko <federicovalenso@gmail.com>
|
| |
|
|
| |
exception (#128971) (#129299)
|
| |
|
| |
_PyTraceMalloc_Stop() now calls PyRefTracer_SetTracer(NULL, NULL).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191)
Support calling PyTraceMalloc_Track() and PyTraceMalloc_Untrack()
during late Python finalization.
* Call _PyTraceMalloc_Fini() later in Python finalization.
* Test also PyTraceMalloc_Untrack() without the GIL
* PyTraceMalloc_Untrack() now gets the GIL.
* Test also PyTraceMalloc_Untrack() in test_tracemalloc_track_race().
(cherry picked from commit 46c7e13c055c218e18b0424efc60965e6a5fe6ea)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
(GH-128741) (#128757)
[3.13] gh-128717: Stop-the-world when setting the recursion limit (GH-128741)
(cherry picked from commit f6c61bf2d7d8b66ccd9f16e723546bdcc251a3d0)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-128165) (#128575)
gh-128146: Exclude os/log.h import on older macOS versions. (GH-128165)
Reworks the handling of Apple system log handling to account for older macOS
versions that don't provide os-log.
(cherry picked from commit e837a1f71e832ce8f551a6fac05e346f654457e0)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
|
| |
|
|
|
|
|
|
| |
ExceptionGroup split function (GH-128079) (#128139)
gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079)
(cherry picked from commit 3879ca0100942ae15a09ac22889cbe3e46d424eb)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-128047) (#128114)
gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047)
I missed the extra `PyModule_Check` in GH-127660 because I was looking at
3.12 as the base implementation for import from. This meant that I
missed the `PyModuleCheck` introduced in GH-112661.
(cherry picked from commit 45e6dd63b88a782f2ec96ab1da54eb5a074d8f4c)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Py_CompileStringObject (GH-128006)
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910)
After commit 10a91d7e9 introduced arena cleanup, commit 2dfbd4f36
removed the free call when _PyCompile_AstOptimize fails.
(cherry picked from commit cfeaa992ba9bad9be2687afcafd85156703d74e8)
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-127866) (GH-127882)
This PR fixes the build issue introduced by the commit 628f6eb from
GH-112207 on systems without thread local support.
(cherry picked from commit f823910bbd4bf01ec3e1ab7b3cb1d77815138296)
Co-authored-by: velemas <10437413+velemas@users.noreply.github.com>
|
| |
|
|
|
| |
(#127823)
(cherry picked from commit 30aeb00d367d0cc9e5a7603371636cddea09f1c0)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(#127775)
gh-127651: Use __file__ in diagnostics if origin is missing (#127660)
See the left hand side in https://github.com/python/cpython/pull/123929/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deL2840-L2849
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 3983527c3a6b389e373a233e514919555853ccb3)
|
| |
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
| |
(GH-125612) (GH-127698)
The `STORE_ATTR_INSTANCE_VALUE` opcode doesn't support objects with
non-NULL managed dictionaries, so don't specialize to that op in that case.
(cherry picked from commit a353455fca1b8f468ff3ffbb4b5e316510b4fd43)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
(#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>
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
(GH-127199) (#127463)
gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199)
(cherry picked from commit 46bfd26fb294a8769ef6d0c056ee6c9df022a037)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
|
|
| |
gh-123967: Fix faulthandler for trampoline frames (GH-127329)
If the top-most frame is a trampoline frame, skip it.
(cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
(#127418)
gh-127208: Reject null character in _imp.create_dynamic() (GH-127400)
_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
| |
gh-126881: fix finalization of dtoa state (GH-126904)
(cherry picked from commit 762c603a866146afc7db2591fb49605e0858e9b1)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
on its startup failure (GH-109761) (GH-127171)
If Python fails to start newly created thread
due to failure of underlying PyThread_start_new_thread() call,
its state should be removed from interpreter' thread states list
to avoid its double cleanup.
(cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
|
| |
|
| |
This is a pseudo-backport of d6b3e78 (gh-126988). In that change for 3.14+, we dropped _PyInterpreterState_FailIfNotRunning() and added _PyErr_SetInterpreterAlreadyRunning(). Here, we replace usage of _PyInterpreterState_FailIfNotRunning() with the inlined equivalent of _PyErr_SetInterpreterAlreadyRunning(), without adding that function. That way we avoid changing the 3.13 ABI.
|
| |
|
|
|
| |
(cherry picked from commit 60ec854bc297e04718fe13db3605d0465bf8badb)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-126338) (#126866)
* Fix merge conflicts.
* [3.13] gh-126312: Don't traverse frozen objects on the free-threaded build (GH-126338)
Also, _PyGC_Freeze() no longer freezes unreachable objects.
(cherry picked from commit d4c72fed8cba8e15ab7bb6c30a92bc9f2c8f0a2c)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
---------
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|