diff options
-rw-r--r-- | alot/db/message.py | 7 | ||||
-rwxr-xr-x | setup.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/alot/db/message.py b/alot/db/message.py index 4c4af99b..2e1fef54 100644 --- a/alot/db/message.py +++ b/alot/db/message.py @@ -10,7 +10,8 @@ from datetime import datetime from notmuch import NullPointerError -from .utils import extract_body, message_from_file +from . import utils +from .utils import extract_body from .utils import decode_header from .attachment import Attachment from .. import helper @@ -101,8 +102,8 @@ class Message(object): "Message file is no longer accessible:\n%s" % path if not self._email: try: - with open(path) as f: - self._email = message_from_file(f) + with open(path, 'rb') as f: + self._email = utils.message_from_bytes(f.read()) except IOError: self._email = email.message_from_string(warning) return self._email @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 from setuptools import setup, find_packages import alot |