From 0f5c8de27bb0dcf909f1f64a870630362f282686 Mon Sep 17 00:00:00 2001 From: inpos Date: Mon, 21 Mar 2016 07:48:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D0=B0=D0=BD=D0=B4=D1=80=D0=BE?= =?UTF-8?q?=D0=B8=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon.xml | 2 +- lib/pyrrent2http/util.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addon.xml b/addon.xml index 5b91e2b..2ad983b 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/lib/pyrrent2http/util.py b/lib/pyrrent2http/util.py index e4e318d..e548b16 100644 --- a/lib/pyrrent2http/util.py +++ b/lib/pyrrent2http/util.py @@ -49,14 +49,14 @@ def unicode_msg(tmpl, args): return msg % tuple(arg_) def encode_msg(msg): - msg = isinstance(msg, unicode) and msg.encode(True and sys.getfilesystemencoding() or 'utf-8') or msg + msg = isinstance(msg, unicode) and msg.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') or msg return msg def localize_path(path): if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding']) if not sys.platform.startswith('win'): - path = path.encode(True and sys.getfilesystemencoding() or 'utf-8') + path = path.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') return path def can_bind(host, port):