From: <mi...@st...> - 2007-02-25 13:01:19
|
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=an...@en...? > [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=an...@en...?' >>> ldap_url=ldapurl.LDAPUrl(u) >>> ldap_url.attrs [u'uid'] Ciao, Michael. |