diff --git a/homeassistant/core.py b/homeassistant/core.py index 8ff9d9cfd81d99..543aba2a0e70ee 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -1064,7 +1064,7 @@ def is_allowed_path(self, path: str) -> bool: """Check if the path is valid for access from outside.""" assert path is not None - parent = pathlib.Path(path).parent + parent = pathlib.Path(path) try: parent = parent.resolve() # pylint: disable=no-member except (FileNotFoundError, RuntimeError, PermissionError): diff --git a/tests/test_core.py b/tests/test_core.py index 77a7872526f4ab..261b6385b048fa 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -809,6 +809,7 @@ def test_is_allowed_path(self): valid = [ test_file, + tmp_dir ] for path in valid: assert self.config.is_allowed_path(path)