diff kallithea/lib/middleware/simplegit.py @ 5618:82ed7ad0dc48

Merge stable
author Mads Kiilerich <madski@unity3d.com>
date Tue, 05 Jan 2016 16:30:05 +0100
parents edb24bc0f71a 890189aa2bfe
children 52356a58c1f6
line wrap: on
line diff
--- a/kallithea/lib/middleware/simplegit.py	Fri Dec 25 13:50:37 2015 +0100
+++ b/kallithea/lib/middleware/simplegit.py	Tue Jan 05 16:30:05 2016 +0100
@@ -38,7 +38,7 @@
     HTTPNotAcceptable
 from kallithea.model.db import User, Ui
 
-from kallithea.lib.utils2 import safe_str, fix_PATH, get_server_url, \
+from kallithea.lib.utils2 import safe_str, safe_unicode, fix_PATH, get_server_url, \
     _set_extras
 from kallithea.lib.base import BaseVCSController, WSGIResultCloseCallback
 from kallithea.lib.utils import make_ui, is_valid_repo
@@ -79,9 +79,11 @@
         # EXTRACT REPOSITORY NAME FROM ENV
         #======================================================================
         try:
-            repo_name = self.__get_repository(environ)
+            str_repo_name = self.__get_repository(environ)
+            repo_name = safe_unicode(str_repo_name)
             log.debug('Extracted repo name is %s', repo_name)
-        except Exception:
+        except Exception as e:
+            log.error('error extracting repo_name: %r', e)
             return HTTPInternalServerError()(environ, start_response)
 
         # quick check if that dir exists...
@@ -176,7 +178,6 @@
         #===================================================================
         # GIT REQUEST HANDLING
         #===================================================================
-        str_repo_name = safe_str(repo_name)
         repo_path = os.path.join(safe_str(self.basepath),str_repo_name)
         log.debug('Repository path is %s', repo_path)