[gobolinux-users] $pythonpath

Lucas C. Villa Real lucasvr at gobolinux.org
Sat Feb 2 00:23:52 NZDT 2008


On Nov 28, 2007 12:16 PM, Jonas Karlsson <jonka750 at student.liu.se> wrote:
> > Perhaps the recursion is caused by a .pth file inside
> > /System/Links/Libraries/python2.5/site-packages/, but
> > site.py should already have code to prevent this.
> >
> I have made some experiments. Adding the 'import...' command
> to gobolinux.pth works as long as it is present only in the
> Python /Programs directory. But when I symlink it into
> /S/L/L/python2.5/site-packages I get infinite recursion as
> well.
>
> I've looked at the code in site.py and it has a 'if sitepath
> in known_paths :' check, but only for appending the sitepath
> to path. It still tries to process *.pth files in sitepath,
> leading to the recursion. By indenting the following block,
> handling the *.pth files this does not happen and the
> addition to gobolinux.pth works. I've attached a diff with
> the change. However this change changes the behaviour so
> known paths can't be added as sitedirs, as it will be a
> known path. Adding the 'import...' before the paths or just
> not declaring the path beside the addsitedir(foo) works
> around this issue. Maybe there's a better solution?

Resurrecting this thread after a talk to Jonas on IRC.. I've tested
this patch after a problem with gobject.py and it works fine. However,
compiling python with prefix set to /usr (/System/Index in the future)
will probably do the job as well, and is a more general fix to the
problem.

I just don't have the time to hack on Python's recipe right now, but I
can certainly test it if someone provides one.

-- 
Lucas
powered by /dev/dsp


More information about the gobolinux-users mailing list