Problem:
list_members -f -o <file> <list>
generates a file of members in the following format:
name_of_subscriber
sync_members -f <file> <list> takes a file of members in the above format.
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.
Do I have a mixed bag of incompatible scripts or is this the expected behavior at this time. I'm running Mac OS X 10.4.5
The above is not terribly critical, as I can combine list_members and sync_members to do what I otherwise would do with just add_members.
Thanks,
Allan
--
| 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@ugs.com hansen@rc.org | | WWW: http://www.ugs.com http://www.rc.org/ | | | |_Anything is possible with the right tools and right information_|
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.)
Also, if add_members produces any output prior to the traceback, the last line or two of that and the corresponding and following bit of the input file might help.
-- Mark Sapiro msapiro@value.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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 <nothing>
// The files Long and Short $cat Long Allan Hansen hansen@rc.org
$cat Short hansen@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 ? main() 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 self.__assertIsMember(member) File "/usr/share/mailman/Mailman/OldStyleMemberships.py", line 113, in __assertIsMember raise Errors.NotAMemberError, member Mailman.Errors.NotAMemberError: Allan Hansen hansen@rc.org
// The command did not add the address: $/usr/share/mailman/bin/list_members -f Test <nothing>
// Now let's use the sync instead. No problem here: $/usr/share/mailman/bin/sync_members -f Long Test Added : Allan Hansen hansen@rc.org
// The address is indeed added: $/usr/share/mailman/bin/list_members -f Test Allan Hansen hansen@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@rc.org
// Indeed, the command failed: $/usr/share/mailman/bin/list_members -f Test Allan Hansen hansen@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 <nothing>
// But the command did succeed: $/usr/share/mailman/bin/list_members -f Test <nothing>
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 'list_members'.
Allan
--
| 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@ugs.com hansen@rc.org | | WWW: http://www.ugs.com http://www.rc.org/ | | | |_Anything is possible with the right tools and right information_|
Allan Hansen wrote:
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 <nothing>
// The files Long and Short $cat Long Allan Hansen hansen@rc.org
$cat Short hansen@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 ? main() 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 self.__assertIsMember(member) File "/usr/share/mailman/Mailman/OldStyleMemberships.py", line 113, in __assertIsMember raise Errors.NotAMemberError, member Mailman.Errors.NotAMemberError: Allan Hansen hansen@rc.org
This is apparently some Apple modified add_members script. The line numbers don't correlate with any distributed Mailman 2.1.x, and the standard script does not call the setDeliveryStatus() method at all.
<snip> > >// 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@rc.org>
Yes, I mentioned this previously. remove_members does not accept the 'long' format, but then if you're removing a member, you probably don't care about the 'name'.
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 'list_members'.
Well, my add_members does. I think Apple broke yours. You might try getting a recent add_members from http://cvs.sourceforge.net/viewcvs.py/mailman/mailman/bin/add_members, and see if that works for you.
-- Mark Sapiro msapiro@value.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Allan Hansen
-
Mark Sapiro