Catch OS-Error (#3924)

This commit is contained in:
Pascal Vizeli 2022-10-04 17:48:53 +02:00 committed by GitHub
parent f9b474866b
commit 18b43ce767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ def read_yaml_file(path: Path) -> dict:
try: try:
return _YAML.load(path) or {} return _YAML.load(path) or {}
except (YAMLError, AttributeError) as err: except (YAMLError, AttributeError, OSError) as err:
raise YamlFileError( raise YamlFileError(
f"Can't read YAML file {path!s} - {err!s}", _LOGGER.error f"Can't read YAML file {path!s} - {err!s}", _LOGGER.error
) from err ) from err