ReconnectLDAPObject doesn't reconnect after main failure

Michael Ströder michael at
Fri Jan 26 23:44:05 CET 2007

Alain Spineux wrote:
> When testing ReconnectLDAPObject I found a bug.
> The object doesn't reconnect after a main failure !
> [..]
> I thing the main probleme is here !
> Look !

Yes, I can reproduce your observation. Thanks for pointing it out.

> l=ldap.ldapobject.ReconnectLDAPObject(ldap_url.initializeUrl())
> print 'search', l.search_s(ldap_url.dn, ldap.SCOPE_SUBTREE, "(objectClass=*)")
> this work too ! And don't give any error while their is no bind !
> work like if l.simple_bind_s('', '') where used just before the search !

Yes, this works as intended in LDAPv3. In opposite to LDAPv2 you MAY
send a LDAP request without prior bind request.

> I wrote a patch but this is only a workaround that detect the main
> failure, set a flag and force a reconnect before any request if the
> flag is set.

Where's the patch? Can't figure out why it does not send the formerly
sent bind request. It has all the data around. And if you take the
server down it will re-send the bind request.

Ciao, Michael.

More information about the python-ldap mailing list