From 0c687c7684bd7f11fa0edfb89ce15c1f02b166bc Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 3 Oct 2010 18:33:57 +1100 Subject: [PATCH] Make sure config value strings are utf8 encoded (fixes #1369) --- deluge/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/config.py b/deluge/config.py index c2e760432..ab0476f1a 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -146,7 +146,8 @@ class Config(object): self._save_timer = None 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 if config_dir: @@ -187,6 +188,9 @@ what is currently in the config and it could not convert the value 5 """ + if isinstance(value, basestring): + value = deluge.common.utf8_encoded(value) + if not self.__config.has_key(key): self.__config[key] = value log.debug("Setting '%s' to %s of %s", key, value, type(value))