Skip to content
Snippets Groups Projects
Commit 7345efa0 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Recursively reset the permissions of temporary directories prior to deletion...

Recursively reset the permissions of temporary directories prior to deletion to ensure that non-writable permissions such as 0555 are removed and do not cause a traceback. (Closes: #891363)
parent 808954e2
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,13 @@ def clean_all_temp_files():
logger.debug("Cleaning %d temporary directories", len(_DIRS))
for x in _DIRS:
# Recursively reset the permissions of temporary directories prior to
# deletion to ensure that non-writable permissions such as 0555 are
# removed and do not cause a traceback. (#891363)
for dirpath, ys, _ in os.walk(x.name):
for y in ys:
os.chmod(os.path.join(dirpath, y), 0o777)
try:
x.cleanup()
except FileNotFoundError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment