merge #5807: [path] fix moving files across drives on Windows

pull/5824/head
Mike Fährmann 3 months ago
commit 1ca2cf51a2
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -338,12 +338,12 @@ class PathFormat():
while True:
try:
os.replace(self.temppath, self.realpath)
except FileNotFoundError:
# delayed directory creation
os.makedirs(self.realdirectory)
continue
except OSError:
# move across different filesystems
try:
shutil.copyfile(self.temppath, self.realpath)
except FileNotFoundError:
os.makedirs(self.realdirectory)
shutil.copyfile(self.temppath, self.realpath)
os.unlink(self.temppath)
break

Loading…
Cancel
Save