[issue32330] Email parser creates a message object that can't be flattened

2020-01-18 Thread Mark Sapiro
Change by Mark Sapiro : -- keywords: +patch pull_requests: +17453 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18059 ___ Python tracker ___

[issue32330] Email parser creates a message object that can't be flattened

2020-01-18 Thread Mark Sapiro
Change by Mark Sapiro : -- versions: +Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread Mark Sapiro
Mark Sapiro added the comment: > I do wonder where you are using the string version of messages :) Probably some places where we could use bytes, but one of the problem areas is where we save the content of a message held for moderation. --

[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread R. David Murray
R. David Murray added the comment: I do wonder where you are using the string version of messages :) I actually thought I'd already done this (errors=replace), but obviously not. I don't have time now to work on a patch for this, and the patch in the other issue

[issue32330] Email parser creates a message object that can't be flattened

2017-12-14 Thread Mark Sapiro
Mark Sapiro 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:

[issue32330] Email parser creates a message object that can't be flattened

2017-12-14 Thread R. David Murray
R. David Murray added the comment: What would you like to see happen in that situation? Should we use errors=replace like we do for headers? (That seems reasonable to me.) Note that it can be re-serialized as binary. --

[issue32330] Email parser creates a message object that can't be flattened

2017-12-14 Thread Mark Sapiro
New submission from Mark Sapiro : This is related to https://bugs.python.org/issue27321 but a different exception is thrown for a different reason. This is caused by a defective spam message. I don't actually have the offending message from the wild, but the attached