errors='ignore' when decode to unicode
authorPatrick Totzke <patricktotzke@gmail.com>
Mon, 5 Dec 2011 20:45:27 +0000 (20:45 +0000)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Tue, 6 Dec 2011 12:28:39 +0000 (13:28 +0100)
bindings/python/notmuch/message.py
bindings/python/notmuch/thread.py

index a9ded8018489c082ae86888b7b3797f2f5d940b6..f95e50e284c5124d0a3e6d37bc0d942e684ccf68 100644 (file)
@@ -427,7 +427,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
index 435cbe24a62e38ef8ef92880cbeffc01505dd217..5058846d7ce89d4bbd0cbef5fb6bab06079e3047 100644 (file)
@@ -325,7 +325,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'
@@ -338,7 +338,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