From 015132ce0ea46041a8f0c48c4f52d722f97b730f Mon Sep 17 00:00:00 2001 From: Stephen Fleming Date: Mon, 21 Aug 2023 23:11:07 -0400 Subject: [PATCH] os.replace() instead of os.rename() to save checkpoint Fixes Windows bug #250 --- cellbender/remove_background/checkpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellbender/remove_background/checkpoint.py b/cellbender/remove_background/checkpoint.py index 5b0903d..206737b 100644 --- a/cellbender/remove_background/checkpoint.py +++ b/cellbender/remove_background/checkpoint.py @@ -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