Author serhiy.storchaka
Recipients Chris.Colbert, serhiy.storchaka
Date 2014-11-18.10:40:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thank you for your report Chris.

PyObject_REPR() is used only in Python/compile.c just before calling Py_FatalError(). So refcount leaks doesn't matter in these cases.

PyObject_REPR() is expanded to deprecated _PyUnicode_AsString which is not defined if Py_LIMITED_API is defined. So it is unlikely that third-party code uses it. We can just remove this macro in 3.5.

There are other bugs in formatting fatal error messages where PyObject_REPR() is used. PyBytes_AS_STRING() is called for unicode objects. Definitely this branch of the code is rarely executed.

Here is a patch which expands PyObject_REPR() in Python/compile.c and replaces PyBytes_AS_STRING() with PyUnicode_AsUTF8(). In 3.5 we also should remove the PyObject_REPR macro definition.
Date User Action Args
2014-11-18 10:40:50serhiy.storchakasetrecipients: + serhiy.storchaka, Chris.Colbert
2014-11-18 10:40:50serhiy.storchakasetmessageid: <>
2014-11-18 10:40:50serhiy.storchakalinkissue22453 messages
2014-11-18 10:40:49serhiy.storchakacreate