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 vstinner
Recipients Tim.Graham, berker.peksag, pitrou, python-dev, serhiy.storchaka, vstinner
Date 2015-03-30.08:38:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Serhiy Storchaka added the comment:
> The second (exception == NULL) check in _Py_PrintFatalError() looks suspicious. When it is possible? And if it is possible, can it cause leaks?

Sorry, I have no idea. I didn't write this code myself. It comes from

    PyErr_Fetch(&exception, &v, &tb);
    if (exception == NULL)
    PyErr_NormalizeException(&exception, &v, &tb);
    if (tb == NULL) {
        tb = Py_None;
    PyException_SetTraceback(v, tb);
    if (exception == NULL)

I read again PyErr_NormalizeException(). I'm not sure that the case
can occur in practice. Maybe it can be replaced with an assertion?
Since Py_FatalError() is called in catastrophic cases, I chose to not
try to drop safety checks :-) You can modify PyErr_PrintEx() or even
_Py_PrintFatalError() if you feel more brave than me :-D
Date User Action Args
2015-03-30 08:38:51vstinnersetrecipients: + vstinner, pitrou, python-dev, berker.peksag, serhiy.storchaka, Tim.Graham
2015-03-30 08:38:51vstinnerlinkissue23571 messages
2015-03-30 08:38:50vstinnercreate