distutils changes my scripts when installing (python 2.2)

Jp Calderone exarkun at intarweb.us
Thu Mar 6 22:19:38 EST 2003


On Fri, Mar 07, 2003 at 02:32:50AM +0100, Irmen de Jong wrote:
> Hello
> using distutils from python 2.2 changes my scripts that I want it to copy. 
> Some of them start with:
> 
> #! /bin/env python
> 
> as the first line.
> Instead of just copying them, distutils copies and adjusts the
> first line to
> 
> #! /usr/bin/python
> 
> That is not terrible ofcourse but I didn't expect this.
> I read somewhere that using the #! /bin/env blabla  way of
> starting scripts on unix was preferable to directly calling
> the program that has to execute the script.
> But I don't know the reasons behind this.

  "#!/bin/env python" will use the first "python" executable found in the
$PATH, whereas "#!/usr/bin/python" will only use /usr/bin/python, and fail
if it is installed elsewhere.

> 
> What do I lose by the change distutils decides to make for me?
> Can I somehow tell distutils not to make this change?
> 

  This is good, because distutils is making the change based on more
information than you have.  When setup.py is running on the client's
machine, it -knows- where Python is, and can set the #! line to be correct.

  Jp

-- 
 up 3 days, 19:58, 5 users, load average: 0.02, 0.01, 0.00





More information about the Python-list mailing list