Change error message for a NULL
thread state on the free-threaded build
#127314
Labels
NULL
thread state on the free-threaded build
#127314
Feature or enhancement
Proposal:
In the C API, this message tends to be shown if you call a function without an active thread state:
While reviewing #125962, I noticed that users don't really understand the distinction between having a thread state and the GIL being acquired, so I would imagine that C API users might end up very confused as to why Python is telling them that they need the GIL while it's disabled. In fact, I sort of noticed this in passing when figuring out #123134--users erroneously seemed to think that on the free-threaded build, it was OK to call functions in a fresh thread without calling
PyGILState_Ensure
or something first.I think this is sort of a documentation problem (we should try to do a better job of clarifying the difference between "GIL" and "thread state"), but changing this error on the free-threaded build is a good start.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: