[Bug] Re: [Zope] ZCatalog "AttributeError: __call__" error

Dieter Maurer dieter@handshake.de
Wed, 6 Mar 2002 22:50:05 +0100


Villemin, Remi writes:
 > I am running Zope 2.5.0.
 > I am able to create a ZCatalog in some folders and to "Find and Catalog"
 > objects in it, but in some other folders when I try to "Find and Catalog"
 > objects I get an "AttributeError: __call__" error.
 > ...
 > The error log is:
 > catalogObject
 >   File /usr/local/zope/2-5-0/lib/python/Products/ZCatalog/Catalog.py, line
 > 423, in recordify
 > AttributeError: __call__
The failing folders contain a strange object.

  It has an attribute "a" (maybe acquired) which is named in the
  "Meta Data" of the catalog with the following (bad) property:
  "callable(a)" is true, but "a" is not really callable.

  This may happen with acquisition wrapped objects. Python's built in
  "callable" is not smart enough to give the correct answer for
  acquisition wrapped objects (may give false "true"s).
  If an uncallable wrapped object (e.g. a folder) is acquired,
  then you would get this error.

This is a ZCatalog bug (please file a Collector report!).
It should use the same method as "DocumentTemplate.DT_Util.render" to
check for callability. I expect the same problem may also occur
at other place in Zope (e.g. "dtml-in").  


Dieter