[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:

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>

More information about the Pypy-issue mailing list