Skip to content
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

Handle unicode properly in IPython.zmq.iostream #534

Merged
merged 0 commits into from Jun 22, 2011

Conversation

takluyver
Copy link
Member

@jstenar says this fixes printing Unicode at the Qt console in Windows (issue #529). It also makes sense in terms of the code, fixing a broken design I'd put in place some time ago.

@@ -1,7 +1,7 @@
import logging
import sys
import time
from cStringIO import StringIO
from io import StringIO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the more efficient cStringIO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do different things - io.StringIO expects Unicode (i.e. it's forwards compatible with Python 3). It's also actually written in C - the Python io module just exports it from the C _io module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...OK, it's possibly moved into C for 2.7.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, as long as there is a reason.

@minrk
Copy link
Member

minrk commented Jun 22, 2011

This makes sense - the forcing of bytes doesn't make sense anymore, because these are real (JSON-style) messages now. Presumably at some point they were basic pyzmq sends, which can't support unicode.

Go ahead and merge this one.

@takluyver takluyver merged commit 19d5c41 into ipython:master Jun 22, 2011
@takluyver
Copy link
Member Author

Thanks, Min. Rebased and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants