Config: __str__ raise if no str/unicode value
This commit is contained in:
@ -135,9 +135,11 @@ class SubConfig(BaseInformation):
|
||||
for name, grp in self.iter_groups():
|
||||
lines.append("[{0}]".format(name))
|
||||
for name, value in self:
|
||||
value = value.encode(default_encoding)
|
||||
try:
|
||||
lines.append("{0} = {1}".format(name, value))
|
||||
except UnicodeEncodeError:
|
||||
lines.append("{0} = {1}".format(name,
|
||||
value.encode(default_encoding)))
|
||||
except PropertiesOptionError:
|
||||
pass
|
||||
return '\n'.join(lines)
|
||||
|
Reference in New Issue
Block a user