Skip to content

Commit d28bd13

Browse files
committed
fix: consider absolute path
1 parent f634595 commit d28bd13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fgpyo/io/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def assert_path_is_writable(path: Path, parent_must_exist: bool = True) -> None:
148148
# Else if file doesn't exist and parent_must_exist is False, test parent until
149149
# you find the first extant path, and check that it is a directory and is writable.
150150
else:
151-
for parent in path.parents:
151+
for parent in path.absolute().parents:
152152
if parent.exists():
153153
assert os.access(parent, os.W_OK), f"Parent directory is not writable: {parent}"
154154
break

0 commit comments

Comments
 (0)