1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix filesize doing blocking I/O in the event loop (#90479)

Fix filesize doing I/O in the event loop
This commit is contained in:
J. Nick Koston
2023-03-29 11:26:28 -10:00
committed by GitHub
parent 1023628821
commit 4c21caa917
3 changed files with 15 additions and 14 deletions

View File

@@ -1950,7 +1950,11 @@ class Config:
)
def is_allowed_path(self, path: str) -> bool:
"""Check if the path is valid for access from outside."""
"""Check if the path is valid for access from outside.
This function does blocking I/O and should not be called from the event loop.
Use hass.async_add_executor_job to schedule it on the executor.
"""
assert path is not None
thepath = pathlib.Path(path)