[Python-Dev] New _Py_InitializeFromConfig() function (PEP 432)
ericsnowcurrently at gmail.com
Wed Aug 1 19:18:41 EDT 2018
On Tue, Jul 31, 2018 at 4:15 PM Victor Stinner <vstinner at redhat.com> wrote:
> I finished my work on the _PyCoreConfig structure:
Thanks for all the good work!
> Right now, the new API is still private. Nick Coghlan splitted the
> initialization in two parts: "core" and "main". I'm not sure that this
> split is needed.
The "core" config is basically the config for the runtime. In fact,
PEP 432 renamed "core" to "runtime". Please keep the firm distinction
between the runtime and the (main) interpreter.
> We should see what to do, but it would be nice to
> make the _PyCoreConfig API public! IMHO it's way better than the old
> way to configuration Python initialization.
However, shouldn't that happen after PEP 432 is accepted?
> The problem is that Python 3.7 got the half-baked implementation, and
> it caused issues:
> * Calling Py_Main() after Py_Initialize() fails with a fatal error on
> Python 3.7.0
> * PYTHONOPTIMIZE environment variable is ignored by Py_Initialize()
> I fixed the first issue, I'm now working on the second one to see how
> it can be fixed. Other option would be to backport the code from
> master to the 3.7 branch, since the code in master has a way better
> design. But it requires to backport a lot of changes. I'm not sure yet
> what is the best option.
Backporting shouldn't be so risky since it's all private API and there
are few other changes in the relevant code since 3.7, right? It
depends on if Ned's okay with it or not. :)
More information about the Python-Dev