[Python-ideas] Migration of /usr/bin/python to python3

Skip Montanaro skip.montanaro at gmail.com
Thu Mar 12 14:21:33 CET 2015


I think the quoting got screwed up somewhere. I wrote:

skip> If I understood correctly, /usr/bin/python would be started by
the kernel, and it would be passed the -x flag.

to which Ryan replied:

ryan> It's not the kernel that invokes that; it's the shell.

then Oleg responded (but it looked like he was quoting me, not Ryan):

oleg> Why do you think it's the shell? It's exec() system call.

I ignored Ryan's original reply, since it's been so long that I
considered things at this level, I thought I might have been mistaken
or that the field had changed in the meantime. So, are we all on the
same page now? The shell calls exec(...whatever...), and within that
call (in the kernel), the #! line is interpreted. There is still some
question about whether it consumes the first two "words" after the #!
(command and one argument), or in some cases consumes all words,
treating them as separate arguments (seems feasible, though
problematic from a security POV) or as one big argument (seems
unlikely, as that would foster an enormous amount of breakage).

Skip


More information about the Python-ideas mailing list