gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Python Shebang Lines


From: Fred Wright
Subject: Re: [gpsd-dev] Python Shebang Lines
Date: Tue, 27 Dec 2016 15:02:07 -0800 (PST)

On Tue, 27 Dec 2016, Gary E. Miller wrote:
> On Tue, 27 Dec 2016 14:14:38 -0800 (PST)
> Fred Wright <address@hidden> wrote:
>
> > At one point, Eric said that he thought that it was rare for people to
> > have multiple Python versions installed, but I think that's likely to
> > become a lot less true with the advent of Python 3.
>
> Gentoo by default installs Python 2 and Python 2.  The eselect commmand
> the configures which one /usr/bin/python goes to.

Presumably you mean Python2 and Python 3.

Yes, and changing that selection after you've installed any required
third-party add-ons will break anything that depends on those add-ons and
doesn't have a shebang line tying it to the proper version.

> > Python 3 is
> > sufficiently incompatible with Python 2 that it will probably be quite
> > some time before it's reasonable to have *only* Python 3 installed.
>
> OTOH, gpsd should not care at all which is the running Python.  ntpsec
> has no issuses with that.

I think I explained in quite a bit of detail why multi-version
compatibility is not the same thing as not caring which version is
*currently* in use.

> > For shebang purposes, this gets expanded a bit, to handle both
> > absolute and PATH-relative values appropriately:
>
> All of ntpsec does this:
>
> #!/usr/bin/env python
>
> It runs on everything we have tried it on.  gpsd should do the same.

Unless it uses nothing but standard Python libraries, I think you'll find
that "runs on everything" just means that you haven't tried enough cases.
:-) I've been burned two different ways by this issue.

In any case, what I've currently implemented doesn't *require* non-generic
shhebang lines; it simply provides a mechanism to have them without
requiring the user or packaging system to know what needs to be patched.

BTW, I looked at what SCons itself does on a variety of platforms, and
found that Linux is the *only* platform where it uses generic shebang
lines, and even that will have to change on any distro where the default
Python is Python 3.

Fred Wright



reply via email to

[Prev in Thread] Current Thread [Next in Thread]