From e173a3de0bd23d72fe3bd1a98194c17add934365 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Thu, 9 May 2019 15:19:31 -0400
Subject: [PATCH 2/2] Ignore UTF-8 errors when decoding emails
---
emailthreads/threads.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emailthreads/threads.py b/emailthreads/threads.py
index 6b7c809..6f6a207 100644
--- a/emailthreads/threads.py
+++ b/emailthreads/threads.py
@@ -41,7 +41,7 @@ def normalize_whitespace(text):
def get_text(msg):
text_part = get_text_part(msg)
- text = text_part.get_payload(decode=True).decode('utf-8')
+ text = text_part.get_payload(decode=True).decode('utf-8', 'ignore')
text = normalize_whitespace(text)
return text
--
2.21.0