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

Alfredo Deza pypy-dev-issue at codespeak.net
Fri Mar 18 02:33:27 CET 2011

Alfredo Deza <alfredodeza at gmail.com> added the comment:

The ``codecs`` module in pypy is behaving differently than CPython 2.5 and 2.6. The issue comes 
when you want to register a custom encoding. PyPy raises a syntax error because it was unable to 
"translate" via the registered codec.

If it gets executed with Python, no exception is raised because the registered encoding with the search 
function is actually translating correctly.

To replicate I have uploaded a tar.gz with 2 files. One file with a custom "foobar" encoding called 
custom_encoding.py. The other file is called foobar.py and this is the file in charge of doing exec on 

To replicate the issue:

# this doesn't raise an exception
python foobar.py

# this raises a syntax error
pypy foobar.py

I'm using pypy v 1.4.1

status: resolved -> in-progress

PyPy development tracker <pypy-dev-issue at codespeak.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: codec_issue.tar.gz
Type: application/x-gzip
Size: 752 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-issue/attachments/20110318/7f6b1c80/attachment.bin>

More information about the Pypy-issue mailing list