mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-06-25 19:36:29 +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)
|
read_json_file(repository_file)
|
||||||
)
|
)
|
||||||
|
|
||||||
except (OSError, json.JSONDecodeError):
|
except (OSError, json.JSONDecodeError, UnicodeDecodeError):
|
||||||
_LOGGER.warning("Can't read repository information from %s",
|
_LOGGER.warning("Can't read repository information from %s",
|
||||||
repository_file)
|
repository_file)
|
||||||
return
|
return
|
||||||
|
@ -45,7 +45,7 @@ class JsonConfig:
|
|||||||
if self._file.is_file():
|
if self._file.is_file():
|
||||||
try:
|
try:
|
||||||
self._data = read_json_file(self._file)
|
self._data = read_json_file(self._file)
|
||||||
except (OSError, json.JSONDecodeError):
|
except (OSError, json.JSONDecodeError, UnicodeDecodeError):
|
||||||
_LOGGER.warning("Can't read %s", self._file)
|
_LOGGER.warning("Can't read %s", self._file)
|
||||||
self._data = {}
|
self._data = {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user