peculiar problem

Michael Ströder michael at stroeder.com
Sun Feb 25 14:00:51 CET 2007


Anil Jangity wrote:
> (thanks for all the help in my previous posts)
> 
> Hi,
> 
> I am seeing a peculiar problem in this area of the code. I don't know
> exactly how to reproduce it. It almost like I have to wait a while and
> I see this problem.
> 
> url = ''.join((self.server, base, '?', attr, '?', scope, '?', filter, '?'))
> try:
>     print url
>     ldap_url = ldapurl.LDAPUrl(url)
>     print ldap_url.attrs
>     print attr
> except ValueError:
>     print "Bad URL"
> 
> The output is:
> 
> ldap://somehost.com:389/ou=People, o=entic.net?uid?one?mail=anilj at entic.net?
> [u'uid']
> uid
> Error - <type 'exceptions.TypeError'>: ('expected string in list', u'uid')

I can't reproduce the error since you didn't provide enough code.

But this simply works regarding module ldapurl:

>>> u=u'ldap://somehost.com:389/ou=People,
o=entic.net?uid?one?mail=anilj at entic.net?'
>>> ldap_url=ldapurl.LDAPUrl(u)
>>> ldap_url.attrs
[u'uid']

Ciao, Michael.



More information about the python-ldap mailing list