summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-03-06 15:16:12 -0800
committerDylan Baker <dylan@pnwbakers.com>2018-03-06 15:16:12 -0800
commit858c7bca401565b63851d78a8591cdac80480080 (patch)
tree6bb5eb0bc02bf89b1049a23f4afff47701b32312 /alot/commands/globals.py
parentd47ffba75d26cc599c790be9de35c37681fb70e7 (diff)
Use urwid.util.detected_encoding instead of try_decode
Commands running in a subprocess should return the terminal encoding so we don't need to guess their encoding.
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 2916793f..d335e8cf 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -280,7 +280,9 @@ class ExternalCommand(Command):
_, err = proc.communicate(stdin.read() if stdin else None)
if proc.returncode == 0:
return 'success'
- return helper.try_decode(err).strip() if err else ''
+ if err:
+ return err.decode(urwid.util.detected_encoding)
+ return ''
if self.in_thread:
d = threads.deferToThread(thread_code)