3 ms·
Python doesn't catch SIGPIPE, it ignores it. The exception is raised from a -1/EPIPE return from libc write(). I fully agree that Python is often a bad citize
by loeg 7y ago
Python doesn't catch SIGPIPE, it ignores it.
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.