Patch 1352 (continued in issue 1329) by Christian Heimes.
Before sys.stderr is set to the proper thing, set it to a really simple
file-like object that can print tracebacks using direct file descriptor I/O.
This is handy for debugging.
diff --git a/Include/fileobject.h b/Include/fileobject.h
index ae127da..40d871a 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -21,6 +21,13 @@
*/
PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
+/* Internal API
+
+ The std printer acts as a preliminary sys.stderr until the new io
+ infrastructure is in place. */
+PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
+PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
+
#ifdef __cplusplus
}
#endif