Patch subprocess rather than Popen and PIPE