# HG changeset patch # User Jeff Hammel # Date 1606236812 28800 # Node ID 49e931b5c8e24741558e3beb65661a739564434d # Parent 0dc878f8a15f19d3ea5c393cc116e1484a7dc796 encode to bytes for mercurial diff -r 0dc878f8a15f -r 49e931b5c8e2 hgpaste/factory.py --- a/hgpaste/factory.py Tue Nov 24 08:19:30 2020 -0800 +++ b/hgpaste/factory.py Tue Nov 24 08:53:32 2020 -0800 @@ -3,6 +3,10 @@ def wsgi_app(config_file): """wsgi application""" + + if isinstance(config_file, str): + # Encode to bytes for mercurial API + config_file = config_file.encode() from mercurial import demandimport; demandimport.enable() from mercurial.hgweb.hgwebdir_mod import hgwebdir application = hgwebdir(config_file)