• Re: Algol 68 / Genie - exiting: action failed, sigpipe_handler

    From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.lang.misc on Sat Sep 20 00:02:38 2025
    From Newsgroup: comp.lang.misc

    On 19.09.2025 20:08, Andy Walker wrote:
    [...] Perhaps also worth noting
    that the problem is nothing [directly] to do with Algol;

    Sure.

    "a68g" is a /C/ program.

    [...]

    Thanks.

    Janis

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Bawden@alan@csail.mit.edu to comp.lang.misc on Fri Sep 19 19:03:32 2025
    From Newsgroup: comp.lang.misc

    Lawrence D’Oliveiro <ldo@nz.invalid> writes:

    On Thu, 18 Sep 2025 01:14:41 -0400, Alan Bawden wrote:

    > ... So in fact you can't get a BrokenPipeError unless SIGPIPE is
    > actually being ignored!

    ldo@theon:~> python3 -c "print('hi there')" | cat /dev/null
    Exception ignored on flushing sys.stdout:
    BrokenPipeError: [Errno 32] Broken pipe

    Note that my one-line Python program does not include any signal()
    call to ignore SIGPIPE, yet BrokenPipeError does get raised (and
    reported).

    Your program doesn't need to call signal(SIGPIPE, SIG_IGN) because Python
    does that for you -- precisely so that BrokenPipeError will work as expected. See <https://docs.python.org/3.13/library/signal.html#general-rules>.

    Also see <https://docs.python.org/3.13/library/signal.html#note-on-sigpipe>, which says some of the same things I said in my original message. (Although
    it suggests that you should _not_ risk doing signal(SIGPIPE, SIG_DFL), as I sometimes do...)
    --
    Alan Bawden
    --- Synchronet 3.21a-Linux NewsLink 1.2