From 5bd89723b042112cfd7e35662803a1b5395b36f9 2011-12-12 17:37:05 From: Jörgen Stenarson Date: 2011-12-12 17:37:05 Subject: [PATCH] Fixing shlex_split to return unicode on py2.x --- diff --git a/IPython/core/completerlib.py b/IPython/core/completerlib.py index c210ee6..850fe33 100644 --- a/IPython/core/completerlib.py +++ b/IPython/core/completerlib.py @@ -77,13 +77,18 @@ def shlex_split(x): comps = shlex.split(x) if len(endofline) >= 1: comps.append(''.join(endofline)) + if not py3compat.PY3: + comps = [py3compat.cast_unicode(x) for x in comps] return comps except ValueError: endofline = [x[-1:]]+endofline x = x[:-1] - return [''.join(endofline)] + x = ''.join(endofline) + if not py3compat.PY3: + x = py3compat.cast_unicode(x) + return [x] def module_list(path): """