def popen2(patch, cmd, mode="r", bufsize=0):
    """Execute cmd as a sub-process and return the file objects (child_stdin, child_stdout)."""
    cmd = _PopenCmd(cmd, mode, bufsize, shared_eo=False)
    pipes = cmd.get_pipes()
    cmd.run()
    return pipes[0], pipes[1]
Execute cmd as a sub-process and return the file objects (child_stdin, child_stdout).
lib/mlpatches/os_popen.py