Hi, Since the rfc822 module was removed in Python 3, and is deprecated in 2.3, I am obviously trying to avoid using it.
But I'm having a hard time finding an equivalent to rfc822.AddressList in the email module, which I want to use to parse a _list_ of addresses: >>> addrlist = 'John Doe <j...@example.com>, "Doe, Jane" <j...@example.com>' >>> list(rfc822.AddressList(addrlist)) [('John Doe', 'j...@example.com'), ('Doe, Jane', 'j...@example.com')] email.utils.parseaddr() only returns the first address in the list: >>> email.utils.parseaddr(addrlist) ('John Doe', 'j...@example.com') email.utils.getaddresses() expects a list or tuple, and I can't simply pass it addrlist.split(', ') for obvious reasons, and anyway rather defeats the purpose of using a helper function to handle the tricky bits. Now, email._parseaddr.AddrlistClass has this functionality: >>> email._parseaddr.AddrlistClass(addrlist).getaddrlist() [('John Doe', 'j...@example.com'), ('Doe, Jane', 'j...@example.com')] But that's obviously not a documented, public interface. Amusingly, even in 3.1, the code for AddrlistClass says: Note: this class interface is deprecated and may be removed in the future. Use rfc822.AddressList instead. Is there some non-deprecated method I can use to parse an RFC 2822 address list? Thanks, Jason. -- http://mail.python.org/mailman/listinfo/python-list