Commit ea1b80c1 by rfkelly0

SubFS: make removedir() more robust to concurrent deletion of files

parent 0dcfe8bb
...@@ -881,9 +881,15 @@ class SubFS(FS): ...@@ -881,9 +881,15 @@ class SubFS(FS):
if path in ("","/"): if path in ("","/"):
if force: if force:
for path2 in self.listdir(path,absolute=True,files_only=True): for path2 in self.listdir(path,absolute=True,files_only=True):
try:
self.remove(path2) self.remove(path2)
except ResourceNotFoundError:
pass
for path2 in self.listdir(path,absolute=True,dirs_only=True): for path2 in self.listdir(path,absolute=True,dirs_only=True):
try:
self.removedir(path2,force=True) self.removedir(path2,force=True)
except ResourceNotFoundError:
pass
else: else:
self.parent.removedir(self._delegate(path),force=force) self.parent.removedir(self._delegate(path),force=force)
if recursive: if recursive:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment