Local Error in simple_bind_s();

Michael Ströder michael at stroeder.com
Thu Dec 20 12:19:10 CET 2007

Leons Petrazickis wrote:
> Michael Ströder <michael at stroeder.com> wrote on 18/12/2007 05:05:16 PM:
>> Leons Petrazickis wrote:
>>> I've installed Thorsten Kurbad's python_ldap-2.3.1-py2.4-linux-i686.egg
> on
>>> my Python 2.4 install
>> Which OS? Which Linux distribution? Which OpenLDAP libs?
> I was using:
> Ubuntu 7.10 with Linux kernel 2.6.22-14-386
> OpenLDAP 2.3.35-1ubuntu0.1
> libsasl2 2.1.22.dfsg1-9ubuntu2
> Python 2.4.4-6ubuntu4
 > Just now, I installed:
 > OpenLDAP 2.3.39

Well, I simply don't know whether Thorsten's egg file is really binary 
compatible with your system. That's why I always recommend to build from 
source when strange issues arise.

> This command worked fine:
> ldapsearch -h bluepages.ibm.com -P 2 -x -b "ou=bluepages,o=ibm.com" -s sub
> "(sn=Leon)" cn tieline

Ok. Just for the records: What kind of LDAP server product is this? Is 
LDAPv3 connect definitely not possible?

> I then compiled a custom copy of python-ldap 2.3.1. I got these warnings
> during compilation:
> file Lib/ldap.py (for module ldap) not found
> file Lib/ldap/schema.py (for module ldap.schema) not found

Yes, ignore it.

http://python-ldap.sourceforge.net/faq.shtml item 6

> It compiled and installed without fatal errors. However, it now crashes
> very differently:
> Traceback (most recent call last):
>   File "test.py", line 10, in ?
>     ldap.set_option(ldap.OPT_DEBUG_LEVEL,4095)
>   File
> "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.egg/ldap/functions.py",
>  line 126, in set_option
>     _ldap_function_call(_ldap.set_option,option,invalue)
> AttributeError: 'module' object has no attribute 'set_option'
> Should I go back to the prebuilt .egg?

No. I'd rather recommend to really remove the stuff from the formerly 
installed egg file since that's what the path above look like. Closely 
examine your /usr/lib/python2.4/site-packages and rm everything which 
looks like the egg files and these python-ldap files:

Then go into the directory where you built the source distribution and 
invoke as root:

python setup.py install

>> If on Linux could you please check with ldd
>> <path-to-site-packages>/_ldap.so which OpenLDAP libs are actually used.
> With Ubuntu's OpenLDAP:
> [..]
> With custom OpenLDAP:

??? Did you install OpenLDAP 2.3.39 in a different prefix?
Beware you have to adjust parameters library_dirs and include_dirs in 
setup.cfg then when building python-ldap from source.

Ciao, Michael.

More information about the python-ldap mailing list