Mark Sapiro <[email protected]> added the comment:
Yes. I think errors=replace is a good solution. In Mailman, we have our own
mailman.email.message.Message class which is a subclass of
email.message.Message and what we do to work around this and issue27321 is
override as_string() with:
def as_string(self):
# Work around for https://bugs.python.org/issue27321 and
# https://bugs.python.org/issue32330.
try:
value = email.message.Message.as_string(self)
except (KeyError, UnicodeEncodeError):
value = email.message.Message.as_bytes(self).decode(
'ascii', 'replace')
return value
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32330>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com