diff kallithea/lib/middleware/simplehg.py @ 8196:e51ad2cd400e

py3: drop the last uses of safe_str - they are no longer relevant when we don't have a separate unicode type
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Dec 2019 13:16:14 +0100
parents e35373106528
children
line wrap: on
line diff
--- a/kallithea/lib/middleware/simplehg.py	Thu Dec 26 15:16:29 2019 +0100
+++ b/kallithea/lib/middleware/simplehg.py	Thu Dec 26 13:16:14 2019 +0100
@@ -36,7 +36,7 @@
 
 from kallithea.lib.base import BaseVCSController, get_path_info
 from kallithea.lib.utils import make_ui
-from kallithea.lib.utils2 import safe_bytes, safe_str
+from kallithea.lib.utils2 import safe_bytes
 
 
 log = logging.getLogger(__name__)
@@ -137,13 +137,13 @@
         """
         Make an hgweb wsgi application.
         """
-        str_repo_name = safe_str(parsed_request.repo_name)
-        repo_path = os.path.join(safe_str(self.basepath), str_repo_name)
+        repo_name = parsed_request.repo_name
+        repo_path = os.path.join(self.basepath, repo_name)
         baseui = make_ui(repo_path=repo_path)
-        hgweb_app = mercurial.hgweb.hgweb(safe_bytes(repo_path), name=str_repo_name, baseui=baseui)
+        hgweb_app = mercurial.hgweb.hgweb(safe_bytes(repo_path), name=safe_bytes(repo_name), baseui=baseui)
 
         def wrapper_app(environ, start_response):
-            environ['REPO_NAME'] = str_repo_name # used by mercurial.hgweb.hgweb
+            environ['REPO_NAME'] = repo_name # used by mercurial.hgweb.hgweb
             return hgweb_app(environ, start_response)
 
         return wrapper_app