summaryrefslogtreecommitdiffstats
path: root/Modules/_interpretersmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-137623: Use an AC decorator for docstring line length enforcement (#137690)Adam Turner2025-08-181-2/+4
|
* GH-137630: Argument Clinic: Reduce use of 'as' for renaming in ↵Adam Turner2025-08-121-13/+12
| | | | ``_interpretersmodule.c`` (#137680)
* GH-137630: Convert ``_interpreters`` to use Argument Clinic (#137631)Adam Turner2025-08-121-313/+248
|
* Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse ↵Serhiy Storchaka2025-07-221-3/+6
| | | | (GH-121303)" (#136991)
* Fix typo: "occured" =>"occurred" (#134928)Roman2025-07-191-1/+1
| | | Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* gh-135839: Fix `module_traverse` and `module_clear` in subinterp modules ↵sobolevn2025-06-251-4/+2
| | | | (#135937)
* gh-135855: Raise TypeError When Passing Non-dict Object to ↵Brian Schubert2025-06-241-12/+10
| | | | `_interpreters.set___main___attrs` (gh-135856)
* gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)Eric Snow2025-06-171-0/+1
| | | | | | As noted in the new tests, there are a few situations we must carefully accommodate for functions that get pickled during interp.call(). We do so by running the script from the main interpreter's __main__ module in a hidden module in the other interpreter. That hidden module is used as the function __globals__.
* gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)Eric Snow2025-06-131-38/+52
| | | | | | | | | | In this refactor we: * move some code around * make a couple of typedefs opaque * decouple errors from session state * improve tracebacks for propagated exceptions This change helps simplify several upcoming changes.
* gh-132775: Expand the Capability of Interpreter.call() (gh-133484)Eric Snow2025-05-301-102/+312
| | | It now supports most callables, full args, and return values.
* gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)Eric Snow2025-05-261-222/+72
| | | | | This reverts commit 8a793c4a365d06a7264887698ccd7d6ba6aba9f2, AKA gh-134599. This effectively re-applies commit 09e72cf (gh-134511)
* gh-134557: Revert "gh-132775: Use _PyCode GetScriptXIData()" (gh-134599)Eric Snow2025-05-231-72/+222
| | | | | This reverts commit 09e72cf091d, AKA gh-134511. We are reverting due to refleaks on free-threaded builds.
* gh-132775: Make _PyXI_session Opaque (gh-134452)Eric Snow2025-05-221-12/+29
| | | | | | | | | This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code. Making the session opaque requires adding the following internal-only functions: * _PyXI_NewSession() * _PyXI_FreeSession() * _PyXI_GetMainNamespace()
* gh-132775: Use _PyCode GetScriptXIData() (gh-134511)Eric Snow2025-05-221-222/+72
|
* gh-132775: Use _PyFunction_VerifyStateless() and _PyCode_VerifyStateless() ↵Eric Snow2025-05-211-73/+66
| | | | (gh-134439)
* gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)Eric Snow2025-05-211-1/+1
| | | It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`. There's also room for other fallback modes if that later makes sense.
* Add missing whitespace in `is_running_main` comment (#133174)Nybblista2025-05-011-1/+1
|
* gh-132775: Cleanup Related to crossinterp.c Before Further Changes (gh-132974)Eric Snow2025-04-281-61/+61
| | | This change consists of adding tests and moving code around, with some renaming thrown in.
* gh-132781: Cleanup Code Related to NotShareableError (gh-132782)Eric Snow2025-04-251-14/+5
| | | | | | | | | | The following are added to the internal C-API: * _PyErr_FormatV() * _PyErr_SetModuleNotFoundError() * _PyXIData_GetNotShareableErrorType() * _PyXIData_FormatNotShareableError() We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().
* gh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960)Eric Snow2025-04-251-8/+278
| | | This is a partial revert of gh-132821. It resolves the refleak introduced by that PR.
* gh-132776: Cleanup for XIBufferViewType (gh-132821)Eric Snow2025-04-251-244/+8
| | | | | * add notes * rename XIBufferViewObject to xibufferview * move memoryview XIData code to memoryobject.c
* gh-132776: Minor Fixes for XIBufferViewType (gh-132779)Eric Snow2025-04-221-21/+72
| | | | | | | | This change covers the following: * dealloc: no cleanup if no buffer set * dealloc: handle already-destroyed interpreter correctly * handle errors in _memoryview_from_xid() correctly * clean up the buffer if the xidata is never used
* gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)Serhiy Storchaka2025-04-081-6/+3
|
* gh-132171: Fix `_interpreters.run_string` crash on string subclass (#132173)sobolevn2025-04-071-1/+1
|
* gh-132174: Fix function name in error message of `_interpreters.run_string` ↵sobolevn2025-04-071-1/+1
| | | | | (#132175) Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
* gh-131238: Remove includes from pycore_interp.h (#131495)Victor Stinner2025-03-201-4/+2
| | | Remove also now unused includes in C files.
* gh-111178: fix UBSan failures in `Modules/_interp*module.c` (GH-129779)Bénédikt Tran2025-02-171-10/+14
| | | | | Fix UBSan failures for `XIBufferViewObject` Remove redundant casts, suppress unused return values
* gh-127196: Fix crash in `_interpreters`, when `shared` had invalid encodings ↵sobolevn2025-01-091-1/+6
| | | | (#127220)
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707)Eric Snow2024-11-121-4/+13
| | | | | | | | | These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12. This involves the following: * add the _PyXI_GET_STATE() and _PyXI_GET_GLOBAL_STATE() macros * add _PyXIData_lookup_context_t and _PyXIData_GetLookupContext() * add _Py_xi_state_init() and _Py_xi_state_fini()
* gh-76785: Minor Cleanup of Exception-related Cross-interpreter State (gh-126602)Eric Snow2024-11-111-1/+1
| | | This change makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12.
* gh-126654: Fix crash in several functions in `_interpreters` module (#126678)sobolevn2024-11-111-0/+5
|
* gh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)Eric Snow2024-11-071-13/+11
| | | | | | | | The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around. * CrossInterpreterData -> XIData * crossinterpdatafunc -> xidatafunc * split out pycore_crossinterp_data_registry.h * add _PyXIData_lookup_t
* gh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)Peter Bierma2024-10-311-1/+5
| | | | Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Use _PyLong_IsNegative instead of _PyLong_Sign if appropriate. (GH-120493)Serhiy Storchaka2024-06-241-1/+0
| | | It is faster and more obvious.
* Remove almost all unpaired backticks in docstrings (#119231)Geoffrey Thomas2024-05-221-1/+1
| | | | | | | | | | | | | | | | | | As reported in #117847 and #115366, an unpaired backtick in a docstring tends to confuse e.g. Sphinx running on subclasses of standard library objects, and the typographic style of using a backtick as an opening quote is no longer in favor. Convert almost all uses of the form The variable `foo' should do xyz to The variable 'foo' should do xyz and also fix up miscellaneous other unpaired backticks (extraneous / missing characters). No functional change is intended here other than in human-readable docstrings.
* gh-116322: Add Py_mod_gil module slot (#116882)Brett Simmers2024-05-031-0/+1
| | | | | | | | | | | | | | This PR adds the ability to enable the GIL if it was disabled at interpreter startup, and modifies the multi-phase module initialization path to enable the GIL when loading a module, unless that module's spec includes a slot indicating it can run safely without the GIL. PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148. A warning will be issued up to once per interpreter for the first GIL-using module that is loaded. If `-v` is given, a shorter message will be printed to stderr every time a GIL-using module is loaded (including the first one that issues a warning).
* gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)Eric Snow2024-04-241-0/+1567
See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.