mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Fix bdecoding some torrent files
This commit is contained in:
parent
c94a13ae17
commit
e42910dbf8
@ -65,8 +65,7 @@ def bdecode(x):
|
|||||||
r, l = decode_func[x[0]](x, 0)
|
r, l = decode_func[x[0]](x, 0)
|
||||||
except (IndexError, KeyError, ValueError):
|
except (IndexError, KeyError, ValueError):
|
||||||
raise Exception("not a valid bencoded string")
|
raise Exception("not a valid bencoded string")
|
||||||
if l != len(x):
|
|
||||||
raise Exception("invalid bencoded value (data after valid prefix)")
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
from types import StringType, IntType, LongType, DictType, ListType, TupleType
|
from types import StringType, IntType, LongType, DictType, ListType, TupleType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user