Skip to content

Commit e318ce3

Browse files
committed
Force change permissions before deleting directory, fixes #1493
Signed-off-by: SitiSchu <[email protected]>
1 parent 2933636 commit e318ce3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/rez/utils/filesystem.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,11 @@ def _on_error(func, path, exc_info):
221221
path = windows_long_path(path)
222222

223223
parent_path = os.path.dirname(path)
224-
if not os.access(parent_path, os.W_OK):
225-
st = os.stat(parent_path)
226-
os.chmod(parent_path, st.st_mode | stat.S_IWUSR)
224+
st = os.stat(parent_path)
225+
os.chmod(parent_path, st.st_mode | stat.S_IWUSR)
227226

228-
if not os.access(path, os.W_OK):
229-
st = os.stat(path)
230-
os.chmod(path, st.st_mode | stat.S_IWUSR)
227+
st = os.stat(path)
228+
os.chmod(path, st.st_mode | stat.S_IWUSR)
231229

232230
except:
233231
# avoid confusion by ensuring original exception is reraised

0 commit comments

Comments
 (0)