summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_interpreters/test_api.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-127165: Disallow embedded NULL characters in `_interpreters` ↵Miss Islington (bot)2024-12-011-0/+4
| | | | | | | | (GH-127199) (#127463) gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199) (cherry picked from commit 46bfd26fb294a8769ef6d0c056ee6c9df022a037) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-126223: Propagate unicode errors in `_interpreters.create()` ↵Miss Islington (bot)2024-10-311-0/+3
| | | | | | | | | | (GH-126224) (#126242) gh-126223: Propagate unicode errors in `_interpreters.create()` (GH-126224) (cherry picked from commit 01415213d72504eafc159721a8f55d57b374fd9c) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-112730: Make the test suite resilient to color-activation environment ↵Pablo Galindo Salgado2024-04-241-0/+2
| | | | variables (#117672)
* gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)Eric Snow2024-04-241-8/+8
| | | See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.
* gh-76785: Fix Windows Refleak in test_interpreters (gh-117913)Eric Snow2024-04-161-3/+0
| | | gh-117662 introduced some refleaks, or, rather, exposed some existing refleaks. The leaks are coming when test.support.os_helper is imported in a "legacy" interpreter. I've updated test.test_interpreters.utils to avoid importing os_helper, which fixes the leaks. I'll address the root cause separately.
* gh-76785: Handle Legacy Interpreters Properly (gh-117490)Eric Snow2024-04-111-72/+133
| | | This is similar to the situation with threading._DummyThread. The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create(). The simplest thing to start with is to disable any method that modifies or runs in the interpreter. As part of this, the runtime keeps track of where an interpreter was created. We also handle interpreter "refcounts" properly.
* gh-117649: Raise ImportError for unsupported modules in free-threaded build ↵Sam Gross2024-04-111-8/+5
| | | | | | | | | | (#117651) The free-threaded build does not currently support the combination of single-phase init modules and non-isolated subinterpreters. Ensure that `check_multi_interp_extensions` is always `True` for subinterpreters in the free-threaded build so that importing these modules raises an `ImportError`.
* gh-76785: Add More Tests to test_interpreters.test_api (gh-117662)Eric Snow2024-04-111-38/+502
| | | In addition to the increase test coverage, this is a precursor to sorting out how we handle interpreters created directly via the C-API.
* gh-76785: Raise InterpreterError, Not RuntimeError (gh-117489)Eric Snow2024-04-031-5/+5
| | | | | I had meant to switch everything to InterpreterError when I added it a while back. At the time I missed a few key spots. As part of this, I've added print-the-exception to _PyXI_InitTypes() and fixed an error case in `_PyStaticType_InitBuiltin().
* gh-76785: Consolidate Some Interpreter-related Testing Helpers (gh-117485)Eric Snow2024-04-021-2/+209
| | | This eliminates the duplication of functionally identical helpers in the _testinternalcapi and _xxsubinterpreters modules.
* gh-76785: Minor Improvements to "interpreters" Module (gh-116328)Eric Snow2024-03-051-0/+7
| | | This includes adding pickle support to various classes, and small changes to improve the maintainability of the low-level _xxinterpqueues module.
* gh-76785: Update test.support.interpreters to Align With PEP 734 (gh-115566)Eric Snow2024-02-281-54/+237
| | | | | This brings the code under test.support.interpreters, and the corresponding extension modules, in line with recent updates to PEP 734. (Note: PEP 734 has not been accepted at this time. However, we are using an internal copy of the implementation in the test suite to exercise the existing subinterpreters feature.)
* gh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)Eric Snow2023-12-131-0/+48
| | | When an exception is uncaught in Interpreter.exec_sync(), it helps to show that exception's error display if uncaught in the calling interpreter. We do so here by generating a TracebackException in the subinterpreter and passing it between interpreters using pickle.
* gh-76785: Add Interpreter.prepare_main() (gh-113021)Eric Snow2023-12-121-0/+57
| | | This is one of the last pieces to get test.support.interpreters in sync with PEP 734.
* gh-76785: Fixes for test.support.interpreters (gh-112982)Eric Snow2023-12-121-0/+642
This involves a number of changes for PEP 734.