Message338533
This is because PyUnicode_DecodeFSDefaultAndSize calls _PyInterpreterState_GET_UNSAFE(), which already documents the potential NULL return value.
/* Get the current interpreter state.
The macro is unsafe: it does not check for error and it can return NULL.
The caller must hold the GIL.
See also _PyInterpreterState_Get()
and _PyGILState_GetInterpreterStateUnsafe(). */
#define _PyInterpreterState_GET_UNSAFE() (_PyThreadState_GET()->interp)
> Python has a *very large* C API. It doesn't seem worth it to me to modify every single Python function to detect when the API is misused.
Understood, happy for this to be closed. Aware that I was misusing the API :-) |
|
Date |
User |
Action |
Args |
2019-03-21 09:28:42 | anthony shaw | set | recipients:
+ anthony shaw, vstinner |
2019-03-21 09:28:42 | anthony shaw | set | messageid: <1553160522.24.0.227960855858.issue36386@roundup.psfhosted.org> |
2019-03-21 09:28:42 | anthony shaw | link | issue36386 messages |
2019-03-21 09:28:42 | anthony shaw | create | |
|