From 78024eafe0d2daf3debd80a888b9ba463de85067 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 23 Nov 2010 15:31:23 +0000 Subject: [PATCH] little precaution --- lib/core/common.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/core/common.py b/lib/core/common.py index 05b53119f..24bb4f37a 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1343,6 +1343,11 @@ def getFileItems(filename, commentPrefix='#', unicode_=True): if line.find(commentPrefix) != -1: line = line[:line.find(commentPrefix)] line = line.strip() + if not unicode_: + try: + str.encode(line) + except UnicodeDecodeError: + continue if line: retVal.append(line)