summaryrefslogtreecommitdiffstats
path: root/module/ConfigParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/ConfigParser.py')
-rw-r--r--module/ConfigParser.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index 55db6b3e3..3304ec258 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -240,9 +240,11 @@ class ConfigParser:
value = data["value"] + "\n"
else:
value = str(data["value"]) + "\n"
-
- f.write('\t%s %s : "%s" = %s' % (data["type"], option, data["desc"], value) )
- #----------------------------------------------------------------------
+ try:
+ f.write('\t%s %s : "%s" = %s' % (data["type"], option, data["desc"], value) )
+ except UnicodeEncodeError:
+ f.write('\t%s %s : "%s" = %s' % (data["type"], option, data["desc"], value.encode("utf8")) )
+
def cast(self, typ, value):
"""cast value to given format"""
if type(value) not in (str, unicode):