# HG changeset patch # User Marcin Kuzminski # Date 1351203980 -7200 # Node ID 742d1b8ca263d1329c06d39bb41e22cb60566f9d # Parent c400f2fbf1310bc5b991dbde27ce59236b674700 use str() on os.walk passing unicode can lead to UnicodeDecode errors when iterating diff -r c400f2fbf131 -r 742d1b8ca263 rhodecode/lib/cleanup.py --- a/rhodecode/lib/cleanup.py Fri Oct 26 00:25:21 2012 +0200 +++ b/rhodecode/lib/cleanup.py Fri Oct 26 00:26:20 2012 +0200 @@ -88,7 +88,7 @@ repos_location = RhodeCodeUi.get_repos_location() to_remove = [] - for dn, dirs, f in os.walk(str(repos_location)): + for dn, dirs, f in os.walk(safe_str(repos_location)): for loc in dirs: if REMOVED_REPO_PAT.match(loc): to_remove.append([loc, self._extract_date(loc)]) diff -r c400f2fbf131 -r 742d1b8ca263 rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py Fri Oct 26 00:25:21 2012 +0200 +++ b/rhodecode/lib/hooks.py Fri Oct 26 00:26:20 2012 +0200 @@ -46,7 +46,7 @@ alias += '.' size_scm, size_root = 0, 0 - for path, dirs, files in os.walk(root_path): + for path, dirs, files in os.walk(safe_str(root_path)): if path.find(alias) != -1: for f in files: try: