From 61f9026e236d02177b67d194b7c789bbde66f593 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 13 Nov 2023 16:31:35 -0800 Subject: [PATCH] Attempt to fix config handling on Windows --- cista/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cista/config.py b/cista/config.py index de5310c..7dac18c 100644 --- a/cista/config.py +++ b/cista/config.py @@ -1,6 +1,7 @@ from __future__ import annotations import secrets +import sys from functools import wraps from hashlib import sha256 from pathlib import Path, PurePath @@ -90,6 +91,8 @@ def config_update(modify): return "read" f.write(new) f.close() + if sys.platform == "win32": + conffile.unlink() # Windows doesn't support atomic replace tmpname.rename(conffile) # Atomic replace except: f.close()