I'm using subprocess.Popen
to run different scripts from another python script and some of them just hang in some point until they are killed by the scheduler script. I tried setting bufsize
to 100 * 1024 * 1024
but didn't succeeded solving the problem. If I ignore all the output setting stdout
and stderr
to subprocess.DEVNULL
it doesn't get stuck.
Example:
# For most scripts this works, but for long running and very verbose scripts, it gets stuck
subprocess.Popen(args=args_list, bufsize=100*1024*1024, stderr=subprocess.PIPE, stdout=subprocess.DEVNULL)
# This works fine, but I don't get the stderr content
subprocess.Popen(args=args_list, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
Thanks for your help!