Submitted by : simon at: 2005-08-13T12:26:12+00:00 (12 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

You can get this sort of error after upgrading zope:

Traceback (most recent call last):
 File "/zope2.8.1/lib/python/ZPublisher/Publish.py", line 113, in publish
   request, bind=1)
 File "/zope2.8.1/lib/python/ZPublisher/mapply.py", line 88, in mapply
   if debug is not None: return debug(object,args,context)
 File "/zope2.8.1/lib/python/ZPublisher/Publish.py", line 40, in call_object
   result=apply(object,args) # Type s<cr> to step into published object.
 File "/repos/ZWiki/UI.py", line 552, in recentchanges
   return form(self,REQUEST,body=dtmlpart(self,REQUEST))
 File "/zope2.8.1/lib/python/App/special_dtml.py", line 62, in __call__
   (self,)+args[1:],kw)
 File "/zope2.8.1/lib/python/DocumentTemplate/DT_String.py", line 476, in __call__
   try: result = render_blocks(self._v_blocks, md)
 File "/zope2.8.1/lib/python/DocumentTemplate/DT_Let.py", line 76, in render
   return render_blocks(self.section, md)
 File "/zope2.8.1/lib/python/DocumentTemplate/DT_In.py", line 645, in renderwob
   sequence=self.sort_sequence(sequence, md)
 File "/zope2.8.1/lib/python/DocumentTemplate/DT_In.py", line 783, in sort_sequence
   s.sort()

TypeError?: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'ImplicitAcquirerWrapper?'

property change --simon, Sat, 13 Aug 2005 12:27:10 -0700 reply

Name: '#1145 TypeError?: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'ImplicitAcquirerWrapper?' with zope 2.8.1' => '#1145 "TypeError?: mybrains.__cmp__(x,y) requires y to be a mybrains, not a ImplicitAcquirerWrapper?" with zope 2.8.1'

confirmation --Tue, 30 Aug 2005 04:45:15 -0700 reply

I got the same problem when sorting strings in a dtml-in loop over an ZSQL result set, but only in some cases. There are functioning sorted dtml-in loops as well. My concrete error says:

<pre>

System Message: SEVERE/4 (<string>, line 46)

Unexpected section title or transition.

....
  • Module DocumentTemplate?.DT_String, line 476, in __call__
  • Module DocumentTemplate?.DT_In, line 643, in renderwob
  • Module DocumentTemplate?.DT_In, line 783, in sort_sequence

TypeError?: r.__cmp__(x,y) requires y to be a 'r', not a 'ImplicitAcquirerWrapper?' </pre>

property change --simon, Thu, 01 Sep 2005 17:52:37 -0700 reply

Category: user-browsing => other

This looks like a Zope 2.8.x bug, see http://www.zope.org/Collectors/Zope/1884

workaround --simon, Mon, 05 Sep 2005 23:42:49 -0700 reply

Workaround: patch your zope by adding this to SOFTWARE_HOME/lib/python/Products/ZCatalog/CatalogBrains?.py AbstractCatalogBrain? class:

def __cmp__(self, other): return 0

need more info --simon, Sun, 26 Feb 2006 11:27:33 -0800 reply

All - please report on how widespread this is. I can reproduce it in one old wiki, but not in others. Also, add your votes/insight to the zope collector issue to get it resolved there. I can't think of a graceful workaround in Zwiki, the ability to sort catalog results is pretty basic.

need more info --simon, Sun, 26 Feb 2006 11:34:05 -0800 reply

I tried replacing TextIndex? with ZCTextIndex? in the wiki catalog just in case, but it didn't seem to matter.

**(property change) ** --simon, Sun, 26 Feb 2006 11:35:32 -0800 reply

Name: '#1145 "TypeError?: mybrains.__cmp__(x,y) requires y to be a mybrains, not a ImplicitAcquirerWrapper?" with zope 2.8.1' => '#1145 recent changes and other views may break in zope >=2.8'

... --simon, Sun, 26 Feb 2006 12:29:29 -0800 reply

I've checked in a workaround that Michael Haubenwallner and I tested (sort with catalog instead of dtml). RC should now be robust despite this zope bug, as long as you have a catalog; without a catalog, RC will no longer sort properly.

... --simon, Thu, 09 Mar 2006 17:55:31 -0800 reply

Of course, DTML pages you have installed can break the same way, unless you change them or patch zope. My pages like http://zopewiki.org/WikiStats are broken. I can't easily do them without dtml sort, and I want to leave my zope unpatched so I'll find this breakage in other places. What to do.

to do --simon, Thu, 08 Jun 2006 08:30:32 -0700 reply

I got the first report of RC not sorting right in a standard wiki. Time to make ZMI add wiki form set up a catalog by default.

update --simon, Sun, 22 Oct 2006 11:06:45 -0700 reply

Name: '#1145 recent changes and other views may break in zope >=2.8' => '#1145 recent changes, WikiStats and other views may break in zope >=2.8' Severity: normal => serious

See also http://www.zope.org/Collectors/Zope/2026 . Not fixed yet.

update --Simon Michael, Sun, 22 Oct 2006 12:42:04 -0700 reply

But I reapplied the patch on this server, so http://zopewiki.org/WikiStats , http://zope3.zwiki.org/WikiStats , WikiStats work again.

can't reproduce this with Zope 2.9.6 any more --betabug, Thu, 22 Feb 2007 12:19:46 +0000 reply

Was it only on upgrading an existing Zwiki? I don't see that def __cmp__(self, other): return 0 line in the Zope 2.9.6 sources, but maybe it was fixed in some other way?

Still in 2.8.8, not in 2.9.6 --betabug, Fri, 06 Apr 2007 09:19:17 +0000 reply

So, what do we do? Close this, saying that 2.8 is old?

Or can we work around it in Zwiki? At least we should put it into KnownIssues.

correction: Zope still has the bug in 2.9 --betabug, Fri, 06 Apr 2007 09:38:59 +0000 reply

The Zope bug is still in 2.9. It seems Zwiki works around this - at least when we have a Catalog.

Is there still an issue with wikis without a Catalog? Some page/function where we can reproduce it?

We're requiring a Catalog now, starting from 0.60 --betabug, Fri, 06 Apr 2007 22:07:11 +0000 reply

Status: open => closed

So we can declare this problem as resolved for Zwiki.

Cf #1041.

search fixed for 0.60 --simon, Mon, 30 Apr 2007 13:56:46 -0700 reply

Name: '#1145 recent changes, WikiStats and other views may break in zope >=2.8' => '#1145 mybrains.__cmp__ error with recent changes, search on zope >=2.8'

This is still unresolved in Zope 2.10.3. SearchPage? was also affected, and could break with certain searches; I have committed a fix for 0.60.

Search results will be ordered by title (as before); this should be made locale-aware, but unfortunately that breaks unless you have configured the locale in zope.conf, so locale-aware sorting requires customizing SearchPage?.