From 78602c4ef9c0ca07d36779837b0564d003f3d994 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 24 Mar 2023 19:28:56 +0400 Subject: [PATCH] Encoding in `open` --- app/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common.py b/app/common.py index b191964..e4c8af1 100644 --- a/app/common.py +++ b/app/common.py @@ -45,12 +45,12 @@ def secret_key_check(name: SecretKey) -> None: key_file = Path(f'/tmp/{name}') if key_file.exists(): - with key_file.open('rt') as f: + with key_file.open('rt', encoding='utf-8') as f: key = f.read() else: key = secrets.token_hex(32) - with key_file.open('wt') as f: + with key_file.open('wt', encoding='utf-8') as f: f.write(key) settings_dict[name] = key