Opened 10 years ago

Last modified 7 years ago

#11531 closed defect

Cannot authenticate with accented chars — at Initial Version

Reported by: anonymous Owned by: Nikolaos Papagrigoriou
Priority: normal Component: TracLdapAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

If there is an accented char (like ò) in the login field, the authentication fails with the following error (see the last row):

Trac[store] DEBUG: LDAPAuth: Unexpected error: Traceback (most recent call last):

File "build/bdist.linux-x86_64/egg/ldapauth/store.py", line 69, in check_password

bind_cn = self._search_user(conn, user)

File "build/bdist.linux-x86_64/egg/ldapauth/store.py", line 129, in _search_user

self.search_filter % user)

File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 516, in search_s

return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)

File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 509, in search_ext_s

msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)

File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 505, in search_ext

timeout,sizelimit,

File "/usr/lib/python2.6/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call

result = func(*args,kwargs)

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf2' in position 39: ordinal not in range(128)

May be a solution could be to encode('utf-8')? http://stackoverflow.com/questions/1652904/unicodeencodeerror-ascii-codec-cant-encode-character

If this cannot be fixed in the TracLdapAuthPlugin code, what can be done to avoid this issue? Thanks

Change History (0)

Note: See TracTickets for help on using tickets.