|
From: <mi...@st...> - 2007-02-26 23:55:14
|
Anil Jangity wrote:
> I notice this in other areas of my code as well.
>
> Here is a trace of a modify:
>
> *** ldap://host:389 - SimpleLDAPObject.modify_ext (('cn=Shilpa J,
> uid=anilj, ou=People, o=entic.net', [(0, 'mail',
> [u'shi...@so...'])], None, None),{})
> Error - <type 'exceptions.TypeError'>: ('expected a string in the
> list', u'shi...@so...')
>
>
> The problem is, it seems work on and off. When the modifications or
> searches are done without the unicode string, it works. But later
> when I try to do the same thing again for some reason it trys to do
> the LDAP operation using unicode lists: [u'abc']
>
> Thats when it fails.
You have to pass solely raw strings to python-ldap since the API does
not handle Unicode strings automatically.
u'shi...@so...'.encode('utf-8')
Ciao, Michael.
|