[PATCH 3/3] errors='ignore' when decode to unicode

Patrick Totzke patricktotzke at googlemail.com
Mon Dec 5 13:19:29 PST 2011


---
 bindings/python/notmuch/message.py |    2 +-
 bindings/python/notmuch/thread.py  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
index fac575c..4790663 100644
--- a/bindings/python/notmuch/message.py
+++ b/bindings/python/notmuch/message.py
@@ -425,7 +425,7 @@ class Message(object):
         header = Message._get_header(self._msg, header)
         if header == None:
             raise NotmuchError(STATUS.NULL_POINTER)
-        return header.decode('UTF-8')
+        return header.decode('UTF-8', errors='ignore')
 
     def get_filename(self):
         """Returns the file path of the message file
diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
index 3e59b35..ddefade 100644
--- a/bindings/python/notmuch/thread.py
+++ b/bindings/python/notmuch/thread.py
@@ -326,7 +326,7 @@ class Thread(object):
         authors = Thread._get_authors(self._thread)
         if authors is None:
             return None
-        return authors.decode('UTF-8')
+        return authors.decode('UTF-8', errors='ignore')
 
     def get_subject(self):
         """Returns the Subject of 'thread'
@@ -339,7 +339,7 @@ class Thread(object):
         subject = Thread._get_subject(self._thread)
         if subject is None:
             return None
-        return subject.decode('UTF-8')
+        return subject.decode('UTF-8', errors='ignore')
 
     def get_newest_date(self):
         """Returns time_t of the newest message date
-- 
1.7.4.1



More information about the notmuch mailing list