diff options
Diffstat (limited to 'Mailman/MailList.py')
-rw-r--r-- | Mailman/MailList.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 7b57c143..26ecd015 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -610,9 +610,19 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # copy the fallback into the primary so that the logic in Save() will # still work. For giggles, we'll copy it to a safety backup. if file == plast: + # Move aside any existing pickle file + try: + os.rename(pfile, pfile + '.corrupt') + except OSError, e: + if e.errno <> errno.ENOENT: raise shutil.copy(file, pfile) shutil.copy(file, pfile + '.safety') elif file == dlast: + # Move aside any existing marshal file + try: + os.rename(dfile, dfile + '.corrupt') + except OSError, e: + if e.errno <> errno.ENOENT: raise shutil.copy(file, dfile) shutil.copy(file, pfile + '.safety') # Copy the loaded dictionary into the attributes of the current |