[Zope-Checkins] CVS: Zope3/lib/python/Persistence - Module.py:1.8

Jeremy Hylton jeremy@zope.com
Thu, 11 Jul 2002 19:29:16 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv23151

Modified Files:
	Module.py 
Log Message:
Add comment about problem I haven't figured out yet.


=== Zope3/lib/python/Persistence/Module.py 1.7 => 1.8 ===
 
 from Transaction import get_transaction
 
+# There seems to be something seriously wrong with a module pickle
+# that contains objects pickled via save_global().  These objects are
+# pickled using references to the module.  It appears that unpickling the
+# object in the module causes the persistence machinery to fail.
+#
+# My suspicion is that the assignment to po_state before trying to
+# load the state confuses things.  The first call to setstate attempts
+# to reference an attribute of the module.  That getattr() fails because
+# the module is not a ghost, but does have any empty dict.  Since
+# that getattr() fails, it's state can't be unpickled.
+#
+# Not sure what to do about this.
+
 class PersistentModule(Persistent):
 
     def __init__(self, name):