diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-21 22:09:57 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-21 22:09:57 +0100 |
commit | 0192c31e54eb0ea9ddaa7170100e372b6d8cdc20 (patch) | |
tree | ef155948ce43ad647d8ba364b5591a76ce44631a /alot | |
parent | 0f242e3f0c234a18bc4ff292cbac62dec075b6ea (diff) |
maintenance
Diffstat (limited to 'alot')
-rw-r--r-- | alot/message.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/alot/message.py b/alot/message.py index 90b53ad9..02f3f803 100644 --- a/alot/message.py +++ b/alot/message.py @@ -194,13 +194,10 @@ def extract_body(mail): body_parts = [] for part in mail.walk(): ctype = part.get_content_type() - enc = part.get_content_charset() + enc = part.get_content_charset() or 'ascii' raw_payload = part.get_payload(decode=True) if part.get_content_maintype() == 'text': - if enc: - raw_payload = unicode(raw_payload, enc, errors='replace') - else: - raw_payload = unicode(raw_payload, errors='replace') + raw_payload = unicode(raw_payload, enc, errors='replace') if ctype == 'text/plain': body_parts.append(raw_payload) else: |