Kaydet (Commit) 4a3733d1 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #9425: save/restore exception on filename encoding

_PyUnicode_AsString() raises an exception on unencodable filename.
üst 028dd97d
......@@ -1213,7 +1213,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL;
#endif
#if defined(Py_DEBUG) || defined(LLTRACE)
filename = _PyUnicode_AsString(co->co_filename);
{
PyObject *error_type, *error_value, *error_traceback;
PyErr_Fetch(&error_type, &error_value, &error_traceback);
filename = _PyUnicode_AsString(co->co_filename);
PyErr_Restore(error_type, error_value, error_traceback);
}
#endif
why = WHY_NOT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment