[Python-bugs-list] [ python-Bugs-495358 ] rfc822.AddressList and "<>" address

noreply@sourceforge.net noreply@sourceforge.net
Thu, 20 Dec 2001 05:03:13 -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: 7
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.


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-20 05:03

Message:
Logged In: YES 
user_id=6380

I want this reviewed before Python 2.2 goes out tomorrow.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495358&group_id=5470