caches: updated cache sanitizer to remove any non-ascii chars

This commit is contained in:
RhodeCode Admin 2022-10-27 15:32:21 +02:00
parent cff104fdd7
commit d04fb901d3

View file

@ -214,7 +214,8 @@ class RemoteRepo(object):
self.cert_dir = get_cert_path(rhodecode.CONFIG.get('__file__'))
def _repo_id_sanitizer(self, repo_id):
return repo_id.replace('/', '__').replace('-', '_')
pathless = repo_id.replace('/', '__').replace('-', '_')
return ''.join(char if ord(char) < 128 else '_{}_'.format(ord(char)) for char in pathless)
def __getattr__(self, name):