Index: Python/import.c =================================================================== --- Python/import.c (revision 69635) +++ Python/import.c (working copy) @@ -991,7 +991,7 @@ if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname)) return 0; - newname = PyUnicode_FromString(pathname); + newname = PyUnicode_DecodeFSDefault(pathname); if (newname == NULL) return -1;