Why is the subprocess.Popen argument length limit smaller than what the OS reports?

后端 未结 2 1766
执念已碎
执念已碎 2020-12-10 13:05

I am running Python 3.4.3 on Linux 3.16.0. I want to use subprocess.Popen to run a command with a long single argument (a complex Bash invocation), roughly 200K

2条回答
  •  孤城傲影
    2020-12-10 13:36

    This other question is similar to yours, but for Windows. As in that scenario, you can bypass any shell limitations by avoiding the shell=True option.

    Otherwise, you can provide a list of files to subprocess.Popen() as done in that scenario, and as suggested by @Aaron Digulla.

提交回复
热议问题