diff --git a/kallithea/lib/hooks.py b/kallithea/lib/hooks.py --- a/kallithea/lib/hooks.py +++ b/kallithea/lib/hooks.py @@ -35,7 +35,7 @@ from kallithea.lib import helpers as h from kallithea.lib.utils import action_logger from kallithea.lib.vcs.backends.base import EmptyChangeset from kallithea.lib.exceptions import HTTPLockedRC, UserCreationError -from kallithea.lib.utils2 import safe_str, _extract_extras +from kallithea.lib.utils2 import safe_str, safe_unicode, _extract_extras from kallithea.model.db import Repository, User @@ -390,6 +390,7 @@ def handle_git_receive(repo_path, revs, from kallithea.lib.utils import make_ui extras = _extract_extras(env) + repo_path = safe_unicode(repo_path) path, ini_name = os.path.split(extras['config']) conf = appconfig('config:%s' % ini_name, relative_to=path) load_environment(conf.global_conf, conf.local_conf, test_env=False, diff --git a/kallithea/lib/middleware/pygrack.py b/kallithea/lib/middleware/pygrack.py --- a/kallithea/lib/middleware/pygrack.py +++ b/kallithea/lib/middleware/pygrack.py @@ -34,6 +34,7 @@ from webob import Request, Response, exc import kallithea from kallithea.lib.vcs import subprocessio +from kallithea.lib.utils2 import safe_unicode log = logging.getLogger(__name__) @@ -86,6 +87,7 @@ class GitRepository(object): :param path: """ + path = safe_unicode(path) assert path.startswith('/' + self.repo_name + '/') return path[len(self.repo_name) + 2:].strip('/') diff --git a/kallithea/lib/middleware/simplegit.py b/kallithea/lib/middleware/simplegit.py --- a/kallithea/lib/middleware/simplegit.py +++ b/kallithea/lib/middleware/simplegit.py @@ -227,7 +227,7 @@ class SimpleGit(BaseVCSController): from kallithea.lib.middleware.pygrack import make_wsgi_app app = make_wsgi_app( repo_root=safe_str(self.basepath), - repo_name=repo_name, + repo_name=safe_unicode(repo_name), extras=extras, ) return app diff --git a/kallithea/lib/vcs/backends/git/repository.py b/kallithea/lib/vcs/backends/git/repository.py --- a/kallithea/lib/vcs/backends/git/repository.py +++ b/kallithea/lib/vcs/backends/git/repository.py @@ -58,7 +58,7 @@ class GitRepository(BaseRepository): def __init__(self, repo_path, create=False, src_url=None, update_after_clone=False, bare=False): - self.path = abspath(repo_path) + self.path = safe_unicode(abspath(repo_path)) repo = self._get_repo(create, src_url, update_after_clone, bare) self.bare = repo.bare