summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-10 13:36:30 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-10 13:36:30 +0100
commit121a9bf68a19d182e3f0f4df6c01e9e2af86e5de (patch)
treeca09439752dcdf8a478519c270ec07d5c584db5c /alot/helper.py
parent3e738f721a0ce1a9cf679f3a296ae470a0a01287 (diff)
Use utf-8 encoding when calling external processes
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/alot/helper.py b/alot/helper.py
index a06236c2..7b038d29 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -138,7 +138,7 @@ def pretty_datetime(d):
def cmd_output(command_line):
- args = shlex.split(command_line.encode('ascii', errors='ignore'))
+ args = shlex.split(command_line.encode('utf-8', errors='ignore'))
try:
output = subprocess.check_output(args)
output = output.decode(urwid.util.detected_encoding, errors='replace')
@@ -150,8 +150,7 @@ def cmd_output(command_line):
def pipe_to_command(cmd, stdin):
- # no unicode in shlex on 2.x
- args = shlex.split(cmd.encode('ascii'))
+ args = shlex.split(cmd.encode('utf-8', errors='ignore'))
try:
proc = subprocess.Popen(args, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,