Author msapiro
Recipients Johannes Löthberg, barry, cheryl.sabella, diekhans, edeca, maciej.szulik, matrixise, msapiro, r.david.murray
Date 2020-10-06.02:54:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I work around it with
class Message(email.message.Message):

    def as_string(self):
        # Work around for and
            value = email.message.Message.as_string(self)
        except (KeyError, LookupError, UnicodeEncodeError):
            value = email.message.Message.as_bytes(self).decode(
                'ascii', 'replace')
        # Also ensure no unicode surrogates in the returned string.
        return email.utils._sanitize(value)
This is easy for me because it's Mailman which already subclasses email.message.Message for other reasons. It is perhaps more difficult if you aren't already subclassing email.message.Message for other purposes.
Date User Action Args
2020-10-06 02:54:38msapirosetrecipients: + msapiro, barry, diekhans, r.david.murray, maciej.szulik, matrixise, cheryl.sabella, Johannes Löthberg, edeca
2020-10-06 02:54:38msapirosetmessageid: <>
2020-10-06 02:54:38msapirolinkissue27321 messages
2020-10-06 02:54:38msapirocreate