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 Ivan.Egorov
Recipients Ivan.Egorov
Date 2011-01-28.22:30:01
SpamBayes Score 0.0017432959
Marked as misclassified No
Message-id <1296253802.55.0.925837101087.issue11050@psf.upfronthosting.co.za>
In-reply-to
Content
email.utils.getaddresses behaves wrong in following folding cases (outer single quote is not a part of value): 
'"A\r\n (B)" <c@d.org>'
'(A\r\n C) <d@e.org>'

The misbehavior occurs in at least 2.6, 2.7 and branches/py3k.

Both these strings are RFC 2822 compliant, but current getaddresses() implementation misbehaves on 'quoted-string' and 'comment' containing CRLF.

Following references the related RFC sections:
http://tools.ietf.org/html/rfc2822#section-3.4
http://tools.ietf.org/html/rfc2822#section-3.2.5

Attachment contains tests and patch for the case.
History
Date User Action Args
2011-01-28 22:30:02Ivan.Egorovsetrecipients: + Ivan.Egorov
2011-01-28 22:30:02Ivan.Egorovsetmessageid: <1296253802.55.0.925837101087.issue11050@psf.upfronthosting.co.za>
2011-01-28 22:30:01Ivan.Egorovlinkissue11050 messages
2011-01-28 22:30:01Ivan.Egorovcreate