Posts: 4,647
Threads: 1,494
Joined: Sep 2016
which exception should be raised if a
process being run produces output to a pipe normally connected to
read its stdout and/or stderr when no output is expected
from that process?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
(Mar-28-2023, 01:30 PM)Gribouillis Wrote: (Mar-27-2023, 05:17 PM)Skaperen Wrote: a pipe normally connected to read its stdout and/or stderr when no output is expected from that process?
If no output from that process is expected, why do you connect a pipe to receive output? It looks that you are expecting some output under abnormal circumstances and you want to detect if these special circumstances occur. This is very different from expecting no output. I think you should clarify your intention.
the pipe is connected so that it can be determined if the process did produce output. that process also needs to not be interrupted by that situation. that process needs to go on running. when it is finally all done this function (which, in other cases, is expected to return data) will raise an exception as a way to pass error conditions (there are other). if the pipe is not connected, then it will be very difficult to detect if the process did produce any output.
the caller of this function, when specifying that no output is expected, may or may not consider that any output is an abnormal case. the function will not care. any output will be discarded just as if the process has been given a stdout open to write to file named in os.devnull.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
Mar-30-2023, 09:57 PM
(This post was last modified: Mar-30-2023, 09:58 PM by Skaperen.)
i was thinking of just using
RuntimeError but this makes more sense and the caller of my function can still expect
RuntimeError if that makes sense to them.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.