[ZODB-Dev] fstail.py error

Christian Robottom Reis kiko at async.com.br
Wed Feb 25 14:26:57 EST 2004


On Wed, Feb 25, 2004 at 04:34:37PM +0100, Martijn Faassen wrote:
>  File "/usr/lib/python2.3/site-packages/ZODB/utils.py", line 36, in u64
>    return unpack(">Q", v)[0]
> TypeError: unpack() argument 2 must be string or read-only buffer, not long
> 
> Anyone know what could be going on?

ISTM Jeremy changed the struct format of the TRANS_HDR field for length
for FileStorage on HEAD (it used to be an 8s, and it's now a Q); it's
probably just a matter of doing something like:

--- ZODB/fstools.py     28 Nov 2003 16:44:49 -0000      1.2
+++ ZODB/fstools.py     25 Feb 2004 19:24:15 -0000
@@ -21,7 +21,7 @@ XXX This file needs to be kept in sync w
 import cPickle
 import struct
 
-from ZODB.FileStorage import TRANS_HDR, DATA_HDR, TRANS_HDR_LEN, \
+from ZODB.FileStorage.format import TRANS_HDR, DATA_HDR, TRANS_HDR_LEN, \
      DATA_HDR_LEN, DATA_VERSION_HDR_LEN
 from ZODB.utils import p64, u64
 from persistent.TimeStamp import TimeStamp
@@ -47,9 +47,8 @@ class TxnHeader:
     def _read_header(self):
         self._file.seek(self._pos)
         self._hdr = self._file.read(TRANS_HDR_LEN)
-        (self.tid, length, self.status, self.user_len, self.descr_len,
+        (self.tid, self.length, self.status, self.user_len, self.descr_len,
          self.ext_len) = struct.unpack(TRANS_HDR, self._hdr)
-        self.length = u64(length)
 
     def read_meta(self):
         """Load user, descr, and ext attributes."""

I'm surprised you didn't state you had to change the import line to get
the script to run at all, though..

Jeremy, looks correct enough to commi?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331



More information about the ZODB-Dev mailing list