Skip to content

Commit ec8c806

Browse files
authored
fix: add UTF-8 encoding and ensure_ascii=False for JSON telemetry logs (#1178)
1 parent f8bc8d6 commit ec8c806

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openhands-sdk/openhands/sdk/llm/utils/telemetry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ def log_llm_call(
297297
and "tools" in data["kwargs"]
298298
):
299299
data["kwargs"].pop("tools")
300-
with open(fname, "w") as f:
301-
f.write(json.dumps(data, default=_safe_json))
300+
with open(fname, "w", encoding="utf-8") as f:
301+
f.write(json.dumps(data, default=_safe_json, ensure_ascii=False))
302302
except Exception as e:
303303
warnings.warn(f"Telemetry logging failed: {e}")
304304

0 commit comments

Comments
 (0)