archive: Check existance of the directory before rmdir
If the code path using os.renames is used, the directory would be removed. So check the existance of it before calling rmdir.
This commit is contained in:
+2
-1
@@ -319,7 +319,8 @@ class ArchiveTar(ArchiveBase):
|
||||
|
||||
os.renames(old_path, new_path)
|
||||
|
||||
os.rmdir(tarinfo.name)
|
||||
if os.path.exists(tarinfo.name):
|
||||
os.rmdir(tarinfo.name)
|
||||
|
||||
elif not os.path.lexists(tarinfo.linkname):
|
||||
# Symlink target does not exist. Assume the old
|
||||
|
||||
Reference in New Issue
Block a user