3 ms·
It is incorrect to use: rc = subprocess.call(["ls", "-l"], shell=True) It means a different thing. OP should use either: rc = subprocess.call(["ls", "-l"
by d0mine 11y ago
It is incorrect to use:
rc = subprocess.call(["ls", "-l"], shell=True)
It means a different thing. OP should use either:
rc = subprocess.call(["ls", "-l"])
Or:
rc = subprocess.call("ls -l", shell=True)
Note: there is no need to use the shell or even to use the external processs in this case.
The example shows the usability issue in the API. Newly designed C++ API shouldn't copy such errors (if it has the same behavior). A list argument with shell=True should be rejected.