~dricottone/huttese-apk

ref: 78032e4aa0d2eef8fe909bd354a415b7d72bbec1 huttese-apk/sr.ht/py3-emailthreads/0002-Ignore-UTF-8-errors-when-decoding-emails.patch -rw-r--r-- 742 bytes
78032e4a — Drew DeVault py-cairosvg: update to 2.4.0 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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