mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
strip UTF-8 BOM when reading SKILL.md in quick_validate (#93811)
The previous `read_text(encoding="utf-8")` call left the UTF-8 byte order mark (EF BB BF, three bytes) in the content string if the file was saved by a tool that emits a BOM. The first line check (`lines[0].strip() != "---"`) then saw "\ufeff---" and rejected the file as "Invalid frontmatter format", even though the document was otherwise valid frontmatter. Co-authored-by: Zo Bot <github-automation@zo.computer>
This commit is contained in:
parent
e896ca9634
commit
6567f99625
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ def validate_skill(skill_path):
|
|||
return False, "SKILL.md not found"
|
||||
|
||||
try:
|
||||
content = skill_md.read_text(encoding="utf-8")
|
||||
content = skill_md.read_text(encoding="utf-8-sig")
|
||||
except OSError as e:
|
||||
return False, f"Could not read SKILL.md: {e}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue