mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
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:
parent
870f09a7f4
commit
0fe25a445d
6 changed files with 70 additions and 57 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue