[Python-Dev] PEP 405 (Python Virtual Environments) and Windows script support

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue May 29 12:37:05 CEST 2012


Mark Hammond <skippy.hammond <at> gmail.com> writes:

> I don't understand the relationship between this "stock launcher" and 
> the PEP 397 launcher.  They seem to have quite distinct requirements 
> without much overlap.  Specifically, I'm not aware that the current PEP 
> 397 implementation could perform the same role as the "stock launcher" - 
> IIUC, it has no special handling of the "-script" suffix or special 
> logic based around its argv[0].
> 

Actually the stock launcher's job is similar to the 397 launcher, though it
doesn't address many of the things that are in PEP 397. The basic requirement is
to run the correct Python for a script installed as part of a package; that's
done by having shebang lines (set up during installation) which point to the
correct Python. The stock launcher reads the shebang line and invokes the
appropriate Python. It's a reimplementation of the launcher used in setuptools
and a much simplified version of the 397 launcher, which I put together when
exploring how packaging would work with venvs on Windows.

In theory, if the PEP 397 launcher is installed, you don't need the stock
launcher; any script installed by packaging (or setuptools/Distribute) in a venv
should have the correct shebang line, and the PEP 397 launcher should do the
right thing.

I'm sorry for all the confusion I've caused here :-(

Regards,

Vinay Sajip



More information about the Python-Dev mailing list