[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Siming Yuan
Siming Yuan added the comment: thank you for the insight and quick response. thought i hit the weirdest bug ever -- resolution: -> not a bug ___ Python tracker ___

[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Anthony Sottile
Anthony Sottile added the comment: They're thin wrappers around the same C functions -- that's just how C works it is also documented: https://docs.python.org/3/library/os.html#os.execvpe > In either case, the arguments to the child process **should start with the > name of the command

[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Siming Yuan
Siming Yuan added the comment: that works... but where does it say arv[0] is the program name? it seems to be more of a how C works... would be nice if the doc had some examples of that. -- ___ Python tracker

[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Anthony Sottile
Anthony Sottile added the comment: You want: os.execl('/bin/bash', 'bash', '--init-file', ...) argv[0] is supposed to be the program name, your example puts `--init-file` as the program name -- nosy: +Anthony Sottile ___ Python tracker

[issue37066] os.execl opening a new bash shell doesn't work if initfile/rcfile provided

2019-05-27 Thread Siming Yuan
New submission from Siming Yuan : Using os.execl you can open a new bash shell (eg, using python to process some env before opening a new shell. $ echo $SHLVL 1 $ ~/.pyenv/versions/3.6.4/bin/python3 Python 3.6.4 (default, Feb 5 2018, 16:53:35) [GCC 4.2.1 Compatible Apple LLVM 9.0.0