Skip to content

The agent that grows with you

fix(backup): percent-encode path in _query_ro_sqlite URI

salch-cred793c07ffaf14
diff --git a/hermes_cli/backup.py b/hermes_cli/backup.py
index 0808f9ff2b6..af5b8e82597 100644
--- a/hermes_cli/backup.py
+++ b/hermes_cli/backup.py
@@ -348,7 +348,7 @@ def _query_ro_sqlite(path: Path, fn):
"""Run ``fn(conn)`` on a read-only connection to *path*; return ``(value, None)`` or ``(None, exc)``."""
conn = None
try:
- conn = sqlite3.connect(f"file:{path}?mode=ro", uri=True, timeout=1.0)
+ conn = sqlite3.connect(f"{path.resolve().as_uri()}?mode=ro", uri=True, timeout=1.0)
return fn(conn), None
except Exception as exc:
return None, exc