diff options
| author | bwarsaw | 2002-05-03 22:57:52 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-05-03 22:57:52 +0000 |
| commit | ff6a91738353426d23b9d83ae62741baa8f61a0d (patch) | |
| tree | 595055481f72c9ab5b81a64e070cfe0bd532fdc7 | |
| parent | 94af05b01e97459ccd93916a6bfdf539344a3d30 (diff) | |
| download | mailman-ff6a91738353426d23b9d83ae62741baa8f61a0d.tar.gz mailman-ff6a91738353426d23b9d83ae62741baa8f61a0d.tar.zst mailman-ff6a91738353426d23b9d83ae62741baa8f61a0d.zip | |
| -rw-r--r-- | Mailman/Archiver/Archiver.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Mailman/Archiver/Archiver.py b/Mailman/Archiver/Archiver.py index 89baf7dd8..813a2c0a2 100644 --- a/Mailman/Archiver/Archiver.py +++ b/Mailman/Archiver/Archiver.py @@ -68,7 +68,6 @@ class Archiver: self.archive_private = mm_cfg.DEFAULT_ARCHIVE_PRIVATE self.archive_volume_frequency = \ mm_cfg.DEFAULT_ARCHIVE_VOLUME_FREQUENCY - # The archive file structure by default is: # # archives/ @@ -101,13 +100,23 @@ class Archiver: os.mkdir(self.archive_dir(), 02775) except OSError, e: if e.errno <> errno.EEXIST: raise - fp = open(os.path.join(self.archive_dir(), 'index.html'), 'w') - fp.write(Utils.maketext( - 'emptyarchive.html', - {'listname': self.real_name, - 'listinfo': self.GetScriptURL('listinfo', absolute=1), - }, mlist=self)) - fp.close() + # See if there's an index.html file there already and if not, + # write in the empty archive notice. + indexfile = os.path.join(self.archive_dir(), 'index.html') + fp = None + try: + fp = open(indexfile) + except IOError, e: + if e.errno <> errno.ENOENT: raise + else: + fp = open(indexfile, 'w') + fp.write(Utils.maketext( + 'emptyarchive.html', + {'listname': self.real_name, + 'listinfo': self.GetScriptURL('listinfo', absolute=1), + }, mlist=self)) + if fp: + fp.close() finally: os.umask(omask) |
