From e401d917aca8bc804f64fb3268b350e44e70d9f0 Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Mon, 9 Dec 2024 16:16:56 +0800 Subject: [PATCH] fix --- api/core/rag/extractor/word_extractor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/rag/extractor/word_extractor.py b/api/core/rag/extractor/word_extractor.py index 1f9e99f91a..e2f0de9414 100644 --- a/api/core/rag/extractor/word_extractor.py +++ b/api/core/rag/extractor/word_extractor.py @@ -50,7 +50,7 @@ class WordExtractor(BaseExtractor): self.web_path = self.file_path # TODO: use a better way to handle the file - self.temp_file = tempfile.NamedTemporaryFile() + self.temp_file = tempfile.NamedTemporaryFile() # noqa: SIM115 self.temp_file.write(r.content) self.file_path = self.temp_file.name elif not os.path.isfile(self.file_path): @@ -228,7 +228,7 @@ class WordExtractor(BaseExtractor): if x.tag.endswith("instrText"): for i in url_pattern.findall(x.text): hyperlinks_url = str(i) - except Exception as e: + except Exception: logger.exception("Failed to parse HYPERLINK xml") def parse_paragraph(paragraph):