I have this program, which when executed on the console like this:
prog 1> output 2> error
Has the valid output and error. However, when I execute the same program using the subprocess module.
p = subprocess.Popen(['prog'],stdout=PIPE, stderr=PIPE,close_fds=True)
out, err = p.communicate()
The out is empty but err is proper. What could be happening here? I can do a os.system and direct to output and error too. But I had been relying on subprocess for doing till recently.
What could be the problem? This is being tried on Linux only. Not on Windows. `