mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 03:24:54 +00:00
Fix exception handling in rencode
This commit is contained in:
parent
37ea2854a2
commit
8c2189f161
1 changed files with 2 additions and 2 deletions
|
@ -164,7 +164,7 @@ def decode_string(x, f):
|
|||
t = s.decode("utf8")
|
||||
if len(t) != len(s):
|
||||
s = t
|
||||
except UnicodeEncodeError:
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
return (s, colon+n)
|
||||
|
||||
|
@ -223,7 +223,7 @@ def make_fixed_length_string_decoders():
|
|||
t = s.decode("utf8")
|
||||
if len(t) != len(s):
|
||||
s = t
|
||||
except UnicodeEncodeError:
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
return (s, f+1+slen)
|
||||
return f
|
||||
|
|
Loading…
Add table
Reference in a new issue