[Python-bugs-list] [ python-Bugs-495358 ] rfc822.AddressList and "<>" address
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 20 Dec 2001 03:00:20 -0800
Bugs item #495358, was opened at 2001-12-20 03:00
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495358&group_id=5470
Category: Python Library
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Artur Zaprzala (zybi)
Assigned to: Nobody/Anonymous (nobody)
Summary: rfc822.AddressList and "<>" address
Initial Comment:
rfc822.AddressList incorrectly handles empty address.
"<>" is converted to None and should be "".
AddressList.__str__() fails on None.
I got an email with such an address and my program
failed processing it.
Example:
>>> import rfc822
>>> rfc822.AddressList("<>").addresslist
[('', None)]
>>> str(rfc822.AddressList("<>"))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.1/rfc822.py", line 753, in __str__
return ", ".join(map(dump_address_pair,
self.addresslist))
TypeError: sequence item 0: expected string, None found
Patch is attached.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495358&group_id=5470