Skip to content

Guard optional stream setEncoding#328

Open
StantonMatt wants to merge 1 commit into
extrabacon:masterfrom
StantonMatt:fix-bun-stream-setencoding
Open

Guard optional stream setEncoding#328
StantonMatt wants to merge 1 commit into
extrabacon:masterfrom
StantonMatt:fix-bun-stream-setencoding

Conversation

@StantonMatt
Copy link
Copy Markdown

@StantonMatt StantonMatt commented Jun 1, 2026

Summary

  • only call setEncoding when a child-process stream exposes that method
  • preserves current behavior for Node streams while avoiding the Bun/Deno-compatible stream TypeError reported in Support Bun #305

Fixes #305.

Verification

  • npm test (rerun passed with 43 passing; one earlier local run hit three Mocha 2s timeouts before passing on rerun)
  • bun -e 'import { PythonShell } from "./index.ts"; await PythonShell.run("exit-code.py", { scriptPath: "test/python", stdio: ["ignore", "pipe", "pipe"] }); console.log("bun smoke passed");'
  • git diff --check
  • review-fix-loop clean

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Bun

1 participant