Skip to content

Commit f8eb05f

Browse files
Modify make_directory to verify that the directory is writable if it already exists.
1 parent 790bc3d commit f8eb05f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/gpodder/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ def make_directory(path):
128128
Tries to create a directory if it does not exist already.
129129
Returns True if the directory exists after the function
130130
call, False otherwise.
131+
If the directory already exists it returns True if it is
132+
writable.
131133
"""
132134
if os.path.isdir(path):
133-
return True
135+
return os.access(path, os.W_OK)
134136

135137
try:
136138
os.makedirs(path)

0 commit comments

Comments
 (0)