|
From: Jens V. <je...@zo...> - 2002-08-07 21:14:47
|
here's the traceback:: [dhcp182:src/python-ldap-HEAD/Demo] jens% python2.1 schema.py=20 ldap://waldorf.zope.com/dc=3Dvts,dc=3Dzope,dc=3Dcom Time elapsed search sub schema sub entry: 0.018 Traceback (most recent call last): File "schema.py", line 29, in ? subschemasubentry_entry =3D l.read_subschemasubentry_s( File "/usr/local/lib/python2.1/site-packages/ldap/ldapobject.py", = line=20 584, in read_subschemasubentry_s attrs File "/usr/local/lib/python2.1/site-packages/ldap/ldapobject.py", = line=20 422, in search_s return = self.search_st(base,scope,filterstr,attrlist,attrsonly,timeout=3D -1) File "/usr/local/lib/python2.1/site-packages/ldap/ldapobject.py", = line=20 425, in search_st msgid =3D self.search(base,scope,filterstr,attrlist,attrsonly) File "/usr/local/lib/python2.1/site-packages/ldap/ldapobject.py", = line=20 419, in search return=20 self._ldap_call(self._l.search,base,scope,filterstr,attrlist,attrsonly) File "/usr/local/lib/python2.1/site-packages/ldap/ldapobject.py", = line=20 95, in _ldap_call result =3D apply(func,args,kwargs) TypeError: argument 1 must be string, not None [dhcp182:src/python-ldap-HEAD/Demo] jens% the "error" is that this call on ldapobject.py line 557 "e =3D=20 ldap.cidict.cidict(r[0][1])" all of a sudden lowercases the key=20 "subschemaSubentry" from the original search result. so when the code=20 tries to determine the value of that key, and asks for the *camelcased*=20= version, it will get None back: "e.get('subschemaSubentry',[None])[0]"=20= because "e" only has a key "subschemasubentry". if "e" contains the=20 original camelcased key then the script continues successfully. jens On Wednesday, August 7, 2002, at 04:03 , Michael Str=F6der wrote: > Jens Vagelpohl wrote: >> i'm trying to run the Demo/schema.py script and steppping through it=20= >> with pdb there's an oddity i see, which prevents the script from = running=20 >> successfully: >> - ldapobject.py line 548 (in method search_subschemasubentry) a = search=20 >> is done on the passed-in DN to retrieve the value for the attribute=20= >> "subschemaSubentry". the search is successful and returns... >> [('dc=3Dvts,dc=3Dzope,dc=3Dcom', {'subschemaSubentry': = ['cn=3DSubschema']})] >> - in line 555 there is the following call: >> e =3D ldap.cidict.cidict(r[0][1]) (r is the result shown above) >> - at this point "e" has the following value: >> {'subschemasubentry': ['cn=3DSubschema']} (notice: = "subschemasubentry" is=20 >> all lowercase now) >> - now the problem is in line 556 in the call... >> search_subschemasubentry_dn =3D e.get('subschemaSubentry', [None])[] > > Yes, no problem since ldap.cidict.cidict is used. I wouldn't claim = that=20 > there is no bug. But I can't see a problem. > >> ... at this point the result is None and the script dies a little = later. > > "Dies a little later" is a little bit unspecific. Can you please = provide=20 > the traceback and mention which LDAP server you're using for testing? > > Ciao, Michael. > |