Message248773
According to the documentation of the subprocess.check_call function: https://docs.python.org/3/library/subprocess.html#subprocess.check_call
It would be nice to notify the reader that this function can raise FileNotFoundException. It is raised in case when the binary one wants to call does not exist.
Example:
Python 3.4.0 (default, Jun 19 2015, 14:20:21)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_call(["foo", "bar"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/subprocess.py", line 552, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.4/subprocess.py", line 533, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.4/subprocess.py", line 848, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'foo' |
|
Date |
User |
Action |
Args |
2015-08-18 14:36:31 | Geoffrey Royer | set | recipients:
+ Geoffrey Royer, docs@python |
2015-08-18 14:36:31 | Geoffrey Royer | set | messageid: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> |
2015-08-18 14:36:31 | Geoffrey Royer | link | issue24888 messages |
2015-08-18 14:36:30 | Geoffrey Royer | create | |
|