[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Tools/scripts pydoc,NONE,1.1

Andrew Kuchling akuchlin@mems-exchange.org
Fri, 2 Mar 2001 11:54:59 -0500


On Fri, Mar 02, 2001 at 11:47:39AM -0500, Greg Ward wrote:
>>   # 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.

--amk