This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author msapiro
Recipients barry, msapiro, r.david.murray
Date 2020-01-20.19:59:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579550373.31.0.760871929465.issue39384@roundup.psfhosted.org>
In-reply-to
Content
This came about because of an actual situation in a Mailman 3 installation. I can't say for sure what the actual original message looked like, but it was received by Mailman's LMTP server and parsed with email.message_from_bytes(), so it clearly wasn't exactly like the message excerpt I posted in the report above. However, All I had to go by was the message object from the shunted pickle file created as a result of the exception.

The message was processed by Mailman, but when Mailman's handler pipeline attempted to save it for the digest, it calls an instance of mailbox.MMDF to add the message to the mailbox accumulating messages for the digest, and that in turn calls the flatten method of an email.generator.BytesGenerator instance. and that's where the exception was thrown.

Perhaps the suggested patch in https://github.com/python/cpython/pull/18056 doesn't address every possible case, and it can result in a slightly garbled message due to replacing 'invalid' characters, but in my case at least, it is much preferable to the alternative.
History
Date User Action Args
2020-01-20 19:59:33msapirosetrecipients: + msapiro, barry, r.david.murray
2020-01-20 19:59:33msapirosetmessageid: <1579550373.31.0.760871929465.issue39384@roundup.psfhosted.org>
2020-01-20 19:59:33msapirolinkissue39384 messages
2020-01-20 19:59:33msapirocreate