mercurial/hgweb/common.py
changeset 40158 9310037f0636
parent 37734 a1110db1e455
child 40211 d216ae4cc3f6
--- a/mercurial/hgweb/common.py	Thu Oct 11 22:27:52 2018 +0200
+++ b/mercurial/hgweb/common.py	Thu Oct 11 21:47:39 2018 +0200
@@ -182,7 +182,8 @@
             break
     try:
         os.stat(path)
-        ct = mimetypes.guess_type(pycompat.fsdecode(path))[0] or "text/plain"
+        ct = pycompat.sysbytes(
+            mimetypes.guess_type(pycompat.fsdecode(path))[0] or "text/plain")
         with open(path, 'rb') as fh:
             data = fh.read()