From a42506dff9f224bbb87f2fe051f9de1c2fcfb880 Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Sat, 3 Dec 2016 18:14:28 +0100 Subject: [PATCH] Fix for new fnames in case of already existing ones --- slack_backup/download.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slack_backup/download.py b/slack_backup/download.py index dc9ec96..0c2b678 100644 --- a/slack_backup/download.py +++ b/slack_backup/download.py @@ -79,8 +79,10 @@ class Download(object): count = 1 while filetype != 'avatar' and os.path.exists(path): - base, ext = os.path.splitext(path) - path = base + "%0.3d" % count + ext + if count == 1: + base, ext = os.path.splitext(path) + path = base + ".%0.3d" % count + ext + count += 1 return path