[Python-Dev] New _Py_InitializeFromConfig() function (PEP 432)

Barry Warsaw barry at python.org
Wed Aug 1 20:15:52 EDT 2018


On Jul 31, 2018, at 15:14, Victor Stinner <vstinner at redhat.com> wrote:
> 
> I finished my work on the _PyCoreConfig structure: it's a C structure
> in Include/pystate.h which has many fields used to configure Python
> initialization. In Python 3.6 and older, these parameters were scatted
> around the code, and it was hard to get an exhaustive list of it.

Great work Victor!  +1 for making _PyCoreConfig public, although I’m sure you’re only proposing that for Python 3.8, not in any future backport.

> I had to refactor a lot of code to implement all of that.
> 
> 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
>  https://bugs.python.org/issue34008
> * PYTHONOPTIMIZE environment variable is ignored by Py_Initialize()
>   https://bugs.python.org/issue34247
> 
> 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.

Do you have WIP branch for the backport?  I agree that it’s probably low enough risk given the private nature of the API in 3.7, but that it’s up to Ned to decide.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180801/65622f5b/attachment.sig>


More information about the Python-Dev mailing list