[python-ldap] violation of exception arguments

Space One space at wechall.net
Fri Jul 3 11:07:15 CEST 2015


Hello,

The documentation of the LDAPError exception base class tells that the
arguments is a dict which might contain the keys 'info', 'dict', 'matched'.
http://python-ldap.org/doc/html/ldap.html#exceptions

This documentation is violated in the following places:

controls/__init__.py
138:        raise ldap.UNAVAILABLE_CRITICAL_EXTENSION('Received
unexpected critical response control with controlType %s' %
(repr(controlType)))

ldapobject.py
679:           raise ldap.TIMEOUT(
680:             "LDAP time limit (%d secs) exceeded." % (timeout)
681:           )

ldap.__version__ == 2.4.10

When unbinding twice the following exception happens which also doesn't
contain a dict:
>>> c = ldap.ldapobject.ReconnectLDAPObject('')
>>> c.unbind()
>>> c.unbind()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 590,
in unbind
    return self.unbind_ext(None,None)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 581,
in unbind_ext
    return
self._ldap_call(self._l.unbind_ext,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99,
in _ldap_call
    result = func(*args,**kwargs)
ldap.LDAPError: LDAP connection invalid

Best regards
spaceone


More information about the python-ldap mailing list