[Zope-Checkins] CVS: ZODB3/ZODB - ConflictResolution.py:1.18.36.3

Jeremy Hylton jeremy@zope.com
Wed, 16 Jul 2003 15:10:15 -0400


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv1666/ZODB

Modified Files:
      Tag: zodb33-devel-branch
	ConflictResolution.py 
Log Message:
Fix apparent bug in conflict resolution that writes bogus class metadata.

Most of the time, an object is loaded when a ghost object is
accessed.  In that case, the first pickle in the database record is
ignored.  That would explain why we've never noticed the bogus
headers.


=== ZODB3/ZODB/ConflictResolution.py 1.18.36.2 => 1.18.36.3 ===
--- ZODB3/ZODB/ConflictResolution.py:1.18.36.2	Tue Jul 15 14:02:57 2003
+++ ZODB3/ZODB/ConflictResolution.py	Wed Jul 16 15:10:09 2003
@@ -90,7 +90,8 @@
         file = StringIO(newpickle)
         unpickler = Unpickler(file)
         unpickler.persistent_load = prfactory.persistent_load
-        class_tuple = unpickler.load()[0]
+        meta = unpickler.load()
+        class_tuple = meta[0]
         if bad_class(class_tuple):
             return None
         newstate = unpickler.load()
@@ -113,7 +114,7 @@
         file = StringIO()
         pickler = Pickler(file,1)
         pickler.persistent_id = persistent_id
-        pickler.dump(class_tuple)
+        pickler.dump(meta)
         pickler.dump(resolved)
         return file.getvalue(1)
     except ConflictError: