You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diffutils diff /etc/pacman.conf /dev/null | :
thread 'main' (39158) panicked at src/diff.rs:94:41:
called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
What is the desired behavior? Let this pass, because it is intentionally?
if let Err(e) = io::stdout().write_all(&result) {
// let broken pipe pass, report other errors
if e.kind() != io::ErrorKind::BrokenPipe {
eprintln!("{e}");
return ExitCode::FAILURE;
}
}
I am also working on an optimized error handling with enums to make it library friendly.
Activity
GunterSchmidt commentedon Mar 8, 2026
Yes, I have noticed this .unwrap() on io before.
What is the desired behavior? Let this pass, because it is intentionally?
I am also working on an optimized error handling with enums to make it library friendly.
oech3 commentedon Mar 9, 2026
https://github.com/uutils/coreutils/blob/995c9e04a6cc34a3a95b23a26fa59ae87e7744bd/src/uucore/src/lib/mods/panic.rs#L28-L45
fix: SIGPIPE panics - issue uutils#192
GunterSchmidt commentedon Mar 9, 2026
I researched your hint and found uutils/coreutils#9657, so I just copied that behavior and added PR #194. Could you please check that.
oech3 commentedon Mar 9, 2026
It should be able to import
uucoreinstead of copy and pasting.Fix broken pipe error, issue uutils#192
GunterSchmidt commentedon Mar 9, 2026
Yes, that is what I did. I still needed to implement the imported functionality.
GunterSchmidt commentedon Mar 10, 2026
With my current implementation you will get
GNU diff does suppress it completely.
This could easily be changed, I would just need to add one line in diff.rs:
Would you prefer that? It would mimic GNU diff behavior, but has less information.
oech3 commentedon Mar 10, 2026
I'm OK. But maintainer should determine how to fix this instead of me.
GunterSchmidt commentedon Mar 10, 2026
Fine, I strongly believe, it should stay as I fixed it.
GunterSchmidt commentedon Mar 12, 2026
As the issues were closely related I fixed #165 also in this PR.