New submission from Cal Leeming <cal.leem...@simplicitymedialtd.co.uk>:

If you attempt to call subprocess.check_output() on a file which is not 
executable, it gives a "file not found" exception, rather than "file not 
executable". Took me about 3 hours to figure out why it kept saying the file 
didn't exist, when it clearly did :|


 ***@***# ls -la ***/src/webapp/tools/grab.sh
-rwxr-xr-x 1 *** *** 4398 Apr 19 10:55 ***/src/webapp/tools/grab.sh

 ***@***# ***/src/webapp/tools/grab.sh
bash: ***/src/webapp/tools/grab.sh: /bin/sh^M: bad interpreter: No such file or 
directory


Traceback (most recent call last):

  File "***/src/webapp/../webapp/idx/fourchan/tasks.py", line 77, in run
    subprocess.check_output([ DOWNLOAD_BIN, ])

  File "/usr/local/lib/python2.7/subprocess.py", line 530, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)

  File "/usr/local/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)

  File "/usr/local/lib/python2.7/subprocess.py", line 1201, in _execute_child
    raise child_exception

OSError: [Errno 2] No such file or directory


Request:
None

----------
messages: 137439
nosy: Cal.Leeming
priority: normal
severity: normal
status: open
title: subprocess.check_output throws wrong exception if non executable

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12235>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to