[Zodb-checkins] CVS: StandaloneZODB/ZEO - ClientCache.py:1.16.2.3 ClientStorage.py:1.33.2.6

Jeremy Hylton jeremy@zope.com
Mon, 29 Oct 2001 16:40:21 -0500


Update of /cvs-repository/StandaloneZODB/ZEO
In directory cvs.zope.org:/tmp/cvs-serv18014

Modified Files:
      Tag: zeo-1_0-branch
	ClientCache.py ClientStorage.py 
Log Message:
Be careful when closeing a tempfile.

On Windows, multiple calls to close() will raise an exception.  On Unix,
the extra calls are ignored.


=== StandaloneZODB/ZEO/ClientCache.py 1.16.2.2 => 1.16.2.3 ===
         try:
             self._f[self._current].close()
-        except ValueError:
+        except (os.error, ValueError):
             pass
 
     def open(self):


=== StandaloneZODB/ZEO/ClientStorage.py 1.33.2.5 => 1.33.2.6 ===
             LOG("ClientStorage", INFO, "close")
             self._call.closeIntensionally()
-            self._tfile.close()
+            try:
+                self._tfile.close()
+            except os.error:
+                # On Windows, this can fail if it is called more than
+                # once, because it tries to delete the file each
+                # time.
+                pass
             self._cache.close()
             if self.invalidator is not None:
                 self.invalidator.close()