mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-06-25 03:16:30 +00:00
Fix UnicodeDecodeError with read json file (#613)
* Update json.py * Update data.py
This commit is contained in:
parent
2c17fe5da8
commit
ae7466ccfe
@ -80,7 +80,7 @@ class AddonsData(JsonConfig, CoreSysAttributes):
|
||||
read_json_file(repository_file)
|
||||
)
|
||||
|
||||
except (OSError, json.JSONDecodeError):
|
||||
except (OSError, json.JSONDecodeError, UnicodeDecodeError):
|
||||
_LOGGER.warning("Can't read repository information from %s",
|
||||
repository_file)
|
||||
return
|
||||
|
@ -45,7 +45,7 @@ class JsonConfig:
|
||||
if self._file.is_file():
|
||||
try:
|
||||
self._data = read_json_file(self._file)
|
||||
except (OSError, json.JSONDecodeError):
|
||||
except (OSError, json.JSONDecodeError, UnicodeDecodeError):
|
||||
_LOGGER.warning("Can't read %s", self._file)
|
||||
self._data = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user