Mercurial > libervia-backend
changeset 3246:5ba0b1cdd45b
tools (common/files_utils): put extra suffix before file extension
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 01 Apr 2020 22:29:43 +0200 (2020-04-01) |
parents | 2a0a16b906ac |
children | f981c0e99220 |
files | sat/tools/common/files_utils.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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