[Zodb-checkins] CVS: Zope3/src/zodb - serialize.py:1.23

Jim Fulton jim at zope.com
Sun Sep 21 13:30:01 EDT 2003


Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv11558/src/zodb

Modified Files:
	serialize.py 
Log Message:
When getting class meta data, use type() rather than .__class__ so as
not to be fooled persistent proxies.

Done by Jeremy on the parentgeddon-branch branch:

Change conflict-resolution to no longer use a proxy. This is
necessary to support persistent proxies.


=== Zope3/src/zodb/serialize.py 1.22 => 1.23 ===
--- Zope3/src/zodb/serialize.py:1.22	Thu Jun 19 17:41:10 2003
+++ Zope3/src/zodb/serialize.py	Sun Sep 21 13:29:59 2003
@@ -79,7 +79,7 @@
         newargs = getattr(obj, "__getnewargs__", None)
         if newargs is not None:
             newargs = newargs()
-    return obj.__class__, newargs
+    return type(obj), newargs
 
 class RootJar:
     def newObjectId(self):
@@ -164,6 +164,14 @@
 
     def getState(self, obj):
         data = self._dump(getClassMetadata(obj), obj.__getstate__())
+        refs = findrefs(data)
+        return data, refs
+
+    def getStateFromResolved(self, ghost, state):
+        # This method is only used in the ResolvedObjectWriter subclass,
+        # but it is defined here to keep all the details of the data
+        # record format internal to this module.
+        data = self._dump(getClassMetadata(ghost), state)
         refs = findrefs(data)
         return data, refs
 




More information about the Zodb-checkins mailing list