From 251303c380f5d5949c40ff537b4ce2721e152f57 Mon Sep 17 00:00:00 2001 From: inpos Date: Sat, 12 Mar 2016 02:35:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=B9=20=D1=88=D1=82=D1=80=D0=B8=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pyrrent2http/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pyrrent2http/util.py b/lib/pyrrent2http/util.py index 22d4f1f..7c96c92 100644 --- a/lib/pyrrent2http/util.py +++ b/lib/pyrrent2http/util.py @@ -42,7 +42,7 @@ def detect_media_type(name): else: return MediaType.UNKNOWN def normalize_msg(tmpl, *args): - msg = tmpl.decode(chardet.detect(tmpl)['encoding']) + msg = isinstance(tmpl, unicode) and tmpl or tmpl.decode(chardet.detect(tmpl)['encoding']) arg_ = [] for a in args: if not isinstance(a, unicode): arg_.append(a.decode(chardet.detect(a)['encoding']))