[Zope-Perl] Loading perl modules from python

Gisle Aas gisle@ActiveState.com
24 May 2000 10:49:21 +0200


"David Ascher" <DavidA@activestate.com> writes:

> > -		       RTLD_LAZY);
> > -	handle = dlopen(pathname, RTLD_LAZY);
> > +		       RTLD_LAZY | RTLD_GLOBAL);
> > +	handle = dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
> 
> This is an issue which comes up periodically, and my birds-eye view is that
> the switch gets toggled back and forth every six months or so...

Good.  At least I was on the right track then.

> > The bad thing with this approach is that we get the flag set for all
> > modules loaded by python, which probably imply that more name
> > conflicts occur.
> 
> Likely...
> 
> > It also seems like an unlikely patch to get adopted
> > for the official python.
> 
> ... for the reason in the preceding line...
> 
> I know that the current state of that line is not accidental, and that
> RTLD_GLOBAL _has_ been discussed in the past.  Probably worth scanning the
> archives, although it's probably pre-python-dev (in other words, deja.com is
> your friend).

I tried to search, but I did not find any previous messages on this
related to python.

> > Can anybody see a nice way to get selective
> > RTLD_GLOBAL for different 'imports' in python?  Or is there another
> > way to make this work?
> 
> I can't think of one, outside of setting a new flag in the sys module which
> would be looked up in the function you patched and decided at runtime
> whether to go RTLD_GLOBAL or not.
> 
> Ugh.

True.

--Gisle