From 4106e828d103e250f5c972d6f68ee40d26f8c5dc 2007-12-13 20:34:23 From: vivainio Date: 2007-12-13 20:34:23 Subject: [PATCH] unix readline does not accept unicode in history, encode to str. Patch by Tiago, close #201 --- diff --git a/IPython/iplib.py b/IPython/iplib.py index 8e872d5..58d529b 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 2891 2007-12-12 22:33:50Z vivainio $ +$Id: iplib.py 2894 2007-12-13 20:34:23Z vivainio $ """ #***************************************************************************** @@ -2075,7 +2075,8 @@ want to merge them back into the new files.""" % locals() histlen = self.readline.get_current_history_length() newhist = self.input_hist_raw[-1].rstrip() self.readline.remove_history_item(histlen-1) - self.readline.replace_history_item(histlen-2,newhist) + self.readline.replace_history_item(histlen-2, + newhist.encode(self.stdin_encoding)) except AttributeError: pass # re{move,place}_history_item are new in 2.4. else: diff --git a/doc/ChangeLog b/doc/ChangeLog index ef174ea..c84bf29 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,13 +1,14 @@ +2007-12-13 Ville Vainio + + * iplib.py(raw_input): unix readline does not allow unicode in + history, encode to normal string. After patch by Tiago. + Close #201 + 2007-12-12 Ville Vainio - * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of current - directory. + * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of + current directory. - * iplib.py: We now set system default encoding to sys.stdin.encoding with - sys.setdefaultencoding, after a patch by 'pan'. This makes str() calls that - IPython still has implicitly work. This should be removed when such calls - are cleaned. - 2007-12-12 Fernando Perez * IPython/Shell.py (_select_shell): add support for controlling