Hi all, I am getting an error when I query a ZCatalog. I'm working using ZPatterns with Zope 2.3.1b3 (source release, python 1.5.2, linux2), Python Version 1.5.2, System Platform freebsd4. Error Type: ValueError Error Value: __nonzero__ should return >= 0 Here is the scenerio leading to the problem. 1. Create an object in a rack with newItem() Search ZCatalog for the item and it is found. 2. Delete the item Search ZCatalog for the item and the error is produced. Updating or Clearing the catalog resolves the problem. Here is the Skinscript method I use with the Catalog. WHEN OBJECT ADDED CALL ProjectCatalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT DELETED CALL ProjectCatalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT CHANGED CALL ProjectCatalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')), ProjectCatalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/')) Another thing, after I edit the item it is no longer indexed in the catalog. Is this another version of the key error issue? Traceback (innermost last): File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/etc/Zope2d/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/etc/Zope2d/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_In.py, line 652, in renderwob (Object: ProjectCatalog) ValueError: (see above) -thanks, Aaron
Can this be duplicated without ZPatterns? E.g., with the Catalog in its current state can you use its methods to reproduce the same error? ----- Original Message ----- From: "Aaron Payne" <aaron@aaronpayne.com> To: <zope@zope.org> Sent: Thursday, March 29, 2001 12:42 PM Subject: [Zope] (no subject)
Hi all,
I am getting an error when I query a ZCatalog. I'm working using ZPatterns with Zope 2.3.1b3 (source release, python 1.5.2, linux2), Python Version 1.5.2, System Platform freebsd4.
Error Type: ValueError Error Value: __nonzero__ should return >= 0
Here is the scenerio leading to the problem. 1. Create an object in a rack with newItem() Search ZCatalog for the item and it is found. 2. Delete the item Search ZCatalog for the item and the error is produced.
Updating or Clearing the catalog resolves the problem. Here is the Skinscript method I use with the Catalog.
WHEN OBJECT ADDED CALL ProjectCatalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT DELETED CALL ProjectCatalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT CHANGED CALL
ProjectCatalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')),
ProjectCatalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/'))
Another thing, after I edit the item it is no longer indexed in the catalog. Is this another version of the key error issue?
Traceback (innermost last): File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/etc/Zope2d/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/etc/Zope2d/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: catalogItems) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_In.py, line 652, in renderwob (Object: ProjectCatalog) ValueError: (see above)
-thanks, Aaron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 01:30 PM 3/29/01 -0500, Chris McDonough wrote:
Can this be duplicated without ZPatterns? E.g., with the Catalog in its current state can you use its methods to reproduce the same error?
Hi Chris, Yes. Here is what I did. In the ZCatalog 1. On the Find Objects page Find objects of type: Folder (any type of obj will work) 2. On the Catalog page Select object, hit Remove The problem occurs when you select more than half of the items for removal. This is strange. If I select 1 for removal 2 are removed. Select 3, 6 are removed, etc. The error returned is a little different. Error Type: ValueError Error Value: __len__() should return >= 0 Traceback (innermost last): File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/etc/Zope2d/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/etc/Zope2d/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/App/special_dtml.py, line 236, in _exec (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_Var.py, line 311, in render (Object: searchResults) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_Var.py, line 402, in len_format ValueError: (see above) -Aaron
Hi all,
I am getting an error when I query a ZCatalog. I'm working using ZPatterns with Zope 2.3.1b3 (source release, python 1.5.2, linux2), Python Version 1.5.2, System Platform freebsd4.
Ohhhh!! Sorry, yes, this is fixed in the 2.3 branch and will be out with the next release. There was a place where the __len__ of the catalog object could "go negative" that was fixed. See http://lists.zope.org/pipermail/zope-checkins/2001-March/005673.html. The __nonzero__ bit was throwing me off. ----- Original Message ----- From: "Aaron Payne" <aaron@aaronpayne.com> To: "Chris McDonough" <chrism@digicool.com>; <zope@zope.org> Sent: Thursday, March 29, 2001 1:48 PM Subject: Re: [Zope] ZCatalog search problem (was: no subject)
At 01:30 PM 3/29/01 -0500, Chris McDonough wrote:
Can this be duplicated without ZPatterns? E.g., with the Catalog in its current state can you use its methods to reproduce the same error?
Hi Chris,
Yes. Here is what I did. In the ZCatalog 1. On the Find Objects page Find objects of type: Folder (any type of obj will work) 2. On the Catalog page Select object, hit Remove The problem occurs when you select more than half of the items for removal. This is strange. If I select 1 for removal 2 are removed. Select 3, 6 are removed, etc. The error returned is a little different.
Error Type: ValueError Error Value: __len__() should return >= 0
Traceback (innermost last): File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/etc/Zope2d/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/etc/Zope2d/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/App/special_dtml.py, line 236, in _exec (Object: manage_catalogView) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_Var.py, line 311, in render (Object: searchResults) File /usr/local/etc/Zope2d/lib/python/DocumentTemplate/DT_Var.py, line 402, in len_format ValueError: (see above)
-Aaron
Hi all,
I am getting an error when I query a ZCatalog. I'm working using ZPatterns with Zope 2.3.1b3 (source release, python 1.5.2, linux2), Python Version 1.5.2, System Platform freebsd4.
participants (2)
-
Aaron Payne -
Chris McDonough