mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
YAML: Force all files to open with utf8
The default encoding method when opening files on Windows is cp1252 which doesn't support all unicode and can cause issues. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
4
auth.py
4
auth.py
@@ -31,7 +31,7 @@ auth_keys: Optional[AuthKeys] = None
|
||||
def load_auth_keys():
|
||||
global auth_keys
|
||||
try:
|
||||
with open("api_tokens.yml", "r") as auth_file:
|
||||
with open("api_tokens.yml", "r", encoding = 'utf8') as auth_file:
|
||||
auth_keys_dict = yaml.safe_load(auth_file)
|
||||
auth_keys = AuthKeys(
|
||||
api_key = auth_keys_dict["api_key"],
|
||||
@@ -44,7 +44,7 @@ def load_auth_keys():
|
||||
)
|
||||
auth_keys = new_auth_keys
|
||||
|
||||
with open("api_tokens.yml", "w") as auth_file:
|
||||
with open("api_tokens.yml", "w", encoding = "utf8") as auth_file:
|
||||
yaml.safe_dump(vars(auth_keys), auth_file, default_flow_style=False)
|
||||
|
||||
print(
|
||||
|
||||
Reference in New Issue
Block a user