summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740)Eric Snow2023-06-141-0/+15
| | | 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.
* gh-104812: Run Pending Calls in any Thread (gh-104813)Eric Snow2023-06-134-83/+191
| | | 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.
* gh-105481: add flags to each instr in the opcode metadata table, to replace ↵Irit Katriel2023-06-135-609/+627
| | | | opcode.hasarg/hasname/hasconst (#105482)
* gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)Eric Snow2023-06-131-4/+15
| | | We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-135-337/+373
| | | | (GH-105680)
* gh-105673: Fix uninitialized warning in sysmodule.c (#105674)Nikita Sobolev2023-06-121-1/+1
| | | In sys_add_xoption(), 'value' may be uninitialized for some error paths.
* gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)Irit Katriel2023-06-116-257/+396
|
* gh-105375: Improve error handling in the sys extension module (#105611)Erlend E. Aasland2023-06-111-6/+18
| | | | | In _PySys_AddXOptionWithError() and sys_add_xoption(), bail on first error to prevent exceptions from possibly being overwritten.
* gh-105375: Improve PyErr_WarnExplicit() error handling (#105610)Erlend E. Aasland2023-06-111-12/+16
| | | | Bail on first error to prevent exceptions from possibly being overwritten.
* gh-105375: Improve error handling in the builtins extension module (#105585)Erlend E. Aasland2023-06-111-8/+32
|
* gh-105375: Improve error handling in compiler_enter_scope() (#105494)Erlend E. Aasland2023-06-091-1/+5
|
* gh-105564: Don't include artificial newlines in the line attribute of tokens ↵Pablo Galindo Salgado2023-06-091-0/+3
| | | | (#105565)
* gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)Victor Stinner2023-06-091-0/+6
| | | | Deprecate the PyImport_ImportModuleNoBlock() function which is just an alias to PyImport_ImportModule() since Python 3.3.
* gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)Eric Snow2023-06-081-1/+2
| | | The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
* gh-100227: Lock Around Adding Global Audit Hooks (gh-105515)Eric Snow2023-06-082-20/+43
| | | The risk of a race with this state is relatively low, but we play it safe anyway.
* gh-100227: Lock Around Use of the Global "atexit" State (gh-105514)Eric Snow2023-06-082-25/+27
| | | The risk of a race with this state is relatively low, but we play it safe anyway.
* GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)Mark Shannon2023-06-087-588/+495
| | | | * Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
* gh-104635: Eliminate redundant STORE_FAST instructions in the compiler ↵Dong-hee Na2023-06-071-5/+18
| | | | (gh-105320)
* gh-105390: Add explicit type cast (#105466)Kirill Podoprigora2023-06-071-1/+2
|
* GH-104610: Remove the use of `PREDICT` macros. (GH-104651)Mark Shannon2023-06-073-551/+507
|
* gh-105435: Fix spurious NEWLINE token if file ends with comment without a ↵Pablo Galindo Salgado2023-06-071-0/+11
| | | | newline (#105442)
* gh-105390: Correctly raise TokenError instead of SyntaxError for tokenize ↵Pablo Galindo Salgado2023-06-071-7/+2
| | | | errors (#105399)
* gh-105259: Ensure we don't show newline characters for trailing NEWLINE ↵Pablo Galindo Salgado2023-06-061-4/+6
| | | | tokens (#105364)
* gh-103906: Remove immortal refcounting in compile/marshal.c (gh-103922)Dong-hee Na2023-06-052-7/+7
|
* gh-105164: Detect annotations inside match blocks (#105177)Jelle Zijlstra2023-06-051-0/+10
|
* GH-105229: Replace some superinstructions with single instruction ↵Mark Shannon2023-06-057-610/+639
| | | | equivalent. (GH-105230)
* GH-104584: Allow optimizers to opt out of optimizing. (GH-105244)Mark Shannon2023-06-051-11/+18
|
* gh-103277: remove unused macros (#105247)Irit Katriel2023-06-031-19/+0
|
* gh-87092: avoid gcc warning on uninitialized struct field in assemble… ↵Dong-hee Na2023-06-021-0/+1
| | | | | (gh-105243) gh-87092: avoid gcc warning on uninitialized struct field in assemble.c (part2)
* gh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)Jelle Zijlstra2023-06-025-289/+288
|
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-028-358/+676
|
* gh-105184: document that marshal functions can fail and need to be checked ↵Irit Katriel2023-06-021-0/+4
| | | | with PyErr_Occurred (#105185)
* gh-104799: Default missing lists in AST to the empty list (#104834)Jelle Zijlstra2023-06-021-219/+365
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-92536: Remove PyUnicode_READY() calls (#105210)Victor Stinner2023-06-017-25/+1
| | | | Since Python 3.12, PyUnicode_READY() does nothing and always returns 0.
* gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)Victor Stinner2023-06-014-34/+4
| | | | | | Since Python 3.12, PyUnicode_READY() does nothing and always returns 0. Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).
* gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current ↵Eric Snow2023-06-013-8/+45
| | | | | | | Thread (gh-105109) This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads. (The idea for this approach came out of discussions with @markshannon.)
* gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)Irit Katriel2023-06-011-31/+7
|
* gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)Victor Stinner2023-06-011-4/+9
| | | | | | | | | | | | Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI. Mention "make regen-limited-abi" in "make regen-all".
* remove unused #includes of pycore_pymem.h (#105166)Irit Katriel2023-06-015-263/+259
|
* gh-105145: Remove old functions to config Python init (#105154)Victor Stinner2023-06-014-141/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the following old functions to configure the Python initialization, deprecated in Python 3.11: * PySys_AddWarnOptionUnicode() * PySys_AddWarnOption() * PySys_AddXOption() * PySys_HasWarnOptions() * PySys_SetArgvEx() * PySys_SetArgv() * PySys_SetPath() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Most of these functions are kept in the stable ABI, except: * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Update Doc/extending/embedding.rst and Doc/extending/extending.rst to use the new PyConfig API. _testembed.c: * check_stdio_details() now sets stdio_encoding and stdio_errors of PyConfig. * Add definitions of functions removed from the API but kept in the stable ABI. * test_init_from_config() and test_init_read_set() now use PyConfig_SetString() instead of PyConfig_SetBytesString(). Remove _Py_ClearStandardStreamEncoding() internal function.
* gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)Victor Stinner2023-06-011-1/+1
| | | | | | | | Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API: use wchar_t instead. Replace Py_UNICODE with wchar_t in multiple C files. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-105148: make _PyASTOptimizeState internal to ast_opt.c (#105149)Irit Katriel2023-05-313-17/+21
|
* gh-104909: Split BINARY_OP into micro-ops (#104910)Guido van Rossum2023-05-313-624/+753
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)Inada Naoki2023-05-313-171/+60
|
* gh-105042: Disable unmatched parens syntax error in python tokenize (#105061)Lysandros Nikolaou2023-05-301-1/+1
|
* gh-105069: Add a readline-like callable to the tokenizer to consume input ↵Pablo Galindo Salgado2023-05-302-22/+31
| | | | iteratively (#105070)
* gh-105035: fix super() calls on unusual types (e.g. meta-types) (#105094)Carl Meyer2023-05-302-221/+225
|
* gh-80064: Fix is_valid_wide_char() return type (#105099)Victor Stinner2023-05-301-1/+1
| | | | Return a classical int, rather than size_t. The size_t type was kept from copied/pasted code related to mbstowcs().
* gh-105017: Include CRLF lines in strings and column numbers (#105030)Marta Gómez Macías2023-05-281-2/+7
| | | Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-104976: Ensure trailing dedent tokens are emitted as the previous ↵Pablo Galindo Salgado2023-05-261-3/+23
| | | | | tokenizer (#104980) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>