Add native Windows compatibility layer
This commit is contained in:
@@ -38,14 +38,14 @@ class APIKeyManager:
|
||||
"""Save encrypted API key to file"""
|
||||
keys = self.load()
|
||||
keys[provider] = self.encrypt_api_key(api_key)
|
||||
with open(self.api_keys_file, 'w') as f:
|
||||
with open(self.api_keys_file, 'w', encoding="utf-8") as f:
|
||||
json.dump(keys, f)
|
||||
|
||||
def load(self) -> Dict[str, str]:
|
||||
"""Load and decrypt API keys"""
|
||||
if not os.path.exists(self.api_keys_file):
|
||||
return {}
|
||||
with open(self.api_keys_file, 'r') as f:
|
||||
with open(self.api_keys_file, 'r', encoding="utf-8") as f:
|
||||
encrypted_keys = json.load(f)
|
||||
return {
|
||||
provider: self.decrypt_api_key(key)
|
||||
|
||||
Reference in New Issue
Block a user