Prevent shlex.split from returning strange encodings

This commit is contained in:
Bruno Cauet 2015-01-20 16:51:44 +01:00
parent 132f5ba912
commit f263935a51

View file

@ -1494,9 +1494,9 @@ def config_edit():
path = config.user_config_path()
if 'EDITOR' in os.environ:
editor = os.environ['EDITOR']
editor = os.environ['EDITOR'].encode('utf8')
try:
editor = shlex.split(editor)
editor = [e.decode('utf8') for e in shlex.split(editor)]
except ValueError: # Malformed shell tokens.
editor = [editor]
args = editor + [path]