LDAP Polling

Yeargan Yancey yancey at unt.edu
Tue Jan 29 16:36:22 CET 2008


Hmm. That only moved the exception.

   File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line  
421, in result3
     rtype, rdata, rmsgid, serverctrls = ldap_result
ValueError: need more than 3 values to unpack

I put the statement above into a try..except block and checked the  
value when the exception occurs. This line

ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)

assigns (None,None,None) to ldap_result, a 3-tuple instead of a 4-tuple.

Once data becomes available from the LDAP server, then it returns a 4- 
tuple as expected.

Yancey



On Jan 29, 2008, at 2:48 AM, Michael Ströder wrote:

> Yeargan Yancey wrote:
>>
>> I am trying to use the asynchronous LDAP polling feature and have a
>> question about what appears to be a timing issue. When I run the code
>> below, I find that I must insert a sleep() before entering the while
>> loop or I get a ValueError exception.
>> [..]
>>   File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line  
>> 415,
>> in result3
>>     rtype, rdata, rmsgid, serverctrls =
>> self._ldap_call(self._l.result3,msgid,all,timeout)
>> ValueError: need more than 3 values to unpack
>
> Hmm, this should never happen. I guess it's caused by _ldap.result3()
> returning NULL for the situation where no result was received at  
> all. I
> will look into it.
>
> In the meantime try if the patch to LDAPObject.py attached solves your
> problem.
>
> Ciao, Michael.<valueerror_in_result3.patch>





More information about the python-ldap mailing list