summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-06-01 14:17:36 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-03-01 10:34:56 -0800
commit788bd5af30ecee5c54b1039171b77765c3f340a8 (patch)
tree1adf2a6e2723a7ada2fb69e8c82d09a0dba96cf0 /alot/helper.py
parent34d1a0863ce13d3b42d11b15898e259eb39a094f (diff)
py3k: only pass str instances to shlex
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/alot/helper.py b/alot/helper.py
index 0297ea65..bd84e287 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -40,7 +40,6 @@ def split_commandline(s, comments=False, posix=True):
s = s.replace('\\', '\\\\')
s = s.replace('\'', '\\\'')
s = s.replace('\"', '\\\"')
- # encode s to utf-8 for shlex
lex = shlex.shlex(s, posix=posix)
lex.whitespace_split = True
lex.whitespace = ';'
@@ -55,8 +54,7 @@ def split_commandstring(cmdstring):
and the like. This simply calls shlex.split but works also with unicode
bytestrings.
"""
- if isinstance(cmdstring, str):
- cmdstring = cmdstring.encode('utf-8', errors='ignore')
+ assert isinstance(cmdstring, str)
return shlex.split(cmdstring)