Issue #6543: Write the traceback in the terminal encoding instead of utf-8.

Fix the encoding of the modules filename.

Reindent also traceback.h, just because I hate tabs :-)
This commit is contained in:
Victor Stinner 2010-06-17 23:08:50 +00:00
parent 870f09a7f4
commit 0fe25a445d
6 changed files with 70 additions and 57 deletions

View file

@ -1190,7 +1190,7 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
d = PyModule_GetDict(m);
if (PyDict_GetItemString(d, "__file__") == NULL) {
PyObject *f;
f = PyUnicode_DecodeFSDefault(filename);
f = PyUnicode_FromString(filename);
if (f == NULL)
return -1;
if (PyDict_SetItemString(d, "__file__", f) < 0) {