From 24228468b9d10d84f7a9c440bf40e9716b70f375 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Sat, 22 Nov 2008 16:16:07 +0000 Subject: [PATCH] Fix of issue 2509. svn: r11337 --- src/gen/lib/baseobj.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gen/lib/baseobj.py b/src/gen/lib/baseobj.py index 4f7931008..b9daa9762 100644 --- a/src/gen/lib/baseobj.py +++ b/src/gen/lib/baseobj.py @@ -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: