mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-07-20 01:42:37 +02: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:
@@ -128,6 +128,8 @@ class Config:
|
|||||||
raise ConfigLoadError(path, "That's a directory, not a file")
|
raise ConfigLoadError(path, "That's a directory, not a file")
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
raise ConfigLoadError(path, "Insufficient permissions")
|
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:
|
def dump(self, path: Optional[Path] = None) -> None:
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user