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, r.david.murray, robertus
Date 2017-08-01.15:34:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501601663.67.0.806344447371.issue31089@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, that is mostly likely why parseaddr operates the way it does.  The old email package does not do very much hand-holding, it expects you to understand the RFCs, which as you note is a rather daunting task.  The new email package (the new policies) in python3 aim to incorporate as much understanding of the RFCs into the library as possible and "do the right thing" automatically so you don't have to worry about it (it can't hide 100%, though...).

As for universal new line mode, you are correct that technically \n by itself is data per the RFC (and illegal in the middle of a quoted string like that), but the way Python handles "text" is to convert \r\n into \n internally.  So while parseaddr is doing the "right thing" per the RFC, the input parsing parts of the email package in fact accept \n or even mixed line endings to accommodate the difference between unix/python line endings and RFC line endings.
History
Date User Action Args
2017-08-01 15:34:23r.david.murraysetrecipients: + r.david.murray, barry, robertus
2017-08-01 15:34:23r.david.murraysetmessageid: <1501601663.67.0.806344447371.issue31089@psf.upfronthosting.co.za>
2017-08-01 15:34:23r.david.murraylinkissue31089 messages
2017-08-01 15:34:23r.david.murraycreate