Skip to content

Commit 2ad5958

Browse files
committed
fix: resolve path between dst_path and answers_file to handle dst_path not already existing
1 parent 9640dc9 commit 2ad5958

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

copier/_user_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ def load_answersfile_data(
577577
) -> AnyByStrDict:
578578
"""Load answers data from a `$dst_path/$answers_file` file if it exists."""
579579
try:
580-
with Path(dst_path, answers_file).open("rb") as fd:
580+
answers_path = Path(dst_path, answers_file).resolve()
581+
with answers_path.open("rb") as fd:
581582
return yaml.safe_load(fd)
582583
except (FileNotFoundError, IsADirectoryError):
583584
if warn_on_missing:

0 commit comments

Comments
 (0)