Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Handle unicode properly in IPython.zmq.iostream #534

Merged
merged 0 commits into from

2 participants

@takluyver
Owner

@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.

IPython/zmq/iostream.py
@@ -1,7 +1,7 @@
import logging
import sys
import time
-from cStringIO import StringIO
+from io import StringIO
@minrk Owner
minrk added a note

Why not use the more efficient cStringIO?

@takluyver Owner

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.

@takluyver Owner

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

@minrk Owner
minrk added a note

Sounds good, as long as there is a reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@minrk
Owner

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
@takluyver
Owner

Thanks, Min. Rebased and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 0 deletions.
Something went wrong with that request. Please try again.