More Python quirks
Hal Murray
hmurray at megapathdsl.net
Sat Nov 19 07:55:24 UTC 2016
Background for Devel...
I mostly work with Fedora. It's default python search path (sys.path)
doesn't include /usr/local/lib/python2.7/site-packages where our libraries
get installed.
Things mostly work if you run
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
I don't know how to set up cleanly. If I put it in my .bashrc, it doesn't
work for root. Maybe it should go in /etc/profile.d/ Mumble. But that's
not the current problem.
--------
I'm getting confused again (still?). It may be simple, but not until I know
the answer.
I was trying to fix the version string so that the one from ntpq would match
the one from ntpd.
It seemed to ignore my edits.
I put a "barf" in the new code to make sure I was getting there. It didn't
go off.
I think the problem was that it finds the compiled stuff off in
$build/main/pylib, but can't find the source do do a check, so it runs the
old compiled versions. That was because I didn't run waf build 'cause I
didn't think I needed it. I expected python to automagically rebuild the
compiled versions. Will that get fixed if you add a sym link back to the
source?
After waf build, I got this.
[murray at glypnod ntpq]$ ./ntpq --version
Traceback (most recent call last):
File "./ntpq", line 34, in <module>
version = ntp.util.stdversion()
File "/usr/local/lib/python2.7/site-packages/ntp/util.py", line 16, in
stdversion
def stdversion():
NameError: global name 'barf' is not defined
[murray at glypnod ntpq]$
Note that the traceback printout is finding the installed source rather than
the local version with the "barf" in it.
--
These are my opinions. I hate spam.
More information about the devel
mailing list