Skip to content

Suppress kernel startup stdout during execution - #900

Open
0xTaoZ wants to merge 1 commit into
nteract:mainfrom
0xTaoZ:fix-kernel-startup-stdout-leak
Open

Suppress kernel startup stdout during execution#900
0xTaoZ wants to merge 1 commit into
nteract:mainfrom
0xTaoZ:fix-kernel-startup-stdout-leak

Conversation

@0xTaoZ

@0xTaoZ 0xTaoZ commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Fixes #899.

Some kernels can write startup messages directly to the parent process' stdout while nbclient starts the kernel. When Papermill is writing the executed notebook JSON to stdout, that message can be prepended before the notebook content and make the output invalid JSON.

This keeps parent stdout quiet while the kernel context is active. Notebook stream output is still handled through Papermill's existing log_output, stdout_file, and notebook output paths.

Tests

  • python -m pytest papermill/tests/test_clientwrap.py papermill/tests/test_cli.py -q
  • python -m black --check --skip-string-normalization papermill/clientwrap.py papermill/tests/test_clientwrap.py
  • python -m ruff check papermill/clientwrap.py papermill/tests/test_clientwrap.py
  • python -m ruff format --check papermill/clientwrap.py papermill/tests/test_clientwrap.py
  • pre-commit run --files papermill/clientwrap.py papermill/tests/test_clientwrap.py
  • git diff --check HEAD~1..HEAD

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.

papermill inserts "Starting Kernel..." text into output notebook

1 participant