Update path.py

pull/5807/head
AyluinReymaer 3 months ago committed by GitHub
parent 91a989a172
commit de61b3b546
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -335,12 +335,15 @@ class PathFormat():
if self.temppath != self.realpath:
# Move temp file to its actual location
os.makedirs(self.realdirectory, exist_ok=True)
while True:
try:
os.replace(self.temppath, self.realpath)
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