Fix UnicodeDecodeError with read json file (#613)

* Update json.py

* Update data.py
This commit is contained in:
Pascal Vizeli 2018-08-02 21:48:50 +02:00 committed by GitHub
parent 2c17fe5da8
commit ae7466ccfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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 = {}