tools (common/files_utils): put extra suffix before file extension

This commit is contained in:
Goffi 2020-04-01 22:29:43 +02:00
commit ef90f2d3f7

View file

@ -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