mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 04:54:23 +00:00
[#2875][Web] Fix: WebUI Json dumps Error
* A torrent file contains an uncommon field 'filehash' which must be hex encoded to allow dumping the torrent info to json. Otherwise it will fail with: UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 0: invalid continuation byte
This commit is contained in:
parent
f739269dfd
commit
5394ac5604
@ -113,6 +113,8 @@ class TorrentInfo(object):
|
|||||||
f["sha1"] = f["sha1"].encode('hex')
|
f["sha1"] = f["sha1"].encode('hex')
|
||||||
if "ed2k" in f and len(f["ed2k"]) == 16:
|
if "ed2k" in f and len(f["ed2k"]) == 16:
|
||||||
f["ed2k"] = f["ed2k"].encode('hex')
|
f["ed2k"] = f["ed2k"].encode('hex')
|
||||||
|
if "filehash" in f and len(f["filehash"]) == 20:
|
||||||
|
f["filehash"] = f["filehash"].encode('hex')
|
||||||
paths[path] = f
|
paths[path] = f
|
||||||
dirname = os.path.dirname(path)
|
dirname = os.path.dirname(path)
|
||||||
while dirname:
|
while dirname:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user