mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-07-12 06:02:31 +02:00
Use utf-8 for credential file
This commit is contained in:
@ -20,8 +20,10 @@ class CredentialFileAuthenticator(Authenticator):
|
|||||||
|
|
||||||
path = config.default_section.working_dir() / section.path()
|
path = config.default_section.working_dir() / section.path()
|
||||||
try:
|
try:
|
||||||
with open(path) as f:
|
with open(path, encoding="utf-8") as f:
|
||||||
lines = list(f)
|
lines = list(f)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
raise AuthLoadError(f"Credential file at {fmt_real_path(path)} is not encoded using UTF-8")
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise AuthLoadError(f"No credential file at {fmt_real_path(path)}") from e
|
raise AuthLoadError(f"No credential file at {fmt_real_path(path)}") from e
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user