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 anthony shaw
Recipients anthony shaw, vstinner
Date 2019-03-21.09:28:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553160522.24.0.227960855858.issue36386@roundup.psfhosted.org>
In-reply-to
Content
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 :-)
History
Date User Action Args
2019-03-21 09:28:42anthony shawsetrecipients: + anthony shaw, vstinner
2019-03-21 09:28:42anthony shawsetmessageid: <1553160522.24.0.227960855858.issue36386@roundup.psfhosted.org>
2019-03-21 09:28:42anthony shawlinkissue36386 messages
2019-03-21 09:28:42anthony shawcreate