Skip to content

Commit 5de963e

Browse files
committed
Use generic implementation on ERROR_ACCESS_DENIED.
1 parent d595047 commit 5de963e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/pathlib/_local.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,11 @@ def move(self, target):
861861
if not isinstance(target, PathBase):
862862
raise
863863
except OSError as err:
864-
if err.errno != errno.EXDEV:
864+
if err.errno == errno.EXDEV:
865+
pass # target is on another filesystem.
866+
elif os.name == 'nt' and err.winerror == 5: # ERROR_ACCESS_DENIED
867+
pass # target may have the wrong type.
868+
else:
865869
raise
866870
return PathBase.move(self, target)
867871

0 commit comments

Comments
 (0)