by developer2 · 6y ago · 0 comments
Half of this article is not "How do Unix pipes work", but "how to fix broken SIGPIPE handling in Python".
The exception is raised from a -1/EPIPE return from libc write().
I fully agree that Python is often a bad citizen in terms of signal handling — it wants to only process signals on 'the main thread', but also wants end-users to fully control signal-handling. The two ideas are sort of at-odds and in general I find handling signals in Python frustrating.