Changeset - 964aa663deca
[Not reviewed]
stable
0 2 0
Mads Kiilerich - 10 years ago 2016-01-05 16:24:27
madski@unity3d.com
repos: fix crashes when repository name is unicode and can't be encoded with the current LANG
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/model/db.py
Show inline comments
 
@@ -1458,7 +1458,7 @@ class Repository(Base, BaseModel):
 
    def __get_instance(self):
 
        repo_full_path = self.repo_full_path
 

	
 
        alias = get_scm(repo_full_path)[0]
 
        alias = get_scm(safe_str(repo_full_path))[0]
 
        log.debug('Creating instance of %s repository from %s',
 
                  alias, repo_full_path)
 
        backend = get_backend(alias)
kallithea/model/repo.py
Show inline comments
 
@@ -742,8 +742,8 @@ class RepoModel(BaseModel):
 
        """
 
        log.info('renaming repo from %s to %s', old, new)
 

	
 
        old_path = os.path.join(self.repos_path, old)
 
        new_path = os.path.join(self.repos_path, new)
 
        old_path = safe_str(os.path.join(self.repos_path, old))
 
        new_path = safe_str(os.path.join(self.repos_path, new))
 
        if os.path.isdir(new_path):
 
            raise Exception(
 
                'Was trying to rename to already existing dir %s' % new_path
 
@@ -758,7 +758,7 @@ class RepoModel(BaseModel):
 

	
 
        :param repo: repo object
 
        """
 
        rm_path = os.path.join(self.repos_path, repo.repo_name)
 
        rm_path = safe_str(os.path.join(self.repos_path, repo.repo_name))
 
        log.info("Removing %s", rm_path)
 

	
 
        _now = datetime.now()
 
@@ -768,4 +768,4 @@ class RepoModel(BaseModel):
 
        if repo.group:
 
            args = repo.group.full_path_splitted + [_d]
 
            _d = os.path.join(*args)
 
        shutil.move(rm_path, os.path.join(self.repos_path, _d))
 
        shutil.move(rm_path, safe_str(os.path.join(self.repos_path, _d)))
0 comments (0 inline, 0 general)