Running subprocess won\'t handle curly braces correctly
# Python 2.7.4
import subprocess
subprocess.Popen(\'ls src/*.cpp\',shell=True):
src/tonemap.cpp src
The other machine uses a different shell that doesn't handle that syntax.
In your case, Popen executed correctly, error is reported from ls
.
It should give same error when you execute the command:
ls src/{t,p}*.cpp
in terminal.
shell=True
runs /bin/sh
that doesn't support this syntax. Specify bash
explicitly:
from subprocess import check_call
check_call('ls src/{t,p}*.cpp', shell=True, executable='/bin/bash')