Author piotr.dobrogost
Recipients Arfrever, allan, barry, eric.araujo, loewis, ncoghlan, piotr.dobrogost, r.david.murray, stephane
Date 2014-03-11.09:28:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394530134.19.0.027134886934.issue10835@psf.upfronthosting.co.za>
In-reply-to
Content
> Garbage in, garbage out.

In this case – exec -a '' – yes, but in general not so – see "Mismatch between sys.executable and sys.version in Python" question at SO (http://stackoverflow.com/q/22236727/95735).

As to not guessing Victor STINNER in comment http://bugs.python.org/issue7774#msg100849 wrote this:

"
There are different methods to get the real program name, but no one is portable. As flox wrote, we can "do a best effort to provide a valid sys.executable". Extract of stackoverflow link:

 * Mac OS X: _NSGetExecutablePath() (man 3 dyld)
 * Linux: readlink /proc/self/exe
 * Solaris: getexecname()
 * FreeBSD: sysctl CTL_KERN KERN_PROC KERN_PROC_PATHNAME -1
 * BSD with procfs: readlink /proc/curproc/file
 * Windows: GetModuleFileName() with hModule = NULL
"
History
Date User Action Args
2014-03-11 09:28:54piotr.dobrogostsetrecipients: + piotr.dobrogost, loewis, barry, ncoghlan, eric.araujo, Arfrever, r.david.murray, allan, stephane
2014-03-11 09:28:54piotr.dobrogostsetmessageid: <1394530134.19.0.027134886934.issue10835@psf.upfronthosting.co.za>
2014-03-11 09:28:54piotr.dobrogostlinkissue10835 messages
2014-03-11 09:28:53piotr.dobrogostcreate