[Zope] Searching Catalog for Unicode Values of FieldIndex

Mohsen Moeeni listless at gmail.com
Wed Aug 18 11:24:15 EDT 2004


Thanks Dieter for your attention.

I could get the desired result by adding this as the term prenormalizer::

python: not isinstance(value, unicode) and unicode(value, 'utf-8') or value

Dieter, I still get an exception while trying to see the Indexed objects in 
the catalog (manage_objectInformation). The problem is that 
``getEntryForObject`` tries to return ``str`` of a value. But ``str`` of Unicode
objects out of ASCII range, raises and excpetion. Full traceback below.

Cheers,
Mohsen,

------
2004-08-18T19:21:37 ERROR(200) SiteError
http://mysite/plone/at_catalog/manage_objectInformation
Traceback (most recent call last):
File "/usr/local/zope270/lib/python/ZPublisher/Publish.py", line 100, in publish
 request, bind=1)
File "/usr/local/zope270/lib/python/ZPublisher/mapply.py", line 88, in mapply
 if debug is not None: return debug(object,args,context)
File "/usr/local/zope270/lib/python/ZPublisher/Publish.py", line 40,
in call_object
 result=apply(object,args) # Type s<cr> to step into published object.
File "/usr/local/zope270/lib/python/Shared/DC/Scripts/Bindings.py",
line 306, in __call__
 return self._bindAndExec(args, kw, None)
File "/usr/local/zope270/lib/python/Shared/DC/Scripts/Bindings.py",
line 343, in _bindAndExec
 return self._exec(bound_data, args, kw)
File "/usr/local/zope270/lib/python/App/special_dtml.py", line 175, in _exec
 try: result = render_blocks(self._v_blocks, ns)
File "/usr/local/zope270/lib/python/DocumentTemplate/DT_In.py", line
626, in renderwob
 sequence=expr(md)
File "/usr/local/zope270/lib/python/DocumentTemplate/DT_Util.py", line
201, in eval
 return eval(code, d)
File "<string>", line 0, in ?
File "/usr/local/zope270/lib/python/Products/ZCatalog/ZCatalog.py",
line 585, in getIndexDataForRID
 return self._catalog.getIndexDataForRID(rid)
File "/usr/local/zope270/lib/python/Products/ZCatalog/Catalog.py",
line 457, in getIndexDataForRID
 result[name] = self.getIndex(name).getEntryForObject(rid, "")
File "/usr/local/zope270/lib/python/Products/ManagableIndex/ManagableIndex.py",
line 191, in getEntryForObject
 return str(info)
UnicodeEncodeError: 'ascii' codec can't encode characters in position
0-2: ordinal not in range(128)


More information about the Zope mailing list