[Zope3-checkins] CVS: ZODB4/src/zodb/zeo - cache.py:1.2.12.2
Barry Warsaw
barry@wooz.org
Wed, 12 Feb 2003 16:06:25 -0500
Update of /cvs-repository/ZODB4/src/zodb/zeo
In directory cvs.zope.org:/tmp/cvs-serv27000
Modified Files:
Tag: opaque-pickles-branch
cache.py
Log Message:
Use ZERO instead of \0*8
=== ZODB4/src/zodb/zeo/cache.py 1.2.12.1 => 1.2.12.2 ===
--- ZODB4/src/zodb/zeo/cache.py:1.2.12.1 Wed Feb 12 15:08:45 2003
+++ ZODB4/src/zodb/zeo/cache.py Wed Feb 12 16:06:24 2003
@@ -102,13 +102,13 @@
import os
import time
+import logging
import tempfile
from struct import pack, unpack
from thread import allocate_lock
-import logging
from zodb.utils import u64
-
+from zodb.interfaces import ZERO
from zodb.zeo.interfaces import ICache
magic='ZEC0'
@@ -152,7 +152,7 @@
# Initialize pairs of filenames, file objects, and serialnos.
self._p = p = [fmt % 0, fmt % 1]
self._f = f = [None, None]
- s = ['\0\0\0\0\0\0\0\0', '\0\0\0\0\0\0\0\0']
+ s = [ZERO, ZERO]
for i in 0, 1:
if os.path.exists(p[i]):
fi = open(p[i],'r+b')
@@ -163,7 +163,7 @@
fi.seek(23)
s[i] = fi.read(8)
# If we found a non-zero serial, then use the file
- if s[i] != '\0\0\0\0\0\0\0\0':
+ if s[i] != ZERO:
f[i] = fi
fi = None
@@ -524,7 +524,7 @@
def _store(self, oid, p, s, version, pv, sv):
if not s:
p = ''
- s = '\0\0\0\0\0\0\0\0'
+ s = ZERO
tlen = 31 + len(p)
if version:
tlen = tlen + len(version) + 12 + len(pv)