[issue11050] email.utils.getaddresses behavior contradicts RFC2822

Ivan Egorov report at bugs.python.org
Fri Jan 28 23:30:02 CET 2011


New submission from Ivan Egorov <egorich.3.04 at gmail.com>:

email.utils.getaddresses behaves wrong in following folding cases (outer single quote is not a part of value): 
'"A\r\n (B)" <c at d.org>'
'(A\r\n C) <d at 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.

----------
components: Library (Lib)
files: email.utils.getaddresses.patch
keywords: patch
messages: 127357
nosy: Ivan.Egorov
priority: normal
severity: normal
status: open
title: email.utils.getaddresses behavior contradicts RFC2822
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file20590/email.utils.getaddresses.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11050>
_______________________________________


More information about the Python-bugs-list mailing list