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.

classification
Title: email._parseaddr AddrlistClass bug
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, tkikuchi
Priority: normal Keywords:

Created on 2007-01-06 12:31 by tkikuchi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_parseaddr.py.patch tkikuchi, 2007-01-06 12:31 email._parseaddr.py.patch
Messages (2)
msg30938 - (view) Author: Tokio Kikuchi (tkikuchi) Date: 2007-01-06 12:31
email._parseaddr AddrlistClass incorrectly parse multilined comment (display name).

According to RFC2822, folding white space is allowed in display name.  Thus following header should be parsed as a single address "foo@example.com" having multilined display name.

To: Foo
 Bar <foo@example.com>

On the other hand, following program results in:
from email.Utils import getaddresses
s = """Foo
 Bar <foo@example.com>
"""
print getaddresses([s])

[('', 'Foo'), ('Bar', 'foo@example.com')]

Note that the first address is not valid one.

Looks like the bug is in _parseaddr.py.  Please check the patch.
msg30939 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2007-03-12 03:21
r54280 in Python 2.6 svn trunk
r54281 in Python 2.5
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44421
2007-01-06 12:31:20tkikuchicreate