mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-04 10:39:50 +00:00
repository: use os.replace instead of os.rename
On Windows, os.rename raises an exception if the destination file already exists, unlike os.replace which replaces the destination file. Docs: https://docs.python.org/3/library/os.html#os.rename https://docs.python.org/3/library/os.html#os.replace
This commit is contained in:
parent
97261dbb22
commit
6a97e936ac
1 changed files with 1 additions and 1 deletions
|
@ -613,7 +613,7 @@ class Repository:
|
|||
os.fsync(fd.fileno())
|
||||
|
||||
def rename_tmp(file):
|
||||
os.rename(file + '.tmp', file)
|
||||
os.replace(file + ".tmp", file)
|
||||
|
||||
hints = {
|
||||
b'version': 2,
|
||||
|
|
Loading…
Add table
Reference in a new issue