[Distutils] shebang line modified by setuptools

Cliff Wells cliff at develix.com
Sun Apr 13 02:28:22 CEST 2008


On Sat, 2008-04-12 at 19:54 -0400, Phillip J. Eby wrote:
> At 03:26 PM 4/12/2008 -0700, Cliff Wells wrote:
> 
> >On Sat, 2008-04-12 at 17:53 -0400, Phillip J. Eby wrote:
> > > At 12:30 PM 4/12/2008 -0700, Cliff Wells wrote:
> > > >PATH is *supposed* to affect applications.
> > >
> > > It affects which application you should run, not which interpreter
> > > you run the application with.
> >
> >I think that's splitting hairs and pretty much just made up to defend
> >your position.
> 
> Anybody who thinks they can globally change which Python interpreter 
> they're running their scripts with is cruising for a serious 
> bruising.  Better they discover their error sooner than later.

If you are on RedHat, yes.  On Gentoo, SourceMage, Foresight, etc the
system is expected to do a "rolling" upgrade.  So what you call an
"error" is what is thought of as a "superior method" by many others.

> Have you ever wondered why Red Hat has that stupid 'python2' 
> executable?  It's because they used #! lines pointing to 'python' 
> rather than referencing a specific *version* of Python... and had to 
> pay for it for years thereafter.

But these are system apps we are discussing, not user apps.  System apps
are not managed by setuptools, rather they are managed by the system's
package manager.  I agree they should point to the "system" python,
whatever the system decides that should be, and the system should be
responsible any upgrading to be done.

In fact, it's specifically *because* of many distros depending so
heavily on a particular version of Python that userspace Python apps
need more flexibility in this area.  /usr/bin/python is quite likely
going to be out-of-date before the system as a whole is (or in my case,
the other way around, as Gentoo moved to 2.5 before all my applications
had).  Either way, if they system Python and the userspace Python
requirements get out of sync, it's clearly the userspace that's going to
have to be flexible.  

> (That's also, by the way, why easy_install also always installs a 
> versioned executable name for itself.)

Actually, if easy_install did something like "#!/usr/bin/python2.4" I
think I'd have less of an issue.  It would allow me to upgrade the
system Python (which on Gentoo, for instance, you can safely do) while
allowing legacy apps to continue to function until they can be upgraded.
In fact, this would almost incidentally lead people down the right road
to fixing it the way you suggest since they will certainly have to
easy_install their required libraries under the new interpreter.

Regards,
Cliff



More information about the Distutils-SIG mailing list