python-ldap, compare_s() return only true in all cases

Michael Ströder michael at
Sat Apr 29 18:53:32 CEST 2006

Fernando Ribeiro wrote:
>    I'm studing the python, and begin with python-ldap. But i have a
> little problem with ldap.compare_s(dn, attr, value) function.

Please subscribe and post to python-ldap-dev list (Cc:-ed).

>    While using ldap_slave.compare_s("dc=domain,dc=com,dc=br",
> "objectClass", "top");
>    It return true.
>    But look in ldap_slave don't have the 'objectClass: top'.

Every structural object class is implicitly derived from 'top'. So I'd
expect this to evaluate to True each time.

What exactly are you trying to achieve?

Could you please verify with another attribute?

Ciao, Michael.

More information about the python-ldap mailing list