Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Sorry, I was puzzled by the exception type and missed details in a long 
traceback (I have issues with reading large texts). Thank you for your detailed 
report.

The simple fix is to add UnicodeEncodeError to "except LookupError". But there 
may be other places where we can get a similar error. They should be fixed too.

Alternatively we can do something when we get an invalid charset from the 
parsed data. I am not the email package expert, so I do not know what would be 
better in that context.

----------
components: +Library (Lib)
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43323>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to