From 35869db5d6778eb74d3121b9546c14a473423d30 2011-07-22 19:13:33 From: Thomas Kluyver Date: 2011-07-22 19:13:33 Subject: [PATCH] Comment explaining fix for gh-597. --- diff --git a/IPython/core/formatters.py b/IPython/core/formatters.py index 262258b..af4bf4d 100644 --- a/IPython/core/formatters.py +++ b/IPython/core/formatters.py @@ -432,6 +432,9 @@ class PlainTextFormatter(BaseFormatter): else: # This uses use StringIO, as cStringIO doesn't handle unicode. stream = StringIO() + # self.newline.encode() is a quick fix for issue gh-597. We need to + # ensure that stream does not get a mix of unicode and bytestrings, + # or it will cause trouble. printer = pretty.RepresentationPrinter(stream, self.verbose, self.max_width, self.newline.encode(), singleton_pprinters=self.singleton_printers,