projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ce6cfd
)
chpathtool: fix mime_type TypeError, bug #473892
v2.2.0_alpha183
author
Zac Medico
<zmedico@gentoo.org>
Thu, 20 Jun 2013 07:05:34 +0000
(
00:05
-0700)
committer
Zac Medico
<zmedico@gentoo.org>
Thu, 20 Jun 2013 07:05:34 +0000
(
00:05
-0700)
bin/chpathtool.py
patch
|
blob
|
history
diff --git
a/bin/chpathtool.py
b/bin/chpathtool.py
index 85e608ea99afffcc5b6b6f83e88ef6d3f975236c..a040babfb03a6944e25ef9687e5e0a10bdc7f43b 100755
(executable)
--- a/
bin/chpathtool.py
+++ b/
bin/chpathtool.py
@@
-1,5
+1,5
@@
#!/usr/bin/python
-# Copyright 2011-201
2
Gentoo Foundation
+# Copyright 2011-201
3
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):