summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-87135: Hang non-main threads that attempt to acquire the GIL during ↵Jeremy Maitin-Shepard2024-10-024-12/+39
| | | | | | | finalization (GH-105805) Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option. Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-116750: Add clear_tool_id function to unregister events and callbacks ↵Tian Gao2024-10-013-1/+113
| | | | (#124568)
* gh-124218: Refactor per-thread reference counting (#124844)Sam Gross2024-10-014-68/+72
| | | | | | | Currently, we only use per-thread reference counting for heap type objects and the naming reflects that. We will extend it to a few additional types in an upcoming change to avoid scaling bottlenecks when creating nested functions. Rename some of the files and functions in preparation for this change.
* gh-124296: Remove private dictionary version tag (PEP 699) (#124472)Sam Gross2024-10-014-11/+5
|
* gh-123497: New limit for Python integers on 64-bit platforms (GH-123724)Serhiy Storchaka2024-09-291-11/+12
| | | | | | | | | | | Instead of be limited just by the size of addressable memory (2**63 bytes), Python integers are now also limited by the number of bits, so the number of bit now always fit in a 64-bit integer. Both limits are much larger than what might be available in practice, so it doesn't affect users. _PyLong_NumBits() and _PyLong_Frexp() are now always successful.
* gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` ↵Bénédikt Tran2024-09-291-0/+22
| | | | (#124677)
* gh-124442: make `__static_attributes__` deterministic by sorting (#124492)Kira2024-09-281-1/+11
| | | | | 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>
* gh-107954: Fix configuration type for the perf profiler (#124636)Pablo Galindo Salgado2024-09-271-1/+1
|
* gh-119180: No longer set `__annotations__` in `__main__` (#124634)Jelle Zijlstra2024-09-271-7/+1
|
* gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)Neil Schemenauer2024-09-271-3/+26
| | | | | 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.
* GH-123516: Improve JIT memory consumption by invalidating cold executors ↵Savannah Ostrowski2024-09-276-0/+70
| | | | | (GH-124443) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-119333: get interp from tstate for PyContext watchers(#124444)Jason Fried2024-09-261-4/+4
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-117376: Fix off-by-ones in conversion functions (GH-124301)Ken Jin2024-09-253-6/+6
| | | Fix off-by-ones in conversion function
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-253-6/+81
| | | | of a boolean expression (#124394)
* gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)Sam Gross2024-09-249-111/+87
| | | | | | Use a `_PyStackRef` and defer the reference to `f_funcobj` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)Serhiy Storchaka2024-09-241-35/+56
| | | | | | | | * 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.
* gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)Jason Fried2024-09-242-0/+81
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-124284: Add stats for refcount operations on immortal objects (GH-124288)Mark Shannon2024-09-232-4/+11
|
* gh-111513: Improve datetime.fromtimestamp's error message (#124249)AN Long2024-09-201-0/+4
|
* gh-123880: Allow recursive import of single-phase-init modules (GH-123950)Petr Viktorin2024-09-201-5/+13
| | | | Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
* gh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)luk13372024-09-191-1/+1
|
* gh-116022: Improve `repr()` of AST nodes (#117046)Tomas R2024-09-181-0/+222
| | | | | | Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out ↵Irit Katriel2024-09-162-30/+53
| | | | of compiler (#123972)
* gh-124058: remove _PyCompile_IsNestedScope, roll it into ↵Irit Katriel2024-09-162-11/+5
| | | | _PyCompile_IsInteractive (#124061)
* gh-124068: Fix reference leak with generators in the free-threaded build ↵Sam Gross2024-09-141-0/+13
| | | | | | | (#124069) If the generator is already cleared, then most fields in the generator's frame are not valid other than f_executable. The invalid fields may contain dangling pointers and should not be used.
* gh-121459: Deferred LOAD_GLOBAL (GH-123128)Ken Jin2024-09-135-28/+30
| | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sam Gross <655866+colesbury@users.noreply.github.com>
* gh-124022: Fix bug where class docstring is removed in interactive mode ↵Irit Katriel2024-09-132-5/+5
| | | | | | | (#124023) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-124019: do not call codegen_annotations_in_scope if there are no ↵Irit Katriel2024-09-121-14/+10
| | | | annotations (#124020)
* gh-124013: remove _PyCompile_IsTopLevelAwait (#124014)Irit Katriel2024-09-122-25/+0
|
* gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` ↵Sam Gross2024-09-129-76/+102
| | | | | | | | (#123924) Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure ↵Mark Shannon2024-09-124-322/+291
| | | | that it is kept in memory for calls (GH-124003)
* gh-123958: apply docstring removal optimization in ast_opt instead of ↵Irit Katriel2024-09-112-22/+37
| | | | codegen (#123959)
* gh-123881: make compiler add the .generic_base base class without ↵Irit Katriel2024-09-102-46/+52
| | | | | | constructing AST nodes (#123883)
* gh-122239: Add actual count in unbalanced unpacking error message when ↵Tushar Sadhwani2024-09-101-0/+11
| | | | possible (#122244)
* gh-123892: Add "_wmi" to sys.stdlib_module_names (#123893)Victor Stinner2024-09-101-0/+1
|
* gh-121404: split compile.c into compile.c and codegen.c (#123651)Irit Katriel2024-09-093-6644/+6521
|
* gh-123275: Support `-Xgil=1` and `PYTHON_GIL=1` on non-free-threaded builds ↵Peter Bierma2024-09-051-4/+8
| | | | (gh-123276)
* GH-123545: Remove duplicate Py_DECREF when handling _PyOptimizer_Optimize ↵Savannah Ostrowski2024-09-052-8/+0
| | | | errors (GH-123546)
* gh-107954, PEP 741: Add PyInitConfig_AddModule() function (#123668)Victor Stinner2024-09-041-0/+35
|
* gh-107954, PEP 741: Adjust Python initialization config (#123663)Victor Stinner2024-09-041-3/+9
| | | | | | | Setting dev_mode to 1 in an isolated configuration now enables also faulthandler. Moreover, setting "module_search_paths" option with PyInitConfig_SetStrList() now sets "module_search_paths_set" to 1.
* gh-121804: always show error location for SyntaxError's in basic repl (#123202)Sergey B Kirpichev2024-09-031-0/+31
|
* gh-107954, PEP 741: Add PyInitConfig C API (#123502)Victor Stinner2024-09-031-8/+485
| | | Add Doc/c-api/config.rst documentation.
* gh-107954, PEP 741: Add PyConfig_Get()/Set() functions (#123472)Victor Stinner2024-09-022-194/+844
| | | | | | | | | | | Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and PyConfig_Names() functions to get and set the current runtime Python configuration. Add visibility and "sys spec" to config and preconfig specifications. _PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-121404: enforce that codegen doesn't access compiler, and compiler ↵Irit Katriel2024-09-021-85/+129
| | | | doesn't use codegen macros (#123575)
* gh-123091: Use more _Py_IsImmortalLoose() (GH-123602)Petr Viktorin2024-09-021-1/+1
| | | | | | | Switch more _Py_IsImmortal(...) assertions to _Py_IsImmortalLoose(...) The remaining calls to _Py_IsImmortal are in free-threaded-only code, initialization of core objects, tests, and guards that fall back to code that works with mortal objects.
* gh-123091: Use _Py_IsImmortalLoose() (#123511)Victor Stinner2024-09-023-6/+6
| | | | Use _Py_IsImmortalLoose() in bytesobject.c, typeobject.c and ceval.c.
* gh-123553: Fix compile warning in `compile.c` (#123578)sobolevn2024-09-011-0/+2
|
* gh-123553: Fix compiler warning in `Python/compile.c` (#123554)Kirill Podoprigora2024-09-011-0/+2
|
* gh-121404: rearrange code in compile.c so that codegen functions come first ↵Irit Katriel2024-08-301-1033/+1071
| | | | and compiler functions second (#123510)
* gh-122854: Add Py_HashBuffer() function (#122855)Victor Stinner2024-08-302-7/+10
|