[New-bugs-announce] [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:

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>

More information about the New-bugs-announce mailing list