diff --git a/vcsserver/lib/rc_cache/backends.py b/vcsserver/lib/rc_cache/backends.py --- a/vcsserver/lib/rc_cache/backends.py +++ b/vcsserver/lib/rc_cache/backends.py @@ -32,7 +32,7 @@ from dogpile.cache.util import memoized_ from pyramid.settings import asbool from vcsserver.lib.memory_lru_dict import LRUDict, LRUDictDebug -from vcsserver.utils import safe_str +from vcsserver.utils import safe_str, safe_unicode _default_max_size = 1024 @@ -133,7 +133,7 @@ class FileNamespaceBackend(PickleSeriali try: super(FileNamespaceBackend, self).__init__(arguments) except Exception: - log.error('Failed to initialize db at: %s', db_file) + log.exception('Failed to initialize db at: %s', db_file) raise def __repr__(self): @@ -265,7 +265,7 @@ class BaseRedisBackend(redis_backend.Red def get_mutex(self, key): if self.distributed_lock: - lock_key = redis_backend.u('_lock_{0}').format(safe_str(key)) + lock_key = redis_backend.u(u'_lock_{0}'.format(safe_unicode(key))) return get_mutex_lock(self.client, lock_key, self._lock_timeout, auto_renewal=self._lock_auto_renewal) else: