diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-17 19:34:51 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-17 19:34:51 (GMT) |
commit | e0f32687152615b7266e66cbee216434fbbdd5bc (patch) | |
tree | c1289093a7c9e848378f58ae79b2c88a42582142 /Modules/main.c | |
parent | c049982ea5dd26282e82d4874a0854df617ec45e (diff) | |
download | cpython-e0f32687152615b7266e66cbee216434fbbdd5bc.zip cpython-e0f32687152615b7266e66cbee216434fbbdd5bc.tar.gz cpython-e0f32687152615b7266e66cbee216434fbbdd5bc.tar.bz2 |
run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead of
PyUnicode_AsUTF8String()
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c index 0c38fac..7df883c 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 = "<decoding error>"; + filename_str = "<encoding error>"; } } else |