I recently switched to latest version from 2.0.4 and i found a major
change in result()'s behaviour:
[snip]
$ python
Python 2.3.5 (#2, Nov 20 2005, 16:40:39)
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap
>>> l = ldap.initialize('ldap://minotest.si.unimib.it')
>>> l.simple_bind('cn=admin,dc=taz', 'canegiallo')
1
>>> l.result(1,1,0)
(97, [])
>>> l.result(1,1,0)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "ldap/ldapobject.py", line 405, in result
res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
File "ldap/ldapobject.py", line 409, in result2
res_type, res_data, res_msgid, srv_ctrls =
self.result3(msgid,all,timeout)
File "ldap/ldapobject.py", line 415, in result3
rtype, rdata, rmsgid, serverctrls =
self._ldap_call(self._l.result3,msgid,all,timeout)
ValueError: unpack tuple of wrong size
[/snip]
btw, i'm glad to do some debug on my apps, that apparently polls to much
<g>, but i think it's broken.
At line 415, i see:
rtype, rdata, rmsgid, serverctrls =
self._ldap_call(self._l.result3,msgid,all,timeout)
but in LDAPObject.c :
if (res_type == 0) {
/* Polls return (None, None, None); timeouts raise an exception */
if (timeout == 0)
return Py_BuildValue("(OOO)", Py_None, Py_None, Py_None);
else
return LDAPerr(LDAP_TIMEOUT);
}
that doesn't match python code. So is maybe sufficient to patch this
file the way i attached (but i'll write maybe some more extensive test,
python-ldap is critical for a lot of our applications).
TIA,
--
Alessandro Ogier <ale...@un...>
gpg --keyserver pgp.mit.edu --recv-keys EEBB4D0D
Universita` degli Studi di Milano - Bicocca
Sistemi Informativi
Via Cozzi 53 - I 20125 Milano Italy
Tel. +39 02 6448 5526
|