Author vstinner
Recipients docs@python, eric.snow, miss-islington, ncoghlan, ned.deily, vstinner, xiang.zhang
Date 2018-06-28.12:49:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530190195.52.0.56676864532.issue33932@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-06-28 12:49:55vstinnersetrecipients: + vstinner, ncoghlan, ned.deily, docs@python, eric.snow, xiang.zhang, miss-islington
2018-06-28 12:49:55vstinnersetmessageid: <1530190195.52.0.56676864532.issue33932@psf.upfronthosting.co.za>
2018-06-28 12:49:55vstinnerlinkissue33932 messages
2018-06-28 12:49:55vstinnercreate