From 5b09c5d19177c4c62af67ad7dc473247dfa9b9d4 2017-01-08 18:00:43 From: Srinivas Reddy Thatiparthy Date: 2017-01-08 18:00:43 Subject: [PATCH] remove CUnicodeIO and replace it with StringIO --- diff --git a/IPython/core/formatters.py b/IPython/core/formatters.py index d441d68..9f5ded5 100644 --- a/IPython/core/formatters.py +++ b/IPython/core/formatters.py @@ -15,6 +15,7 @@ import json import sys import traceback import warnings +from io import StringIO from decorator import decorator @@ -655,11 +656,7 @@ class PlainTextFormatter(BaseFormatter): if not self.pprint: return repr(obj) else: - # handle str and unicode on Python 2 - # io.StringIO only accepts unicode, - # cStringIO doesn't handle unicode on py2, - # StringIO allows str, unicode but only ascii str - stream = pretty.CUnicodeIO() + stream = StringIO() printer = pretty.RepresentationPrinter(stream, self.verbose, self.max_width, self.newline, max_seq_length=self.max_seq_length,