[Python-Dev] Draft PEP and reference implementation of a Python launcher for Windows

Mark Hammond mhammond at skippinet.com.au
Sun Mar 20 22:16:28 CET 2011


Following up myself here...
On 20/03/2011 9:25 PM, Mark Hammond wrote:
> On 20/03/2011 8:37 PM, "Martin v. Löwis" wrote:
> ...
> Some of these uses probably shouldn't use the launcher directly - eg,
> ISAPI apps and COM objects which have a separate registration step could
> register a specific python.exe - the installation script itself could by
> launched by the launcher, but that script could continue to use
> sys.executable to record the specific python.exe.

The above raises an interesting question - if the launcher executed 
Python in-process, what would sys.executable be?  I can imagine there 
are few scenarios where it would be desirable to have it refer to the 
launcher and a number of scenarios where it would be undesirable and 
possibly break existing scripts.

Consider when a script with a "../python3" shebang line is started via 
the launcher, but that script itself uses sys.executable to launch its 
own child.  If sys.executable was the launcher, that child would likely 
be started using a python 2.x interpreter...

Mark


More information about the Python-Dev mailing list