On Mar 12, 2015 4:53 PM, "Barry Warsaw" <barry@python.org> wrote:
>
> On Mar 11, 2015, at 09:38 PM, M.-A. Lemburg wrote:
>
> >I think the migration should start with modifying scripts to use
> >
> >#!/usr/bin/env python2
> >
> >when they are Python 2 only (*) and
> >
> >#!/usr/bin/env python3
> >
> >when they are Python 3 only and
> >
> >#!/usr/bin/env python
> >
> >only when they support both Python 2 and 3.
>
> Mostly, I agree, although I would not recommend /usr/bin/env for system
> installed scripts.  Using /usr/bin/env is fine for development trees, but a
> really bad idea for anything installed in system locations.  Modify your
> suggestion to /usr/bin/python2 and /usr/bin/python3 and I'm on board. :)

For (re-)packaged scripts, it seems reasonable to expect package maintainers to use explicit platform-specific paths.

Otherwise, for checksums and diff noise, does /usr/bin/env python2 make sense?

>
> I would very much like to see explicit use of /usr/bin/python2 replace
> /usr/bin/python for scripts.

+1. This will require documented guidelines and many emails to package maintainers.

Where should a note about this go in
/docs?

>
> Then I think the problem is, what do users expect when they type
>
> $ python foo.py
>
> at their shell prompt?

For the first python binary on $PATH to supersede whatever might be defined in the shebang line of foo.py (thus skipping any shebang path and args).