Hi Chris (and anyone else who can help), Hopefully you may be able to save my sanity. Querying a ZCatalog(2.3.1, running update thing made no difference), I'm getting the following error: type: exceptions.TypeError value: len() of unsized object sr = self.searchResults(kw) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\ZCatalog.py", line 535, in searchResults (REQUEST,used, query_map), kw) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\Catalog.py", line 651, i n searchResults used=self._indexedSearch(kw, sort_index, r.append, used) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\Catalog.py", line 558, i n _indexedSearch append((k,LazyMap(self.__getitem__, intset))) File "E:\Zope\2.3.1\lib\python\Products\ZCatalog\Lazy.py", line 205, in __init __ self._len = len(seq) I inserted a print `seq` before that line, and the situations where it barfs, seq is either 461695167 or 0, rather than the list it should be. Has anyone else seen this? Anyone got a cleu what's going on or how I can find out what's going on? cheers, Chris
What's the query? ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: <zope-dev@zope.org> Sent: Thursday, April 12, 2001 12:13 PM Subject: [Zope-dev] ZCatalog waaaagh!
Hi Chris (and anyone else who can help),
Hopefully you may be able to save my sanity. Querying a ZCatalog(2.3.1, running update thing made no difference), I'm getting the following error:
type: exceptions.TypeError value: len() of unsized object
Ugh. I know why this is. Ugh. Ugh Ugh. Give me an hour. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: <zope-dev@zope.org> Sent: Thursday, April 12, 2001 12:13 PM Subject: [Zope-dev] ZCatalog waaaagh!
Hi Chris (and anyone else who can help),
Hopefully you may be able to save my sanity. Querying a ZCatalog(2.3.1, running update thing made no difference), I'm getting the following error:
type: exceptions.TypeError value: len() of unsized object
sr = self.searchResults(kw) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\ZCatalog.py", line 535, in searchResults (REQUEST,used, query_map), kw) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\Catalog.py", line 651, i n searchResults used=self._indexedSearch(kw, sort_index, r.append, used) File "E:\Zope\2379A4~1.1\lib\python\Products\ZCatalog\Catalog.py", line 558, i n _indexedSearch append((k,LazyMap(self.__getitem__, intset))) File "E:\Zope\2.3.1\lib\python\Products\ZCatalog\Lazy.py", line 205, in __init __ self._len = len(seq)
I inserted a print `seq` before that line, and the situations where it barfs, seq is either 461695167 or 0, rather than the list it should be.
Has anyone else seen this? Anyone got a cleu what's going on or how I can find out what's going on?
cheers,
Chris
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
I know why this is, but I'm not going to fix it tonight... sigh. I need to go cry on Jim's shoulder for a bit before I check a proper fix in. In the meantime, if you're desperate, here's a temporary fix... replace the items method of the UnTextIndex class in UnTextIndex.py. The current method looks something like this: def items(self): reurn self._index.items() change it to: def items(self): items = [] for k, v in self._index.items(): if type(v) is type(1): v = IITreeSet((v,)) items.append((k,v)) return tuple(items) this is a very, very temporary fix... but it should fix the problem for now. - C
Yeah, except I put another search-related bug in there just especially for you. ;-) See the PTK list for a patch... Chris Withers wrote:
Chris McDonough wrote:
I know why this is, but I'm not going to fix it tonight... sigh.
I need to go cry on Jim's shoulder for a bit before I check a proper fix in.
I'm guessing the fix for this is in 2.3.2b1?
cheers,
Chris
Chris McDonough wrote:
In the meantime, if you're desperate, here's a temporary fix...
replace the items method of the UnTextIndex class in UnTextIndex.py. The current method looks something like this:
def items(self): reurn self._index.items()
change it to:
def items(self): items = [] for k, v in self._index.items(): if type(v) is type(1): v = IITreeSet((v,)) items.append((k,v)) return tuple(items)
Urm... UnTextIndex.py doesn't appear to have an items method in 2.3.1 or 2.3.1b1. I tried changing the one in UnIndex.py, but it didn't make any difference. I'm still getting the error at the end when searching. I'm having loads of problems right now (Zope hanging, not crashing, not racing, just hanging) and testsuites that used to run now suddenly not running on _some_ (ugh!) of the machines they used to so I'm not in a position to move to 2.3.2bx (maybe 2.3.2 final ;-) where I know this is fixed. *sigh* Any help would be very much appreciated ;-) cheers, Chris
d'oh! Error type: <strong>TypeError</strong><br> Error value: <strong>unsubscriptable object</strong> Traceback (innermost last): File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Zope\2379A4~1.1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 171, in publish File E:\Zope\2379A4~1.1\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: reset) File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: reset) File E:\Zope\2379A4~1.1\lib\python\OFS\DTMLMethod.py, line 189, in __call__ (Object: reset) File E:\Zope\2379A4~1.1\lib\python\DocumentTemplate\DT_String.py, line 538, in __call__ (Object: reset) File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 259, in debug_render_blocks File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 239, in debugException File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 256, in debug_render_blocks File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 136, in reset_cases (Object: Traversable) File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 187, in create_case (Object: Traversable) File E:\Zope\current\Products\GenericCases\Case.py, line 451, in update File E:\Zope\current\Products\GenericCases\Case.py, line 323, in set_field File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 306, in get_cases (Object: Traversable) File E:\Zope\current\Products\GenericCases\scripting.py, line 389, in search (Object: Traversable) File E:\Zope\2.3.1\lib\python\Products\ZCatalog\Lazy.py, line 224, in __getitem__ TypeError: (see above)
Can you give me something that reproduces this? ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com>; <zope-dev@zope.org> Sent: Monday, April 23, 2001 8:32 AM Subject: Re: [Zope-dev] ZCatalog waaaagh!: The Error
d'oh!
Error type: <strong>TypeError</strong><br> Error value: <strong>unsubscriptable object</strong>
Traceback (innermost last): File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Zope\2379A4~1.1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 171, in publish File E:\Zope\2379A4~1.1\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: reset) File E:\Zope\2379A4~1.1\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: reset) File E:\Zope\2379A4~1.1\lib\python\OFS\DTMLMethod.py, line 189, in __call__ (Object: reset) File E:\Zope\2379A4~1.1\lib\python\DocumentTemplate\DT_String.py, line 538, in __call__ (Object: reset) File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 259, in debug_render_blocks File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 239, in debugException File E:\Zope\current\Products\ZDebug\DTMLDebug.py, line 256, in debug_render_blocks File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 136, in reset_cases (Object: Traversable) File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 187, in create_case (Object: Traversable) File E:\Zope\current\Products\GenericCases\Case.py, line 451, in update File E:\Zope\current\Products\GenericCases\Case.py, line 323, in set_field File E:\Zope\current\Products\GenericCases\CasesFolder.py, line 306, in get_cases (Object: Traversable) File E:\Zope\current\Products\GenericCases\scripting.py, line 389, in search (Object: Traversable) File E:\Zope\2.3.1\lib\python\Products\ZCatalog\Lazy.py, line 224, in __getitem__ TypeError: (see above)
Chris McDonough wrote:
Can you give me something that reproduces this?
I already gave you more than I should have ;-) 2.3.2b2 solves this so I think moving to that might be easier than fixing this. All the tests seem to have miraculously started passing today (wtf?!!) so I'm more confused but not as worried... cheers, Chris
Sorry, I meant UnIndex.py! Doh! There is a more comprehensive fix checked in to 2.3.2b2.
In the meantime, if you're desperate, here's a temporary fix...
replace the items method of the UnTextIndex class in UnTextIndex.py.
The
current method looks something like this:
def items(self): reurn self._index.items()
change it to:
def items(self): items = [] for k, v in self._index.items(): if type(v) is type(1): v = IITreeSet((v,)) items.append((k,v)) return tuple(items)
Urm... UnTextIndex.py doesn't appear to have an items method in 2.3.1 or 2.3.1b1.
I tried changing the one in UnIndex.py, but it didn't make any difference. I'm still getting the error at the end when searching.
I'm having loads of problems right now (Zope hanging, not crashing, not racing, just hanging) and testsuites that used to run now suddenly not running on _some_ (ugh!) of the machines they used to so I'm not in a position to move to 2.3.2bx (maybe 2.3.2 final ;-) where I know this is fixed.
Ugh. You can try to replace the UnIndex.py from your copy with the 2.3.2b2 CVS copy if that helps any. You can probably also replace ZCatalog/Catalog.py.
*sigh*
Any help would be very much appreciated ;-)
cheers,
Chris
participants (2)
-
Chris McDonough -
Chris Withers