# HG changeset patch # User Goffi # Date 1585772983 -7200 # Node ID 5ba0b1cdd45b38c84db604a28c3023341ffacf5a # Parent 2a0a16b906ac13f0a8a0df89c52d63f5468bcf25 tools (common/files_utils): put extra suffix before file extension diff -r 2a0a16b906ac -r 5ba0b1cdd45b sat/tools/common/files_utils.py --- a/sat/tools/common/files_utils.py Wed Apr 01 22:28:50 2020 +0200 +++ b/sat/tools/common/files_utils.py Wed Apr 01 22:29:43 2020 +0200 @@ -30,6 +30,6 @@ 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