mirror of
https://github.com/caronc/apprise-api.git
synced 2025-03-06 02:21:46 +01:00
Fix failure to save settings on Windows (#114)
Signed-off-by: Nathan Rennie-Waldock <nathan.renniewaldock@gmail.com>
This commit is contained in:
parent
6e42368082
commit
a5f8767094
@ -131,6 +131,10 @@ class AppriseConfigCache(object):
|
||||
|
||||
# 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:
|
||||
|
Loading…
Reference in New Issue
Block a user