From: Christos Zoulas Date: Tue, 28 Jun 2016 17:10:22 +0000 (+0000) Subject: PR/562: Reiner Herrmann: Avoid double encoding with python3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc42c23c0575c86b225fd47d2f0a955ea0efc65b;p=file PR/562: Reiner Herrmann: Avoid double encoding with python3 --- diff --git a/python/magic.py b/python/magic.py index c48f7d5a..b0f7a176 100644 --- a/python/magic.py +++ b/python/magic.py @@ -134,7 +134,7 @@ class Magic(object): if isinstance(r, str): return r else: - return str(r).encode('utf-8') + return str(r, 'utf-8') def descriptor(self, fd): """ @@ -152,7 +152,7 @@ class Magic(object): if isinstance(r, str): return r else: - return str(r).encode('utf-8') + return str(r, 'utf-8') def error(self): """ @@ -163,7 +163,7 @@ class Magic(object): if isinstance(e, str): return e else: - return str(e).encode('utf-8') + return str(e, 'utf-8') def setflags(self, flags): """