I have this code
fd_log_out = open(path_log_out, 'w') fd_log_err = open(path_log_err, 'w') subprocess.check_call(command, cwd=path, stdout=fd_log_out, stderr=fd_log_err) I would like to process the stderr during the check_call to trigger an event if something is seen. I have tried to create a subclass of TextIOWrapper and overwrite the write function but it was never called.
What is the called function by subprocess.check_call. The source code is too complex to find it.
Is there any other way to do this? With PIPE maybe ?
Thanks.
fileno()method) asstdoutorstderr, the output from the process goes straight to that FD -- the Python interpreter never sees it at all, and has no opportunity to process it.subprocess.PIPEto implement a shim).