changeset 34721:baee5512f262

hgweb: mimetype guessing needs a unicode path Differential Revision: https://phab.mercurial-scm.org/D1086
author Augie Fackler <augie@google.com>
date Sat, 14 Oct 2017 10:47:29 -0400
parents 60e7da55e5e6
children 95be8928d6b2
files mercurial/hgweb/common.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Sat Oct 14 15:37:33 2017 -0400
+++ b/mercurial/hgweb/common.py	Sat Oct 14 10:47:29 2017 -0400
@@ -166,7 +166,7 @@
             break
     try:
         os.stat(path)
-        ct = mimetypes.guess_type(path)[0] or "text/plain"
+        ct = mimetypes.guess_type(pycompat.fsdecode(path))[0] or "text/plain"
         with open(path, 'rb') as fh:
             data = fh.read()