summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2018-11-17 12:12:55 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2018-11-17 12:12:55 +0000
commit63cc745f5b59089a61546ff27975d0e2a8f7e534 (patch)
treea38173ace7412dcd2ed890298334b5d4e20312b6
parent1a4ac93fbbb865ab6d9fe9fdc50eb58980dc4a01 (diff)
downloaddeluge-63cc745f5b59089a61546ff27975d0e2a8f7e534.tar.gz
deluge-63cc745f5b59089a61546ff27975d0e2a8f7e534.tar.bz2
deluge-63cc745f5b59089a61546ff27975d0e2a8f7e534.zip
[Core|Py3] Fix fastresume data not being loaded
Decode the resume_data dict keys to fix lookups with torrent_id strings not finding resume_data.
-rw-r--r--deluge/core/torrentmanager.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index e54fef66a..eb9e810f6 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -1072,8 +1072,11 @@ class TorrentManager(component.Component):
log.warning('Unable to load %s: %s', _filepath, ex)
resume_data = None
else:
+ # lt.bdecode returns the dict keys as bytes so decode them.
+ resume_data = {k.decode(): v for k, v in resume_data.items()}
log.info('Successfully loaded %s: %s', filename, _filepath)
break
+
# If the libtorrent bdecode doesn't happen properly, it will return None
# so we need to make sure we return a {}
if resume_data is None: