diff --git a/contributors/emails/hermes-fleet-fix@localhost b/contributors/emails/hermes-fleet-fix@localhost new file mode 100644 index 0000000000..183f2f3651 --- /dev/null +++ b/contributors/emails/hermes-fleet-fix@localhost @@ -0,0 +1 @@ +rohitsabu diff --git a/hermes_state.py b/hermes_state.py index 2f9d621303..8bec8e91f1 100644 --- a/hermes_state.py +++ b/hermes_state.py @@ -248,6 +248,10 @@ def _secure_state_db_files(db_path: Path, *, create_main: bool = False) -> None: fd = os.open(path, flags, 0o600) except FileNotFoundError: continue + except IsADirectoryError: + # Not a database file at all; sqlite3.connect() raises the + # canonical error for this, and a directory leaks no row data. + continue try: os.fchmod(fd, 0o600) finally: