[Mailman-Users] Withlist Errors

Robert Haack haack at nclack.k12.or.us
Thu Dec 15 16:33:29 CET 2005


Mark Sapiro wrote:

>Robert Haack wrote:
>
>  
>
>>I'm working on a procedure to change the number of recipients in lists. 
>>Following a sample Mark Sapiro (Thank You Mark) I created the below
>>procedure.  When I run it though I a bunch of errors.  Being that I know
>>nothing about Python I was hoping that one of you might be able to point
>>out what is wrong here.  If I need to post this to the python list
>>instead just let me know.
>>    
>>
>
>
>The Python folks don't know about withlist or Mailman specific methods,
>so this is the appropriate place.
>
>
>  
>
>>def cng_no_recipents(mlist):
>>  mlist.Lock()
>>  mlist.max_num_recipients = 100
>>  mlist.Save()
>>  mlist.Unlock()
>>
>>
>>[root at nclack bin]# ./withlist -l -r cngnorecipe.cng_no_recipents test3
>>Importing cngnorecipe...
>>Running cngnorecipe.cng_no_recipents()...
>>Loading list test3 (locked)
>>Traceback (most recent call last):
>> File "./withlist", line 275, in ?
>>   main()
>> File "./withlist", line 256, in main
>>   r = do_list(listname, args, func)
>> File "./withlist", line 189, in do_list
>>   return func(m, *args)
>> File "/var/mailman/bin/cngnorecipe.py", line 2, in cng_no_recipents
>>   mlist.Lock()
>> File "/var/mailman/Mailman/MailList.py", line 159, in Lock
>>   self.__lock.lock(timeout)
>> File "/var/mailman/Mailman/LockFile.py", line 291, in lock
>>   raise AlreadyLockedError
>>Mailman.LockFile.AlreadyLockedError
>>Unlocking (but not saving) list: test3
>>Finalizing
>>    
>>
>
>
>The problem is just what it says. The script is trying to lock the list
>(mlist.Lock()), and the list is already locked (withlist -l option).
>There are several ways around this, but the easiest is to just remove
>-l from the withlist command.
>  
>
Okay I got this part resolved but when I run the program it prints out
the initial value 150.  I then change the value to 100 and print it out
and it shows me 100.  If I then go look at the list or run the program
again I find that my initial value is still there.  I've tried this
while logged onto the web based page and when I'm not logged in and I
get the same results.  The program is exactly as it is above.

TIA

Robert Haack
Programmer Analyst
North Clackamas School District #12
haack at nclack.k12.or.us





More information about the Mailman-Users mailing list