summaryrefslogtreecommitdiffstats
path: root/contrib/file/python
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2016-12-11 07:37:20 +0000
committerdelphij <delphij@FreeBSD.org>2016-12-11 07:37:20 +0000
commit884efc61f7391700d81bb717ea62d897524b2184 (patch)
tree4a428617338dba61584b97a48fed633f5f610466 /contrib/file/python
parent90c02dc90566ee82971be44f1fe9fcf2016abc22 (diff)
downloadFreeBSD-src-884efc61f7391700d81bb717ea62d897524b2184.zip
FreeBSD-src-884efc61f7391700d81bb717ea62d897524b2184.tar.gz
MFC r308420: MFV r308392: file 5.29.
Diffstat (limited to 'contrib/file/python')
-rw-r--r--contrib/file/python/magic.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/file/python/magic.py b/contrib/file/python/magic.py
index c48f7d5..b0f7a17 100644
--- a/contrib/file/python/magic.py
+++ b/contrib/file/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):
"""
OpenPOWER on IntegriCloud