1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-04 10:39:50 +00:00

use os.replace not os.rename

This commit is contained in:
Thomas Waldmann 2023-01-13 19:17:48 +01:00
parent 804867d3ad
commit 91104674e7
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -139,7 +139,7 @@ class ExclusiveLock:
timer = TimeoutTimer(timeout, sleep).start()
while True:
try:
os.rename(temp_path, self.path)
os.replace(temp_path, self.path)
except OSError: # already locked
if self.by_me():
return self