summaryrefslogtreecommitdiffstats
path: root/deluge/core/torrentmanager.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2011-11-20 17:27:10 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2011-11-20 18:00:18 +0000
commit2504b2520a9554d01e85a786c5c102d0f591a68c (patch)
tree2d10a9243915adcd5753103162cf0635788788c6 /deluge/core/torrentmanager.py
parentd8560f5c259c98c4f28f0ec364bcfd76fd81183e (diff)
downloaddeluge-2504b252.tar.gz
deluge-2504b252.tar.bz2
deluge-2504b252.zip
Fix #1964 : Unhandled UnpicklingError with corrupt state file
Diffstat (limited to 'deluge/core/torrentmanager.py')
-rw-r--r--deluge/core/torrentmanager.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index c49e8c901..996f5c441 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -608,7 +608,7 @@ class TorrentManager(component.Component):
os.path.join(get_config_dir(), "state", "torrents.state"), "rb")
state = cPickle.load(state_file)
state_file.close()
- except (EOFError, IOError, Exception), e:
+ except (EOFError, IOError, Exception, cPickle.UnpicklingError), e:
log.warning("Unable to load state file: %s", e)
# Try to use an old state
@@ -683,8 +683,8 @@ class TorrentManager(component.Component):
state_file.flush()
os.fsync(state_file.fileno())
state_file.close()
- except IOError:
- log.warning("Unable to save state file.")
+ except IOError, e:
+ log.warning("Unable to save state file: %s", e)
return True
# We have to move the 'torrents.state.new' file to 'torrents.state'