From 699badf505849955c4be9a6dd1ed48bd5427a927 Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:22:54 +0000 Subject: [PATCH] Use utf-8 encoding for the open method #4 --- ldap_jwt_auth/core/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldap_jwt_auth/core/constants.py b/ldap_jwt_auth/core/constants.py index 93ccd98..29aff2d 100644 --- a/ldap_jwt_auth/core/constants.py +++ b/ldap_jwt_auth/core/constants.py @@ -8,13 +8,13 @@ # Read the contents of the private and public key files into constants. These are used for encoding and decoding of JWT # access and refresh tokens. try: - with open(config.authentication.private_key_path, "r") as f: + with open(config.authentication.private_key_path, "r", encoding="utf-8") as f: PRIVATE_KEY = f.read() except FileNotFoundError as exc: sys.exit(f"Cannot find private key: {exc}") try: - with open(config.authentication.public_key_path, "r") as f: + with open(config.authentication.public_key_path, "r", encoding="utf-8") as f: PUBLIC_KEY = f.read() except FileNotFoundError as exc: sys.exit(f"Cannot find public key: {exc}")