diff --git a/python/fileformat.py b/python/fileformat.py index df588a4..fd1b71a 100644 --- a/python/fileformat.py +++ b/python/fileformat.py @@ -54,6 +54,9 @@ def read_action(lines): def write_field_value_str(val): lines = '' + if not val: + val = '' + val = unicode(val) value_lines = val.split('\n') for l in value_lines: lines += ' ' + l + '\n' @@ -63,13 +66,13 @@ def write_field_value_dict(val): lines = '\n' for (key,values) in val.items(): for single_value in values: - lines += ' ' + key + ' ' + single_value + '\n' + lines += ' ' + key + ' ' + unicode(single_value) + '\n' return lines def write_field_value_list(val): lines = '' for single_value in val: - lines += ' ' + single_value + lines += ' ' + unicode(single_value) return lines def write_action(d):