以下命令在CLI中运行良好:
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r /path/coverage.xml
当我将相同的命令传递给shell=False的子进程时,我得到以下错误:
FileNotFoundError: [Errno 2] No such file or directory: 'bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r /path/coverage.xml'
如果shell=True,则会出现以下错误:
/bin/sh: -c: line 0: syntax error near unexpected token `('
在我看来,当shell为False时,整个命令似乎被视为一条路径,我不明白为什么subprocess在shell=True时认为存在语法错误.
如何从Python中使用此命令?