From: Victor Stinner Date: Sun, 17 Oct 2010 19:34:51 +0000 (+0000) Subject: run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead of X-Git-Tag: v3.2a4~467 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0f32687152615b7266e66cbee216434fbbdd5bc;p=thirdparty%2FPython%2Fcpython.git run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead of PyUnicode_AsUTF8String() --- diff --git a/Modules/main.c b/Modules/main.c index 0c38fac24e95..7df883c8bb7d 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -280,14 +280,14 @@ run_file(FILE *fp, const wchar_t *filename, PyCompilerFlags *p_cf) if (filename) { unicode = PyUnicode_FromWideChar(filename, wcslen(filename)); if (unicode != NULL) { - bytes = PyUnicode_AsUTF8String(unicode); + bytes = PyUnicode_EncodeFSDefault(unicode); Py_DECREF(unicode); } if (bytes != NULL) filename_str = PyBytes_AsString(bytes); else { PyErr_Clear(); - filename_str = ""; + filename_str = ""; } } else