mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Try to detect unsupported config file encoding
The encoding detection is quite rudimentary, but should detect the default windows encoding in many cases.
This commit is contained in:
parent
a99ddaa0cc
commit
a709280cbf
@ -128,6 +128,8 @@ class Config:
|
||||
raise ConfigLoadError(path, "That's a directory, not a file")
|
||||
except PermissionError:
|
||||
raise ConfigLoadError(path, "Insufficient permissions")
|
||||
except UnicodeDecodeError:
|
||||
raise ConfigLoadError(path, "File is not encoded using UTF-8")
|
||||
|
||||
def dump(self, path: Optional[Path] = None) -> None:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user