Commit cc2a3070 authored by Andreas Jung's avatar Andreas Jung

      - Collector #227: improved handling of unicode string in TextIndex.py
        with unmodified default encoding in site.py.
parent c4016749
......@@ -28,6 +28,8 @@ Zope Changes
- FTP: Spaces in usernames inside a FTP file listing are now
replaced by underscores to avoid confusion with some FTP clients.
- Collector #227: improved handling of unicode string in TextIndex.py
with unmodified default encoding in site.py.
Zope 2.5.1 beta 1
......
......@@ -15,7 +15,7 @@
"""
__version__ = '$Revision: 1.25 $'[11:-2]
__version__ = '$Revision: 1.26 $'[11:-2]
import re
......@@ -282,9 +282,11 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
try:
source = getattr(obj, self.id)
if callable(source):
source = str(source())
else:
source = source()
if not isinstance(source, UnicodeType):
source = str(source)
except (AttributeError, TypeError):
return 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment