Update of /cvsroot/mailman/mailman/Mailman
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16276

Modified Files:
      Tag: Release_2_1-maint
        MailList.py 
Log Message:
Load(): Another shutil EPERM elimination patch; os.remove any existing safety
file.



Index: MailList.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v
retrieving revision 2.100.2.15
retrieving revision 2.100.2.16
diff -u -d -r2.100.2.15 -r2.100.2.16
--- MailList.py 29 Feb 2004 18:52:36 -0000      2.100.2.15
+++ MailList.py 29 Feb 2004 23:05:51 -0000      2.100.2.16
@@ -610,21 +610,33 @@
         # 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
+            # Move aside any existing pickle file and delete any existing
+            # safety file.  This avoids EPERM errors inside the shutil.copy()
+            # calls if those files exist with different ownership.
             try:
                 os.rename(pfile, pfile + '.corrupt')
             except OSError, e:
                 if e.errno <> errno.ENOENT: raise
+            try:
+                os.remove(pfile + '.safety')
+            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
+            # Move aside any existing marshal file and delete any existing
+            # safety file.  This avoids EPERM errors inside the shutil.copy()
+            # calls if those files exist with different ownership.
             try:
                 os.rename(dfile, dfile + '.corrupt')
             except OSError, e:
                 if e.errno <> errno.ENOENT: raise
+            try:
+                os.remove(dfile + '.safety')
+            except OSError, e:
+                if e.errno <> errno.ENOENT: raise
             shutil.copy(file, dfile)
-            shutil.copy(file, pfile + '.safety')
+            shutil.copy(file, dfile + '.safety')
         # Copy the loaded dictionary into the attributes of the current
         # mailing list object, then run sanity check on the data.
         self.__dict__.update(dict)


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to