[PATCH 2 of 2 v2] py3: convert unicode paths given for hgweb config

Ludovic Chabant ludovic at chabant.com
Mon Apr 22 21:57:33 EDT 2019


# HG changeset patch
# User Ludovic Chabant <ludovic at chabant.com>
# Date 1555683992 0
#      Fri Apr 19 14:26:32 2019 +0000
# Branch stable
# Node ID eaf4d232055361fd79e5d5299fc76d641be2fb6c
# Parent  8214209f30a56052124b7f530d2a955a2b93b14f
py3: convert unicode paths given for hgweb config

diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py
--- a/mercurial/hgweb/__init__.py
+++ b/mercurial/hgweb/__init__.py
@@ -13,6 +13,7 @@
 from ..i18n import _
 
 from .. import (
+    encoding,
     error,
     pycompat,
 )
@@ -38,6 +39,8 @@
     - list of virtual:real tuples (multi-repo view)
     '''
 
+    if isinstance(config, pycompat.unicode):
+        config = encoding.unitolocal(config)
     if ((isinstance(config, bytes) and not os.path.isdir(config)) or
         isinstance(config, dict) or isinstance(config, list)):
         # create a multi-dir interface


More information about the Mercurial-devel mailing list