Skip to content

Commit 903ce05

Browse files
author
Markus
committed
fix(workflows): tolerate non-UTF8 integration.json in auto-detect (#2408)
Made-with: Cursor
1 parent bbd4f34 commit 903ce05

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/specify_cli/workflows/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def _resolve_integration_auto(self) -> str:
741741
path = self.project_root / self._INTEGRATION_JSON
742742
try:
743743
data = json.loads(path.read_text(encoding="utf-8"))
744-
except (OSError, json.JSONDecodeError):
744+
except (OSError, UnicodeDecodeError, json.JSONDecodeError):
745745
return self._AUTO_FALLBACK
746746
if isinstance(data, dict):
747747
value = data.get("integration")

tests/test_workflows.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,6 @@ def test_resolve_inputs_auto_reads_integration_json(self, project_dir):
18821882
"""'auto' default resolves to the integration in .specify/integration.json."""
18831883
from unittest.mock import patch
18841884
from specify_cli.workflows.engine import WorkflowEngine, WorkflowDefinition
1885-
from specify_cli.workflows.base import StepStatus
18861885

18871886
# Write integration.json with opencode
18881887
int_json = project_dir / ".specify" / "integration.json"

0 commit comments

Comments
 (0)