From cc640cf85f0c4d2b528d16376c1af097228e59a5 2007-12-12 22:33:50 From: vivainio Date: 2007-12-12 22:33:50 Subject: [PATCH] revert sys.setdefaultencoding patch() --- diff --git a/IPython/iplib.py b/IPython/iplib.py index 07269bc..8e872d5 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 2889 2007-12-12 19:32:33Z vivainio $ +$Id: iplib.py 2891 2007-12-12 22:33:50Z vivainio $ """ #***************************************************************************** @@ -79,16 +79,6 @@ import IPython.prefilter as prefilter import IPython.shadowns # Globals -# make converting between str and unicode easy, so str() will work most of the -# time - -try: - sys.setappdefaultencoding(sys.stdin.encoding or 'ascii') -except: - # Many python versions don't have sys.setappdefaultencoding - reload(sys) - sys.setdefaultencoding(sys.stdin.encoding or 'ascii') - # store the builtin raw_input globally, and use this always, in case user code # overwrites it (like wx.py.PyShell does) raw_input_original = raw_input @@ -1921,7 +1911,7 @@ want to merge them back into the new files.""" % locals() # this allows execution of indented pasted code. It is tempting # to add '\n' at the end of source to run commands like ' a=1' # directly, but this fails for more complicated scenarios - source = str(source) + source=source.encode(self.stdin_encoding) if source[:1] in [' ', '\t']: source = 'if 1:\n%s' % source