Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

fix: Add explicit UTF-8 encoding to read_text() calls

TaeBbong365d51f52fea
diff --git a/strix/skills/__init__.py b/strix/skills/__init__.py
index c3ac3911..c9cdf031 100644
--- a/strix/skills/__init__.py
+++ b/strix/skills/__init__.py
@@ -130,7 +130,7 @@ def load_skills(skill_names: list[str]) -> dict[str, str]:
if skill_path and (skills_dir / skill_path).exists():
full_path = skills_dir / skill_path
var_name = skill_name.split("/")[-1]
- content = full_path.read_text()
+ content = full_path.read_text(encoding="utf-8")
content = _FRONTMATTER_PATTERN.sub("", content).lstrip()
skill_content[var_name] = content
logger.info(f"Loaded skill: {skill_name} -> {var_name}")
diff --git a/strix/tools/registry.py b/strix/tools/registry.py
index ac6e15fa..7313bc33 100644
--- a/strix/tools/registry.py
+++ b/strix/tools/registry.py
@@ -48,7 +48,7 @@ def _load_xml_schema(path: Path) -> Any:
if not path.exists():
return None
try:
- content = path.read_text()
+ content = path.read_text(encoding="utf-8")
content = _process_dynamic_content(content)