fix(email): Add missing byte-decoding in set_subject

This commit is contained in:
Corentin Forler 2023-09-05 12:20:31 +02:00
parent ec20739fee
commit e5dd924cbe

View file

@ -412,6 +412,9 @@ class Email:
# assume that the encoding is utf-8
self.subject = safe_decode(self.subject)[:140]
if isinstance(self.subject, bytes):
self.subject = self.subject.decode("utf8", "replace") # last resort
if not self.subject:
self.subject = "No Subject"