Commit dfebaac9 by rfkelly0

remove ill-advised retry loop in OSFS.removedir.

Some ways of opening a file can cause it to infinite-loop on Windows.
parent 9599a2a7
...@@ -129,13 +129,7 @@ class OSFS(FS): ...@@ -129,13 +129,7 @@ class OSFS(FS):
# Don't remove the root directory of this FS # Don't remove the root directory of this FS
if path in ("","/"): if path in ("","/"):
return return
try:
os.rmdir(sys_path) os.rmdir(sys_path)
except OSError, e:
if e.errno != errno.ENOTEMPTY or not force:
raise
# Someone has created files in here in the meantime, try again.
self.removedir(path,recursive=False,force=True)
# Using os.removedirs() for this can result in dirs being # Using os.removedirs() for this can result in dirs being
# removed outside the root of this FS, so we recurse manually. # removed outside the root of this FS, so we recurse manually.
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