mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Use utf-8 for credential file
This commit is contained in:
parent
b56475450d
commit
a8f76e9be7
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user