Message213132
> 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
" |
|
Date |
User |
Action |
Args |
2014-03-11 09:28:54 | piotr.dobrogost | set | recipients:
+ piotr.dobrogost, loewis, barry, ncoghlan, eric.araujo, Arfrever, r.david.murray, allan, stephane |
2014-03-11 09:28:54 | piotr.dobrogost | set | messageid: <1394530134.19.0.027134886934.issue10835@psf.upfronthosting.co.za> |
2014-03-11 09:28:54 | piotr.dobrogost | link | issue10835 messages |
2014-03-11 09:28:53 | piotr.dobrogost | create | |
|