D1086: hgweb: mimetype guessing needs a unicode path

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Oct 15 09:27:20 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbaee5512f262: hgweb: mimetype guessing needs a unicode path (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1086?vs=2766&id=2776

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, yuja
Cc: mercurial-devel


More information about the Mercurial-devel mailing list