diff --git a/safety/safety.py b/safety/safety.py index ded6efb0..1c29d4cc 100644 --- a/safety/safety.py +++ b/safety/safety.py @@ -44,6 +44,7 @@ def get_from_cache(db_name: str, cache_valid_seconds: int = 0, skip_time_verification: bool = False) -> Optional[Dict[str, Any]]: cache_file_lock = f"{DB_CACHE_FILE}.lock" + os.makedirs(os.path.dirname(cache_file_lock), exist_ok=True) lock = FileLock(cache_file_lock, timeout=10) with lock: if os.path.exists(DB_CACHE_FILE):