Menu

#529 rfc822.parseaddress() in Util.py Invalid

2.0.x
closed-invalid
nobody
5
2002-08-16
2002-08-14
No

The reference to rfc822.parseaddress() on line 160 of
Util.py in Mailman 2.0.12 is invalid. As of at least
Python 2.1 and Python 2.2, the rfc822 module does not
contain this function. This makes it impossible to use
add_members from the command line, although web-based
subscription still seems to work.

The pertinent traceback:

Traceback (most recent call last):
File "/usr/sbin/add_members", line 221, in ?
main()
File "/usr/sbin/add_members", line 195, in main
nres = ml.ApprovedAddMembers(nmembers, None, 0,
send_welcome_msg)
File "/usr/lib/mailman/Mailman/MailList.py", line
1097, in
ApprovedAddMembers
Utils.ValidateEmail(name)
File "/usr/lib/mailman/Mailman/Utils.py", line 160,
in ValidateEmail
realname,str = rfc822.parseaddress(str)
AttributeError: 'rfc822' module has no attribute
'parseaddress'

The fix is pretty simple. Simply replace

realname,str = rfc822.parseaddress(str)

on line 160 of Utils.py with

realname,str = rfc822.parseaddr(str)

Discussion

  • Barry Warsaw

    Barry Warsaw - 2002-08-16

    Logged In: YES
    user_id=12800

    Where did you get Mailman 2.0.12 from? There is no
    parseaddress() call in Utils.py in the official Mailman
    2.0.13 release, and there was no change to this since
    MM2.0.12. Are you using some non-standard patch or local hack?

     
  • Barry Warsaw

    Barry Warsaw - 2002-08-16
    • status: open --> closed-invalid
     
  • Federico Sevilla III

    Logged In: YES
    user_id=9096

    This is from the Debian package. I just downloaded the
    package sources for the 2.0.12-3 package, and there is
    nothing that changes the Utils.py file, and the Utils.py
    file as claimed indeed comes with rfc822.parseaddr(str) and
    not rfc822.parseaddress(str). Unfortunately because I
    already modified my installed Utils.py to fix the problem I
    was having, I cannot trace to see when the file was last
    updated (this wasn't a fresh install but was an upgrade from
    a previous version) to find out why it got changes.

    My apologies for the hassles. Thank you for pointing out
    that the distributed tarball comes with a Utils.py that was
    not broken to begin with.

    Cheers.

     
  • Federico Sevilla III

    Logged In: YES
    user_id=9096

    This is from the Debian package. I just downloaded the
    package sources for the 2.0.12-3 package, and there is
    nothing that changes the Utils.py file, and the Utils.py
    file as claimed indeed comes with rfc822.parseaddr(str) and
    not rfc822.parseaddress(str). Unfortunately because I
    already modified my installed Utils.py to fix the problem I
    was having, I cannot trace to see when the file was last
    updated (this wasn't a fresh install but was an upgrade from
    a previous version) to find out why it got changes.

    My apologies for the hassles. Thank you for pointing out
    that the distributed tarball comes with a Utils.py that was
    not broken to begin with.

    Cheers.

     
  • Barry Warsaw

    Barry Warsaw - 2002-08-16

    Logged In: YES
    user_id=12800

    Ok, thanks for the update.

     

Log in to post a comment.