Closed jan-matejka closed 2 years ago
FWIW, I was able to fix this in my local install by adding these lines to the end of cram/__main__.py
and the cram
script:
except IOError as e:
import errno
if e.errno != errno.EPIPE:
raise
Makes sense. I have recently encountered similar problem but in zsh where I had to wrap my pipeline in sigpipe handler like
sigpipe cat $file | tee foo
where sigpipe:
function sigpipe {
local rc
$@ || {
rc=$?
test $rc -eq 141 ||
test $rc -eq 0 ||
fatal "failed with unexpected exitcode: $@"
}
}
So I think, @pjeby, your patch is correct solution. Though I suspect newer pythons might provide a subtype of IOError for the errno.EPIPE.
Dram (https://git.sr.ht/~rne/dram) does not have this bug.