Building python-ldap with libldap_r (was: defect)

Michael Ströder michael at stroeder.com
Mon Jul 1 16:03:46 CEST 2002


Michael Ströder wrote:
> 
> libs = ldap_r ldap lber sasl

libldap_r allows finer-grained locking for each LDAPObject 
instance. I've checked in a new ldap/__init__.py and 
ldap/ldapobject.py which allows to use separate Lock instances for 
global function calls into LDAP lib and for each LDAPObject 
instance created.

At the moment you have to create a LDAPObject instance directly 
for using that (not through ldap.open() or ldap.initialize()).

Example:

l = ldap.ldapobject.LDAPObject('ldap://www.openldap.org',ldap_r=1)

Also there's a more elegant fall-back if the Python installation 
used has no thread support (translates to import threading failed).

Please read the changed source and comment!
Please try to build a python-ldap with libldap_r and test!
Also test with Python without thread support!

Ciao, Michael.






More information about the python-ldap mailing list