Skip to content

paste: preserve readable columns after input errors - #17052

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:paste-parallel-read-errors
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:paste-parallel-read-errors

Conversation

@limadog9

@limadog9 limadog9 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Preserve partial fields and continue merging readable columns when one input fails. Report each failed operand once and exit with status 1.

Addresses the parallel paste case in #15254 and the GNU compatibility tracker #14705.

GNU 9.12 misc/read-errors.sh now gets both expected paste diagnostics, up from one. The aggregate test still fails on fold. Both GNU paste suites pass. Rust paste tests went from 29 passed and 2 failed to 31 passed.

@sylvestre
sylvestre force-pushed the paste-parallel-read-errors branch from b02e176 to b22f6f3 Compare December 1, 2026 13:03
@limadog9
limadog9 force-pushed the paste-parallel-read-errors branch from b22f6f3 to fce2a4f Compare December 1, 2026 17:27
Comment thread src/uu/paste/src/paste.rs Outdated
Ok(read) => read,
Err(err) => {
// Keep any bytes read before the error as this row's field.
// The next row can still get data if the error was transient.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why keep reading after an error? closing the column and showing the error right away would drop the read_error field, no?
the tests only cover a persistent error anyway

Comment thread src/uu/paste/src/paste.rs Outdated
if !needs_terminator {
break;
}
// Finish the partial record and try reading the next one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, a break would be enough, the needs_terminator check after the loop already finishes the record

Comment thread src/uu/paste/src/paste.rs
@@ -158,32 +158,24 @@ fn paste(
delimiter_state.reset_to_first_delimiter();
}
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about -s? paste -s left dir1 right still stops at dir1

@limadog9
limadog9 force-pushed the paste-parallel-read-errors branch from fce2a4f to b91d64f Compare December 1, 2026 20:21

This branch has not been deployed

No deployments
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.

2 participants