summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* GH-102126: fix deadlock at shutdown when clearing thread states (#102222)Kumar Aditya2023-02-251-3/+10
|
* GH-100719: Remove redundant `gi_code` field from generator object. (GH-100749)Mark Shannon2023-02-232-39/+38
|
* GH-100982: Restrict `FOR_ITER_RANGE` to a single instruction to allow ↵Mark Shannon2023-02-223-30/+20
| | | | instrumentation. (GH-101985)
* gh-101903: Remove obsolete undefs for previously removed macros ↵Owain Davies2023-02-211-4/+0
| | | | Py_EnterRecursiveCall and Py_LeaveRecursiveCall (#101923)
* gh-102056: Fix a few bugs in error handling of exception printing code (#102078)Irit Katriel2023-02-201-7/+16
|
* gh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (GH-101912)Steve Dower2023-02-206-145/+145
| | | | | | * gh-101907: Removes use of non-standard C++ extension from Include/cpython/code.h * Make cases_generator correct on Windows
* gh-97786: Fix compiler warnings in pytime.c (#101826)Mark Dickinson2023-02-201-6/+29
| | | Fixes compiler warnings in pytime.c.
* gh-101967: add a missing error check (#101968)Eclips42023-02-181-1/+3
|
* gh-101758: Add _PyState_AddModule() Back for the Stable ABI (gh-101956)Eric Snow2023-02-161-0/+20
| | | | | | | We're adding the function back, only for the stable ABI symbol and not as any form of API. I had removed it yesterday. This undocumented "private" function was added with the implementation for PEP 3121 (3.0, 2007) for internal use and later moved out of the limited API (3.6, 2016) and then into the internal API (3.9, 2019). I removed it completely yesterday, including from the stable ABI manifest (where it was added because the symbol happened to be exported). It's unlikely that anyone is using _PyState_AddModule(), especially any stable ABI extensions built against 3.2-3.5, but we're playing it safe. https://github.com/python/cpython/issues/101758
* gh-101952: Fix possible segfault in `BUILD_SET` opcode (#101958)Eclips42023-02-162-0/+4
|
* gh-101881: Support (non-)blocking read/write functions on Windows pipes ↵Rayyan Ansari2023-02-161-2/+91
| | | | | | | | | | | | (GH-101882) * fileutils: handle non-blocking pipe IO on Windows Handle erroring operations on non-blocking pipes by reading the _doserrno code. Limit writes on non-blocking pipes that are too large. * Support blocking functions on Windows Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.
* gh-101928: fix crash in compiler on multi-line lambda in function call (#101933)penguin_wwy2023-02-161-2/+2
|
* gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)Gregory P. Smith2023-02-161-2/+1
| | | | | | | | | This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance. This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice. Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names. Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
* gh-98627: Add an Optional Check for Extension Module Subinterpreter ↵Eric Snow2023-02-164-10/+120
| | | | | | | | | | | | | | | Compatibility (gh-99040) Enforcing (optionally) the restriction set by PEP 489 makes sense. Furthermore, this sets the stage for a potential restriction related to a per-interpreter GIL. This change includes the following: * add tests for extension module subinterpreter compatibility * add _PyInterpreterConfig.check_multi_interp_extensions * add Py_RTFLAGS_MULTI_INTERP_EXTENSIONS * add _PyImport_CheckSubinterpIncompatibleExtensionAllowed() * fail iff the module does not implement multi-phase init and the current interpreter is configured to check https://github.com/python/cpython/issues/98627
* gh-101758: Fix the wasm Buildbots (gh-101943)Eric Snow2023-02-161-0/+4
| | | | | They were broken by gh-101920. https://github.com/python/cpython/issues/101758
* gh-101758: Add a Test For Single-Phase Init Modules in Multiple Interpreters ↵Eric Snow2023-02-151-2/+74
| | | | | | | (gh-101920) The test verifies the behavior of single-phase init modules when loaded in multiple interpreters. https://github.com/python/cpython/issues/101758
* gh-101758: Clean Up Uses of Import State (gh-101919)Eric Snow2023-02-159-987/+1363
| | | | | | | | | | | | | | | This change is almost entirely moving code around and hiding import state behind internal API. We introduce no changes to behavior, nor to non-internal API. (Since there was already going to be a lot of churn, I took this as an opportunity to re-organize import.c into topically-grouped sections of code.) The motivation is to simplify a number of upcoming changes. Specific changes: * move existing import-related code to import.c, wherever possible * add internal API for interacting with import state (both global and per-interpreter) * use only API outside of import.c (to limit churn there when changing the location, etc.) * consolidate the import-related state of PyInterpreterState into a single struct field (this changes layout slightly) * add macros for import state in import.c (to simplify changing the location) * group code in import.c into sections *remove _PyState_AddModule() https://github.com/python/cpython/issues/101758
* gh-101819: Remove _PyWindowsConsoleIO_Type from the Windows DLL (GH-101904)Erlend E. Aasland2023-02-151-5/+9
| | | Automerge-Triggered-By: GH:erlend-aasland
* GH-87849: Fix refleak in SEND instruction. (GH-101908)Mark Shannon2023-02-152-0/+2
| | | Fix refleak in SEND instruction.
* gh-101758: Add a Test For Single-Phase Init Module Variants (gh-101891)Eric Snow2023-02-141-10/+95
| | | | | The new test exercises the most important variants for single-phase init extension modules. We also add some explanation about those variants to import.c. https://github.com/python/cpython/issues/101758
* gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)Irit Katriel2023-02-146-41/+55
|
* gh-101810: Remove duplicated st_ino calculation (GH-101811)James Lee2023-02-131-2/+0
|
* GH-87849: Simplify stack effect of SEND and specialize it for generators and ↵Mark Shannon2023-02-136-78/+139
| | | | coroutines. (GH-101788)
* gh-101670: typo fix in PyImport_ExtendInittab() (#101723)Sergey B Kirpichev2023-02-091-1/+1
| | | Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-98831: Use opcode metadata for stack_effect() (#101704)Guido van Rossum2023-02-092-227/+56
| | | | | | | | | | * Write output and metadata in a single run This halves the time to run the cases generator (most of the time goes into parsing the input). * Declare or define opcode metadata based on NEED_OPCODE_TABLES * Use generated metadata for stack_effect() * compile.o depends on opcode_metadata.h * Return -1 from _PyOpcode_num_popped/pushed for unknown opcode
* gh-98831: Modernize CALL and family (#101508)Guido van Rossum2023-02-085-583/+630
| | | Includes a slight improvement to `DECREF_INPUTS()`.
* gh-101670: typo fix in PyImport_AppendInittab() (GH-101672)Sergey B Kirpichev2023-02-081-1/+1
|
* gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension ↵David Hewitt2023-02-081-4/+5
| | | | modules for incompatibility (GH-101615)
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-0810-120/+171
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* gh-98831: Modernize CALL_FUNCTION_EX (#101627)Guido van Rossum2023-02-083-32/+22
| | | New generator feature: Move CHECK_EVAL_BREAKER() call to just before DISPATCH().
* gh-98831: Modernize FORMAT_VALUE (#101628)Guido van Rossum2023-02-083-30/+12
| | | Generator update: support balanced parentheses and brackets in conditions and size expressions.
* gh-98831: Finish the UNPACK_SEQUENCE family (#101666)Guido van Rossum2023-02-073-45/+46
| | | New generator feature: Generate useful glue for output arrays, so you can just write values to the output array (no bounds checking). Rewrote UNPACK_SEQUENCE_TWO_TUPLE to use this, and also UNPACK_SEQUENCE_{TUPLE,LIST}.
* gh-101632: Add the new RETURN_CONST opcode (#101633)penguin_wwy2023-02-075-11/+53
|
* gh-98831: rewrite UNPACK_EX, UNPACK_SEQUENCE, UNPACK_SEQUENCE_TWO_TUPLE in ↵Irit Katriel2023-02-073-54/+40
| | | | the instruction definition DSL (#101641)
* gh-98831: Modernize the FOR_ITER family of instructions (#101626)Guido van Rossum2023-02-073-75/+104
| | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ ↵Matthieu Dartiailh2023-02-071-3/+0
| | | | | (#101127) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)Irit Katriel2023-02-063-22/+21
|
* gh-59956: Partial Fix for GILState API Compatibility with Subinterpreters ↵Eric Snow2023-02-061-21/+4
| | | | | | | | | | | (gh-101431) The GILState API (PEP 311) implementation from 2003 made the assumption that only one thread state would ever be used for any given OS thread, explicitly disregarding the case of subinterpreters. However, PyThreadState_Swap() still facilitated switching between subinterpreters, meaning the "current" thread state (holding the GIL), and the GILState thread state could end up out of sync, causing problems (including crashes). This change addresses the issue by keeping the two in sync in PyThreadState_Swap(). I verified the fix against gh-99040. Note that the other GILState-subinterpreter incompatibility (with autoInterpreterState) is not resolved here. https://github.com/python/cpython/issues/59956
* gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction ↵Irit Katriel2023-02-033-54/+53
| | | | definition DSL (#101529)
* gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the ↵Irit Katriel2023-02-033-42/+40
| | | | instruction definition DSL (#101516)
* gh-98831: rewrite RERAISE and CLEANUP_THROW in the instruction definition ↵Irit Katriel2023-02-023-34/+34
| | | | DSL (#101511)
* gh-98831: Modernize the LOAD_GLOBAL family (#101502)Guido van Rossum2023-02-013-77/+66
|
* gh-98831: rewrite PUSH_EXC_INFO and conditional jumps in the instruction ↵Irit Katriel2023-02-014-98/+97
| | | | definition DSL (#101481)
* gh-98831: Modernize the LOAD_ATTR family (#101488)Guido van Rossum2023-02-013-230/+205
|
* GH-100288: Skip extra work when failing to specialize LOAD_ATTR (GH-101354)Brandt Bucher2023-01-311-60/+24
|
* gh-98831: rewrite BEFORE_ASYNC_WITH and END_ASYNC_FOR in the instruction ↵Irit Katriel2023-01-313-38/+40
| | | | definition DSL (#101458)
* gh-98831: rewrite GET_LEN, GET_ITER, BEFORE_WITH and a few simple opcodes in ↵Irit Katriel2023-01-313-69/+59
| | | | the instruction definition DSL (#101443)
* gh-99955: use SUCCESS/ERROR return values in optimizer and assembler. Use ↵Irit Katriel2023-01-311-189/+142
| | | | RETURN_IF_ERROR where appropriate. Fix a couple of bugs. (#101412)
* gh-101400: Fix incorrect lineno in exception message on continue/break which ↵Dong-hee Na2023-01-301-2/+4
| | | | are not in a loop (#101413)
* gh-59956: Clarify Runtime State Status Expectations (gh-101308)Eric Snow2023-01-303-149/+387
| | | | | | | | | | | | | A PyThreadState can be in one of many states in its lifecycle, represented by some status value. Those statuses haven't been particularly clear, so we're addressing that here. Specifically: * made the distinct lifecycle statuses clear on PyThreadState * identified expectations of how various lifecycle-related functions relate to status * noted the various places where those expectations don't match the actual behavior At some point we'll need to address the mismatches. (This change also includes some cleanup.) https://github.com/python/cpython/issues/59956