From 1b997b23491bda9038fc6f22e5fce47530e75e31 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 5 Jul 2009 17:42:36 +0000 Subject: [PATCH] The default format version and file version should be 1 --- deluge/config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deluge/config.py b/deluge/config.py index cd4d8ed9d..2355c72a4 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -105,8 +105,8 @@ class Config(object): self.__change_callbacks = [] # These hold the version numbers and they will be set when loaded - self.__format_version = None - self.__file_version = None + self.__format_version = 1 + self.__file_version = 1 # This will get set with a reactor.callLater whenever a config option # is set. @@ -331,6 +331,7 @@ class Config(object): try: self.__config.update(json.loads(fdata)) except Exception, e: + log.exception(e) try: self.__config.update(pickle.loads(fdata)) except Exception, e: @@ -357,8 +358,9 @@ class Config(object): # We will only write a new config file if there is a difference try: data = open(filename, "rb") - data.seek(4) - loaded_data = json.load(data) + data.readline() + data.readline() + loaded_data = json.loads(data.read()) data.close() if self.__config == loaded_data: # The config has not changed so lets just return