Author ronaldoussoren
Recipients brett.cannon, eric.snow, ncoghlan, ned.deily, ronaldoussoren, vstinner
Date 2018-07-28.09:52:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532771571.29.0.56676864532.issue34247@psf.upfronthosting.co.za>
In-reply-to
Content
Interesting... pylifecycle.c uses code in main.c, I hadn't expected that.

If I've read the code correctly Py_Initialize won't look at PYTHONOPTIMZE at all (and other environment variables that have a command-line equivalent). Those are read in main.c:cmdline_get_env_flags, which is only called (indirectly) from Py_Main and _Py_UnixMain. 

I'm note sure what's the correct solution for this.

1. Reading PYTHONOPTIMZE (and related variables) could be done 
   in _PyCoreConfig_Read, but that would then need to grow a flag to ensure
   that this won't replace values calculated earlier in the implementation 
   of Py_Main

2. Writing back the global variables is probably best done using a new
   function (lets _PyCoreConfig_SetGlobals), mirroring    
   pymain_set_global_config but using a _PyCoreConfig config structure
   instead of the command-line structure used by the latter function.
History
Date User Action Args
2018-07-28 09:52:51ronaldoussorensetrecipients: + ronaldoussoren, brett.cannon, ncoghlan, vstinner, ned.deily, eric.snow
2018-07-28 09:52:51ronaldoussorensetmessageid: <1532771571.29.0.56676864532.issue34247@psf.upfronthosting.co.za>
2018-07-28 09:52:51ronaldoussorenlinkissue34247 messages
2018-07-28 09:52:51ronaldoussorencreate