diff --git a/IPython/core/completerlib.py b/IPython/core/completerlib.py index 95f0e4b..98ba2ec 100644 --- a/IPython/core/completerlib.py +++ b/IPython/core/completerlib.py @@ -68,7 +68,8 @@ def shlex_split(x): # shlex.split has unicode bugs, so encode first to str if isinstance(x, unicode): - x = x.encode(sys.stdin.encoding) + # don't raise errors on encoding: + x = x.encode(sys.stdin.encoding or sys.getdefaultencoding(), 'replace') endofline = [] while x != '':