From f519f17fbfbfe606311390d413e6459c323d3404 2011-06-28 17:10:09 From: MinRK Date: 2011-06-28 17:10:09 Subject: [PATCH] catch another unconditional encode in completerlib closes gh-440 --- 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 != '':