You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose _Py_NewInterpreter() as Py_NewInterpreterFromConfig() #98608
A while back I added _Py_NewInterpreter() (a "private" API) to support configuring the new interpreter. Ultimately, I'd like to adjust
the signature a little and then make the function part of the public API (as Py_NewInterpreterFromConfig()).
My plan:
change the argument to a new _PyInterpreterConfig struct
rename the function to Py_NewInterpreterFromConfig(), inspired by Py_InitializeFromConfig() (takes a PyInterpreterConfig instead of isolated_subinterpreter)
split up the boolean isolated_subinterpreter into the corresponding multiple granular settings
allow_fork
allow_subprocess
allow_threads
drop PyConfig._isolated_interpreter
Note that the current default (Py_NewInterpeter() and Py_Initialize*()) allows fork, subprocess, and threads, and the optional "isolated" interpreter disables all three. I'm not planning on changing any of that here.
My main objective here is to expose the existing API in a way that we can do the following afterward:
stop giving the option to disallow subprocess (i.e. drop PyInterpreterConfig.allow_subprocess)
add an option to disallow just "exec" instead
stop disallowing threads as a default behavior for an "isolated" interpreter (we'd still keep the option though)
add the option to disallow daemon threads
add an option to check if each extension supports running in multiple interpreters
add other options for PEP 684 (per-interpreter GIL)
Activity
gh-98608: Change _Py_NewInterpreter() to _Py_NewInterpreterFromConfig…
gh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig(…
gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)
pythongh-98608: Fix Failure-handling in new_interpreter() (pythongh-1…
pythongh-98608: Fix Failure-handling in new_interpreter() (pythongh-1…
gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)
gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)
pythongh-98608: Stop Treating All Errors from _Py_NewInterpreterFromC…
pythongh-98608: Fix Failure-handling in new_interpreter() (pythongh-1…
pythongh-98608: Stop Treating All Errors from _Py_NewInterpreterFromC…
pythongh-98608: Fix Failure-handling in new_interpreter() (pythongh-1…
pythongh-98608: Move PyInterpreterConfig to pylifecycle.h
gh-98608: Move PyInterpreterConfig to pylifecycle.h (#107191)
pythongh-98608: Move PyInterpreterConfig to pylifecycle.h (pythonGH-1…
[3.12] gh-98608: Move PyInterpreterConfig to pylifecycle.h (GH-107191) (
pythongh-98608: Move PyInterpreterConfig to pylifecycle.h (python#107191