[issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt

2021-08-31 Thread anarcat
New submission from anarcat : If an email message has a message/rfc822 part *and* that part is quoted-printable encoded, Python freaks out. Consider this code: import email.parser import email.policy # python 3.9.2 cannot decode this message, it fails with

[issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt

2021-08-31 Thread anarcat
anarcat added the comment: looking at email.feedparser.FeedParser._parse_gen(), it looks like this is going to be really hard to fix, because the parser just happily recurses into the sub-part without ever checking the CTE (content-transfer-encoding). that's typically only do