Skip to content

Commit

Permalink
Merge pull request ipython#2500 from bfroehle/outstream_encoding
Browse files Browse the repository at this point in the history
Add `encoding` attribute to `OutStream` class.
  • Loading branch information
bfroehle committed Oct 23, 2012
2 parents eee115c + 758148b commit 717d7ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IPython/zmq/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from session import extract_header, Message

from IPython.utils import io, text, encoding
from IPython.utils import io, text
from IPython.utils import py3compat

#-----------------------------------------------------------------------------
Expand All @@ -23,6 +23,7 @@ class OutStream(object):
topic=None

def __init__(self, session, pub_socket, name):
self.encoding = 'UTF-8'
self.session = session
self.pub_socket = pub_socket
self.name = name
Expand Down Expand Up @@ -73,9 +74,8 @@ def write(self, string):
else:
# Make sure that we're handling unicode
if not isinstance(string, unicode):
enc = encoding.DEFAULT_ENCODING
string = string.decode(enc, 'replace')

string = string.decode(self.encoding, 'replace')

self._buffer.write(string)
current_time = time.time()
if self._start <= 0:
Expand Down

0 comments on commit 717d7ae

Please sign in to comment.