mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 10:59:43 +00:00
Fix UnicodeDecodeError with read json file (#613)
* Update json.py * Update data.py
This commit is contained in:
@@ -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 = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user