[python-ldap] whoami_s() result

Dusan Stefanik stefanik at dsx.cz
Thu Feb 21 17:01:34 CET 2013


Hi,

I discovered some odd behaviour with whoami_s().
###
import ldap

l = ldap.ldapobject.SimpleLDAPObject('ldap://localhost')
l.bind_s('uid=dusan,ou=users,dc=example,dc=com','asdfg')
l.unbind_s()
l.whoami_s()


## result
python: whoami.c:68: ldap_whoami: Assertion `(
(ld)->ldc->ldc_options.ldo_valid == 0x2 )' failed.
Aborted


###

In documentation unbind_s():

Further invocation of methods on the object will yield an exception.

But as I discovered... exception in C module thus I can't catch
exception(?).

Calling another function raise: ldap.LDAPError: LDAP connection invalid


Thanks

Dusan



More information about the python-ldap mailing list