fix(printer): ignore broken pipe on output streams
Metadata
Current evaluation
Merged in canonical/craft-cli#443 via commit 15f312f, making printer output ignore BrokenPipeError and avoid crashes when downstream consumers close early.
Resolution: closed resolved
Reason: The PR merged and landed as commit 15f312f. Repository history links the commit to #443, and the resulting code catches BrokenPipeError during printer output.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Summary
Ignore `BrokenPipeError` when writing to output streams in the printer.
This avoids crashes when output is piped to an early-closing consumer (for example
`head -n1`) and the downstream stream closes before craft-cli finishes writing or
cleaning up the terminal/output state.
## Testing
- `pytest -q tests/unit/test_printer.py -k "broken_pipe" -rs`
- `pytest -q tests/unit/test_printer.py -rs`
- `pytest -q tests/integration/test_messages_integration.py -k "third_party_output" -rs`
- `pytest -q tests/unit/test_messages_stream_cm.py -rs`
- `ruff check craft_cli/printer.py tests/unit/test_printer.py`
## AI assistance
AI assistance was used while investigating and preparing the review fix; the resulting code and tests were manually verified.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-cli#443 via commit 15f312f, making printer output ignore BrokenPipeError and avoid crashes when downstream consumers close early. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-cli#443 via 15f312f: printer streams now ignore BrokenPipeError, preventing crashes when downstream consumers exit early. | |
| qwen/qwen3.6-35b-a3b |
Impact:
55
Quick Win:
27
Complexity:
35
Confidence:
80
Actionability:
75
|
needs review | Adds BrokenPipeError handling to printer output streams to prevent crashes when piping to early-closing consumers like head -n1. Approved by 1 reviewer, all CI passing, 1 unresolved review comment. | |
| qwen/qwen3.6-35b-a3b |
Impact:
45
Quick Win:
38
Staleness:
35
Complexity:
15
Confidence:
75
|
needs review | Fixes BrokenPipeError crashes when output is piped to early-closing consumers. Approved by 1 reviewer, 1 unresolved comment, all CI passing, contributor awaiting feedback. | |
| qwen/qwen3.6-35b-a3b |
Impact:
50
Quick Win:
35
Staleness:
5
Complexity:
30
Confidence:
70
|
needs review | Fixes BrokenPipeError crashes in the printer when output streams close early. All CI passing, author recently followed up, but has 0 reviewers and 5 unresolved review comments. | |
| qwen/qwen3.6-35b-a3b |
Impact:
50
Quick Win:
40
Staleness:
45
Complexity:
20
Confidence:
70
|
needs review | Adds BrokenPipeError handling to printer output to prevent crashes when piping to early-closing consumers like head -n1. PR is 145 days old, CI passing, awaiting maintainer review with 5 unresolved comments. | |
| qwen/qwen3.6-35b-a3b |
Impact:
40
Quick Win:
32
Staleness:
85
Complexity:
20
Confidence:
70
|
close stale | Fixes BrokenPipeError crashes when output is piped to early-closing consumers like head. PR is 145 days old with no maintainer review; the fix appears already applied in the codebase. | |
| qwen/qwen3.6-35b-a3b |
Impact:
50
Quick Win:
40
Staleness:
80
Complexity:
20
Confidence:
60
|
needs review | PR adds BrokenPipeError handling to printer output streams. CI passes, but PR has been open for 145 days with no maintainer response. Code appears to already exist in current HEAD. | |
| qwen/qwen3.6-35b-a3b |
Impact:
50
Quick Win:
35
Staleness:
65
Complexity:
30
Confidence:
60
|
needs review | Fixes BrokenPipeError crashes when output is piped to early-closing consumers. Open 144 days with no maintainer review; CI failing on pre-existing lint/test issues unrelated to the diff. | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
32
Staleness:
58
Complexity:
30
Confidence:
80
|
needs review | Ignore BrokenPipeError in printer output streams to avoid crashes when piped to early-closing consumers (e.g., head -n1). +87/-11, 2 files, unit tests. All test jobs pass; lint/OSV failures pre-existing. No maintainer review; author pinged 99 days ago. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
60
Complexity:
15
Confidence:
85
|
needs review | Fixes BrokenPipeError when output streams close early. Tests pass except for unrelated pre-existing CI failures. Awaiting maintainer review after 2 months of inactivity. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
65
Complexity:
15
Confidence:
80
|
needs review | Catches BrokenPipeError in the printer module to prevent crashes when downstream consumers close early. Tests pass locally and against upstream; CI failures are unrelated to the diff. Awaiting maintainer review after a recent contributor follow-up. |
Update history
| Date | Change |
|---|---|
| updated | |
| closed | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #378 Broken pipe when trimming lines (head) | craft-cli | closed | BrokenPipeError when piping craft-cli output into `head` was fixed by merged PR canonical/craft-cli#443 (commit 15f312f), which makes the printer ignore broken pipes on write and stream cleanup; issue #378 closed as resolved. |