From 5ffa208962793fcee65f17eadba48c19234bd87d Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 27 Jan 2020 19:53:31 +0100 Subject: [PATCH] tools (common/files_utils): fixed get_unique_name when `path` is a str and not a Path --- 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 64f8b42c..a31771e2 100644 --- a/sat/tools/common/files_utils.py +++ b/sat/tools/common/files_utils.py @@ -27,7 +27,7 @@ def get_unique_name(path): @param path(str, Path): path to the file to create @return (Path): unique path (can be the same as path if there is no conflict) """ - ori_path = Path(path) + ori_path = path = Path(path) idx = 1 while path.exists(): path = ori_path.with_name(ori_path.name + f"_{idx}")