From ef90f2d3f72159981163bf840aa80ef591f81a61 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 1 Apr 2020 22:29:43 +0200 Subject: [PATCH] tools (common/files_utils): put extra suffix before file extension --- sat/tools/common/files_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sat/tools/common/files_utils.py b/sat/tools/common/files_utils.py index d7c9c067..61096415 100644 --- a/sat/tools/common/files_utils.py +++ b/sat/tools/common/files_utils.py @@ -30,6 +30,6 @@ def get_unique_name(path): ori_path = path = Path(path) idx = 1 while path.exists(): - path = ori_path.with_name(ori_path.name + f"_{idx}") + path = ori_path.with_name(f"{ori_path.stem}_{idx}{ori_path.suffix}") idx += 1 return path