diff --git a/util.py b/util.py index 20c3e61..4007d2b 100644 --- a/util.py +++ b/util.py @@ -9,7 +9,7 @@ import zipfile def get_recursive_filelist_sorted(path): filelist = [] for root, dirs, files in os.walk(path): - relroot = root.replace(path, '') + relroot = root.replace(path, '', 1) if relroot != '' and relroot in var.config.get('bot', 'ignored_folders'): continue if len(relroot): @@ -66,7 +66,7 @@ class Dir(object): def add_file(self, file): if file.startswith(self.name + '/'): - file = file.replace(self.name + '/', '') + file = file.replace(self.name + '/', '', 1) if '/' in file: # This file is in a subdir