[Zope3-dev] Persistent declarations, dead interfaces and a TypeError

Sidnei da Silva sidnei at enfoldsystems.com
Thu Feb 22 21:24:23 EST 2007


Hi there,

I'm consistently having issues with 'directlyProvides' and interfaces
that are moved or removed. The symptom is that when the persisted
declaration is unghostified a TypeError happens.

This is specially bad since in this case the 'directlyProvides' is
being used on a PAS plugin, and the TypeError prevents the user from
even going into the ZMI to delete the object!

Here's a snippet of the traceback. In the list of interfaces below,
the ones prefixed by Products.Five.bbb do not exist anymore:

  Module ZODB.Connection, line 732, in setstate
  Module ZODB.Connection, line 786, in _setstate
  Module ZODB.serialize, line 604, in setGhostState
  Module ZODB.serialize, line 597, in getState
  Module zope.interface.declarations, line 766, in Provides
  Module zope.interface.declarations, line 669, in __init__
  Module zope.interface.declarations, line 47, in __init__
  Module zope.interface.declarations, line 1363, in _normalizeargs
  Module zope.interface.declarations, line 1362, in _normalizeargs
TypeError: ('iteration over non-sequence', <function Provides at
0x009A6F70>, (<class
'Products.PluggableAuthService.plugins.ScriptablePlugin.ScriptablePlugin'>,
<InterfaceClass persistent.interfaces.IPersistent>, <class
'Products.Five.bbb.OFS_interfaces.IFolder'>, <class
'Products.Five.bbb.OFS_interfaces.IObjectManager'>, <InterfaceClass
zope.app.container.interfaces.IContainer>, <class
'Products.Five.bbb.OFS_interfaces.ICopyContainer'>, <class
'Products.Five.bbb.App_interfaces.INavigation'>, <class
'Products.Five.bbb.Acquisition_interfaces.IAcquirer'>, <class
'Products.Five.bbb.webdav_interfaces.IDAVCollection'>, <class
'Products.Five.bbb.webdav_interfaces.IDAVResource'>, <class
'Products.Five.bbb.webdav_interfaces.IWriteLock'>, <class
'Products.Five.bbb.OFS_interfaces.ITraversable'>, <class
'Products.Five.bbb.OFS_interfaces.IPropertyManager'>, <class
'Products.Five.bbb.AccessControl_interfaces.IRoleManager'>, <class
'Products.Five.bbb.AccessControl_interfaces.IPermissionMappingSupport'>,
<class 'Products.Five.bbb.OFS_interfaces.IItem'>, <class
'Products.Five.bbb.OFS_interfaces.ICopySource'>, <class
'Products.Five.bbb.AccessControl_interfaces.IOwned'>, <class
'Products.Five.bbb.App_interfaces.IUndoSupport'>, <class
'Products.Five.bbb.OFS_interfaces.IFindSupport'>, <class
'Products.Five.bbb.OFS_interfaces.ISimpleItem'>, <InterfaceClass
Products.PluggableAuthService.interfaces.plugins.IAuthenticationPlugin>,
<InterfaceClass
Products.PluggableAuthService.interfaces.plugins.IExtractionPlugin>))

I believe that _normalizeargs in zope.interface.declarations should be
changed to cope with this, by ignoring those 'broken' references.

Thoughts?
-- 
Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214


More information about the Zope3-dev mailing list