Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Fix: temp file path for tests gets created if it doesn't exist

blueheron786da2670a5921e
diff --git a/mwmbl/apps.py b/mwmbl/apps.py
index b152a64..a58f901 100644
--- a/mwmbl/apps.py
+++ b/mwmbl/apps.py
@@ -21,6 +21,8 @@ def create_index(index_name, num_pages, rebuild_on_mismatch=False):
from mwmbl.tinysearchengine.indexer import PAGE_SIZE, Document, TinyIndex
index_path = Path(settings.DATA_PATH) / index_name
+ index_path.parent.mkdir(parents=True, exist_ok=True)
+
try:
existing_index = TinyIndex(item_factory=Document, index_path=index_path)
except FileNotFoundError: