I use
proc = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=shell,
universal_newlines=False,
env=env)
And the code fails with the exception
File "subprocess.py", line 623, in __init__
File "subprocess.py", line 1141, in _execute_child
OSError: [Errno 7] Argument list too long
I found that my command length was really huge and hence this fails. And now I have correct it. However, I'm trying to find what is the maximum length of the command string that I can pass to subprocess Popen.