[also reported to collector, but this breaks textindex Catalogs totally, so I thought it was also worth cc'ing to the list] The current CVS version of ZCatalog has a couple of nasty bugs in it. First off, the standard nonglobbing Lexicon uses a variable 'self.counter', without ever initialising it. Oops. Secondly, Catalog handles the default Lexicon case 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. Note that the patch tries to handle gracefully existing Catalogs and Lexicons that might be broken. The complete fix would also handle the case of the Lexicon being created in a saner way - maybe always store the name... ? If the email system munges this patch, it's also at http://www.zope.org/Members/anthony/patches/zcatalog-lexicon.diff Thanks, Anthony Index: Lexicon.py =================================================================== RCS file: /cvs-repository/Zope2/lib/python/SearchIndex/Lexicon.py,v retrieving revision 1.8 diff -u -r1.8 Lexicon.py --- Lexicon.py 2000/02/01 18:40:20 1.8 +++ Lexicon.py 2000/02/19 08:55:16 @@ -115,6 +115,7 @@ def __init__(self): self._lexicon = OIBTree() + self.counter = 0 def set(self, word): """ return the word id of 'word' """ @@ -123,6 +124,8 @@ return self._lexicon[word] else: + if not hasattr(self, 'counter'): + self.counter = 0 self._lexicon[intern(word)] = self.counter self.counter = self.counter + 1 return self.counter Index: UnTextIndex.py =================================================================== RCS file: /cvs-repository/Zope2/lib/python/SearchIndex/UnTextIndex.py,v retrieving revision 1.19 diff -u -r1.19 UnTextIndex.py --- UnTextIndex.py 2000/01/31 19:25:35 1.19 +++ UnTextIndex.py 2000/02/19 08:55:16 @@ -172,7 +172,10 @@ Zope. I don't think indexes were ever intended to participate in this way, but I don't see too much of a problem with it. """ - vocab = getattr(self, vocab_id) + if type(vocab_id) is not type(""): + vocab = vocab_id + else: + vocab = getattr(self, vocab_id) return vocab.lexicon -- Anthony Baxter <anthony@interlink.com.au> It's never too late to have a happy childhood.