Switching to subprocess.Popen, previous use of subprocess.check_output only introduced in Python 2.7