changeset 8:49e931b5c8e2 default tip

encode to bytes for mercurial
author Jeff Hammel <k0scist@gmail.com>
date Tue, 24 Nov 2020 08:53:32 -0800
parents 0dc878f8a15f
children
files hgpaste/factory.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)