RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Refactor: Email parser use with to handle buffer (#11496)
Stephen Hu41665b0865eb
diff --git a/rag/app/email.py b/rag/app/email.pyindex 2e95eceecb..6f3e30ab48 100644--- a/rag/app/email.py+++ b/rag/app/email.py@@ -51,9 +51,11 @@ def chunk(attachment_res = []if binary:- msg = BytesParser(policy=policy.default).parse(io.BytesIO(binary))+ with io.BytesIO(binary) as buffer:+ msg = BytesParser(policy=policy.default).parse(buffer)else:- msg = BytesParser(policy=policy.default).parse(open(filename, "rb"))+ with open(filename, "rb") as buffer:+ msg = BytesParser(policy=policy.default).parse(buffer)text_txt, html_txt = [], []# get the email header info