From b1b4e2e7fde9a83f0a41264155526bcf08bad4a2 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Wed, 5 Jul 2000 20:41:36 +0000 Subject: Create(): Fold in the CreateFiles() method. Don't use self.Lock() here because that reloads the database as a side-effect - but the config.db file doesn't exist at this point! This fixes the newlist problem. Also, there's no need to create the LOCK_DIR file; and use a safer way to create the next-digest and next-digest-topics files (which I'm not sure are strictly necessary anymore). CreateFiles(): Removed. --- Mailman/MailList.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'Mailman/MailList.py') diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 3efb5ea6e..2eb444b84 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -782,23 +782,21 @@ it will not be changed."""), 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) -- cgit v1.2.3-70-g09d2