From 38cf34840094f576a4d175abab5920f3cc7ef7e5 Mon Sep 17 00:00:00 2001 From: inpos Date: Mon, 14 Mar 2016 13:03:04 +0300 Subject: [PATCH] absPath --- lib/pyrrent2http/pyrrent2http.py | 1 - lib/pyrrent2http/util.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index 42691d1..d00cca3 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -592,7 +592,6 @@ class Pyrrent2http(object): def buildTorrentParams(self, uri): try: absPath = uri2path(uri) - logging.info('absPath: %s' % (repr(absPath))) logging.info(normalize_msg('Opening local torrent file: %s', (absPath,))) torrent_info = lt.torrent_info(absPath) except Exception as e: diff --git a/lib/pyrrent2http/util.py b/lib/pyrrent2http/util.py index 6265271..f788c1d 100644 --- a/lib/pyrrent2http/util.py +++ b/lib/pyrrent2http/util.py @@ -45,7 +45,7 @@ def normalize_msg(tmpl, args): 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'])) + arg_.append(isinstance(a, unicode) and a or a.decode(chardet.detect(a)['encoding'])) return msg % tuple(arg_)