]> granicus.if.org Git - file/commitdiff
PR/562: Reiner Herrmann: Avoid double encoding with python3
authorChristos Zoulas <christos@zoulas.com>
Tue, 28 Jun 2016 17:10:22 +0000 (17:10 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 28 Jun 2016 17:10:22 +0000 (17:10 +0000)
python/magic.py

index c48f7d5a3012e1c0a0ac982f9b62a72b7ae62320..b0f7a1765e8f71d33b7892171ad3612055c8c244 100644 (file)
@@ -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):
         """