mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 07:25:04 +02:00
Use utf-8 for credential file
This commit is contained in:
parent
b56475450d
commit
a8f76e9be7
1 changed files with 3 additions and 1 deletions
|
|
@ -20,8 +20,10 @@ class CredentialFileAuthenticator(Authenticator):
|
|||
|
||||
path = config.default_section.working_dir() / section.path()
|
||||
try:
|
||||
with open(path) as f:
|
||||
with open(path, encoding="utf-8") as 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:
|
||||
raise AuthLoadError(f"No credential file at {fmt_real_path(path)}") from e
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue