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 eric.snow, ncoghlan, vstinner
Date 2020-06-01.18:56:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Current comment in Objects/dictobject.c:

    /* We can arrive here with a NULL tstate during initialization: try
       running "python -Wi" for an example related to string interning.
       Let's just hope that no exception occurs then...  This must be
       _PyThreadState_GET() and not PyThreadState_Get() because the latter
       abort Python if tstate is NULL. */

PyDict_GetItem() is no longer called before Py_Initialize(). I reworked the Python startup to no longer use Python objects before Py_Initialize(): see PEP 587 (PyConfig).

> To help C extension modules authors, I propose to keep a check at the runtime even in release build. Later, we may drop this check in release mode and only keep it in debug mode.

Hum, since the whole test pass with the change and it was not documented that it was possible to call the function with the GIL released, I changed my mind and only kept the runtime check in debug mode.
Date User Action Args
2020-06-01 18:56:17vstinnersetrecipients: + vstinner, ncoghlan, eric.snow
2020-06-01 18:56:17vstinnersetmessageid: <>
2020-06-01 18:56:17vstinnerlinkissue40839 messages
2020-06-01 18:56:17vstinnercreate