|
From: Derrick 'd. H. <dm...@dm...> - 2002-06-29 17:41:44
|
On Sat, Jun 29, 2002 at 04:32:52PM +0200, Michael Str=F6der wrote:
| Derrick 'dman' Hudson wrote:
| >- pmsg =3D Py_None;
| >+ pmsg =3D LDAPmessage_to_python( self->ldap, msg );
| >It really does help to not ignore the data that's returned :-).
|=20
| Oh, yes.
|=20
| >I haven't thoroughly tested it
|=20
| You already noticed the issues with web2ldap.
Yep. I was beating myself over the head last night trying to figure
out the right type to return.
| One has to fix two other parts of python-ldap for this patch to work
| with web2ldap.
Ahh.
=20
| I've checked in Modules/LDAPObject.c Lib/ldap/ldapobject.py=20
| Lib/ldap/async.py. Now the C module's result() is directly wrapped=20
| and LDAPObject.c contains the fix above.
I see now :
def search_st(...)
- return self.result(msgid,all=3D1,timeout=3Dtimeout)
+ return self.result(msgid,all=3D1,timeout=3Dtimeout)[1]
=20
That's precisely what I kept running into -- the line
ldap_result[0][1]
_sometimes_ wasn't getting the right element. I thought the result
function wasn't returning the right value (it needed another layer of
list nesting), but when I would add the extra list some other parts
wouldn't work! That certainly explains it :-).
| I guess I will add a derived class for the non-blocking version of=20
| LDAPObject.result(). So everyone will be free to choose.
Isn't that what 'timeout=3D0' is for? I also think the C function needs
to be modified to treat Py_None as NULL to allow python code to
specify a timeout that is indefinitely long.
-D
--=20
"GUIs normally make it simple to accomplish simple actions and
impossible to accomplish complex actions."
--Doug Gwyn (22/Jun/91 in comp.unix.wizards)
=20
http://dman.ddts.net/~dman/
|