[Zope-dev] "zope.interface" confuses Python

Dieter Maurer dieter at handshake.de
Mon Jan 7 11:55:06 EST 2008


Yesterday, I released "dm.zdoc" and today I find problems.

The analysis revealed:

  The class "webdav.EtagSupport.EtagSupport" has initially no
  attributes "__provides__" and "__providedBy__".

  For still unknown reasons, it suddenly gets these attributes.
  "__provides__" is a "zope.interface.declarations.ClassProvides".
  Therefore, I expect that Zope 3 or "five" is responsible
  for these additions.

  "EtagSupport" is in the mro of "ManagableIndex".
  But nevertheless, "ManagableIndex.__provides__" results in
  an "AttributeError".

Here is a transscript reproducing the problem:

>>> import App.FindHomes
>>> from webdav.EtagSupport import EtagSupport
>>> EtagSupport.__provides__
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: class EtagSupport has no attribute '__provides__'
>>> from Products.ManagableIndex.ManagableIndex import ManagableIndex
/usr/local/lib/python24.zip/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module
  DeprecationWarning)
>>> EtagSupport.__provides__
<zope.interface.declarations.ClassProvides object at 0x40b5566c>
>>> ManagableIndex.__provides__
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: __provides__
>>> from inspect import getmro
>>> EtagSupport in getmro(ManagableIndex)
True


Any ideas?

-- 
Dieter


More information about the Zope-Dev mailing list