[Zope-Checkins] CVS: Zope2 - Lexicon.py:1.10 UnTextIndex.py:1.20

Ken Manheimer klm@digicool.com
Sat, 18 Mar 2000 11:14:47 -0500


Update of /cvs-repository/Zope2/lib/python/SearchIndex
In directory korak.digicool.com:/projects/users/klm/TrackerSans/lib/python/SearchIndex

Modified Files:
	Lexicon.py UnTextIndex.py 
Log Message:
Fixes from Anthony Baxter for some serious ZCatalog bugs.  From

Anthony's collector submission:

Title:  current cvs zcatalog lexicon/vocab support is broken

At: http://classic.zope.org:8080/Collector/Collector/1071/sview

Submitter:  Anthony Baxter

Description:  The current CVS version of ZCatalog has a couple of
              nasty bugs in it. 

First off, the standard Lexicon uses a variable 'self.counter',
without ever initialising it. Oops.

Secondly, Catalog handles the default Lexicon inconsistently. In the
case of a lexicon being provided, it stores the name as self.lexicon,
otherwise it stores a Lexicon _object_ as self.lexicon. Later on, it
tries to do a getattr with the lexicon object as the second arg.

The first bug utterly breaks non-globbing Lexicons. The second bug
breaks textindexes that don't provide a lexicon at creation time.

A patch for both follows.  [Rather, this checkin commits both.]  Note
that the patch tries to handle gracefully existing Catalogs and
Lexicons that might be broken.