[issue12235] subprocess.check_output throws wrong exception if non executable

Charles-François Natali report at bugs.python.org
Wed Jun 1 18:49:25 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

Python is not raising this error, your OS is.
It doesn't find the interpreter, and if you look carefully, it's clear why:

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

See the ^M after /bin/sh?
It's looks like a DOS line ending, and the spurious \r character is concatenated to the intepreter path, leading to this error.
You didn't copy this script through a Windows box, didn't you?
Just run dos2unix on your script, and it should solve your problem.

----------
nosy: +charles-francois.natali

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12235>
_______________________________________


More information about the Python-bugs-list mailing list