[Mailman-Users] add_members

Allan Hansen hansen at rc.org
Tue Feb 28 06:23:51 CET 2006

At 8:13 -0800 2/27/06, Mark Sapiro wrote:
>Allan Hansen wrote:
>>add_members -r <file> <list>
>>    crashes with a traceback when given a file in the above format.
>>The crash appears to happen in OldStyleMemberships.py
>>add_members appears to strip all whitespace from the file.
>Please provide a traceback for analysis. (Note that despite the perhaps
>misleading comment, line.strip() only strips leading and trailing
>whitespace, not all whitespace.)

Sure, Mark (my apologies for misinterpreting what line.strip() does. 

Here goes:

I'm starting with an empty list called Test and a file, Long,
with a subscriber (me) in long format, and another file, Short,
with a subscriber (me) in short format:

// Empty list
$/usr/share/mailman/bin/list_members -f Test

// The files Long and Short
$cat Long
Allan Hansen <hansen at rc.org>

$cat Short
hansen at rc.org

// Here's the traceback from add_members:
$add_members -r Long Test
Traceback (most recent call last):
  File "/usr/share/mailman/bin/add_members", line 277, in ?
  File "/usr/share/mailman/bin/add_members", line 257, in main
    addall(mlist, nmembers, 0, send_welcome_msg, s, enable_mail)
  File "/usr/share/mailman/bin/add_members", line 157, in addall
    mlist.setDeliveryStatus(member, MemberAdaptor.ENABLED)
  File "/usr/share/mailman/Mailman/OldStyleMemberships.py", line 338, in setDeliveryStatus
  File "/usr/share/mailman/Mailman/OldStyleMemberships.py", line 113, in __assertIsMember
    raise Errors.NotAMemberError, member
Mailman.Errors.NotAMemberError: Allan Hansen <hansen at rc.org>

// The command did not add the address:
$/usr/share/mailman/bin/list_members -f Test

// Now let's use the sync instead. No problem here:
$/usr/share/mailman/bin/sync_members -f Long Test
Added  : Allan Hansen <hansen at rc.org>

// The address is indeed added:
$/usr/share/mailman/bin/list_members -f Test
Allan Hansen <hansen at rc.org>

// Now, let's try removing same. We have a problem:
$/usr/share/mailman/bin/remove_members -f Long Test
No such member: Allan Hansen <hansen at rc.org>

// Indeed, the command failed:
$/usr/share/mailman/bin/list_members -f Test
Allan Hansen <hansen at rc.org>

// But we can use the short format. There's no output from this command.
$/usr/share/mailman/bin/remove_members -f Short Test

// But the command did succeed:
$/usr/share/mailman/bin/list_members -f Test

The above shows that 'add_members' and 'remove_members' don't understand
the long format that is readily accepted by 'sync_members' and output by


| Allan Hansen, Ph.D.                                             |
|    P.O. Box 2423, Cypress, CA 90630, U.S.A.                     |
|                                                                 |
| Work:                              Home:                        |
| Phone: +1-714/952-6015             +1-714/875-8870              |
| Fax:   +1-714/952-6746                                          |
| Email: allan.hansen at ugs.com        hansen at rc.org                |
| WWW:   http://www.ugs.com          http://www.rc.org/           |
|                                                                 |
|_Anything is possible with the right tools and right information_|

More information about the Mailman-Users mailing list