mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
Use binary mode on all config files for Windows compat
This commit is contained in:
parent
ad322aabd1
commit
ec72ac57d7
1 changed files with 3 additions and 3 deletions
|
@ -237,7 +237,7 @@ class Config(object):
|
|||
if not filename:
|
||||
filename = self.__config_file
|
||||
try:
|
||||
self.__config.update(pickle.load(open(filename, "r")))
|
||||
self.__config.update(pickle.load(open(filename, "rb")))
|
||||
except Exception, e:
|
||||
log.warning("Unable to load config file: %s", filename)
|
||||
|
||||
|
@ -255,7 +255,7 @@ class Config(object):
|
|||
# Check to see if the current config differs from the one on disk
|
||||
# We will only write a new config file if there is a difference
|
||||
try:
|
||||
if self.__config == pickle.load(open(filename, "r")):
|
||||
if self.__config == pickle.load(open(filename, "rb")):
|
||||
# The config has not changed so lets just return
|
||||
self.__save_timer = None
|
||||
return
|
||||
|
@ -267,7 +267,7 @@ class Config(object):
|
|||
# Save the new config and make sure it's written to disk
|
||||
try:
|
||||
log.debug("Saving new config file %s", filename + ".new")
|
||||
f = open(filename + ".new", "w")
|
||||
f = open(filename + ".new", "wb")
|
||||
pickle.dump(self.__config, f)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
|
|
Loading…
Add table
Reference in a new issue