X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fmessage.py;h=e71dbe3e9933011d334d3ed18990d6fa2844693d;hp=de0fb4151e52e50c3f3eb684932b65820d74cf82;hb=HEAD;hpb=c3a683299d4c27d6eadaacf4fb516f73a6c69fc3 diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index de0fb415..e71dbe3e 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -46,7 +46,7 @@ import sys class Message(Python3StringMixIn): - """Represents a single Email message + r"""Represents a single Email message Technically, this wraps the underlying *notmuch_message_t* structure. A user will usually not create these objects themselves @@ -482,7 +482,9 @@ class Message(Python3StringMixIn): if status != 0: raise NotmuchError(status) - return value.value.decode('utf-8') if value is not None else None + if value is None or value.value is None: + return None + return value.value.decode('utf-8') def get_properties(self, prop="", exact=False): """ Get the properties of the message, returning a generator of