Thanks to visit codestin.com
Credit goes to github.com

Skip to content

timeval options do not have symmetric set/get  #95

Closed
@encukou

Description

@encukou

Issue description:

Infinite timeout is set using a negative number, but turns into None when retreived.
Setting timeout to None leads to an internal error.

>>> import ldap
>>> conn = ldap.initialize('https://example.com')
>>> conn.set_option(ldap.OPT_NETWORK_TIMEOUT, -1)
>>> print(conn.get_option(ldap.OPT_NETWORK_TIMEOUT))
None
>>> conn.set_option(ldap.OPT_NETWORK_TIMEOUT, None)
Traceback (most recent call last):
  ...
SystemError: <built-in method set_option of LDAP object at 0x7f943715dd78> returned a result with an error set

Operating system: Fedora
Python version: 3.6.3
python-ldap version: 3.0.0b1
Imported from https://sourceforge.net/p/python-ldap/bugs/48/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions