[Zope-dev] Broken objects

Victor Safronovich vsafronovich at naumen.ru
Thu Sep 29 06:03:17 EDT 2005


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


-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru



More information about the Zope-Dev mailing list