On 15 February 2015 at 16:15, Petr Viktorin <encu...@gmail.com> wrote: > On Sun, Feb 15, 2015 at 2:21 PM, Paul Moore <p.f.mo...@gmail.com> wrote: >> So the usage would be something like >> >> python -m zipapp [options] dir_to_zip >> >> Options: >> -p <interpreter> The interpreter to use on the shebang line >> (defaulting to /usr/bin/env python) > > On many systems this default would mean Python 2. Even if the official > recommendation changes for 3.5, the status quo might linger for a few > years. > On the other hand, the number of distros that don't ship Python 3 is > small, and the reason they're slow-moving tends to be stability and/or > compliance, so they're not the target audience for zipapp. And the > python3 symlink is not going away any time soon. > So I'd suggest `/usr/bin/env python3` for the default.
But that will fail for users who only have Python 2 installed. And it won't pick up an activated virtualenv (assuming virtualenvs on Unix don't include a python3 command, which I believe is true - it certainly won't on Windows). As a Windows user, I believe that the command "python" should run the version of Python that you choose to be your default. I know it's not quite that simple on Unix, and the system "python" command is typically Python 2, with "python3" for the system Python 3 version, but I also know that tools like pyenv work like that. Equally, I've seen lots of scripts with "#!/usr/bin/env python" as the shebang line, and none with "#!/usr/bin/env python3". That may just be my limited experience with Unix though. I don't really want "#!/usr/bin/env python3" as the default shebang on Windows (at a minimum, it would do the wrong thing for my current environment). I'm open to advice from the Unix users as to how to set things up better on Unix, but there's a whole new set of problems that will arise as soon as we have different defaults on Unix and Windows, so IMO there would need to be pretty significant benefits to justify doing that. And of course it *is* only a default - users can set whatever they want. (But getting defaults right is important, so that's not to dismiss the point). Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com