From 3d9bccc0b19a2d14cc45d69ea36f4dac96b4f090 Mon Sep 17 00:00:00 2001 From: Lakitna Date: Thu, 2 Apr 2026 18:37:09 +0200 Subject: [PATCH] Added error message when cache file points to a directory --- src/CacheLibrary/CacheLibrary.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CacheLibrary/CacheLibrary.py b/src/CacheLibrary/CacheLibrary.py index 89b3b5b..2d48b3e 100644 --- a/src/CacheLibrary/CacheLibrary.py +++ b/src/CacheLibrary/CacheLibrary.py @@ -102,6 +102,10 @@ def __init__( path = Path(file_path) + if path.is_dir(): + msg = f"Cache file path must be a file. '{path.resolve().as_posix()}' is a directory." + raise ValueError(msg) + if path.suffix == ".json": self.cache_file = JsonCacheFile( path,