# HG changeset patch # User Marcin Kuzminski # Date 2013-03-29 22:33:02 # Node ID 336184b9f4cf3c43e7737ee349d3bab19401ad3f # Parent 5917256510d7cf4415ae6b84ab6cf2bb7c872c8e fix unicode issues on logging in SCM middlewares diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -206,7 +206,8 @@ class SimpleGit(BaseVCSController): #=================================================================== # GIT REQUEST HANDLING #=================================================================== - repo_path = os.path.join(safe_str(self.basepath), safe_str(repo_name)) + 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) # CHECK LOCKING only if it's not ANONYMOUS USER @@ -231,7 +232,7 @@ class SimpleGit(BaseVCSController): try: self._handle_githooks(repo_name, action, baseui, environ) log.info('%s action on GIT repo "%s" by "%s" from %s' % - (action, repo_name, username, ip_addr)) + (action, str_repo_name, safe_str(username), ip_addr)) app = self.__make_app(repo_name, repo_path, extras) return app(environ, start_response) except HTTPLockedRC, e: diff --git a/rhodecode/lib/middleware/simplehg.py b/rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py +++ b/rhodecode/lib/middleware/simplehg.py @@ -168,7 +168,8 @@ class SimpleHg(BaseVCSController): #====================================================================== # MERCURIAL REQUEST HANDLING #====================================================================== - repo_path = os.path.join(safe_str(self.basepath), safe_str(repo_name)) + 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) # CHECK LOCKING only if it's not ANONYMOUS USER @@ -193,7 +194,7 @@ class SimpleHg(BaseVCSController): try: log.info('%s action on HG repo "%s" by "%s" from %s' % - (action, repo_name, username, ip_addr)) + (action, str_repo_name, safe_str(username), ip_addr)) app = self.__make_app(repo_path, baseui, extras) return app(environ, start_response) except RepoError, e: