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 vstinner
Recipients barry, christian.heimes, vstinner
Date 2018-06-22.07:04:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529651081.24.0.56676864532.issue33919@psf.upfronthosting.co.za>
In-reply-to
Content
> I think the basic implementation problem is that by the time you get to get_hash_info() in sysmodule.c, you no longer have access to the _PyCoreConfig object, nor the _PyMain object that it's generally attached to.

An interpreter now keeps a copy of _PyCoreConfig and _PyMainInterpreterConfig.

See for example make_flags() in sysmodule.c:

_PyCoreConfig *core_config = &_PyGILState_GetInterpreterStateUnsafe()->core_config;
...
PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(core_config->dev_mode));

The interpreter really owns the copy of these configs and they are kept until the interpreter object is destroyed.

Another example:

static PyObject *
import_find_and_load(PyObject *abs_name)
{
    ...
    int import_time = interp->core_config.import_time;
    ...
}
History
Date User Action Args
2018-06-22 07:04:41vstinnersetrecipients: + vstinner, barry, christian.heimes
2018-06-22 07:04:41vstinnersetmessageid: <1529651081.24.0.56676864532.issue33919@psf.upfronthosting.co.za>
2018-06-22 07:04:41vstinnerlinkissue33919 messages
2018-06-22 07:04:41vstinnercreate