[Zodb-checkins] SVN: ZODB/branches/jim-zeo-blob/src/ZODB/lock_file.py Fixed error strings and made error handling a little more defensive.

Jim Fulton jim at zope.com
Wed May 16 16:33:36 EDT 2007


Log message for revision 75813:
  Fixed error strings and made error handling a little more defensive.
  

Changed:
  U   ZODB/branches/jim-zeo-blob/src/ZODB/lock_file.py

-=-
Modified: ZODB/branches/jim-zeo-blob/src/ZODB/lock_file.py
===================================================================
--- ZODB/branches/jim-zeo-blob/src/ZODB/lock_file.py	2007-05-16 20:01:29 UTC (rev 75812)
+++ ZODB/branches/jim-zeo-blob/src/ZODB/lock_file.py	2007-05-16 20:33:36 UTC (rev 75813)
@@ -39,14 +39,14 @@
             try:
                 ZODB.winlock.LockFile(file.fileno())
             except ZODB.winlock.LockError:
-                raise LockError("Couldn't lock %r", file.name)
+                raise LockError("Couldn't lock %r" % file.name)
             
 
         def _unlock_file(file):
             try:
                 ZODB.winlock.UnlockFile(file.fileno())
             except ZODB.winlock.LockError:
-                raise LockError("Couldn't unlock %r", file.name)
+                raise LockError("Couldn't unlock %r" % file.name)
                 
 else:
     # Unix
@@ -56,7 +56,7 @@
         try:
             fcntl.flock(file.fileno(), _flags)
         except IOError:
-            raise LockError("Couldn't lock %r", file.name)
+            raise LockError("Couldn't lock %r" % file.name)
             
 
     def _unlock_file(file):
@@ -81,6 +81,7 @@
         try:
             _lock_file(self._fp)
         except:
+            self._fp.close()
             logger.exception("Error locking file %s", path)
             raise
         print >> self._fp, os.getpid()



More information about the Zodb-checkins mailing list