diff -r a8be613391d1 -r 9310037f0636 mercurial/hgweb/common.py --- 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()