]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix imp_cache_from_source(): Decode make_compiled_pathname() result from the
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 15 Oct 2010 22:46:07 +0000 (22:46 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 15 Oct 2010 22:46:07 +0000 (22:46 +0000)
filesystem encoding instead of utf-8.

imp_cache_from_source() encodes the input path to filesystem encoding and this
path is passed to make_compiled_pathname().

Python/import.c

index 857529370f974be0db81b4655793f4d425ce937a..94363deae0215dc901023e643d8b7e0ada5fe551 100644 (file)
@@ -3483,7 +3483,7 @@ imp_cache_from_source(PyObject *self, PyObject *args, PyObject *kws)
         PyErr_Format(PyExc_SystemError, "path buffer too short");
         return NULL;
     }
-    return PyUnicode_FromString(buf);
+    return PyUnicode_DecodeFSDefault(buf);
 }
 
 PyDoc_STRVAR(doc_cache_from_source,