New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 #597
Comments
github and pasteibins screws up the test code |
Hm, on what system? Is there any unicode in that file that I'm not seeing? Do you have any unicode paths that could be causing the problem I can run that example without error, even if I stick unicode content into it. If I do add unicode content and |
The first |
regular ubuntu 11.04 natty system with en_US.UTF-8 this is what goes into usr/lib/python2.7/StringIO.py(270) from /home/jtaylor/tmp/ipython/IPython/core/formatters.py(444)
|
To be specific, I think the issue is when one of the objects in a list has a unicode repr*, and the pretty printer tries to format the list onto several lines (it doesn't happen when the list is short enough to be displayed on one line).
|
The relevant bit from the docs:
So it seems the pretty printer is encoding things to bytestrings, and that gets the StringIO in a muddle. |
The linked commit above is a simple but inelegant fix for this issue. Ideally, pretty should use and return unicode, but that's a much bigger set of changes. |
Closed by 6b2de8f. |
running following results in an UnicodeDecodeError with current git head:
it works when one prints the last line
The text was updated successfully, but these errors were encountered: