diff Python/compile.c @ 65399:55ed5c524428

Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expects filenames encoded to the filesystem encoding with surrogateescape error handler (to support undecodable bytes), instead of UTF-8 in strict mode.
author Victor Stinner <victor.stinner@haypocalc.com>
date Sat, 16 Oct 2010 13:14:10 +0000
parents 861c35cef7aa
children 244cbcb67dcd
line wrap: on
line diff
--- a/Python/compile.c	Sat Oct 16 11:29:07 2010 +0000
+++ b/Python/compile.c	Sat Oct 16 13:14:10 2010 +0000
@@ -3942,7 +3942,7 @@
     freevars = dict_keys_inorder(c->u->u_freevars, PyTuple_Size(cellvars));
     if (!freevars)
         goto error;
-    filename = PyUnicode_FromString(c->c_filename);
+    filename = PyUnicode_DecodeFSDefault(c->c_filename);
     if (!filename)
         goto error;