summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-21 22:09:57 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-21 23:38:58 +0100
commit7786c5e7c0620174a9ad9e8982ebb605aa943861 (patch)
tree2c71a1c3e0bfdada40c3b0d7882a0c7780896eff
parent2d6ac9e84d691192d17a6423ee4884123141a379 (diff)
maintenance
-rw-r--r--alot/message.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/alot/message.py b/alot/message.py
index c2927a85..393e988b 100644
--- a/alot/message.py
+++ b/alot/message.py
@@ -185,13 +185,10 @@ def extract_body(mail):
tab_width = config.getint('general', 'tabwidth')
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: