From 2b5e72460a9f216a8ea904013b62d0a8df01646c Mon Sep 17 00:00:00 2001 From: faulty Date: Fri, 9 Dec 2022 11:05:13 +0100 Subject: [PATCH] fix: rw savefiles --- utils/manager/savefile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/manager/savefile.py b/utils/manager/savefile.py index 96a36d4..ce4fd76 100644 --- a/utils/manager/savefile.py +++ b/utils/manager/savefile.py @@ -10,13 +10,13 @@ class SaveFile(dict): if not os.path.exists(_dir): os.makedirs(_dir) if os.path.exists(self.path): - with open(self.path) as f: + with open(self.path, 'w+') as f: self.update(json.loads(f.read())) else: self.save() def save(self): - with open(self.path, 'a+') as f: + with open(self.path, 'w+') as f: f.write(json.dumps(self, indent=1)) def __getitem__(self, key):