[Zope-dev] TypeError on FieldIndex

Morten W. Petersen morten@thingamy.net
Fri, 15 Jun 2001 17:49:27 +0200 (CEST)


Hia guys,
 
running the GUM product on a fresh BerkeleyDB based 2.4.0a1 instance on
Linux raises the following issue for the field index type:
 
Site Error
 
An error was encountered while publishing this resource.
 
Error Type: ('type', 0, <type 'string'>, <type 'int'>)
Error Value: None
 
 
Troubleshooting Suggestions

	The URL may be incorrect.
	The parameters passed to this resource may be incorrect.
	A resource that this resource relies on may be encountering
	an error.
 
For more detailed information about the error, please refer to the HTML
source for this page.
 
If the error persists please contact the site maintainer. Thank you for
your patience.
Traceback (innermost last):
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Zope/__init__.py, line
226, in zpublisher_exception_hook
    (Object: CatalogAware)
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
    (Object: index_html)
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
    (Object: index_html)
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/App/special_dtml.py,
line 127, in __call__
    (Object: index_html)
  File
/home/morten/tmp/Zope-2.4.0a1-src/lib/python/DocumentTemplate/DT_String.py,
line 543, in __call__
    (Object: index_html)
  File
/home/morten/tmp/Zope-2.4.0a1-src/lib/python/DocumentTemplate/DT_In.py,
line 681, in renderwob
    (Object: get_incoming_message_containers)
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/GUM/gum.py,
line 591, in get_incoming_message_containers
    (Object: CatalogAware)
  File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/GUM/gum.py,
line 858, in get_gum_message_containers
    (Object: CatalogAware)
  File
/home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/ZCatalog.py,
line 582, in searchResults
    (Object: LockableItem)
  File
/home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/Catalog.py,
line 663, in searchResults
  File
/home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/Catalog.py,
line 550, in _indexedSearch
('type', 0, <type 'string'>, <type 'int'>): (see above)
 
I added an extra try except block:
 
                if request.has_key(index.id) :
                    try:
                       if len(request[index.id])>0:
                            r=index._apply_index(request)
                    except:
                       raise str((index.id, request[index.id],
                                type(index.id), type(request[index.id])))
 
The original exception was a TypeError, len() of unsized object.

Cheers,

Morten