From 97dd0f1a77c084013f3d2ea2c36d71c2248503f1 2012-06-14 17:38:39 From: MinRK Date: 2012-06-14 17:38:39 Subject: [PATCH] allow unicode in Shell.raw_input --- diff --git a/IPython/frontend/terminal/interactiveshell.py b/IPython/frontend/terminal/interactiveshell.py index 5ddbccc..f619886 100644 --- a/IPython/frontend/terminal/interactiveshell.py +++ b/IPython/frontend/terminal/interactiveshell.py @@ -565,12 +565,15 @@ class TerminalInteractiveShell(InteractiveShell): if self.has_readline: self.set_readline_completer() + + # raw_input expects str, but we pass it unicode sometimes + prompt = py3compat.cast_bytes_py2(prompt) try: line = py3compat.str_to_unicode(self.raw_input_original(prompt)) except ValueError: warn("\n********\nYou or a %run:ed script called sys.stdin.close()" - " or sys.stdout.close()!\nExiting IPython!") + " or sys.stdout.close()!\nExiting IPython!\n") self.ask_exit() return ""