don't crash if field value is special unicode chars
This commit is contained in:
parent
a36aa0d56e
commit
7840a165e4
1 changed files with 2 additions and 0 deletions
|
|
@ -72,6 +72,8 @@ class BackendsConfig(object):
|
|||
raise BackendAlreadyExists(instance_name)
|
||||
config.set(instance_name, '_backend', backend_name)
|
||||
for key, value in params.iteritems():
|
||||
if isinstance(value, unicode):
|
||||
value = value.encode('utf-8')
|
||||
config.set(instance_name, key, value)
|
||||
with open(self.confpath, 'wb') as f:
|
||||
config.write(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue