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: rfc822.Message.getaddrlist broken
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, skip.montanaro
Priority: normal Keywords:

Created on 2002-05-12 06:36 by skip.montanaro, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg10738 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2002-05-12 06:36
rfc822.Message.getaddrlist() uses an AddressList 
instance as a helper.  AddressList objects parse 
their inputs during __init__.  Calling 
a.getaddrlist() thus causes the parsing to start 
over, but with the position set past the end of the 
address string.  Instead of calling 
AddressList.getaddrlist() 
rfc822.Message.getaddrlist() should simply access the 
addresslist attribute, e.g., at the end of that 
method it should read:

    alladdrs = ''.join(raw)
    a = AddressList(alladdrs)
    return a.addresslist

Here's a simple example that demonstrates the problem:

    >>> import rfc822
    >>> a = rfc822.AddressList ("skip@pobox.com")
    >>> a.getaddrlist()
    []
    >>> a.addresslist
    [('', 'skip@pobox.com')]

Bugfix candidate?

Skip
msg10739 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2002-05-21 18:31
Logged In: YES 
user_id=12800

Yup, I recently ran into something similar.  Your analysis
is spot on of course, as is your proposed fix.  I will
commit changes to rfc822.py and to test_rfc822.py.  

Yes, this is a bug fix candidate.
History
Date User Action Args
2022-04-10 16:05:19adminsetgithub: 36593
2002-05-12 06:36:24skip.montanarocreate