Fix of issue 2509.

svn: r11337
This commit is contained in:
Peter Landgren
2008-11-22 16:16:07 +00:00
parent eebe0e1b9d
commit 24228468b9

View File

@@ -73,6 +73,13 @@ class BaseObject:
# Run through its own items
patern_upper = pattern.upper()
for item in self.get_text_data_list():
# Many items kave length=0; skip those. However this might be caused by some
# unknown other error.
if len(item) == 0:
continue
# Some items are strings, which will fail in item.upper(), and some items are unicode.
# Convert all items to unicode and the item.upper().find(patern_upper) will work OK.
item = unicode(item)
if not item:
continue
if case_sensitive: