diff Python/compile.c @ 65536:42b84d3188d1 3.1

Recorded merge of revisions 85569-85570 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85569 | victor.stinner | 2010-10-16 15:14:10 +0200 (sam., 16 oct. 2010) | 4 lines 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. ........ r85570 | victor.stinner | 2010-10-16 15:42:53 +0200 (sam., 16 oct. 2010) | 4 lines Fix ast_error_finish() and err_input(): filename can be NULL Fix my previous commit (r85569). ........
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 19 Oct 2010 01:22:07 +0000
parents 2907ce8bfbb6
children 4e472427315e 3c9232a684ae
line wrap: on
line diff
--- a/Python/compile.c	Mon Oct 18 13:49:09 2010 +0000
+++ b/Python/compile.c	Tue Oct 19 01:22:07 2010 +0000
@@ -4046,7 +4046,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;