summaryrefslogtreecommitdiffstats
path: root/Programs
Commit message (Collapse)AuthorAgeFilesLines
* gh-139927: Fix test_embed on OpenIndiana (#142514)Victor Stinner2025-12-101-9/+14
| | | | Avoid swprintf() function in Programs/_testembed.c since it doesn't work as expected on OpenIndiana.
* gh-140011: Delete importdl assertion that prevents importing embedded ↵Itamar Oren2025-11-261-0/+173
| | | | modules from packages (GH-141605)
* gh-116146: Avoid empty braces in _testembed.c (GH-141556)Petr Viktorin2025-11-141-1/+1
|
* gh-116146: Add C-API to create module from spec and initfunc (GH-139196)Itamar Oren2025-11-141-0/+111
| | | | | Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-135801: Add the module parameter to compile() etc (GH-139652)Serhiy Storchaka2025-11-132-2/+2
| | | | | | | Many functions related to compiling or parsing Python code, such as compile(), ast.parse(), symtable.symtable(), and importlib.abc.InspectLoader.source_to_code() now allow to pass the module name used when filtering syntax warnings.
* gh-89745: Remove test_embed.test_init_read_set() (#139500)Victor Stinner2025-10-021-39/+0
| | | | Since Python 3.11, it's no longer possible to call PyConfig_Read() to get the path configuration, and then modify the path configuration.
* gh-139146: Check `calloc()` results in ↵Denis Sergeev2025-09-291-0/+10
| | | | | | `_testembed.c::test_pre_initialization_sys_options` (#139147) Reported by: Dmitrii Chuprov <cheese@altlinux.org> Signed-off-by: Denis Sergeev <zeff@altlinux.org>
* gh-128639: Don't assume one thread in subinterpreter finalization with fixed ↵Peter Bierma2025-09-171-3/+6
| | | | | daemon thread support (GH-134606) This reapplies GH-128640.
* gh-138886: Remove deprecated `PySys_ResetWarnOptions` C-API function (#138887)sobolevn2025-09-151-0/+4
|
* Use PyInitConfig API in _freeze_module.c (#137423)Victor Stinner2025-08-061-16/+29
|
* gh-137093: Fix race condition in `test_embed.test_bpo20891` (GH-137094)Peter Bierma2025-07-251-18/+6
| | | Use a `PyEvent` instead of a lock to fix a race on the free-threaded build.
* GH-133711: Enable UTF-8 mode by default (PEP 686) (#133712)Adam Turner2025-07-151-2/+2
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-132554: "Virtual" iterators (GH-132555)Mark Shannon2025-05-271-1/+1
| | | | | | * FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero * NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.
* gh-131185: Use a proper thread-local for cached thread states (gh-132510)Peter Bierma2025-05-211-1/+28
| | | | | Switches over to a _Py_thread_local in place of autoTssKey, and also fixes a few other checks regarding PyGILState_Ensure after finalization. Note that this doesn't fix concurrent use of PyGILState_Ensure with Py_Finalize; I'm pretty sure zapthreads doesn't work at all, and that needs to be fixed seperately.
* Revert "gh-128639: Don't assume one thread in subinterpreter finalization ↵Peter Bierma2025-05-191-6/+3
| | | | | | | (gh-128640)" (gh-134256) This reverts commit 9859791f9e116c827468f307ac0770286c975c8b. The original change broke the iOS and android buildbots, where the tests are run single-process.
* gh-128639: Don't assume one thread in subinterpreter finalization (gh-128640)Peter Bierma2025-05-191-3/+6
| | | | Incidentally, this also fixed the warning not showing up if a subinterpreter wasn't cleaned up via _interpreters.destroy. I had to update some of the tests as a result.
* gh-133644: Avoid deprecated Py_SetProgramName() in _testembed.c (#133665)Victor Stinner2025-05-091-53/+24
| | | | | * Rename _testembed_Py_InitializeFromConfig() to _testembed_initialize(). * Replace _testembed_Py_Initialize() with _testembed_initialize().
* gh-102567: Add -X importtime=2 for logging an importtime message for ↵Noah Kim2025-05-061-2/+2
| | | | | already-loaded modules (#118655) Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* gh-132661: Implement PEP 750 (#132662)Lysandros Nikolaou2025-04-301-13/+13
| | | | | | | | | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Wingy <git@wingysam.xyz> Co-authored-by: Koudai Aono <koxudaxi@gmail.com> Co-authored-by: Dave Peck <davepeck@gmail.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Paul Everitt <pauleveritt@me.com> Co-authored-by: sobolevn <mail@sobolevn.me>
* gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)mpage2025-04-011-7/+7
| | | Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
* GH-130296: Remove `_PyOpcode_max_stack_effect` as it is no longer used ↵Mark Shannon2025-03-201-1/+1
| | | | (GH-131493)
* gh-126835: Move constant tuple folding from ast_opt to CFG (#130769)Yan Yanchii2025-03-191-8/+8
|
* gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG ↵Yan Yanchii2025-03-141-30/+31
| | | | (#130481)
* GH-128534: Fix behavior of branch monitoring for `async for` (GH-130847)Mark Shannon2025-03-071-11/+11
| | | * Both branches in a pair now have a common source and are included in co_branches
* gh-130574: renumber RESUME opcode from 149 to 128 (GH-130685)Tomasz Pytel2025-03-061-1/+1
|
* gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR ↵Irit Katriel2025-02-071-14/+15
| | | | (#129700)
* GH-128914: Remove all but one conditional stack effects (GH-129226)Mark Shannon2025-01-271-10/+10
| | | | | | | | | | | | | * Remove all 'if (0)' and 'if (1)' conditional stack effects * Use array instead of conditional for BUILD_SLICE args * Refactor LOAD_GLOBAL to use a common conditional uop * Remove conditional stack effects from LOAD_ATTR specializations * Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array. * Remove conditional stack effects from CALL_FUNCTION_EX
* Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and ↵Sam Gross2025-01-231-12/+12
| | | | | | | the code generators (GH-128918)" (GH-129202) The commit introduced a ~2.5-3% regression in the free threading build. This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
* GH-128914: Remove conditional stack effects from `bytecodes.c` and the code ↵Mark Shannon2025-01-201-12/+12
| | | | generators (GH-128918)
* gh-129033: Remove _PyInterpreterState_SetConfig() function (#129048)Victor Stinner2025-01-201-43/+0
| | | | | | Remove _PyInterpreterState_GetConfigCopy() and _PyInterpreterState_SetConfig() private functions. PEP 741 "Python Configuration C API" added a better public C API: PyConfig_Get() and PyConfig_Set().
* gh-129033: Remove _Py_InitializeMain() function (#129034)Victor Stinner2025-01-201-35/+0
| | | Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* GH-128375: Better instrument for `FOR_ITER` (GH-128445)Mark Shannon2025-01-061-33/+33
|
* GH-122548: Implement branch taken and not taken events for sys.monitoring ↵Mark Shannon2024-12-191-33/+33
| | | | (GH-122564)
* gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build (gh-127737)Donghee Na2024-12-191-1/+1
|
* gh-125063: marshal: Add version 5, improve documentation (GH-126829)Petr Viktorin2024-11-151-0/+1
| | | | | | | | | | * Document that slices can be marshalled * Deduplicate and organize the list of supported types in docs * Organize the type code list in marshal.c, to make it more obvious that this is a versioned format * Back-fill some historical info Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* GH-125837: Split `LOAD_CONST` into three. (GH-125972)Mark Shannon2024-10-291-29/+29
| | | | | | | | * Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
* gh-125517: Fix unreachable code warnings in `_testembed.c` (#125518)sobolevn2024-10-151-8/+12
|
* gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266)RUANG (Roy James)2024-10-151-0/+1
|
* bpo-34206: Improve docs and test coverage for pre-init functions (#8023)Alyssa Coghlan2024-10-081-8/+33
| | | | | | | | | | | | | | | | | | | | - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-107954: Fix configuration type for the perf profiler (#124636)Pablo Galindo Salgado2024-09-271-0/+5
|
* gh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)luk13372024-09-191-0/+9
|
* gh-123919: Fix null handling in `_freeze_module.c` (#123920)sobolevn2024-09-111-0/+11
|
* gh-107954, PEP 741: Add PyInitConfig_AddModule() function (#123668)Victor Stinner2024-09-041-0/+57
|
* gh-107954, PEP 741: Adjust Python initialization config (#123663)Victor Stinner2024-09-041-12/+34
| | | | | | | 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-107954, PEP 741: Add PyInitConfig C API (#123502)Victor Stinner2024-09-031-0/+139
| | | Add Doc/c-api/config.rst documentation.
* gh-123022: Fix crash with `Py_Initialize` in background thread (#123052)Sam Gross2024-08-171-0/+18
| | | | | | | | | | | | Check that the current default heap is initialized in `_mi_os_get_aligned_hint` and `mi_os_claim_huge_pages`. The mimalloc function `_mi_os_get_aligned_hint` assumes that there is an initialized default heap. This is true for our main thread, but not for background threads. The problematic code path is usually called during initialization (i.e., `Py_Initialize`), but it may also be called if the program allocates large amounts of memory in total. The crash only affected the free-threaded build.
* GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942)Mark Shannon2024-08-131-9/+9
|
* gh-117482: Fix the Slot Wrapper Inheritance Tests (gh-122248)Eric Snow2024-07-291-3/+11
| | | The tests were only checking cases where the slot wrapper was present in the initial case. They were missing when the slot wrapper was added in the additional initializations. This fixes that.
* GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)Mark Shannon2024-07-251-11/+11
|
* GH-120507: Lower the `BEFORE_WITH` and `BEFORE_ASYNC_WITH` instructions. ↵Mark Shannon2024-06-181-11/+11
| | | | | | | | | (#120640) * Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions. * Add LOAD_SPECIAL instruction * Reimplement `with` and `async with` statements using LOAD_SPECIAL