This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients Cal.Leeming, gregory.p.smith, neologix, r.david.murray
Date 2011-06-01.17:34:46
SpamBayes Score 6.4739656e-06
Marked as misclassified No
Message-id <1306949687.69.0.612170149279.issue12235@psf.upfronthosting.co.za>
In-reply-to
Content
> I think it should at least include "bad interpreter", otherwise it is a tad misleading.

It just forwards the error raised by the exec system call:

$ cat foo.sh 
#! /bin/foo
$ strace ./foo.sh 
execve("./foo.sh", ["./foo.sh"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)

> Subprocess is throwing the correct exception, what it isn't doing is preserving stderr.

There's not stderr, it's just execve which is failing with errno set to ENOENT.
Now, if you wonder how bash manages to print this "bad interpreter" error message, it's simple: it first checks for common errno values (ENOEXEC, ENOMEM), and then it parses the shebang: if it finds a line starting with #!, it assumes that it's a bad interpreter, and prints the offending line.
That's it.

Suggesting to close as invalid.
History
Date User Action Args
2011-06-01 17:34:47neologixsetrecipients: + neologix, gregory.p.smith, r.david.murray, Cal.Leeming
2011-06-01 17:34:47neologixsetmessageid: <1306949687.69.0.612170149279.issue12235@psf.upfronthosting.co.za>
2011-06-01 17:34:47neologixlinkissue12235 messages
2011-06-01 17:34:46neologixcreate