apenwarr/redo — pull request #13 by traviscross (2013-06-28 02:03:32+00:00)
Title: Failing to restore SIGPIPE leads to surprising and dangerous behavior

Python chooses to ignore SIGPIPE, however most unix processes expect
to terminate on the signal. Therefore failing to restore the default
action results in surprising behavior. For example, we expect
`dd if=/dev/zero | head -c1` to return immediately. However, prior to
this commit, that pipeline would hang forever. Insidious forms of
data corruption or loss were also possible.

See:

http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html
http://blog.nelhage.com/2010/02/a-very-subtle-bug/