Revert "Fix Windows UTF-8 encoding errors in spec file reading (#744)" (#770)

This reverts commit a01634d548.
This commit is contained in:
Andy
2026-01-07 10:56:39 +01:00
committed by GitHub
parent a01634d548
commit c300c09495
4 changed files with 5 additions and 16 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ def gather_phase_outputs(spec_dir: Path, phase_name: str) -> str:
file_path = spec_dir / filename
if file_path.exists():
try:
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text()
# Limit individual file size
if len(content) > 10000:
content = content[:10000] + "\n\n[... file truncated ...]"
+1 -1
View File
@@ -82,7 +82,7 @@ class AgentRunner:
return False, f"Prompt not found: {prompt_path}"
# Load prompt
prompt = prompt_path.read_text(encoding="utf-8")
prompt = prompt_path.read_text()
debug_detailed(
"agent_runner",
"Loaded prompt file",
@@ -40,12 +40,7 @@ class SpecDocumentValidator:
fixes.append("Create spec.md with required sections")
return ValidationResult(False, "spec", errors, warnings, fixes)
try:
content = spec_file.read_text(encoding="utf-8")
except (OSError, UnicodeDecodeError) as e:
errors.append(f"Failed to read spec.md: {e}")
fixes.append("Ensure spec.md is a valid UTF-8 encoded file")
return ValidationResult(False, "spec", errors, warnings, fixes)
content = spec_file.read_text()
# Check for required sections
for section in SPEC_REQUIRED_SECTIONS:
+2 -8
View File
@@ -171,15 +171,9 @@ def detect_project_type(project_dir: Path) -> str:
# Try to detect API framework
deps_text = ""
if requirements.exists():
try:
deps_text = requirements.read_text(encoding="utf-8").lower()
except (OSError, UnicodeDecodeError):
pass # Skip if file is unreadable
deps_text = requirements.read_text().lower()
if pyproject.exists():
try:
deps_text += pyproject.read_text(encoding="utf-8").lower()
except (OSError, UnicodeDecodeError):
pass # Skip if file is unreadable
deps_text += pyproject.read_text().lower()
if "fastapi" in deps_text or "flask" in deps_text or "django" in deps_text:
return "python_api"