sicd: add SIGPIPE/SIG_IGN porting note at EPIPE catch site

CPython sets SIGPIPE to SIG_IGN so EPIPE surfaces as BrokenPipeError.
A Go port must replicate this explicitly or the EPIPE path silently
becomes a SIGPIPE death.

24/24 green.
This commit is contained in:
Markus Fritsche
2026-07-23 01:05:39 +02:00
parent 833a0432b8
commit a0f93c16cf
+4
View File
@@ -113,6 +113,10 @@ def main() -> None:
break
write_all(w_fd, chunk)
except BrokenPipeError:
# CPython sets SIGPIPE to SIG_IGN at startup, so EPIPE surfaces
# as BrokenPipeError instead of killing the process. A port to
# another language (Go, etc.) must replicate this explicitly or
# the EPIPE path silently becomes a SIGPIPE death.
pass
except OSError as e:
sys.stderr.write(f"sicd: stdin read error: {e}\n")