gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] GPSD and the Python 3 transition


From: Eric S. Raymond
Subject: [gpsd-users] GPSD and the Python 3 transition
Date: Tue, 22 Mar 2016 13:24:39 -0400 (EDT)

The Python 3 transition is upon us. Fedora rawhide is switching to
Python 3 as its 'python' default.

Fortunately, in response to similar issues around reposurgeon, Peter
Donis and I have written up a relatively simple set of code
transformations that allows Python code to run 'polyglot', that is
not caring whether its interpreter is Python 2 or Python 3

You can read the HOWTO at

http://www.catb.org/esr/faqs/practical-python-porting/

I have applied this method to most of the GPSD Python code and tested
the results.  A couple of minor tweaks remain to be done, and there is
one significant problem; I can't verify that xgps or xgpsspeed work
under Python 3 because on Ubuntu there are no 3.x packages for gobject
or pygtk under Ubuntu.

If you are a dev or user running a distro that has such packages,
please try changing the shebang line in these scripts to invoke
Python 3 and testing them.  They ought to just work (I know the gps
client library is good under 3) but I want to verify that.  Then we
could change the shebang line to invoke python (rather than python2)
and not care what it finds.

This does mean the floor Python version we can use is now 2.7; 2.6
is not compatible enough with 3.x for my polyglot trickery to work.

Current state of the Python code:

gegps, gpscap.py, gpsfake, leapsecond.py, gps/*, maskaudit.py - OK under 2 or 3.

jsongen.py, valgrind_audit.py - not ported yet.  Not expected to be difficult.

gpscat, test_maidenhead.py - don't work yet under Python 3, apparently
due to the clienthelpers C module not being installed where Python 3
can see it. Probably needs a build-recipe tweak.

xgps, xgpsspeed - have the gobject/pygtk issue.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

Freedom begins between the ears.        -- Edward Abbey



reply via email to

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