Update of /cvsroot/mailman/mailman/Mailman
In directory usw-pr-cvs1:/tmp/cvs-serv16264

Modified Files:
        MailList.py 
Log Message:
__load(): Big dummy, os.path.getmtime() can raise an OSError if the
file doesn't exist.  Need to catch that.


Index: MailList.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v
retrieving revision 2.67
retrieving revision 2.68
diff -C2 -d -r2.67 -r2.68
*** MailList.py 1 Apr 2002 16:31:25 -0000       2.67
--- MailList.py 5 Apr 2002 14:43:28 -0000       2.68
***************
*** 494,505 ****
          else:
              assert 0, 'Bad database file name'
-         mtime = os.path.getmtime(dbfile)
-         if mtime <= self.__timestamp:
-             # File is not newer
-             return None, None
          try:
              fp = open(dbfile)
!         except IOError, e:
              if e.errno <> errno.ENOENT: raise
              return None, e
          try:
--- 494,512 ----
          else:
              assert 0, 'Bad database file name'
          try:
+             # Check the mod time of the file first.  If it matches our
+             # timestamp, then the state hasn't change since the last time we
+             # loaded it.  Otherwise open the file for loading, below.  If the
+             # file doesn't exist, we'll get an EnvironmentError with errno set
+             # to ENOENT (EnvironmentError is the base class of IOError and
+             # OSError).
+             mtime = os.path.getmtime(dbfile)
+             if mtime <= self.__timestamp:
+                 # File is not newer
+                 return None, None
              fp = open(dbfile)
!         except EnvironmentError, e:
              if e.errno <> errno.ENOENT: raise
+             # The file doesn't exist yet
              return None, e
          try:



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to