Author vstinner
Recipients Decorater, eric.snow, ncoghlan, serhiy.storchaka, vstinner
Date 2017-11-22.17:34:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511372071.25.0.213398074469.issue32096@psf.upfronthosting.co.za>
In-reply-to
Content
>  We *don't* currently have anything like that for environment variables, not even the ones which are "read once at startup, then never read them again".

I changed Py_Main() in bpo-32030. Now multiple environment variables are read once at startup and put into _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Modules/main.c#L1365-L1413

I added new fields to _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Include/pystate.h#L27-L39

I suggest to continue to add more fields to _PyCoreConfig to move all code to configure Python before Py_Initialize(), and later to let users embedding Python to configure Python as they want, without losing features. For example, to enable the new "development mode" (-X dev), now you "just" have to set _PyCoreConfig.dev_mode to 1.
History
Date User Action Args
2017-11-22 17:34:31vstinnersetrecipients: + vstinner, ncoghlan, eric.snow, serhiy.storchaka, Decorater
2017-11-22 17:34:31vstinnersetmessageid: <1511372071.25.0.213398074469.issue32096@psf.upfronthosting.co.za>
2017-11-22 17:34:31vstinnerlinkissue32096 messages
2017-11-22 17:34:31vstinnercreate