Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (revision 62084) +++ Python/pythonrun.c (working copy) @@ -1273,8 +1273,15 @@ Py_DECREF(value); /* If an error happened here, don't show it. XXX This is wrong, but too many callers rely on this behavior. */ - if (err != 0) + if (err != 0) { + /* Warn about parts of the exception not displayed */ + if (PyErr_Occurred() && + PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) + PyErr_WarnEx(PyExc_UnicodeWarning, + "The exception and/or traceback could not be encoded properly.", + 2); PyErr_Clear(); + } } PyObject *