diff Modules/main.c @ 65484:39cdcc7d3e20

run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead of PyUnicode_AsUTF8String()
author Victor Stinner <victor.stinner@haypocalc.com>
date Sun, 17 Oct 2010 19:34:51 +0000
parents 3794c9b50824
children 0b5bfba7a907
line wrap: on
line diff
--- a/Modules/main.c	Sun Oct 17 19:16:33 2010 +0000
+++ b/Modules/main.c	Sun Oct 17 19:34:51 2010 +0000
@@ -280,14 +280,14 @@
     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