fix(extractor): temporary file (#10543)

This commit is contained in:
-LAN- 2024-11-11 17:31:27 +08:00 committed by GitHub
parent 90087160c6
commit a1543b7da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ class WordExtractor(BaseExtractor):
self.web_path = self.file_path
# TODO: use a better way to handle the file
with tempfile.NamedTemporaryFile(delete=False) as self.temp_file:
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):