diff options
| author | Mark Sapiro | 2008-10-17 15:36:33 -0700 |
|---|---|---|
| committer | Mark Sapiro | 2008-10-17 15:36:33 -0700 |
| commit | 12513c7d0fc1f5d2a1aabda349637309f6e8300b (patch) | |
| tree | 8cf03369a6fe107546446951a6af9ebc6bc88f10 /mailman/bin/arch.py | |
| parent | 7e2a6552475d0cb53c66aa76d5b56a4cf5911e10 (diff) | |
| download | mailman-12513c7d0fc1f5d2a1aabda349637309f6e8300b.tar.gz mailman-12513c7d0fc1f5d2a1aabda349637309f6e8300b.tar.zst mailman-12513c7d0fc1f5d2a1aabda349637309f6e8300b.zip | |
Diffstat (limited to 'mailman/bin/arch.py')
| -rw-r--r-- | mailman/bin/arch.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mailman/bin/arch.py b/mailman/bin/arch.py index 7406dc32a..39ad9e343 100644 --- a/mailman/bin/arch.py +++ b/mailman/bin/arch.py @@ -115,6 +115,15 @@ def main(): # XXX processUnixMailbox() should refresh the lock. lock_path = os.path.join(mlist.data_path, '.archiver.lck') with Lock(lock_path, lifetime=int(hours(3))): + # Try to open mbox before wiping old archive. + try: + fp = open(mbox) + except IOError, e: + if e.errno == errno.ENOENT: + print >> sys.stderr, _('Cannot open mbox file: $mbox') + else: + print >> sys.stderr, e + sys.exit(1) # Maybe wipe the old archives if opts.wipe: if mlist.scrub_nondigest: @@ -132,14 +141,6 @@ def main(): shutil.rmtree(mlist.archive_dir()) if mlist.scrub_nondigest and saved: os.renames(savedir, atchdir) - try: - fp = open(mbox) - except IOError, e: - if e.errno == errno.ENOENT: - print >> sys.stderr, _('Cannot open mbox file: $mbox') - else: - print >> sys.stderr, e - sys.exit(1) archiver = HyperArchive(mlist) archiver.VERBOSE = opts.verbose |
