Skip to content

Commit

Permalink
os.replace() instead of os.rename() to save checkpoint (#260)
Browse files Browse the repository at this point in the history
Fixes Windows bug #250
  • Loading branch information
sjfleming authored Aug 28, 2023
1 parent af80d5a commit 0da3ed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cellbender/remove_background/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def make_tarball(files: List[str], tarball_name: str) -> bool:
for file in files:
# without arcname, unpacking results in unpredictable file locations!
tar.add(file, arcname=os.path.basename(file))
os.rename(tarball_name + '.tmp', tarball_name)
os.replace(tarball_name + '.tmp', tarball_name)
return True


Expand Down

0 comments on commit 0da3ed5

Please sign in to comment.