I'd rather you'd use subprocess.check_call(['pm','production','touch-finished',p,'-S',s,'--force','--quiet']) and don't set shell to True.