[PyPy-issue] [issue402] codecs are broken in pypy-c

Amaury Forgeot d Arc pypy-dev-issue at codespeak.net
Fri Mar 18 11:04:27 CET 2011


Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

To decode a source file, pypy calls:
   unicode(text, encoding)
When CPython uses the equivalent of:
   codecs.getreader(encoding)(input_stream).readline

Note that even with CPython, your encoding is incorrect:
   compile(open(filename).read(), 'file', 'exec')
fails with a SyntaxError, because the input is now a string (instead of a file) and 
text.decode(encoding) is called on the whole content.

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue402>
_______________________________________________________



More information about the Pypy-issue mailing list