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: