From 88bd891e6c536cec0b53d2a52115f44f8498c331 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 15 Oct 2010 22:46:07 +0000 Subject: [PATCH] Fix imp_cache_from_source(): Decode make_compiled_pathname() result from the 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/import.c b/Python/import.c index 857529370f9..94363deae02 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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,