Fix write bytes not str

This commit is contained in:
2024-02-29 17:32:43 +01:00
parent 1198bb5320
commit 77f8f8958f

View File

@@ -16,7 +16,7 @@ class GenerateUI:
def get_presets(self): def get_presets(self):
if not os.path.exists("local/presets.json"): if not os.path.exists("local/presets.json"):
with open("local/presets.json", "w") as f: with open("local/presets.json", "wb") as f:
f.write(orjson.dumps({})) f.write(orjson.dumps({}))
with open("local/presets.json", "r") as f: with open("local/presets.json", "r") as f:
return orjson.loads(f.read()) return orjson.loads(f.read())