[Zodb-checkins] CVS: ZODB3/ZEO - cache.py:1.3

Tim Peters tim.one at comcast.net
Mon Dec 29 17:13:26 EST 2003


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv29379/ZEO

Modified Files:
	cache.py 
Log Message:
scan():  If the status byte has an unexpected value, show it in hex
rather than as a (probably) unprintable character.


=== ZODB3/ZEO/cache.py 1.2 => 1.3 ===
--- ZODB3/ZEO/cache.py:1.2	Wed Dec 24 11:02:03 2003
+++ ZODB3/ZEO/cache.py	Mon Dec 29 17:13:23 2003
@@ -572,7 +572,7 @@
 # disk.
 
 class FileCache(object):
-    
+
     def __init__(self, maxsize, fpath, parent, reuse=True):
         # Maximum total of object sizes we keep in cache.
         self.maxsize = maxsize
@@ -624,7 +624,7 @@
         else:
             self.new = False
             self.f = None
-        
+
         # Statistics:  _n_adds, _n_added_bytes,
         #              _n_evicts, _n_evicted_bytes
         self.clearStats()
@@ -661,7 +661,7 @@
             elif status in '1234':
                 size = int(status)
             else:
-                assert 0, status
+                assert 0, hex(ord(status))
 
             self.filemap[ofs] = size, ent
             if ent is None and size > max_free_size:
@@ -839,7 +839,7 @@
         # disk where the object was stored.  We need to load the
         # header to update the in-memory data structures held by
         # ClientCache.
-        
+
         # XXX Or we could just keep the header in memory at all times.
 
         e = self.key2entry.get(key)
@@ -861,11 +861,11 @@
     # This method should be called when the object header is modified.
 
     def update(self, obj):
-        
+
         e = self.key2entry[obj.key]
         self.f.seek(e.offset + OBJECT_HEADER_SIZE)
         obj.serialize_header(self.f)
-        
+
     def settid(self, tid):
         if self.tid is not None:
             if tid < self.tid:




More information about the Zodb-checkins mailing list