Repository navigation
Expose _Py_NewInterpreter() as Py_NewInterpreterFromConfig() #98608
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancementinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)3.12only security fixesonly security fixes
on Oct 24, 2022 - added a commit that references this issue
on Oct 26, 2022 - added 4 commits that reference this issue
on Mar 21, 2023
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement
Projects
- StatusShow more project fieldsDone
A while back I added
_Py_NewInterpreter()(a "private" API) to support configuring the new interpreter. Ultimately, I'd like to adjustthe signature a little and then make the function part of the public API (as
Py_NewInterpreterFromConfig()).My plan:
_PyInterpreterConfigstructPy_NewInterpreterFromConfig(), inspired byPy_InitializeFromConfig()(takes aPyInterpreterConfiginstead ofisolated_subinterpreter)isolated_subinterpreterinto the corresponding multiple granular settingsPyConfig._isolated_interpreterNote that the current default (
Py_NewInterpeter()andPy_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:
PyInterpreterConfig.allow_subprocess)Linked PRs