changeset 42208:91104f10ff65

py3: properly reject non-encoded strings given to hgweb
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 19 Apr 2019 14:26:32 +0000
parents 7ed472e79096
children 390ec72b8ea4
files mercurial/hgweb/__init__.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/__init__.py	Fri Apr 19 14:25:18 2019 +0000
+++ b/mercurial/hgweb/__init__.py	Fri Apr 19 14:26:32 2019 +0000
@@ -38,6 +38,9 @@
     - list of virtual:real tuples (multi-repo view)
     '''
 
+    if isinstance(config, pycompat.unicode):
+        raise error.ProgrammingError(
+            'Mercurial only supports encoded strings: %r' % config)
     if ((isinstance(config, bytes) and not os.path.isdir(config)) or
         isinstance(config, dict) or isinstance(config, list)):
         # create a multi-dir interface