This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients docs@python, emilyemorehouse, eric.snow, hroncok, miss-islington, ncoghlan, ned.deily, vstinner, xiang.zhang
Date 2018-06-29.18:12:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I looked quickly at _Py_InitializeCore() and I'm not sure
> that it's designed to replace an existing configuration.
> ...
> So maybe for this specific case, _Py_InitializeCore() should
> always set Py_HashRandomizationFlag.


At the same time, the use of Py_*Flag variables is a little unclear in the PEP 432 world.  Under the PEP I'd expect code in CPython to use the core config from the current PyInterpreterState (or even _PyRuntimeState), rather than the global flag variables.  So presumably (the PEP doesn't talk about it) the intent of keeping them is to help folks that currently make use of the flags.  However, they shouldn't be modifying them after initialization, and under PEP 432 they don't need to set them beforehand (they set values on the config), right?

Part of the problem here is that Py_Main() results in all the flag variables getting set (before runtime initialization).  However, with the current PEP 432 [internal] implementation those variables are (mostly) never getting set, right?  Shouldn't we set all of them, but only at the end of _Py_InitializeCore() (for the sake of extensions/embedders that use them)?  In that case we'd need to replace our internal use of Py_HashRandomizationFlag with field on the config struct on _PyRuntimeState.

> But it was just one example to show that right now,
> _Py_InitializeCore() doesn't seem to support to be called
> twice with two different configurations.

Are there other things (than how we set that flag) that break in that case?  Regardless, what would ensure that it works properly?
Date User Action Args
2018-06-29 18:12:17eric.snowsetrecipients: + eric.snow, ncoghlan, vstinner, ned.deily, docs@python, xiang.zhang, emilyemorehouse, hroncok, miss-islington
2018-06-29 18:12:17eric.snowsetmessageid: <>
2018-06-29 18:12:17eric.snowlinkissue33932 messages
2018-06-29 18:12:17eric.snowcreate