-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
MNT: Add linter for thread-unsafe C API uses #26159
Copy link
Copy link
Closed
Labels
03 - Maintenance39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)sprintableIssue fits the time-frame and setting of a sprintIssue fits the time-frame and setting of a sprint
Metadata
Metadata
Assignees
Labels
03 - Maintenance39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)sprintableIssue fits the time-frame and setting of a sprintIssue fits the time-frame and setting of a sprint
As noted in PEP 703 C API functions that return borrowed references are problematic in the nogil build.
We need to audit our usages and replace any that upgrade a borrowed reference to an owned reference with alternate C API functions that return new references.
Problematic Functions:
PyList_GetItem(MNT: migrate PyList_GetItem usages to PyList_GetItemRef #26246)PyList_GET_ITEM(all existing usages are in argument parsing)PyDict_GetItemPyDict_GetItemWithErrorPyDict_NextPyDict_GetItemString(ENH: fix thread-unsafe C API usages #27145 for the PyDict items)._PyDict_GetItemStringWithError(MNT: replace _PyDict_GetItemStringWithError with PyDict_GetItemStringRef #26282)