summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/helper.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/alot/helper.py b/alot/helper.py
index f14c2c94..6fc3a970 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -307,11 +307,12 @@ def guess_mimetype(blob):
:param blob: file content as read by file.read()
:type blob: data
- :returns: mime-type
+ :returns: mime-type, falls back to 'application/octet-stream'
+ :rtype: str
"""
m = magic.open(magic.MAGIC_MIME_TYPE)
m.load()
- return m.buffer(blob)
+ return m.buffer(blob) or 'application/octet-stream'
def guess_encoding(blob):