[Zope-dev] Broken objects

Jim Fulton jim at zope.com
Thu Sep 29 06:34:31 EDT 2005


So I guess it didn't work. :)

I'll look into this.  The first step will be to write a test for this.
The intent was definately that you would be able to get to a broken object's
state.

Jim

Victor Safronovich wrote:
> Hello Jim Fulton,
> 
> Thursday, September 29, 2005, 2:57:47 PM, you wrote:
> 
> JF> Victor Safronovich wrote:
> 
>>>Hello zope-dev!
>>>
>>> http://www.zope.org/Collectors/Zope/1911
>>> 
>>> I try to migrate my old database from zope 2.6.1.
>>>
>>> I  have Broken objects, but it is impossible to get its state in Zope 2.8.
>>> In Zope 2.6 Broken objects have states, what i uses to migrate its.
>>> I think this is because DB.classFactory is overrided to use
>>> OFS.Uninstalled.BrokenClass, which is bad persistent class.
>>>
>>> the __dict__ of all my Broken objects equals to {'_p_changed':None}.
>>>
>>> my_object._p_mtime does not load it`s state.
> 
> 
> JF> Try setting _p_changed=1.
>   object.__dict__ equals to {'_p_changed':1}
> 
> JF> Or try accessing some other attribute.
>   object.data
> 
>   AttributeError('data') raise by OFS.Uninstalled.Broken.__getattr__
> 
> Inheritance tree of class BrokenClass:
> 
>   + OFS.Uninstalled.BrokenClass
>     + __builtin__.ExplicitAcquirer
>       + ExtensionClass.Base
>         - __builtin__.object
>     + OFS.SimpleItem.Item
>       + ExtensionClass.Base
>         - __builtin__.object
>       + webdav.Resource.Resource
>         + ExtensionClass.Base
>           - __builtin__.object
>         + webdav.Lockable.LockableItem
>           - webdav.EtagSupport.EtagSupport
>       + OFS.CopySupport.CopySource
>         + ExtensionClass.Base
>           - __builtin__.object
>       + App.Management.Tabs
>         + ExtensionClass.Base
>           - __builtin__.object
>       - OFS.Traversable.Traversable
>       + OFS.ZDOM.Element
>         - OFS.ZDOM.Node
>       + AccessControl.Owned.Owned
>         + ExtensionClass.Base
>           - __builtin__.object
>       + App.Undo.UndoSupport
>         + ExtensionClass.Base
>           - __builtin__.object
>     + Persistence.Persistent
>       + persistent.Persistent
>         - __builtin__.object
>       + ExtensionClass.Base
>         - __builtin__.object
> 
> Contradictions of inherited attributes in class BrokenClass:
> 
>   __delattr__ (wrapper_descriptor)
>     + OFS.Uninstalled.BrokenClass
>       + __builtin__.ExplicitAcquirer
>         + ExtensionClass.Base
>           @ __builtin__.object
>       + OFS.SimpleItem.Item
>         + ExtensionClass.Base
>           # __builtin__.object
>         + webdav.Resource.Resource
>           + ExtensionClass.Base
>             # __builtin__.object
>         + OFS.CopySupport.CopySource
>           + ExtensionClass.Base
>             # __builtin__.object
>         + App.Management.Tabs
>           + ExtensionClass.Base
>             # __builtin__.object
>         + AccessControl.Owned.Owned
>           + ExtensionClass.Base
>             # __builtin__.object
>         + App.Undo.UndoSupport
>           + ExtensionClass.Base
>             # __builtin__.object
>       + Persistence.Persistent
>         # persistent.Persistent
>           # __builtin__.object
>         + ExtensionClass.Base
>           # __builtin__.object
> 
>   __getattribute__ (wrapper_descriptor)
>     + OFS.Uninstalled.BrokenClass
>       + __builtin__.ExplicitAcquirer
>         @ ExtensionClass.Base
>           # __builtin__.object
>       + OFS.SimpleItem.Item
>         # ExtensionClass.Base
>           # __builtin__.object
>         + webdav.Resource.Resource
>           # ExtensionClass.Base
>             # __builtin__.object
>         + OFS.CopySupport.CopySource
>           # ExtensionClass.Base
>             # __builtin__.object
>         + App.Management.Tabs
>           # ExtensionClass.Base
>             # __builtin__.object
>         + AccessControl.Owned.Owned
>           # ExtensionClass.Base
>             # __builtin__.object
>         + App.Undo.UndoSupport
>           # ExtensionClass.Base
>             # __builtin__.object
>       # Persistence.Persistent
>         # persistent.Persistent
>           # __builtin__.object
>         # ExtensionClass.Base
>           # __builtin__.object
> 
>   __setattr__ (wrapper_descriptor)
>     + OFS.Uninstalled.BrokenClass
>       + __builtin__.ExplicitAcquirer
>         + ExtensionClass.Base
>           @ __builtin__.object
>       + OFS.SimpleItem.Item
>         + ExtensionClass.Base
>           # __builtin__.object
>         + webdav.Resource.Resource
>           + ExtensionClass.Base
>             # __builtin__.object
>         + OFS.CopySupport.CopySource
>           + ExtensionClass.Base
>             # __builtin__.object
>         + App.Management.Tabs
>           + ExtensionClass.Base
>             # __builtin__.object
>         + AccessControl.Owned.Owned
>           + ExtensionClass.Base
>             # __builtin__.object
>         + App.Undo.UndoSupport
>           + ExtensionClass.Base
>             # __builtin__.object
>       + Persistence.Persistent
>         # persistent.Persistent
>           # __builtin__.object
>         + ExtensionClass.Base
>           # __builtin__.object
> 
>   __setstate__ (method_descriptor)
>     + OFS.Uninstalled.BrokenClass
>       + __builtin__.ExplicitAcquirer
>         @ ExtensionClass.Base
>       + OFS.SimpleItem.Item
>         # ExtensionClass.Base
>         + webdav.Resource.Resource
>           # ExtensionClass.Base
>         + OFS.CopySupport.CopySource
>           # ExtensionClass.Base
>         + App.Management.Tabs
>           # ExtensionClass.Base
>         + AccessControl.Owned.Owned
>           # ExtensionClass.Base
>         + App.Undo.UndoSupport
>           # ExtensionClass.Base
>       + Persistence.Persistent
>         # persistent.Persistent
>         # ExtensionClass.Base
> 
> I think __setattr__ and __setstate__ overriden by ExtensionClass, but needfully
> must be from Persistent. Or classFactory must return ZODB.broken.{Persistent}Broken objects
> 
> 


-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope-Dev mailing list