Re: Fix for Python library path problem

2017-09-29 Thread Gary E. Miller via devel
Yo Eric! On Fri, 29 Sep 2017 14:47:27 -0400 "Eric S. Raymond via devel" wrote: > site.py won't do it. I didn't usggest that site.py was the answer. My suggestions was the commens in site.py lead to the answer. It adjusts the load path at Python startup > time, but only in accordance with sy

Re: Fix for Python library path problem

2017-09-29 Thread Eric S. Raymond via devel
Hal Murray : > > devel@ntpsec.org said: > > That's right. What we can do, though, is win under the following > > assumption: if /usr/lib/X/Y/ is in sys.path, so is /usr/local/lib/X/Y/. > > Look at this from my system: > > Bad assumption, at least on Fedora: > > Python 2.7.13 (default, Sep 5 2

Re: Fix for Python library path problem

2017-09-29 Thread Eric S. Raymond via devel
Fred Wright via devel : > Let's step back and look at what the actual requirements are. > > First of all, in order for an import to work in Python, the directory > containing the module needs to be in sys.path at the time of the import. > This requirement can be met in one of two ways: > > 1) Pla

Re: Fix for Python library path problem

2017-09-29 Thread Eric S. Raymond via devel
Fred Wright via devel : > > We constanlty have issues with conflicting system installed and user > > installed ntpd. it will be a lot of fun when the distro updates > > ntpd and breaks the user installed ntpd. That was not a problem > > before this patch. > > Interestingly enough, this last para

Re: Fix for Python library path problem

2017-09-28 Thread Gary E. Miller via devel
Yo Fred! On Thu, 28 Sep 2017 19:25:06 -0700 (PDT) Fred Wright via devel wrote: > Interestingly enough, this last paragraph is both completely > irrelevant to the issue at hand, and simultaneously gets to the crux > of the matter. :-) Always my intention . > The whole issue being discussed here

Re: Fix for Python library path problem

2017-09-28 Thread Fred Wright via devel
On Tue, 26 Sep 2017, Gary E. Miller via devel wrote (different thread): > On Tue, 26 Sep 2017 22:04:53 -0400 (EDT) > "Eric S. Raymond via devel" wrote: > > > 2. Keep Fred's patch. Ship 1.0 with FHS non-conformance as a known > >and documented bug. > > Gack. Opening a tech support nightmare.

Re: Fix for Python library path problem

2017-09-28 Thread Gary E. Miller via devel
Yo Hal! On Wed, 27 Sep 2017 23:50:51 -0700 Hal Murray via devel wrote: > Is the install location fixed at configure time, or can that be > specified at install time? None of the above. Packagers do it after the install to a temp location. RGDS GARY

Re: Fix for Python library path problem

2017-09-28 Thread Gary E. Miller via devel
Yo Hal! On Wed, 27 Sep 2017 23:35:23 -0700 Hal Murray wrote: > > Once again, I think pip has the answer: edit the sys.path. > > Why is editing sys.path better than using PYTHONPATH? Editing the config file that stores sys.path is persistent, and used by all python that uses that path. PYTH

Re: Fix for Python library path problem

2017-09-28 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 19:02:23 -0700 (PDT) Fred Wright via devel wrote: > First of all, in order for an import to work in Python, the directory > containing the module needs to be in sys.path at the time of the > import. This requirement can be met in one of two ways: Yup. > One of the

Re: Fix for Python library path problem

2017-09-27 Thread Hal Murray via devel
> 2.3) Add code to the programs to augment sys.path prior to the import. This > would need to be in all the programs; common code in a library would suffer > from a chicken-and-egg problem. The step that copies python code over to $build/main/... could do minor edits. There would be only one co

Re: Fix for Python library path problem

2017-09-27 Thread Hal Murray via devel
> Once again, I think pip has the answer: edit the sys.path. Why is editing sys.path better than using PYTHONPATH? -- These are my opinions. I hate spam. ___ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel

Re: Fix for Python library path problem

2017-09-27 Thread Hal Murray via devel
devel@ntpsec.org said: > That's right. What we can do, though, is win under the following > assumption: if /usr/lib/X/Y/ is in sys.path, so is /usr/local/lib/X/Y/. > Look at this from my system: Bad assumption, at least on Fedora: Python 2.7.13 (default, Sep 5 2017, 08:53:59) [GCC 7.1.1 2017

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Jason Azze : > On Sep 27, 2017 8:51 PM, "Eric S. Raymond via devel" > wrote: > > Gary E. Miller via devel : > > > I thought you just told me the opposite, > > > > Sorry if I was not clear the first time. > > > > > and I *know* Jason did. > > > > I sugggest you reconfirm with him. > > > > Re-readi

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Eric S. Raymond via devel wrote: > Gary E. Miller via devel : > > What we see that pip does, is edit the sys.path to include the > > location an egg is installed. That looks to me like a method > > to go forward with. > > It looks to me like a fscking disaster, introducing ye

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > What we see that pip does, is edit the sys.path to include the > location an egg is installed. That looks to me like a method > to go forward with. It looks to me like a fscking disaster, introducing yet another complication that will cause us endless headaches. Wha

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > > I thought you just told me the opposite, > > Sorry if I was not clear the first time. > > > and I *know* Jason did. > > I sugggest you reconfirm with him. > > Re-reading the emails I see a bunch of double negatives going around. Great. Now I don't think I know *a

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 16:31:12 -0700 (PDT) Fred Wright via devel wrote: > On Wed, 27 Sep 2017, Gary E. Miller via devel wrote: > > Fred Wright via devel wrote: > > > It only matters > > > for Linux, since get_python_lib() returns FHS-compliant results on > > > *BSD, and on OSX the

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Gary E. Miller via devel wrote: > Fred Wright via devel wrote: > It only matters > > for Linux, since get_python_lib() returns FHS-compliant results on > > *BSD, and on OSX the paths are so completely different that FHS > > doesn't apply. > > Uh, lost me. macOS is very mu

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 15:51:25 -0700 (PDT) Fred Wright via devel wrote: > On Wed, 27 Sep 2017, Gary E. Miller via devel wrote: > > > > What we see that pip does, is edit the sys.path to include the > > location an egg is installed. That looks to me like a method > > to go forward with.

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Gary E. Miller via devel wrote: > > What we see that pip does, is edit the sys.path to include the > location an egg is installed. That looks to me like a method > to go forward with. That sounds plausible, but we need to figure out how it does that. It's not just about "ed

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 17:40:56 -0400 "Eric S. Raymond" wrote: > Gary E. Miller via devel : > > Yo Eric! > > > > On Wed, 27 Sep 2017 17:21:23 -0400 > > "Eric S. Raymond via devel" wrote: > > > > > Fred Wright via devel : > > > > So *something* is adding additional entries to sys.pat

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 17:36:56 -0400 "Eric S. Raymond" wrote: > Gary E. Miller via devel : > > Yo Eric! > > > > On Wed, 27 Sep 2017 16:43:54 -0400 > > "Eric S. Raymond" wrote: > > > > > Gary E. Miller via devel : > > > > Except for your upcoming solution to the PYTHONPATH issue.

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > Yo Eric! > > On Wed, 27 Sep 2017 17:21:23 -0400 > "Eric S. Raymond via devel" wrote: > > > Fred Wright via devel : > > > So *something* is adding additional entries to sys.path in your > > > Ubuntu Python (but not mine). If there's a way to make that > > > happen, i

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > Yo Eric! > > On Wed, 27 Sep 2017 16:43:54 -0400 > "Eric S. Raymond" wrote: > > > Gary E. Miller via devel : > > > Except for your upcoming solution to the PYTHONPATH issue. > > > > Explain "the PYTHONPATH issue", please. > > I just installed git head. No PYTHONP

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 17:21:23 -0400 "Eric S. Raymond via devel" wrote: > Fred Wright via devel : > > So *something* is adding additional entries to sys.path in your > > Ubuntu Python (but not mine). If there's a way to make that > > happen, it could be another solution. I *don't* see a

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Fred Wright via devel : > So *something* is adding additional entries to sys.path in your Ubuntu > Python (but not mine). If there's a way to make that happen, it could be > another solution. I *don't* see any of that here (ubuntu 14.04, Python > 2.7.6), even though there are multiple packages wi

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Jason Azze via devel : > I checked CentOS 6.9 and CentOS 7.3 and, after I figured out I had to > import sys, I can confirm that the second expression comes back empty. Good to know, thanks. -- http://www.catb.org/~esr/";>Eric S. Raymond My work is funded by the Internet Civil Eng

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Fred Wright via devel : > > Doesn't it? Look at my example again. It looks a lot like somebody, either > > Python or Ubuntu's Python packagers, has gone to the effort to ensure that > > FHS-compliant library directories under /usr/local/lib exist in parallel > > with > > every system library dir

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 13:56:49 -0700 (PDT) Fred Wright via devel wrote: > So *something* is adding additional entries to sys.path in your Ubuntu > Python (but not mine). pip adds to the sys.path. Other package managers prolly do as well. RGDS GARY --

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Jason! On Wed, 27 Sep 2017 16:54:56 -0400 Jason Azze via devel wrote: > On Wed, Sep 27, 2017 at 4:19 PM, Eric S. Raymond via devel > wrote: > > > Just to be sure, though, people with access to other platforms - > > like Red Hat and FreeBSD - should run these checks in Python > > > [x

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Eric S. Raymond wrote: > Fred Wright via devel : > > FYI, I just took a look at sys.path on the three Linuces I have here > > (Ubuntu, CentOS, and Fedora), and none of them has a single entry with > > "local" as part of the path. > > I see this under Ubuntu: > > >>> [x for x i

Re: Fix for Python library path problem

2017-09-27 Thread Jason Azze via devel
On Wed, Sep 27, 2017 at 4:19 PM, Eric S. Raymond via devel wrote: > Just to be sure, though, people with access to other platforms - like Red Hat > and FreeBSD - should run these checks in Python > [x for x in sys.path if x.find('/usr/lib') != -1] > [x for x in sys.path if x.find('/usr/

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 13:45:30 -0700 (PDT) Fred Wright via devel wrote: > So most of the world elects to follow Python, not FHS. Uh, you misunderstood the FHS. None of those were source code tar balls you installed. Those are the system packages, right where they should be. The system

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 16:43:54 -0400 "Eric S. Raymond" wrote: > Gary E. Miller via devel : > > Except for your upcoming solution to the PYTHONPATH issue. > > Explain "the PYTHONPATH issue", please. I just installed git head. No PYTHONPATH: spidey ntpsec # ntpq -up ntpq: can't find P

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Eric S. Raymond wrote: > Fred Wright via devel : > > > > On Wed, 27 Sep 2017, Eric S. Raymond via devel wrote: > > > > > I've pushed a fix for Fred Wright's FixConfig class that seems to > > > solve the problem of incorrect Python library locations. > > > > > > I tested it wi

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > Except for your upcoming solution to the PYTHONPATH issue. Explain "the PYTHONPATH issue", please. -- http://www.catb.org/~esr/";>Eric S. Raymond My work is funded by the Internet Civil Engineering Institute: https://icei.org Please visit their site a

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 16:19:54 -0400 "Eric S. Raymond via devel" wrote: > I think we're done here. I'll add an explanatory comment to the > massage() logic. Except for your upcoming solution to the PYTHONPATH issue. RGDS GARY

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Fred Wright via devel : > FYI, I just took a look at sys.path on the three Linuces I have here > (Ubuntu, CentOS, and Fedora), and none of them has a single entry with > "local" as part of the path. I see this under Ubuntu: >>> [x for x in sys.path if x.find('local') != -1] ['/usr/local/lib/pytho

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Fred Wright via devel : > > On Wed, 27 Sep 2017, Eric S. Raymond via devel wrote: > > > I've pushed a fix for Fred Wright's FixConfig class that seems to > > solve the problem of incorrect Python library locations. > > > > I tested it with no --prefix option and with --prefix=/usr, > > using inst

Re: Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
Gary E. Miller via devel : > Yo Eric! > > On Wed, 27 Sep 2017 10:21:57 -0400 (EDT) > "Eric S. Raymond via devel" wrote: > > > Gary, please verify that this addresses your FHS concerns. > > Sort of. Looks like the python libs now installed in the right place, > again: > > /usr/local/lib64/pyth

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 10:59:53 -0700 (PDT) Fred Wright via devel wrote: > > I'm not sure about "obscure", but if the result isn't in sys.path, > > then it's back to the same old problem. > > FYI, I just took a look at sys.path on the three Linuces I have here > (Ubuntu, CentOS, and Fed

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Fred! On Wed, 27 Sep 2017 10:47:34 -0700 (PDT) Fred Wright via devel wrote: > AFAICT, Python simply doesn't follow FHS on Linux. Really? It does on Gentoo. Ditto debian, etc... RGDS GARY --- Gary E. Miller Rellim 109

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Fred Wright wrote: > On Wed, 27 Sep 2017, Eric S. Raymond via devel wrote: > > > I've pushed a fix for Fred Wright's FixConfig class that seems to > > solve the problem of incorrect Python library locations. > > > > I tested it with no --prefix option and with --prefix=/usr, >

Re: Fix for Python library path problem

2017-09-27 Thread Fred Wright via devel
On Wed, 27 Sep 2017, Eric S. Raymond via devel wrote: > I've pushed a fix for Fred Wright's FixConfig class that seems to > solve the problem of incorrect Python library locations. > > I tested it with no --prefix option and with --prefix=/usr, > using install --destdir=/tmp/ntp. > > Gary, please

Re: Fix for Python library path problem

2017-09-27 Thread Gary E. Miller via devel
Yo Eric! On Wed, 27 Sep 2017 10:21:57 -0400 (EDT) "Eric S. Raymond via devel" wrote: > Gary, please verify that this addresses your FHS concerns. Sort of. Looks like the python libs now installed in the right place, again: /usr/local/lib64/python2.7/site-packages/ntp/packet.py My first quick

Fix for Python library path problem

2017-09-27 Thread Eric S. Raymond via devel
I've pushed a fix for Fred Wright's FixConfig class that seems to solve the problem of incorrect Python library locations. I tested it with no --prefix option and with --prefix=/usr, using install --destdir=/tmp/ntp. Gary, please verify that this addresses your FHS concerns. Fred, please tell me