Menu

#48 timeval options do not have symmetric set/get

None
closed
nobody
None
5
2017-12-04
2009-08-17
No

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)

Discussion

  • Petr Viktorin

    Petr Viktorin - 2017-12-04
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.