Author serhiy.storchaka
Recipients Chris.Colbert, pitrou, serhiy.storchaka, vstinner
Date 2014-11-18.16:39:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> For the second part, you can use PySys_FormatStderr() which is more complex but more correct

PySys_FormatStderr() is more heavy function, it depends on working sys.stderr and codecs. Taking into account the lack of tests we should be careful with such changes. So I prefer to keep fprintf.

> Py_LIMITED_API is the "stable ABI". Most third-party code doesn't use it, so it may still use PyObject_REPR().

So we should just add a warning? This macro is not documented anywhere.

-/* Helper for passing objects to printf and the like */
-#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
+#ifndef Py_LIMITED_API
+/* Helper for passing objects to printf and the like.
+   Leaks refcounts.  Don't use it!
+#define PyObject_REPR(obj) PyUnicode_AsUTF8(PyObject_Repr(obj))
Date User Action Args
2014-11-18 16:39:07serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, Chris.Colbert
2014-11-18 16:39:07serhiy.storchakasetmessageid: <>
2014-11-18 16:39:07serhiy.storchakalinkissue22453 messages
2014-11-18 16:39:06serhiy.storchakacreate