{"record":{"id":"fa24bf40bd775ed1","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-text-fa24bf","errorCode":"FS_NOT_TEXT","errorMessage":"cannot read \"${target.displayPath}\": binary file","messagePattern":"cannot read \"(.+?)\": binary file","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/fsio.ts","lineNumber":380,"sourceCode":"    throw new FsError(`cannot ${verb} \"${target.displayPath}\": not found`, 'FS_NOT_FOUND')\n  }\n  if (!info.isFile()) throw new FsError(`cannot ${verb} \"${target.displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE')\n  return info\n}\n\n/**\n * Read a whole regular UTF-8 text file into a single decoded string. Rejects\n * non-regular files, invalid UTF-8, and NUL-byte binary samples.\n * @param target - the resolved file to read.\n * @param signal - aborts the read (`FS_ABORTED`).\n * @returns the full decoded text, byte-for-byte (no normalization).\n */\nexport async function readWholeText(target: LocalTarget, signal?: AbortSignal): Promise<string> {\n  await statRegularFile(target, 'read', signal)\n  const raw = await readFileAbortable(target.targetKey, 'read', signal)\n  throwIfAborted(signal, 'read')\n  if (raw.subarray(0, BINARY_SAMPLE_BYTES).includes(0)) {\n    throw new FsError(`cannot read \"${target.displayPath}\": binary file`, 'FS_NOT_TEXT')\n  }\n  return decodeUtf8(raw, 'read', target.displayPath)\n}\n\n/**\n * Read a whole regular file as raw bytes with no decoding or binary rejection.\n * `maxBytes` bounds the complete content: the stat size short-circuits an\n * oversized file before any content I/O, and the stream reads at most one byte\n * beyond the cap so a file growing after stat cannot cause unbounded buffering.\n * @param target - the resolved file to read.\n * @param signal - aborts the read (`FS_ABORTED`).\n * @param maxBytes - inclusive byte cap on the complete content (`FS_TOO_LARGE`).\n * @param internals - test seam for a deterministic post-stat growth race.\n * @returns the full raw content, at most `maxBytes` long.\n */\nexport async function readWholeBytes(\n  target: LocalTarget,\n  signal: AbortSignal | undefined,","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/fsio.ts#L362-L398","documentation":"Error \"cannot read \"${target.displayPath}\": binary file\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/fsio.ts:380 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}