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 <[EMAIL PROTECTED]> $cat Short [EMAIL PROTECTED] // 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 <[EMAIL PROTECTED]> // 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 <[EMAIL PROTECTED]> // The address is indeed added: $/usr/share/mailman/bin/list_members -f Test Allan Hansen <[EMAIL PROTECTED]> // Now, let's try removing same. We have a problem: $/usr/share/mailman/bin/remove_members -f Long Test No such member: Allan Hansen <[EMAIL PROTECTED]> // Indeed, the command failed: $/usr/share/mailman/bin/list_members -f Test Allan Hansen <[EMAIL PROTECTED]> // 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: [EMAIL PROTECTED] [EMAIL PROTECTED] | | WWW: http://www.ugs.com http://www.rc.org/ | | | |_Anything is possible with the right tools and right information_| ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp