# HG changeset patch # User Ludovic Chabant # Date 2019-04-19 14:26:32 # Node ID 91104f10ff65b15f515ae39b556038932ce44f01 # Parent 7ed472e7909694fda972064be9f870b7072dfb78 py3: properly reject non-encoded strings given to hgweb diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py --- a/mercurial/hgweb/__init__.py +++ b/mercurial/hgweb/__init__.py @@ -38,6 +38,9 @@ def hgweb(config, name=None, baseui=None - 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