From 7a645486ab1620e54709aa08db90c5e80bea8a44 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 14 Jan 2009 01:15:00 +0000 Subject: [PATCH] Fix bdecoding some torrent files --- ChangeLog | 4 ++++ deluge/bencode.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c17102d51..462e0b4e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Deluge 1.1.1 - (In Development) + Misc: + * Fix bdecoding some torrent files + Deluge 1.1.0 - "Time gas!" (10 January 2009) Core: * Fix issue in get_tracker_host when the torrent has no tracker diff --git a/deluge/bencode.py b/deluge/bencode.py index b9cc3dcdc..e61f2bf0c 100644 --- a/deluge/bencode.py +++ b/deluge/bencode.py @@ -65,8 +65,7 @@ def bdecode(x): r, l = decode_func[x[0]](x, 0) except (IndexError, KeyError, ValueError): raise Exception("not a valid bencoded string") - if l != len(x): - raise Exception("invalid bencoded value (data after valid prefix)") + return r from types import StringType, IntType, LongType, DictType, ListType, TupleType