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 @@ -69,6 +69,7 @@ from dulwich.web import HTTPGitApplicati from paste.auth.basic import AuthBasicAuthenticator from paste.httpheaders import REMOTE_USER, AUTH_TYPE +from rhodecode.lib import safe_str from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware from rhodecode.lib.utils import invalidate_cache, check_repo_fast from rhodecode.model.user import UserModel @@ -147,8 +148,8 @@ class SimpleGit(object): #============================================================== if not REMOTE_USER(environ): - self.authenticate.realm = self.config['rhodecode_realm'].\ - encode('utf8', 'replace') + self.authenticate.realm = \ + safe_str(self.config['rhodecode_realm']) result = self.authenticate(environ) if isinstance(result, str): AUTH_TYPE.update(environ, 'basic')