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

Michael Ströder michael at
Mon May 1 12:29:59 CEST 2006

Fernando Ribeiro wrote:
>>>    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.
> It return true to all objectClasses.
> With others atribute (except objectClass) it work fine.
> I have tested with C too, and it return the same result.

Can you please post the LDAP filter strings you tested with?

Can you reproduce the same results with OpenLDAP's command-line tool
ldapcompare? If yes, please discuss the question on the
OpenLDAP-Software mailing list (see
detailing your tests.

>    Exists other way to compare entries?

What exactly do you mean with comparing entries? Please describe in
slightly more detail what you are trying to achieve.

You can off course simply retrieve entries with a search request and
compare attributes in your Python application.

Ciao, Michael.

More information about the python-ldap mailing list