Skip to content

Reject stdin reads while output is captured - #1037

Draft
MatthewMckee4 wants to merge 1 commit into
mainfrom
fix/captured-stdin
Draft

Reject stdin reads while output is captured#1037
MatthewMckee4 wants to merge 1 commit into
mainfrom
fix/captured-stdin

Conversation

@MatthewMckee4

Copy link
Copy Markdown
Owner

Summary

Reject Python stdin reads with an actionable error while output capture is active, and redirect file descriptor 0 to immediate EOF for child processes. Preserve real stdin under --no-capture. Closes #983.

Test Plan

Ran just test and uvx prek run -a.

@MatthewMckee4 MatthewMckee4 added bug Something isn't working diagnostics Related to diagnostics and output of Karva test-running Related to running tests with karva labels Jul 25, 2026
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

❌ Merging this PR may alter performance

Baseline: main (6c8b73a). Candidate: PR (a5dc0b3). Each benchmark compares median CLI wall time on one GitHub Actions runner, alternating install order. Runs warm the duration cache before measuring and include default per-test status output. Lower is better.

0 improved benchmarks
3 regressed benchmarks
8 unchanged benchmarks

Warning

Benchmark regressions were detected. Review the wall-time changes before merging.

Performance Changes

Mode Benchmark Base Head Change Runs
WallTime itsdangerous 201.9 ms 211.6 ms +4.8% 21
WallTime blinker 239.1 ms 268.3 ms +12.2% 21
WallTime tomlkit 694.8 ms 725.7 ms +4.5% 15
All benchmark scores
Mode Benchmark Base Head Change Runs
WallTime requests 354.2 ms 354.1 ms -0.0% 21
WallTime h11 425.3 ms 424.1 ms -0.3% 21
WallTime sniffio 278.9 ms 279.5 ms +0.2% 21
WallTime itsdangerous 201.9 ms 211.6 ms +4.8% 21
WallTime blinker 239.1 ms 268.3 ms +12.2% 21
WallTime jinja 360.9 ms 361.1 ms +0.0% 21
WallTime installer 397.1 ms 398.4 ms +0.3% 21
WallTime tomlkit 694.8 ms 725.7 ms +4.5% 15
WallTime outcome 313.4 ms 314.0 ms +0.2% 21
WallTime pluggy 309.5 ms 309.6 ms +0.0% 21
WallTime werkzeug 1.531 s 1.531 s +0.0% 21

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

✅ Merging this PR will not alter memory usage

All benchmark scores
Mode Benchmark Base Head Change Runs
Memory requests 58.4 MiB 58.5 MiB +0.2% 21
Memory h11 53.0 MiB 53.0 MiB -0.0% 21
Memory sniffio 47.0 MiB 47.0 MiB -0.0% 21
Memory itsdangerous 44.1 MiB 44.1 MiB +0.0% 21
Memory blinker 46.8 MiB 46.8 MiB +0.0% 21
Memory jinja 54.0 MiB 54.1 MiB +0.2% 21
Memory installer 48.4 MiB 48.5 MiB +0.2% 21
Memory tomlkit 48.9 MiB 48.9 MiB +0.0% 15
Memory outcome 48.1 MiB 48.1 MiB +0.0% 21
Memory pluggy 42.9 MiB 42.9 MiB +0.0% 21
Memory werkzeug 84.2 MiB 84.2 MiB +0.0% 21

@github-actions

Copy link
Copy Markdown
Contributor

✅ No diagnostic changes

Test result comparison
Project Previous New
requests ✅ 117 pass · 0 fail · 12 skip ✅ 117 pass · 0 fail · 12 skip
h11 ✅ 78 pass · 0 fail · 0 skip ✅ 78 pass · 0 fail · 0 skip
sniffio ✅ 3 pass · 0 fail · 1 skip ✅ 3 pass · 0 fail · 1 skip
itsdangerous ✅ 10 pass · 0 fail · 0 skip ✅ 10 pass · 0 fail · 0 skip
blinker ✅ 25 pass · 0 fail · 0 skip ✅ 25 pass · 0 fail · 0 skip
jinja ✅ 25 pass · 0 fail · 0 skip ✅ 25 pass · 0 fail · 0 skip
installer ✅ 20 pass · 0 fail · 0 skip ✅ 20 pass · 0 fail · 0 skip
tomlkit ✅ 332 pass · 0 fail · 0 skip ✅ 332 pass · 0 fail · 0 skip
outcome ✅ 10 pass · 0 fail · 0 skip ✅ 10 pass · 0 fail · 0 skip
pluggy ✅ 74 pass · 0 fail · 0 skip ✅ 74 pass · 0 fail · 0 skip
werkzeug ✅ 96 pass · 0 fail · 0 skip ✅ 96 pass · 0 fail · 0 skip

@MatthewMckee4
MatthewMckee4 marked this pull request as draft July 26, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working diagnostics Related to diagnostics and output of Karva test-running Related to running tests with karva

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject stdin reads while output is captured

1 participant