STINNER Victor <[email protected]> added the comment:
I looked quickly at _Py_InitializeCore() and I'm not sure that it's designed to
replace an existing configuration.
Example:
int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
(...)
if (!core_config->use_hash_seed || core_config->hash_seed) {
/* Random or non-zero hash seed */
Py_HashRandomizationFlag = 1;
}
If Py_Initialize() sets Py_HashRandomizationFlag to 1, but Py_Main() doesn't
use an hash seed, Py_HashRandomizationFlag value remains 1 which is wrong.
pymain_read_conf() fills _PyCoreConfig from global configuration flags, but
then global configuration flags are supposed to be set from the global
configuration flags.
So maybe for this specific case, _Py_InitializeCore() should always set
Py_HashRandomizationFlag. 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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33932>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com