Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/skill/understand/test_merge_batch_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def _run_merge(self) -> tuple[int, str, dict]:
capture_output=True, text=True,
)
out_path = self.intermediate / "assembled-graph.json"
assembled = _j.loads(out_path.read_text()) if out_path.exists() else {}
assembled = _j.loads(out_path.read_text(encoding="utf-8")) if out_path.exists() else {}
return result.returncode, result.stderr, assembled

def test_two_parts_of_one_logical_batch_merge(self) -> None:
Expand Down Expand Up @@ -1102,7 +1102,7 @@ def _run_merge(self) -> tuple[int, str, dict]:
capture_output=True, text=True,
)
out_path = self.intermediate / "assembled-graph.json"
assembled = _j.loads(out_path.read_text()) if out_path.exists() else {}
assembled = _j.loads(out_path.read_text(encoding="utf-8")) if out_path.exists() else {}
return result.returncode, result.stderr, assembled

def test_fused_filename_emits_stderr_warning(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def parse_gitignore(project_root: Path) -> list[re.Pattern[str]]:
if not gitignore.exists():
return patterns

for line in gitignore.read_text(errors="replace").splitlines():
for line in gitignore.read_text(encoding="utf-8", errors="replace").splitlines():
line = line.strip()
if not line or line.startswith("#"):
continue
Expand Down Expand Up @@ -208,7 +208,7 @@ def detect_entry_points(root: Path, file_paths: list[str]) -> list[dict[str, Any
continue
full_path = root / rel_path
try:
content = full_path.read_text(errors="replace")
content = full_path.read_text(encoding="utf-8", errors="replace")
except (OSError, UnicodeDecodeError):
continue

Expand Down Expand Up @@ -267,7 +267,7 @@ def priority_score(path: str) -> int:
for rel_path in sorted_paths[:MAX_SAMPLED_FILES]:
full_path = root / rel_path
try:
content = full_path.read_text(errors="replace")
content = full_path.read_text(encoding="utf-8", errors="replace")
except (OSError, UnicodeDecodeError):
continue

Expand Down Expand Up @@ -312,7 +312,7 @@ def extract_metadata(root: Path) -> dict[str, Any]:
if not filepath.exists():
continue
try:
content = filepath.read_text(errors="replace")
content = filepath.read_text(encoding="utf-8", errors="replace")
except (OSError, UnicodeDecodeError):
continue

Expand Down Expand Up @@ -415,7 +415,7 @@ def main() -> None:

context = _truncate_to_fit(context)
output = json.dumps(context, indent=2)
output_path.write_text(output)
output_path.write_text(output, encoding="utf-8")
size_kb = len(output.encode()) / 1024
print(f" Wrote {output_path} ({size_kb:.0f} KB)", file=sys.stderr)

Expand Down