Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cve_bin_tool/version_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading