{"record":{"id":"bc7cc3c40267ef53","repo":"HKUDS/nanobot","slug":"the-file-is-not-valid-utf-8","errorCode":null,"errorMessage":"The file is not valid UTF-8.","messagePattern":"The file is not valid UTF-8\\.","errorType":"exception","errorClass":"ConfigLoadError","httpStatus":null,"severity":"error","filePath":"nanobot/config/loader.py","lineNumber":95,"sourceCode":"            ) from exc\n        config.bind_source_path(path)\n        _apply_ssrf_whitelist(config)\n        return config\n\n    try:\n        with path.open(encoding=\"utf-8\") as handle:\n            data = json.load(handle)\n    except json.JSONDecodeError as exc:\n        raise ConfigLoadError(\n            path,\n            kind=\"invalid_json\",\n            summary=(\n                f\"JSON syntax error at line {exc.lineno}, column {exc.colno}: \"\n                f\"{_sentence(exc.msg)}\"\n            ),\n        ) from exc\n    except UnicodeDecodeError as exc:\n        raise ConfigLoadError(\n            path,\n            kind=\"io_error\",\n            summary=\"The file is not valid UTF-8.\",\n        ) from exc\n    except OSError as exc:\n        detail = exc.strerror or type(exc).__name__\n        raise ConfigLoadError(\n            path,\n            kind=\"io_error\",\n            summary=f\"Unable to read the file: {_sentence(detail)}\",\n        ) from exc\n\n    if not isinstance(data, dict):\n        root_type = type(data).__name__\n        raise ConfigLoadError(\n            path,\n            kind=\"invalid_root\",\n            summary=\"The top level of config.json must be a JSON object.\",","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/config/loader.py#L77-L113","documentation":"Error \"The file is not valid UTF-8.\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/config/loader.py:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}