Skip to content

Commit

Permalink
Fix failure to save settings on Windows (#114)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rennie-Waldock <[email protected]>
  • Loading branch information
NHellFire committed Apr 21, 2023
1 parent 6e42368 commit a5f8767
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apprise_api/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def put(self, key, content, fmt):

# Write our file to a temporary file
_, tmp_path = tempfile.mkstemp(suffix='.tmp', dir=path)
# Close the file handle provided by mkstemp()
# We're reopening it, and it can't be renamed while open on Windows
os.close(_)

if self.mode == AppriseStoreMode.HASH:
try:
with gzip.open(tmp_path, 'wb') as f:
Expand Down

0 comments on commit a5f8767

Please sign in to comment.