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.
This commit is contained in:
Victor Stinner 2010-10-16 13:14:10 +00:00
parent 5a7913eb3b
commit 4c7c8c3023
7 changed files with 69 additions and 28 deletions

View file

@ -3942,7 +3942,7 @@ makecode(struct compiler *c, struct assembler *a)
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;