[Zope-dev] Bug in error logging in Catalog

Steve Alexander steve@cat-box.net
Sun, 27 Aug 2000 13:21:16 +0100


Zope 2.2.1, lib/python/Products/ZCatalog/Catalog.py

When there is an error uncataloging an object, uncatalogObject()
attempts to log the fact with this line:

            LOG('Catalog', ERROR, ('uncatalogObject unsuccessfully '
                                   'attempted to uncatalog an object '
                                   'with a uid of %s. ' % uid))

However, if uncatalogObject has been passed a tuple, the error logging
will fail with "TypeError Error Value: not all arguments converted".

The fix is to change the line to:

            LOG('Catalog', ERROR, ('uncatalogObject unsuccessfully '
                                   'attempted to uncatalog an object '
                                   'with a uid of %s. ' % `uid`))

or, to fit with the rest of the calls to LOG in Catalog.py:

            LOG('Catalog', ERROR, ('uncatalogObject unsuccessfully '
                                   'attempted to uncatalog an object '
                                   'with a uid of %s. ' % str(uid)))


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net