Use the subprocess module instead of popen2 to make it work on Windows.