Update of /cvsroot/mailman/mailman/Mailman
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29936
Modified Files:
Tag: Release_2_1-maint
MailList.py
Log Message:
Load(): Before creating the .safety file, move any existing .pck or .db file
to a .corrupt file, since it could not be read. This should eliminate the
shutil EPERM exceptions.
Index: MailList.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v
retrieving revision 2.100.2.14
retrieving revision 2.100.2.15
diff -u -d -r2.100.2.14 -r2.100.2.15
--- MailList.py 29 Feb 2004 16:57:58 -0000 2.100.2.14
+++ MailList.py 29 Feb 2004 18:52:36 -0000 2.100.2.15
@@ -610,9 +610,19 @@
# 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
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org