From a008467a407fe6cb180b3534fbcb698939718d88 Mon Sep 17 00:00:00 2001 From: Aarohi Chadha <149961233+aarohichadha@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:22:33 +0530 Subject: [PATCH] Update version_signature.py --- cve_bin_tool/version_signature.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cve_bin_tool/version_signature.py b/cve_bin_tool/version_signature.py index cd10875b64..e5b81bbb9b 100644 --- a/cve_bin_tool/version_signature.py +++ b/cve_bin_tool/version_signature.py @@ -40,7 +40,10 @@ def dbname(self) -> str: def open(self) -> None: """Opens connection to sqlite database.""" - self.conn = sqlite3.connect(self.dbname) + # Ensure the cache directory exists before connecting + db_path = Path(self.dbname) + db_path.parent.mkdir(parents=True, exist_ok=True) + self.conn = sqlite3.connect(db_path) self.cursor = self.conn.cursor() def close(self) -> None: