diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 73ecc4a..ae26453 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -1704,7 +1704,7 @@ class InteractiveShell(SingletonConfigurable, Magic): [D:\ipython]|2> Hello Word_ # cursor is here """ if isinstance(s, unicode): - s = s.encode(self.stdin_encoding) + s = s.encode(self.stdin_encoding, 'replace') self.rl_next_input = s # Maybe move this to the terminal subclass?