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 ...@@ -28,6 +28,8 @@ Zope Changes
- FTP: Spaces in usernames inside a FTP file listing are now - FTP: Spaces in usernames inside a FTP file listing are now
replaced by underscores to avoid confusion with some FTP clients. 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 Zope 2.5.1 beta 1
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
""" """
__version__ = '$Revision: 1.25 $'[11:-2] __version__ = '$Revision: 1.26 $'[11:-2]
import re import re
...@@ -282,9 +282,11 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -282,9 +282,11 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
try: try:
source = getattr(obj, self.id) source = getattr(obj, self.id)
if callable(source): if callable(source):
source = str(source()) source = source()
else:
if not isinstance(source, UnicodeType):
source = str(source) source = str(source)
except (AttributeError, TypeError): except (AttributeError, TypeError):
return 0 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