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 vstinner
Date 2020-06-01.18:46:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
For historical reasons, it was allowed to call the PyDict_GetItem() function with the GIL released.
I propose to change PyDict_GetItem() to fail with a fatal error if it's called with the GIL released.

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.

In Python 3.8 and then 3.9, some functions started to crash when called without holding the GIL. It caused some bad surprises to C extension modules authors. Example: gdb developers with bpo-40826. In my opinion, holding the GIL was always required even if it is not very explicit in the documentation of the C API (only the documentation of few functions are explicit about the GIL).
Date User Action Args
2020-06-01 18:46:37vstinnersetrecipients: + vstinner
2020-06-01 18:46:37vstinnersetmessageid: <>
2020-06-01 18:46:37vstinnerlinkissue40839 messages
2020-06-01 18:46:37vstinnercreate