[Zodb-checkins] CVS: ZODB4/src/zodb/storage - file.py:1.8.4.10

Barry Warsaw barry@wooz.org
Wed, 12 Mar 2003 12:27:33 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv11008

Modified Files:
      Tag: opaque-pickles-branch
	file.py 
Log Message:
restore(): refs will be None when data is None, so convert that to the
empty list.


=== ZODB4/src/zodb/storage/file.py 1.8.4.9 => 1.8.4.10 ===
--- ZODB4/src/zodb/storage/file.py:1.8.4.9	Wed Mar 12 12:17:25 2003
+++ ZODB4/src/zodb/storage/file.py	Wed Mar 12 12:27:29 2003
@@ -966,6 +966,8 @@
                 dlen = len(data)
                 nrefs = len(refs)
             # Write the recovery data record
+            if refs is None:
+                refs = []
             self._tfile.write(pack(DATA_HDR,
                                    oid, serial, old, self._pos,
                                    len(version), nrefs, dlen))
@@ -985,8 +987,7 @@
                 self._tvindex[version] = here
                 self._tfile.write(version)
             # Write the references
-            if refs:
-                self._tfile.write(''.join(refs))
+            self._tfile.write(''.join(refs))
             # Write the data or a backpointer
             if data is None:
                 if prev_pos: