From 32c78544f908e51723915348a226d351c636c0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Wed, 30 May 2018 19:14:32 +0200 Subject: [PATCH] utils.py: Fix not adding files correctly in some edge cases --- util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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