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-07-31.15:32:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501515167.06.0.374969537962.issue31089@psf.upfronthosting.co.za>
In-reply-to
Content
parseaddr does what you expect if the message has been read using universal newline mode (ie: the linesep is \n):

>>> parseaddr('"=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\n =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>"')
('=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\n =?UTF-8?Q?omo=C5=9Bci?=', 'anita.wiecklinska@pato.com.pl')

I suppose this wouldn't be *that* hard to fix.  If it isn't too complex and you want to propose a patch I'll take a look.

In any case it works fine in python3 using the new policies:

>>> from email import message_from_string as mfs
>>> from email.policy import default
>>> m = mfs('From: "=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\r\n =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>"\r\n\r\ntest', policy=default)
>>> m['from'].addresses
(Address(display_name='Anita =W4\udc86iecklińska | PATO Nieruch omości', username='anita.wiecklinska', domain='pato.com.pl'),)
History
Date User Action Args
2017-07-31 15:32:47r.david.murraysetrecipients: + r.david.murray, barry, robertus
2017-07-31 15:32:47r.david.murraysetmessageid: <1501515167.06.0.374969537962.issue31089@psf.upfronthosting.co.za>
2017-07-31 15:32:47r.david.murraylinkissue31089 messages
2017-07-31 15:32:47r.david.murraycreate