D1086: hgweb: mimetype guessing needs a unicode path
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Sun Oct 15 04:57:50 UTC 2017
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1086
AFFECTED FILES
mercurial/hgweb/common.py
CHANGE DETAILS
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 @@
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()
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list