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