# HG changeset patch # User Augie Fackler # Date 2017-10-14 14:47:29 # Node ID baee5512f2623229dff5419464b1f493cf839aef # Parent 60e7da55e5e6142a20bbb047634aa0b47f8165e5 hgweb: mimetype guessing needs a unicode path Differential Revision: https://phab.mercurial-scm.org/D1086 diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -166,7 +166,7 @@ def staticfile(directory, fname, req): 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()