summaryrefslogtreecommitdiff
path: root/alot/addressbooks.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-06-03 13:12:52 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-06-03 13:16:40 +0100
commit716a777bd883de7e9b23caf659bf6876f835473b (patch)
tree8b894483a3b8419a18d939ca8d24f5bfaac5a2b6 /alot/addressbooks.py
parentbec78df4a6932048f73c515d7c1ed9be98c98817 (diff)
add helper split_commandstring
that splits a command string into a list of strings to pass on to subprocess.Popen and the like. This helper is now used throughout the application instead of calling shlex.split directly as this is a potential source for errors because shlex is not yet able to properly deal with unicode bytestrings.
Diffstat (limited to 'alot/addressbooks.py')
-rw-r--r--alot/addressbooks.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/alot/addressbooks.py b/alot/addressbooks.py
index f527492f..16818a39 100644
--- a/alot/addressbooks.py
+++ b/alot/addressbooks.py
@@ -1,9 +1,9 @@
import re
import os
-import shlex
from alot.settings.utils import read_config
from helper import call_cmd
+from alot.helper import split_commandstring
class AddressBook(object):
@@ -73,7 +73,7 @@ class MatchSdtoutAddressbook(AddressBook):
return self.lookup('\'\'')
def lookup(self, prefix):
- cmdlist = shlex.split(self.command.encode('utf-8', errors='ignore'))
+ cmdlist = split_commandstring(self.command)
resultstring, errmsg, retval = call_cmd(cmdlist + [prefix])
if not resultstring:
return []