From: Michael <mi...@st...> - 2000-10-10 16:36:52
|
Konstantin Chuguev wrote: > > The problem is that python-ldap assumes ldap_result() returns, like > ldap_search() and many other C LDAP API functions, an LDAP error code, > which is wrong, according to the API. > [..] > To check if there was an LDAP error while > processing an asynchronous request, one needs to call int > ldap_result2error(LDAP *ld, LDAPMessage *res, int freeit) after > ldap_result(). You're right. > result_type = ldap_result( self->ldap, msgid, all, tvp, &msg > ); > result = ldap_result2error( self->ldap, msg, 0 ); > > ... but the drawback is that in this case the result type variable is > getting hidden to a python caller. No drawback since we have exceptions! :-) Look at the lines following the ldap_result() call: if (result == -1) return LDAPerror( self->ldap, "ldap_result" ); etc. I think this should raise an exception. IMHO David planned to do it right but forgot to call ldap_result2error() function. Ciao, Michael. |