[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2021-02-21 Thread STINNER Victor
STINNER Victor added the comment: I made a similar change in _PyDict_GetItemHint(): commit d5fc99873769f0d0d5c5d5d99059177a75a4e46e (HEAD -> master, upstream/master) Author: Victor Stinner Date: Sun Feb 21 12:02:04 2021 +0100 bpo-42093: Cleanup _PyDict_GetItemHint() (GH-24582)

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-02 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-02 Thread STINNER Victor
STINNER Victor added the comment: New changeset 59d3dce69b0a4f6ee17578ae68037cc7ae90936f by Victor Stinner in branch 'master': bpo-40839: PyDict_GetItem() requires the GIL (GH-20580) https://github.com/python/cpython/commit/59d3dce69b0a4f6ee17578ae68037cc7ae90936f -- __

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-01 Thread STINNER Victor
STINNER Victor added the comment: 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

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-01 Thread STINNER Victor
STINNER Victor added the comment: Note: I created this issue while working on bpo-40826 "PyOS_InterruptOccurred() now requires to hold the GIL: PyOS_Readline() crash". -- ___ Python tracker

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-01 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +19819 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20580 ___ Python tracker ___ _

[issue40839] Disallow calling PyDict_GetItem() with the GIL released

2020-06-01 Thread STINNER Victor
New submission from STINNER Victor : 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 ke