Skip to content

Add timeout option for PythonShell runs#329

Open
StantonMatt wants to merge 1 commit into
extrabacon:masterfrom
StantonMatt:add-timeout-option
Open

Add timeout option for PythonShell runs#329
StantonMatt wants to merge 1 commit into
extrabacon:masterfrom
StantonMatt:add-timeout-option

Conversation

@StantonMatt
Copy link
Copy Markdown

@StantonMatt StantonMatt commented Jun 2, 2026

Summary

  • Add an optional timeout setting to PythonShell options
  • Reject timed-out runs with a timeout error and preserve collected logs
  • Honor killSignal, flush buffered splitter output, handle parser errors during timeout flush, and use a SIGKILL fallback when the timeout signal is ignored
  • Clear timeout timers on spawn failures

Context

Fixes #96.

Verification

  • npm test -- --grep 'timeout|bad path|fails to spawn'
  • npm test (run outside the sandbox because Python's py_compile test writes bytecode under ~/Library/Caches)
  • npx prettier --check README.md index.ts test/test-python-shell.ts
  • git diff --check
  • review-fix-loop: no actionable regressions found

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.

Timeout support

1 participant