utils: remove: catch EPERM when chmoding a file

Fix https://github.com/iterative/dvc/pull/2298#issuecomment-520184196
This commit is contained in:
Ruslan Kuprieiev
2019-08-11 03:00:08 +03:00
committed by GitHub
parent b2f452ef04
commit 71ab380d03
+2 -2
View File
@@ -193,8 +193,8 @@ def _chmod(func, p, excinfo):
try:
os.chmod(p, perm)
except OSError as exc:
# broken symlink
if exc.errno != errno.ENOENT:
# broken symlink or file is not owned by us
if exc.errno not in [errno.ENOENT, errno.EPERM]:
raise
func(p)