fix: correctly print multi-line errors
Metadata
Current evaluation
Merged in canonical/craft-cli#270 (0ca6940), splitting error text into lines so prior progress output cannot corrupt multi-line errors; fixes #263.
Resolution: closed resolved
Reason: The approved PR was merged as commit 0ca6940. It prints each error line independently, resolving the stale progress-text corruption tracked in canonical/craft-cli#263.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The bug manifested in a situation like this:
- A long progress() message is printed, say "AAAAAAAA";
- An error is emitter, and the result of str(error) is a multi-line string where the first line is shorter than the previously-emitted progress() message. Example: "BBBB\nCCCC";
- The newline in the error message is not correctly handled by the printer, meaning that after "BBBB" is written to the terminal the remainder of the line is not cleared. So the end result looks like:
> BBBBAAAA
> CCCC
The "proper" fix for this would mean a big rework on the printer to properly support multi-line messages; for now, fix only the error case by "manually" splitting the error message and printing each line individually.
Fixes #263
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox`?
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-cli#270 (0ca6940), splitting error text into lines so prior progress output cannot corrupt multi-line errors; fixes #263. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-cli#270 (commit 0ca6940): errors are split and printed line by line, preventing leftover progress text from corrupting multi-line messages. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for multi-line error printing. The change splits error strings to print each line individually, preventing leftover characters from previous progress messages. Approved by two reviewers, passed CI, and resolves #263. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/craft-cli#263
(confidence 100%)
Issue explicitly identified as fixed by PR #270.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #64 Fix typo | craft-cli | merged | Merged canonical/craft-cli#64, correcting a one-line typo in commit 6f5deec via merge commit 425c2a9; the reported CI failure was unrelated. | |
| #1000 Error presentation sometimes omits the last lines | craft-parts | closed | Merged in canonical/craft-parts#1012 (f47837ad), reformatting plugin build errors so trailing diagnostic lines are preserved. | |
| #118 Fix typos and markdowns | craft-cli | merged | Merged in canonical/craft-cli#118, correcting codespell findings and Markdown text in one file (+4/-4). | |
| #353 feat: prepend newlines to details if necessary | craft-cli | merged | Merged #353 via commit 687c2fa, adding leading newlines to multiline error details for readability; released in craft-cli 3.1.0. |