[Zope-dev] ZCatalog bug, probably BTrees, what Zope version is this fixed in?
Hi, I have a ZCatalog search that returns 213 results. As soon as I add a sort_on and sort_order to the request doing this search, the number of results drops to about 60. This reminds me of some bugs in the BTrees package that I remember being solved in the not too distant past. Can someone please confirm to me what version of Zope I need to use to get these fixes? If it's not in a release yet, _please_ can it make it for 2.4.2. cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZCatalog bug
I'm updating a site that is currently using Python 1.5.2 and Zope 2.3.something to use Python 2.1 and Zope 2.4.from_cvs. I've had a problem: most products won't initialize. They fail on an AttributeError in SearchIndex/UnTextIndex.py related to setting up the help system. This ugly patch fixes it. There must be a better way! *** /lib/python/SearchIndex/UnTextIndex.py.original --- /lib/python/SearchIndex/UnTextIndex.py.new *** *** 327,333 return 0 lexicon = self.getLexicon(self._lexicon) ! splitter=lexicon.Splitter wordScores = OIBTree() last = None --- 327,337 return 0 lexicon = self.getLexicon(self._lexicon) ! ! try: ! splitter=lexicon.Splitter ! except AttributeError: ! splitter=lexicon.lexicon.Splitter wordScores = OIBTree() last = None *** *** 343,349 # Convert scores to use wids: widScores=IIBucket() ! getWid=lexicon.getWordId for word, score in wordScores.items(): widScores[getWid(word)]=score --- 347,356 # Convert scores to use wids: widScores=IIBucket() ! try: ! getWid=lexicon.getWordId ! except AttributeError: ! getWid=lexicon.lexicon.getWordId for word, score in wordScores.items(): widScores[getWid(word)]=score -- Steve Alexander Software Engineer Cat-Box limited ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZCatalog bug?
I have just installed Zope 2.3.1 and the latest CMF. When trying to publish some CMF resource after submitting a form to edit the site config, I get a TypeError: expected integer key. The stack traceback is included below. A more experienced user has said that this looks like it could be because of a bug in ZCatalog. I'd like to stress that this is literally the first thing I'm doing with Zope, so there's not much to do to reproduce the setup. :-) Does anyone have any guesses about why this is happening? Thanks. Traceback (innermost last): File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: reconfig) File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 218, in __call__ (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Return.py, line 106, in render (Object: reconfig_form(_.None, _, portal_status_message='Settings changed')) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval (Object: reconfig_form(_.None, _, portal_status_message='Settings changed')) (Info: _) File string, line 0, in ? File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 213, in __call__ (Object: reconfig_form) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: reconfig_form) File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 213, in __call__ (Object: standard_html_header) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: standard_html_header) File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 213, in __call__ (Object: actions_box) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: actions_box) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 146, in render (Object: isAnon="portal_membership.isAnonymousUser()" AuthClass="isAnon and 'GuestActions' or 'MemberActions'" uname="isAnon and 'Guest' or portal_membership.getAuthenticatedMember().getUserName()" obj="this()" actions="portal_actions.listFilteredActionsFor(obj)" user_actions="actions['user']" folder_actions="actions['folder']" object_actions="actions['object'] + actions['workflow']" global_actions="actions['global']") File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval (Object: portal_actions.listFilteredActionsFor(obj)) (Info: portal_actions) File string, line 0, in ? File /var/lib/zope/Products/CMFCore/ActionsTool.py, line 162, in listFilteredActionsFor (Object: portal_actions) File /var/lib/zope/Products/CMFCore/WorkflowTool.py, line 222, in listActions (Object: portal_workflow) File /var/lib/zope/Products/CMFCore/DefaultWorkflow.py, line 209, in listGlobalActions File /var/lib/zope/Products/CMFCore/CatalogTool.py, line 200, in searchResults (Object: Traversable) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/Products/ZCatalog/ZCatalog.py, line 535, in searchResults (Object: Traversable) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/Products/ZCatalog/Catalog.py, line 651, in searchResults File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/Products/ZCatalog/Catalog.py, line 542, in _indexedSearch File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 513, in _apply_index File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 576, in query File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 640, in evaluate File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 591, in get_operands File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 448, in __getitem__ TypeError: (see above) -- Adam Chlipala [EMAIL PROTECTED] http://home.devlocus.org/~psion/ ICQ UIN: 489166 AIM: PsionV If God does not exist, then anything is permitted. ... I am the Word that speaks Itself I am
[Zope-dev] ZCatalog bug?
Adam Chlipala [EMAIL PROTECTED] wrote: I have just installed Zope 2.3.1 and the latest CMF. When trying to publish some CMF resource after submitting a form to edit the site config, I get a TypeError: expected integer key. The stack traceback is included below. A more experienced user has said that this looks like it could be because of a bug in ZCatalog. I'd like to stress that this is literally the first thing I'm doing with Zope, so there's not much to do to reproduce the setup. :-) Does anyone have any guesses about why this is happening? Thanks. Traceback (innermost last): File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: reconfig) File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 218, in __call__ (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: reconfig) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Return.py, line 106, in render (Object: reconfig_form(_.None, _, portal_status_message='Settings changed')) File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval (Object: reconfig_form(_.None, _, portal_status_message='Settings changed')) (Info: _) File string, line 0, in ? File /var/lib/zope/Products/CMFCore/FSDTMLMethod.py, line 213, in __call__ (Object: reconfig_form) snip File /usr/local/stow/zope-2.3.1/lib/zope/lib/python/SearchIndex/UnTextIndex.py, line 448, in __getitem__ TypeError: (see above) Yes this is a catalog bug, which is fixed in CVS. You can, in this case, safely ignore it, and continue using the portal (your configuration changes may not have been saved, however). Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZCatalog bug in 2.3.1b2
I posted this before but didn't get a reply. Has any one seen this bug, Or do they know a fix? ATM this is stopping me using 2.3.1b2 which is a bad thing(tm) --- Zope Errorr Zope has encountered an error while publishing this resource. Error Type: TypeError Error Value: len() of unsized object With this traceback: Traceback (innermost last): File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Let.py, line 146, in render (Object: Results="Catalog(REQUEST=REQUEST)") File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval (Object: Catalog(REQUEST=REQUEST)) (Info: REQUEST) File string, line 0, in ? File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/ZCatalog.py, line 530, in searchResults (Object: Traversable) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.py, line 654, in searchResults File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.py, line 591, in _indexedSearch TypeError: (see above) Here is the line which calls the search: sr = self.searchResults({'Type' : type, 'sort_on':'lowercase_title_'}) fyi. type = 'TypeTest' The indexes are as follows: Status = Text Index Type = Field Index Identifier = Field Index lowercase_title_ = Field Index parent_identifiers_ = Keyword Index The meta types are like this: Title id identifier There are only 13 records in the catalog. And there are some results to be returned. Cheers -Andy ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZCatalog bug in 2.3.1b2
I cannot reproduce this, Andy, although I'm sure something is up. If it continues to fail under b3, can you possibly send me a Data.fs that exhibits the problem? Sorry, - C - Original Message - From: "Andy Dawkins" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 20, 2001 11:02 AM Subject: [Zope-dev] ZCatalog bug in 2.3.1b2 I posted this before but didn't get a reply. Has any one seen this bug, Or do they know a fix? ATM this is stopping me using 2.3.1b2 which is a bad thing(tm) --- Zope Errorr Zope has encountered an error while publishing this resource. Error Type: TypeError Error Value: len() of unsized object With this traceback: Traceback (innermost last): File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_String .py, line 538, in __call__ (Object: executeSearch) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Let.py , line 146, in render (Object: Results="Catalog(REQUEST=REQUEST)") File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Util.p y, line 334, in eval (Object: Catalog(REQUEST=REQUEST)) (Info: REQUEST) File string, line 0, in ? File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/ZCatalog .py, line 530, in searchResults (Object: Traversable) File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog. py, line 654, in searchResults File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog. py, line 591, in _indexedSearch TypeError: (see above) Here is the line which calls the search: sr = self.searchResults({'Type' : type, 'sort_on':'lowercase_title_'}) fyi. type = 'TypeTest' The indexes are as follows: Status = Text Index Type = Field Index Identifier = Field Index lowercase_title_ = Field Index parent_identifiers_ = Keyword Index The meta types are like this: Title id identifier There are only 13 records in the catalog. And there are some results to be returned. Cheers -Andy ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZCatalog Bug?
The bug collector doesn't appear to be working, so I apologize if this issue has already been raised. ZCatalog is failing for me when I attempt to reindex the catalog after adding a keyword index. Zope complains of a name error for Except on line 118 of UnKeywordIndex.py. Here's the code in question: # First we need to see if there's anything interesting to look at # self.id is the name of the index, which is also the name of the # attribute we're interested in. If the attribute is callable, # we'll do so. try: newKeywords = getattr(obj, self.id) if callable(newKeywords): newKeywords = newKeywords() except Except: # Line 118 newKeywords = MV Could the author have meant to write 'Exception' here instead of 'Except'? I am running Zope 2.3.0 stable. -- Ed Goppelt ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZCatalog Bug?
On Fri, 16 Mar 2001 08:48:09 -0500, Edmund Goppelt [EMAIL PROTECTED] wrote: Could the author have meant to write 'Exception' here instead of 'Except'? I am running Zope 2.3.0 stable. The current cvs has this changed to 'except AttributeError' Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZCatalog Bug Fix II
Chris Withers wrote: Okay, tracked down what's happening, can't understand why :-( Now I can... convoluted but with a simple answer ;-) As to why the object is on the top of the namespace, I dunno whether it's dtml-in or ZCatalog that's responsible... The reason for this, was because the object was being acquired. The naming similarity was pure chance. I had an index called TestCase in the catalog, the same name as the DTML method for the form. I _didn't_ have a column called TestCase in the ZCatalog MetaData, so when the result-displaying DTML method tried to dtml-var it, it was acquired, and hence the method was plopped on top of the namespace. The actual problem is that ZCatalog was using the indexes instead of the metadata when telling Z Search was results form to build. The following patch solves that, I'm sure I put it in the collector when I moved Squishdot to use ZCatalog too :-S cheers, Chris --- zcatalog.py.old2 Sun Jan 28 20:56:06 2001 +++ zcatalog.py Sun Jan 28 21:00:09 2001 @@ -486,7 +486,7 @@ def _searchable_result_columns(self): r = [] -for name in self._catalog.indexes.keys(): +for name in self._catalog.schema.keys(): i = {} i['name'] = name i['type'] = 's' PS: I won't bother with the collector on this one, since both relevent people are already being CC'ed ;-) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )