[Python-Dev] PEP 441 - Improving Python ZIP Application Support

Barry Warsaw barry at python.org
Tue Feb 17 19:52:56 CET 2015


On Feb 16, 2015, at 04:16 PM, Paul Moore wrote:

>So, the options I see:
>
>1. Stick with /usr/bin/env python
>2. No shebang unless -p is specified
>3. Unix users come up with a solution which is the same as the above
>for Windows users, but which suits them better.

#2 seems to me to be the most reasonable alternative.  The resulting pyz files
(built w/o -p) would still be explicitly executable, just like .py files.

However, -p must be able to accept any number of strings, including
"/usr/bin/env python3" if the user wants that.

Probably the best thing to do (on *nix at least) is, if the path is absolute,
use the given string verbatim.  If the path is relative, search for the given
executable on $PATH and use the first one found.  If nothing is found, use
what's given explicitly.

I think that will give all the reasonable use cases.

Cheers,
-Barry


More information about the Python-Dev mailing list