fix(python): add encoding=utf-8 to file reads and writes in sandbox.py#1912
fix(python): add encoding=utf-8 to file reads and writes in sandbox.py#1912mesutoezdil wants to merge 1 commit into
Conversation
…ox.py read_text(), fdopen() without encoding use the system locale, which can differ on non-UTF-8 systems. All config files (metadata.json, oidc_token.json, active_gateway) are UTF-8 text.
PR Review StatusValidation: This is a small, concentrated Python SDK bug fix that makes OpenShell's shared gateway config files use an explicit UTF-8 encoding, matching the Rust-side writers for Review findings:
Docs: not needed; this does not change a documented command, config field, or workflow. Next state: |
|
/ok to test dba017a |
read_text()andfdopen(..., "w")without an explicit encoding use the system locale,which can be non-UTF-8 on some platforms (e.g. Windows).
4 call sites in
sandbox.pyread or write UTF-8 config files without specifying encoding:metadata_path.read_text()gatewaymetadata.jsontoken_path.read_text()oidc_token.jsonos.fdopen(fd, "w")atomic write ofoidc_token.jsonactive_file.read_text()active_gatewayname fileAll 4 are now explicit with
encoding="utf-8".