summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-06-20 00:05:34 -0700
committerZac Medico <zmedico@gentoo.org>2013-06-20 00:05:34 -0700
commit2a6b69cf6ac36c262e253ce701dd9db5a24d0f25 (patch)
treea22a2139a89274479ea1f7213ce85ede4fd4cc41
parentemirrordist: wget --no-check-certificate (diff)
downloadportage-2a6b69cf6ac36c262e253ce701dd9db5a24d0f25.tar.gz
portage-2a6b69cf6ac36c262e253ce701dd9db5a24d0f25.tar.bz2
portage-2a6b69cf6ac36c262e253ce701dd9db5a24d0f25.zip
chpathtool: fix mime_type TypeError, bug #473892v2.2.0_alpha183
-rwxr-xr-xbin/chpathtool.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 85e608ea9..a040babfb 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# Copyright 2011-2012 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import io
@@ -41,6 +41,8 @@ class IsTextFile(object):
def _is_text_magic(self, filename):
mime_type = self._m.file(filename)
+ if isinstance(mime_type, bytes):
+ mime_type = mime_type.decode('ascii', 'replace')
return mime_type.startswith("text/")
def _is_text_encoding(self, filename):