New submission from Geoffrey Royer:
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'
----------
assignee: docs@python
components: Documentation
messages: 248773
nosy: Geoffrey Royer, docs@python
priority: normal
severity: normal
status: open
title: FileNotFoundException raised by subprocess.call
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24888>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com