quick-fix patch for newlist failure
![](https://secure.gravatar.com/avatar/e542859f7cf390bcbcfd1957aa86eaf9.jpg?s=120&d=mm&r=g)
Here's a fix that's probably safe, and fixes the "newlist" problem. Of course I'm not sure if it's the right final fix, but I figure while Barry's examining the problem, this might be worth a try for some of you.
The issue is that list.Lock() now wants to reload the list config.db (with list.Load()), and that doesn't exist in the case of list.Create(). So this fix just catches the "Unknown List" error from Load(), and ignores it, on the theory that the only time that should happen is when the list is in the process of being created.
I've installed it on my beta3 production site, and will let you know if it seems to cause any other errors.
diff MailList.py.orig MailList.py 1345c1345,1348 < self.Load()
try: self.Load() except Errors.MMUnknownListError: pass
![](https://secure.gravatar.com/avatar/867c1bb32337fa1f1672f1b0c0c0ec97.jpg?s=120&d=mm&r=g)
"DM" == Dan Mick <Dan.Mick@West.Sun.COM> writes:
DM> Here's a fix that's probably safe, and fixes the "newlist" DM> problem. Of course I'm not sure if it's the right final fix, DM> but I figure while Barry's examining the problem, this might DM> be worth a try for some of you. I just got back from a gig -- thanks for the quick fix Dan. Here's a slightly better one that also fixes a few other ugly bits. This is serious enough to warrant a quick beta4, but I want to spend a couple of hours looking into Ricardo's problem (which I still can't reproduce). Better that then having to do a beta5 over the weekend ;} I'm just too beat tonight. -Barry Index: MailList.py =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v retrieving revision 1.172 diff -u -r1.172 MailList.py --- MailList.py 2000/06/28 18:40:48 1.172 +++ MailList.py 2000/06/30 03:04:42 @@ -782,23 +782,21 @@ Utils.MakeDirTree(os.path.join(mm_cfg.LIST_DATA_DIR, name)) self._full_path = os.path.join(mm_cfg.LIST_DATA_DIR, name) self._internal_name = name - self.Lock() - self.InitVars(name, admin, crypted_password) - self._ready = 1 - self.InitTemplates() - self.Save() - self.CreateFiles() - - def CreateFiles(self): + # Don't use Lock() since that tries to load the non-existant config.db + self.__lock.lock() + self.InitVars(name, admin, crypted_password) + self._ready = 1 + self.InitTemplates() + self.Save() # Touch these files so they have the right dir perms no matter what. # A "just-in-case" thing. This shouldn't have to be here. ou = os.umask(002) try: - open(os.path.join(mm_cfg.LOCK_DIR, '%s.lock' % - self._internal_name), 'a+').close() - open(os.path.join(self._full_path, "next-digest"), "a+").close() - open(os.path.join(self._full_path, "next-digest-topics"), - "a+").close() + path = os.path.join(self._full_path, 'next-digest') + fp = open(path, "a+") + fp.close() + fp = open(path+'-topics', "a+") + fp.close() finally: os.umask(ou)
participants (2)
-
bwarsaw@beopen.com
-
Dan Mick