fix_url won't save list as no Lock
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Low
|
Mark Sapiro |
Bug Description
In mailman 2.1.13 and 2.1.11 using python 2.52 on a linux host
bin/withlist -r fix_url listname -u url
fails with
Mailman.
eg
bin/withlist -r fix_url listname -u url
Importing fix_url...
Running fix_url.
Loading list test (unlocked)
Setting web_page_url to: URL
Setting host_name to: HOSTNAME
Saving list
Traceback (most recent call last):
File "bin/withlist", line 299, in <module>
main()
File "bin/withlist", line 277, in main
r = do_list(listname, args, func)
File "bin/withlist", line 202, in do_list
return func(m, *args)
File "/opt/mailman/
mlist.Save()
File "/opt/mailman/
self.
File "/opt/mailman/
raise NotLockedError, '%s: %s' % (repr(self), self.__read())
Mailman.
Finalizing
Fix is
*** bin/fix_url.py.orig 2010-05-30 16:12:06.000000000 +1000
--- bin/fix_url.py 2010-07-27 18:19:04.000000000 +1000
***************
*** 83,88 ****
--- 83,89 ----
print _('Setting host_name to: %(mailhost)s')
mlist.
print _('Saving list')
+ mlist.Lock()
mlist.Save()
mlist.
Changed in mailman: | |
assignee: | nobody → Mark Sapiro (msapiro) |
importance: | Undecided → Low |
milestone: | none → 2.1.14 |
status: | New → Fix Committed |
Changed in mailman: | |
status: | Fix Committed → Fix Released |
Your suggested fix has two serious problems:
1) Locking the list reloads it as a side effect. Thus, locking after making changes to your instance of the list object will undo those changes.
2) The documentation of fix_url states that it should be run via
% bin/withlist -l -r fix_url listname [options]
Thus, if it is run as documented (with the -l option to withlist), it will throw an AlreadyLockedError exception when it attempts to lock the already locked list.
While this isn't really a bug since fix_url is documented to be run via withlist -l, a patch to "fix" it properly is attached