From 8c2189f1613b27e0e082bc8e0001e1fe5405be2c Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 27 Sep 2012 18:00:47 +0100 Subject: [PATCH] Fix exception handling in rencode --- deluge/rencode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/rencode.py b/deluge/rencode.py index 2b32c001b..e58c71542 100644 --- a/deluge/rencode.py +++ b/deluge/rencode.py @@ -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