Skip to content

Commit

Permalink
Use utf-8 encoding for the open method #4
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Dec 20, 2023
1 parent 8a5b092 commit 699badf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ldap_jwt_auth/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit 699badf

Please sign in to comment.