From 898da23caad3bc1d877444492a7d4db50525fefe Mon Sep 17 00:00:00 2001 From: He Wang Date: Wed, 2 Jul 2025 18:35:16 +0800 Subject: [PATCH] make dirs with 'exist_ok=True' (#8629) ### What problem does this PR solve? The following error occurred during local testing, which should be fixed by configuring 'exist_ok=True'. ```log set_progress(7461edc2535c11f0a2aa0242c0a82009), progress: -1, progress_msg: 21:41:41 Page(1~100000001): [ERROR][Errno 17] File exists: '/ragflow/tmp' ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/cv_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/llm/cv_model.py b/rag/llm/cv_model.py index 8c8f23963..da7efaef1 100644 --- a/rag/llm/cv_model.py +++ b/rag/llm/cv_model.py @@ -240,7 +240,7 @@ class QWenCV(Base): # stupid as hell tmp_dir = get_project_base_directory("tmp") if not os.path.exists(tmp_dir): - os.mkdir(tmp_dir) + os.makedirs(tmp_dir, exist_ok=True) path = os.path.join(tmp_dir, "%s.jpg" % get_uuid()) Image.open(io.BytesIO(binary)).save(path) return [ @@ -262,7 +262,7 @@ class QWenCV(Base): # stupid as hell tmp_dir = get_project_base_directory("tmp") if not os.path.exists(tmp_dir): - os.mkdir(tmp_dir) + os.makedirs(tmp_dir, exist_ok=True) path = os.path.join(tmp_dir, "%s.jpg" % get_uuid()) Image.open(io.BytesIO(binary)).save(path)