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 r.david.murray
Recipients barry, jaraco, jayvdb, r.david.murray, tanzer@swing.co.at
Date 2018-12-05.22:21:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544048461.88.0.788709270274.issue25545@psf.upfronthosting.co.za>
In-reply-to
Content
The problem comes from thinking you can parse an arbitrary email message if it is in unicode form.  *YOU CANNOT DO THAT* in the general case (ie: non-ascii attachments).

That said, the new email package API is designed to facilitate "off label" uses.  I would have no problem with the definition of a policy object[*] that was basically "use this to parse messages in unicode form as long as they don't use MIME".  As soon as you start parsing MIME headers, the input had better be binary or pure ascii, or the headers *won't make sense*.  You break the MIME API contract if you use MIME with a non-ascii unicode string.

[*] that policy might be a clone of one of the existing policies and not actually do anything to prevent the input having mime headers...ideally it would, but I just don't want to say it is OK to use the standard email policies to do this and expect it to continue to work in the future.  It probably will, but we should not document it that way! :)
History
Date User Action Args
2018-12-05 22:21:01r.david.murraysetrecipients: + r.david.murray, barry, jaraco, jayvdb, tanzer@swing.co.at
2018-12-05 22:21:01r.david.murraysetmessageid: <1544048461.88.0.788709270274.issue25545@psf.upfronthosting.co.za>
2018-12-05 22:21:01r.david.murraylinkissue25545 messages
2018-12-05 22:21:01r.david.murraycreate