| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
`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>
|
| |
|
|
|
|
|
|
|
| |
The PyMutex implementation supports unlocking after fork because we
clear the list of waiters in parking_lot.c. This doesn't work as well
for _PyRecursiveMutex because on some systems, such as SerenityOS, the
thread id is not preserved across fork().
(cherry picked from commit 5610860840aa71b186fc5639211dd268b817d65f)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-124865) (gh-125709) (GH-125204)
* gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)
Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.
This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785.
(cherry picked from commit f2cb39947093feda3ff85b8dc820922cc5e5f954)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.13] gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)
They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
---------
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-126566) (#126567)
gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566)
(cherry picked from commit 9ecd8f7f40e6724a1c1d46c2665147aaabceb2d2)
Co-authored-by: Valery Fedorenko <federicovalenso@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
_PyCompile_LookupArg (gh-126238) (#126475)
[3.13] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (GH-126239)
* Replace Py_DECREF by Py_XDECREF
(cherry picked from commit 8525c9375f25e6ec0c0b5dfcab464703f6e78082)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-126322) (gh-126344)
* gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (#126322)
* Fix comprehensions comment to inlined by pep 709
* Update spacing
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* Add reference to PEP 709
---------
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
(cherry picked from commit 868bfcc02ed42a1042851830b79c6877b7f1c7a8)
* Add space
---------
Co-authored-by: rimchoi <hyerimc858@gmail.com>
|
| |
|
|
|
|
|
|
| |
unknown feature (GH-126140) (#126155)
gh-126139: Improve error message location for future statement with unknown feature (GH-126140)
(cherry picked from commit 224c370a3680132997f1e43d20a3b4ca95a060ab)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
(GH-126115) (#126130)
gh-126105: Fix crash in `ast` module, when `._fields` is deleted (GH-126115)
Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).
(cherry picked from commit b2eaa75b176e07730215d76d8dce4d63fb493391)
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| |
|
|
|
| |
specialized paths (GH-125712) (#125791)
(cherry picked from commit 3d1df3d84e5c75a52b6f1379cd7f2809fc50befa)
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-126020) (#126042)
(cherry picked from commit 80eec52fc813bc7d20478da3114ec6ffd73e7c31)
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-123929) (#125937)
gh-123930: Better error for "from imports" when script shadows module (#123929)
(cherry picked from commit 500f5338a8fe13719478589333fcd296e8e8eb02)
|
| |
|
|
|
|
| |
When formatting the AST as a string, infinite values are replaced by
1e309, which evaluates to infinity. The initialization of this string
replacement was not thread-safe in the free threading build.
(cherry picked from commit 427dcf24de4e06d239745d74d08c4b2e541dca5a)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, `long` is a signed 32-bit integer so it can't represent
`0xffff_ffff` without overflow. Windows exit codes are unsigned 32-bit
integers, so if a child process exits with `-1`, it will be represented
as `0xffff_ffff`.
Also fix a number of other possible cases where `_Py_HandleSystemExit`
could return with an exception set, leading to a `SystemError` (or
fatal error in debug builds) later on during shutdown.
(cherry picked from commit ad6110a93ffa82cae71af6c78692de065d3871b5)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-125882) (GH-125921)
This fixes a crash when `gc.get_objects()` or `gc.get_referrers()` is
called during a GC in the free threading build.
Switch to `_PyObjectStack` to avoid corrupting the `struct worklist`
linked list maintained by the GC. Also, don't return objects that are frozen
(`gc.freeze()`) or in the process of being collected to more closely match
the behavior of the default build.
(cherry picked from commit e545ead66ce725aae6fb0ad5d733abe806c19750)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-125178) (#125846)
(cherry picked from commit 079875e39589eb0628b5883f7ffa387e7476ec06)
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
states (GH-124459) (#125540)
This fixes a crash when running the PyO3 test suite on the free-threaded
build. The `qsbr` field is initialized after the `PyThreadState` is
added to the interpreter's linked list -- it might still be NULL.
Instead, we "steal" the queue of to-be-freed memory blocks. This is
always initialized (possibly empty) and protected by the stop the world
pause.
(cherry picked from commit 54c6fcbefd33a8d8bf8c004cf1aad3be3d37b933)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
* Detect source file encoding.
* Use the "replace" error handler even for UTF-8 (default) encoding.
* Remove the BOM.
* Fix detection of too long lines if they contain NUL.
* Return the head rather than the tail for truncated long lines.
(cherry picked from commit e2f710792b0418b8ca1ca3b8cdf39588c7268495)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-124914) (gh-124991)
gh-112804: Clamping timeout value for _PySemaphore_PlatformWait (gh-124914)
* gh-112804: Clamping timeout value for _PySemaphore_PlatformWait
* Address code review
* nit
(cherry picked from commit a5fc50994a3fae46d0c3d496c4e1d5e00548a1b8)
Co-authored-by: Donghee Na <donghee.na@python.org>
|
| |
|
|
|
|
|
|
| |
(GH-124952) (#124977)
gh-124871: fix 'visited' tracking in compiler's reachability analysis (GH-124952)
(cherry picked from commit f474391b26aa9208b44ca879f8635409d322f738)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-124492) (#124738)
* [3.13] gh-124442: make `__static_attributes__` deterministic by sorting (GH-124492)
(cherry picked from commit 04c837d9d8a474777ef9c1412fbba14f0682366c)
Co-authored-by: Kira <kp2pml30@gmail.com>
Signed-off-by: kp2pml30 <kp2pml30@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
|
|
| |
Revert the incremental GC in 3.13, since it's not clear that without further turning, the benefits outweigh the costs.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
|
|
|
| |
gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893)
(cherry picked from commit fb1b51a58df4315f7ef3171a5abeb74f132b0971)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
| |
gh-124746: remove assertion in 3.13
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(#124649)
gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)
Fix a bug that can cause a crash when sub-interpreters use "basic"
single-phase extension modules. Shared objects could refer to PyGC_Head
nodes that had been freed as part of interpreter shutdown.
(cherry picked from commit 6f9525dd3f0ef5809106ca0923a7512d666a04bb)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
|
| |
|
|
|
|
|
|
| |
(GH-124164) (#124250)
gh-124160: Pass main_tstate to update_global_state_for_extension() (GH-124164)
(cherry picked from commit 7331d0f70bc9fbac177b76b6ec03486430383425)
Co-authored-by: luk1337 <priv.luk@gmail.com>
|