[issue10095] Support undecodable filenames in the parser API

2010-10-14 Thread STINNER Victor
STINNER Victor added the comment: > We shouldn't need to reopen the file in the first place. > If we already have a file handle, we can rewind it. > Then the encoding of the file name becomes irrelevant. Oh yes, great idea. r85476 implements this solution (use lseek(0) on fileno(tok->fp)). Th

[issue10095] Support undecodable filenames in the parser API

2010-10-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: We shouldn't need to reopen the file in the first place. If we already have a file handle, we can rewind it. Then the encoding of the file name becomes irrelevant. I keep forgetting: what was the plan for deprecating the FILE* functions in the parser interf

[issue10095] Support undecodable filenames in the parser API

2010-10-13 Thread STINNER Victor
New submission from STINNER Victor : It looks like the parser API (eg. PyParser_ParseFileFlagsEx, PyParser_ASTFromFile) expects utf-8 filename: err_input() decodes the filename from utf-8. But Example in a non-ascii directory (/home/SHARE/SVN/py3kéŁ) and an ascii locale: $ LANG= ./python