When setting OPT_TIMEOUT or OPT_NETWORK_TIMEOUT options, you can specify a negative number which is converted to a NULL timeval pointer internally.
However, when getting the same options, a NULL is turned into the None object (and not a negative number).
There should be some symmetry here for people (like me) who assume they can write code like this:
saved_val = _ldap.get_option(_ldap.OPT_TIMEOUT)
try:
_ldap.set_option(_ldap.OPT_TIMEOUT, 1000)
...
finally:
_ldap.set_option(_ldap.OPT_TIMEOUT, saved_val)
I opened this issue on GitHub: https://github.com/python-ldap/python-ldap/issues/95