# HG changeset patch # User Goffi # Date 1580151211 -3600 # Node ID d6da17f6e4ce010ca11e0f305656ec82ef7f1f35 # Parent b9486a7f9b4f093eba82dfcf9da18c368d09e67d tools (common/files_utils): fixed get_unique_name when `path` is a str and not a Path diff -r b9486a7f9b4f -r d6da17f6e4ce sat/tools/common/files_utils.py --- a/sat/tools/common/files_utils.py Mon Jan 27 19:53:31 2020 +0100 +++ b/sat/tools/common/files_utils.py Mon Jan 27 19:53:31 2020 +0100 @@ -27,7 +27,7 @@ @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}")