Skip to content
Closed
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
2 changes: 1 addition & 1 deletion agent/auxiliary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def _read_nous_auth() -> Optional[dict]:
try:
if not _AUTH_JSON_PATH.is_file():
return None
data = json.loads(_AUTH_JSON_PATH.read_text())
data = json.loads(_AUTH_JSON_PATH.read_text(encoding="utf-8"))
if data.get("active_provider") != "nous":
return None
provider = data.get("providers", {}).get("nous", {})
Expand Down
4 changes: 2 additions & 2 deletions agent/copilot_acp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def _handle_server_message(
if block_error:
raise PermissionError(block_error)
try:
content = path.read_text()
content = path.read_text(encoding="utf-8")
except FileNotFoundError:
content = ""
line = params.get("line")
Expand Down Expand Up @@ -659,7 +659,7 @@ def _handle_server_message(
f"Write denied: '{path}' is a protected system/credential file."
)
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(str(params.get("content") or ""))
path.write_text(str(params.get("content") or ""), encoding="utf-8")
response = {
"jsonrpc": "2.0",
"id": message_id,
Expand Down
2 changes: 1 addition & 1 deletion agent/credential_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _remove_env_source(provider: str, removed) -> RemovalResult:
if env_path.exists():
env_in_dotenv = any(
line.strip().startswith(f"{env_var}=")
for line in env_path.read_text(errors="replace").splitlines()
for line in env_path.read_text(encoding="utf-8", errors="replace").splitlines()
)
except OSError:
pass
Expand Down
2 changes: 1 addition & 1 deletion agent/shell_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def allowlist_path() -> Path:
def load_allowlist() -> Dict[str, Any]:
"""Return the parsed allowlist, or an empty skeleton if absent."""
try:
raw = json.loads(allowlist_path().read_text())
raw = json.loads(allowlist_path().read_text(encoding="utf-8"))
except (FileNotFoundError, json.JSONDecodeError, OSError):
return {"approvals": []}
if not isinstance(raw, dict):
Expand Down
2 changes: 1 addition & 1 deletion tools/managed_tool_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _read_nous_provider_state() -> Optional[dict]:
path = auth_json_path()
if not path.is_file():
return None
data = json.loads(path.read_text())
data = json.loads(path.read_text(encoding="utf-8"))
providers = data.get("providers", {})
if not isinstance(providers, dict):
return None
Expand Down
2 changes: 1 addition & 1 deletion tools/skills_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def _backfill_optional_provenance(quiet: bool = False) -> List[str]:

lock_path = SKILLS_DIR / ".hub" / "lock.json"
try:
data = json.loads(lock_path.read_text()) if lock_path.exists() else {"version": 1, "installed": {}}
data = json.loads(lock_path.read_text(encoding="utf-8")) if lock_path.exists() else {"version": 1, "installed": {}}
except (json.JSONDecodeError, OSError):
data = {"version": 1, "installed": {}}
installed = data.setdefault("installed", {})
Expand Down