| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
a redundant NOP (#109899)
* [3.12] gh-109889: comment out assertion indicating a failed optimization of a redundant NOP
* comment out the function to avoid warnings on it being unused
|
|
|
|
|
|
|
|
| |
block which is a jump target (GH-109839) (#109865)
gh-109823: Adjust labels in compiler when removing an empty basic block which is a jump target (GH-109839)
(cherry picked from commit d73c12b88c2275fd44e27c91c24f3ac85419d2b8)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
cold/warm blocks (GH-109734) (#109749)
gh-109719: Fix missing jump target labels when compiler reorders cold/warm blocks (GH-109734)
(cherry picked from commit 7c553991724d8d537f8444db73f016008753d77a)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
|
|
|
|
| |
target labels (#109630) (#109632)
gh-109627: duplicated smalll exit blocks need to be assigned jump target labels (#109630)
(cherry picked from commit 9ccf0545efd5bc5af5aa51774030c471d49a972b)
|
|
|
|
|
|
|
|
| |
(#109542)
gh-109371: Fix monitoring with instruction events set (gh-109385)
(cherry picked from commit 412f5e85d6b9f2e90c57c54539d06c7a025a472a)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
|
|
|
|
|
|
|
|
|
| |
(#109410)
gh-109219: propagate free vars through type param scopes (GH-109377)
(cherry picked from commit 909adb5092c0ae9426814742d97932204b211cfb)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
| |
conditional block (#109384) (#109411)
gh-105658: fix excess trace events for except block ending with a conditional block (#109384)
(cherry picked from commit 4a54074a0f5579d417445ec28427cd0ed5aa01f4)
|
|
|
|
|
|
|
|
| |
(GH-109349) (#109381)
gh-109341: Fix crash on compiling invalid AST including TypeAlias (GH-109349)
(cherry picked from commit 987b4bc0870e1e29a88275dc3fa39bf2c3dcc763)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
classes (GH-109196) (#109297)
gh-109118: Disallow nested scopes within PEP 695 scopes within classes (GH-109196)
Fixes GH-109118. Fixes GH-109194.
(cherry picked from commit b88d9e75f68f102aca45fa62e2b0e2e2ff46d810)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
|
|
|
| |
(GH-109289) (#109291)
gh-109195: fix source location for super load before LOAD_SUPER_ATTR (GH-109289)
(cherry picked from commit ceeb4173aee7b835f553a8286feaa48b98c16124)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
| |
de-optimization during callback. (GH-109131) (#109268)
GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131)
|
|
|
|
|
|
|
|
|
|
|
|
| |
function (GH-109123) (#109173)
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function (#109123)
(cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc)
* [3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123).
(cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
| |
parentheses (GH-108959) (#109147)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
`sys.monitoring.set_local_events()` (GH-108420) (#108899)
* GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events()` (GH-108420)
* Restore generated objects
* Restore size of monitoring arrays in code object for 3.12 ABI compatibility.
* Update ABI file
|
|
|
|
|
|
|
|
|
| |
(GH-108659) (#108700)
gh-108654: restore comprehension locals before handling exception (GH-108659)
(cherry picked from commit d52c4482a82f3f98f1a78efa948144a1fe3c52b2)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#108523)
gh-107913: Fix possible losses of OSError error codes (GH-107930)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.
(cherry picked from commit 2b15536fa94d07e9e286826c23507402313ec7f4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove assert that should've been DEOPT_IF
The assert(method != NULL) in CALL_NO_KW_LIST_APPEND is wrong --
this condition should lead to a deoptimization, and indeed there
is a DEOPT_IF two lines later that will trigger if method == NULL.
This would crash in a devious repro scenario (first seen live
in boto3 tests) when compiled with assertions enabled.
In a production version there is no crash, so impact is limited.
(The crash also appears in main; I will prepare a separate PR.)
* Add back a different assert(self != NULL)
* 📜🤖 Added by blurb_it.
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
for loop (GH-108242) (#108275)
gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop (GH-108242)
(cherry picked from commit a1cc74c4eebc55795877eb3be019a1bec34402f8)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
PyErr_SetFromErrnoWithFilename() etc (GH-107929) (#108205)
gh-107916: Save the error code before decoding the filename in PyErr_SetFromErrnoWithFilename() etc (GH-107929)
(cherry picked from commit 80bdebdd8593f007a2232ec04a7729bba6ebf12c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyErr_Format() (GH-107918) (#108134)
* gh-107915: Handle errors in C API functions PyErr_Set*() and PyErr_Format() (GH-107918)
Such C API functions as PyErr_SetString(), PyErr_Format(),
PyErr_SetFromErrnoWithFilename() and many others no longer crash or
ignore errors if it failed to format the error message or decode the
filename. Instead, they keep a corresponding error.
(cherry picked from commit 633ea217a85f6b6ba5bdbc73094254d5811b3485)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Define PY_SSIZE_T_CLEAN.
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
| |
* gh-106242: Fix path truncation in os.path.normpath (GH-106816)
* gh-106242: Minor fixup to avoid compiler warnings
---------
Co-authored-by: Finn Womack <flan313@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(#107751)
* Unrevert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)".
This reverts commit 6e4eec760648a71e1cd8f8f551997b1823b4bb9f (gh-107648).
* Initialize each interpreter's refchain properly.
* Skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.
|
|
|
|
|
|
| |
GH-107774: Add missing audit event for PEP 669 (GH-107775)
(cherry picked from commit 494e3d4436774a5ac1a569a635b8c5c881ef1c0c)
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
|
|
|
|
|
|
|
| |
(GH-107725) (#107802)
GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)
(cherry picked from commit 52fbcf61b5a70993c2d32332ff0ad9f369d968d3)
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
|
|
|
|
|
|
| |
Isolated Subinterpreters (gh-107567) (#107599)" (#107648)
Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)"
This reverts commit 58af2293c52a1ad3754d254690c0e54f787c545b.
|
|
|
|
|
|
|
|
|
|
| |
`_PyEval_EvalFrameDefault()` (GH-107535) (#107618)
GH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefault()` (GH-107535)
* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
(cherry picked from commit fa45958450aa3489607daf9855ca0474a2a20878)
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
|
|
|
|
|
|
|
|
|
| |
(gh-107567) (#107599)
gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)
The linked list of objects was a global variable, which broke isolation between interpreters, causing crashes. To solve this, we've moved the linked list to each interpreter.
(cherry picked from commit 58ef74186795c56e3ec86e8c8f351a1d7826638a)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-107471: Fix Refleaks in test_import (gh-107569)
gh-107184 introduced a refleak in test_import.SubinterpImportTests (specifically test_singlephase_check_with_setting_and_override and test_single_init_extension_compat). We fix it here by making sure _testsinglephase is removed from sys.modules whenever we clear the runtime's internal state for the module.
The underlying problem is strictly contained in the internal function _PyImport_ClearExtension() (AKA _testinternalcapi.clear_extension()), which is only used in tests.
(This also fixes an intermittent segfault introduced in the same place, in test_disallowed_reimport.)
(cherry picked from commit 017f047183fa33743f7e36c5c360f5c670032be3)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-106974) (gh-107412)
gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974)
This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed?
We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter.
We also remove the accommodations for "detached" thread states, which were a dubious idea to start with.
(cherry picked from commit 8ba4df91ae60833723d8d3b9afeb2b642f7176d5)
|
|
|
|
| |
callback function. (GH-107347) (GH-107382)
|
|
|
|
| |
that cannot be disabled. (GH-107337) (GH-107351)
|
|
|
|
|
|
| |
(GH-107346)
* Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
|
|
|
|
|
|
|
|
|
|
| |
import_find_extension() (gh-107184) (gh-107360)
gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184)
This fixes a bug where incompatible modules could still be imported if attempted multiple times.
(cherry picked from commit 75c974f5353685f338344618ad7344e64c2293d0)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
| |
(GH-106977). (#107204)
(cherry picked from commit e5d5522612e03af3941db1d270bf6caebf330b8a)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#107069) (#107075)
GH-103082: Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS (#107069)
Rename private C API constants:
* Rename PY_MONITORING_UNGROUPED_EVENTS to _PY_MONITORING_UNGROUPED_EVENTS
* Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS
(cherry picked from commit 0927a2b25c059988e237108605ed8ab0c5459c53)
|
|
|
|
|
|
| |
(GH-106768) (GH-106855)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
(cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93)
|
|
|
|
|
|
|
| |
(cherry picked from commit d8f87cdf94a6533c5cf2d25e09e6fa3eb06720b9)
Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
| |
gh-105340: include hidden fast-locals in locals() (GH-105715)
* gh-105340: include hidden fast-locals in locals()
(cherry picked from commit 104d7b760fed18055e4f04e5da3ca619e28bfc81)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
|
| |
Document PYTHONSAFEPATH along side -P (GH-106122)
(cherry picked from commit 0355625d94a50f4b816770bad946420d005900b8)
Co-authored-by: Jeremy Paige <ucodery@gmail.com>
|
|
|
|
|
|
|
|
| |
nodes (GH-106224) (#106295)
gh-106145: Make `end_{lineno,col_offset}` required on `type_param` nodes (GH-106224)
(cherry picked from commit 46c1097868745eeb47abbc8af8c34e8fcb80ff1d)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-106226)
* EOFError no longer overrides other errors such as MemoryError or OSError at
the start of the object.
* Raise more relevant error when the NULL object occurs as a code object
component.
* Minimize an overhead of calling PyErr_Occurred().
(cherry picked from commit 8bf6904b229583033035d91a3800da5604dcaad4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 6c60684bf5d34fae27a2f6a142ff794b38cefe1b)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
|
|
|
|
|
| |
(#106036)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
(`Python/import.c`) (GH-105980) (#106055)
gh-105979: Fix exception handling in `unmarshal_frozen_code` (`Python/import.c`) (GH-105980)
(cherry picked from commit cd5280367a3a7065d13b8f7234474f7a2e9a18fd)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
(#106041)
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034)
These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt. They should not be
used in new code.
(cherry picked from commit 1d33d5378058671bfabb6f4d4b5bfd4726973ff9)
|
|
|
|
|
| |
(cherry picked from commit 28187a9c4f95affe50fd37e0db0db177e2b9c2e9)
Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
many __defaults__ (GH-105863)
GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847)
(cherry picked from commit 2beab5bdef5fa2a00a59371e6137f769586b7404)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
|
|
|
|
|
|
|
| |
(GH-105838)
GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589)
(cherry picked from commit a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
|
|
|
|
|
|
|
| |
(gh-105765)
This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time. To solve this we add a thread-local variable for the value. We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
(cherry picked from commit b87d2882754a7c273e2695c33384383eba380d7d)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
| |
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
(cherry picked from commit 757b402)
|