mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
Add native Windows compatibility layer
This commit is contained in:
@@ -11,7 +11,7 @@ PREFS_FILE = os.path.join("data", "user_prefs.json")
|
||||
def _load():
|
||||
"""Load the raw prefs file (internal use only)."""
|
||||
try:
|
||||
with open(PREFS_FILE, "r") as f:
|
||||
with open(PREFS_FILE, "r", encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
return {}
|
||||
@@ -19,7 +19,7 @@ def _load():
|
||||
|
||||
def _save(prefs):
|
||||
os.makedirs(os.path.dirname(PREFS_FILE), exist_ok=True)
|
||||
with open(PREFS_FILE, "w") as f:
|
||||
with open(PREFS_FILE, "w", encoding="utf-8") as f:
|
||||
json.dump(prefs, f, indent=2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user