diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-09-27 18:39:45 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-09-27 18:39:45 +0100 |
commit | b3ebcc1e48958149bae0b21b9ac72f3326c4284a (patch) | |
tree | 8414b9bd87c1366eeba2f113ac3bc8e33b942fb3 /alot | |
parent | aafb0b9040134b91590a5f4cfb9809fe1d4fa0da (diff) |
fix: double decoding of mailcap handlers output
issue #68
Diffstat (limited to 'alot')
-rw-r--r-- | alot/helper.py | 2 | ||||
-rw-r--r-- | alot/message.py | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/alot/helper.py b/alot/helper.py index 4d941ed4..aa5c7953 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -142,7 +142,7 @@ def cmd_output(command_line): args = shlex.split(command_line.encode('ascii', errors='ignore')) try: output = subprocess.check_output(args) - output = output.decode(urwid.util.detected_encoding) + output = output.decode(urwid.util.detected_encoding, errors='replace') except subprocess.CalledProcessError: return None except OSError: diff --git a/alot/message.py b/alot/message.py index e8cf539c..75895456 100644 --- a/alot/message.py +++ b/alot/message.py @@ -209,8 +209,7 @@ def extract_body(mail): tmpfile.close() os.unlink(tmpfile.name) if rendered_payload: # handler had output - bodytxt += unicode(rendered_payload.strip(), - encoding='utf8', errors='replace') + bodytxt += rendered_payload.strip() elif part.get_content_maintype() == 'text': bodytxt += raw_payload # else drop |