[Zope-dev] 2.3.0. Unindex_object Tried To Unindex Nonexistent

Steve Alexander steve@cat-box.net
Mon, 29 Jan 2001 12:19:57 +0000


Andy Dawkins wrote:

> I'm having some more problems with the ZCatalog in Zope 2.3.0
> 
> I've got a name error in the file UnTextIndex.py
> 
> Error Type: NameError
> Error Value: i
> 
> I believe this is occuring when the catalog tries to unindex an object
> that isn't currently indexed.
> 
> The traceback reports line 332:
> 
> File /usr/zope/zope-2_3_0/lib/python/SearchIndex/UnTextIndex.py, line
> 332, in removeForwardEntry
> 
> The line in question reads:
> LOG('UnTextIndex', ERROR,
> 	'Unindex_objects tried to unindex nonexistent'
> 	' document %s' % str(i))
> 
> The function never uses or declares i, however it does use documentId.
> I think perhaps the i should have been documentId but I thought i would
> check with you guys first.
> 
> What do you think?

You're right. In an earlier version in CVS, all the variables called 
"documentId" were called "i". I guess this one just missed the 
search-replace :-)  Of course, documentId makes for much more readable 
code; although "i" is faster to type :)

Change it to documentId and you'll be fine.

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