new subprocess call using Popen and PIPE insted of check_call and
tempfiles