mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 07:33:31 +00:00
Make sure config value strings are utf8 encoded (fixes #1369)
This commit is contained in:
parent
ff7ff8eac7
commit
f1f6f137c3
@ -146,7 +146,8 @@ class Config(object):
|
|||||||
self._save_timer = None
|
self._save_timer = None
|
||||||
|
|
||||||
if defaults:
|
if defaults:
|
||||||
self.__config = dict(defaults)
|
for key, value in defaults.iteritems():
|
||||||
|
self.set_item(key, value)
|
||||||
|
|
||||||
# Load the config from file in the config_dir
|
# Load the config from file in the config_dir
|
||||||
if config_dir:
|
if config_dir:
|
||||||
@ -187,6 +188,9 @@ what is currently in the config and it could not convert the value
|
|||||||
5
|
5
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if isinstance(value, basestring):
|
||||||
|
value = deluge.common.utf8_encoded(value)
|
||||||
|
|
||||||
if not self.__config.has_key(key):
|
if not self.__config.has_key(key):
|
||||||
self.__config[key] = value
|
self.__config[key] = value
|
||||||
log.debug("Setting '%s' to %s of %s", key, value, type(value))
|
log.debug("Setting '%s' to %s of %s", key, value, type(value))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user