From 56b94c59524b59148fa0f3aba9d013082d6ef36b Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Thu, 14 May 2026 11:10:58 +0800 Subject: [PATCH] up --- reme2/component/file_parser/default_file_parser.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reme2/component/file_parser/default_file_parser.py b/reme2/component/file_parser/default_file_parser.py index 426bcd57..a726ea66 100644 --- a/reme2/component/file_parser/default_file_parser.py +++ b/reme2/component/file_parser/default_file_parser.py @@ -48,13 +48,11 @@ class DefaultFileParser(BaseFileParser): stat = file_path.stat() rel_path = self._get_relative_path(path) - async with aiofiles.open(file_path, "rb") as f: - data = await f.read() + async with aiofiles.open(file_path, encoding=self.encoding) as f: + text = await f.read() - if not data: + if not text: return FileNode(path=rel_path, st_mtime=stat.st_mtime), [] - - text = data.decode(self.encoding, errors="ignore") front_matter, content = self._parse_front_matter(text) if not content: