We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ec594d commit 7ca3e5bCopy full SHA for 7ca3e5b
chatblade/storage.py
@@ -53,7 +53,7 @@ def to_cache(messages, session):
53
file_path_tmp = file_path + make_postfix()
54
with open(file_path_tmp, "w") as f:
55
yaml.dump(messages, f)
56
- os.rename(file_path_tmp, file_path)
+ os.replace(file_path_tmp, file_path)
57
58
59
def messages_from_cache(session):
@@ -84,7 +84,7 @@ def migrate_to_session(session):
84
85
# resolve name conflict, but keep old cache file
86
# until all has gone through fine
87
- os.rename(file_path, file_path_tmp)
+ os.replace(file_path, file_path_tmp)
88
to_cache(messages, session)
89
os.unlink(file_path_tmp)
90
0 commit comments