[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Tools/scripts pydoc,NONE,1.1
Guido van Rossum
guido@digicool.com
Fri, 02 Mar 2001 12:01:50 -0500
> >> # check if Python is called on the first line with this expression.
> >> # This expression will leave lines using /usr/bin/env alone; presumably
> >> # the script author knew what they were doing...)
> >> first_line_re = re.compile(r'^#!(?!\s*/usr/bin/env\b).*python(\s+.*)?')
> >
> >Yup. Andrew, care to explain why not munging "#!/usr/bin/env python"
> >lines is the right thing to do? I happen to think it's not; I think #!
> >lines should always be munged (assuming this is a Python script, of
> >course).
>
> Disagree; as the comment says, "presumably the script author knew what
> they were doing..." when they put /usr/bin/env at the top. This had
> to be done so that pydoc could be installed at all.
Don't understand the list sentence -- what started this thread is that
when pydoc is installed but there's another (older) installed python
that is first on $PATH, pydoc breaks.
--Guido van Rossum (home page: http://www.python.org/~guido/)