Modify

Opened 8 years ago

Closed 8 years ago

#12995 closed defect (fixed)

UnicodeEncodeError: 'ascii' codec can't encode characters

Reported by: mazzibig@… Owned by: bebbo
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

When try to list users in Admin Panel and 'dir_basedn' contains ou with not latin chars (example:dir_basedn = OU=Энергомаш,DC=foo,DC=bar we accept exсeption

Файл "D:/sapr/webserver/Python/lib/site-packages/trac/web/main.py", строка 613, в _dispatch_request
  dispatcher.dispatch(req)
Файл "D:/sapr/webserver/Python/lib/site-packages/trac/web/main.py", строка 253, в dispatch
  resp = chosen_handler.process_request(req)
Файл "D:/sapr/webserver/Python/lib/site-packages/trac/admin/web_ui.py", строка 108, в process_request
  provider.render_admin_panel(req, cat_id, panel_id, path_info)
Файл "build/bdist.win32/egg/acct_mgr/admin.py", строка 219, в render_admin_panel
  return self._do_users(req)
Файл "build/bdist.win32/egg/acct_mgr/admin.py", строка 691, в _do_users
  filters)))
Файл "build/bdist.win32/egg/acct_mgr/admin.py", строка 48, в fetch_user_data
  for username in acctmgr.get_users():
Файл "build/bdist.win32/egg/acct_mgr/api.py", строка 251, в get_users
  users.extend(store.get_users())
Файл "build/bdist.win32/egg/tracext/dirauth/auth.py", строка 152, в get_users
  to_utf8(self.name_attr)])
Файл "build/bdist.win32/egg/tracext/dirauth/auth.py", строка 721, в _ldap_search
  msgid = context.search_ext(base, scope, filterstr, attrlist, 0, [lc], None, -1, sz);
Файл "D:/sapr/webserver/Python/lib/site-packages/ldap/ldapobject.py", строка 586, в search_ext
  timeout,sizelimit,
Файл "D:/sapr/webserver/Python/lib/site-packages/ldap/ldapobject.py", строка 106, в _ldap_call
  result = func(*args,**kwargs)

DirectoryAuthPlugin from 2.1.0-SNAPSHOT

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by bebbo

In 16084:

refs #12995

  • improved utf8 handling.

Some notes:

  1. only lower case DNs will work:

wrong:
dir_basedn = OU=Энергомаш,DC=foo,DC=bar
correct:
dir_basedn = OU=энергомаш,DC=foo,DC=bar

  1. group_expand = 1 will lead to "Genshi UnicodeDecodeError..." if invoking "http://host/trac/admin/general/perm" since the trac templates do not handle unicode correctly.

comment:2 Changed 8 years ago by bebbo

In 16085:

refs #12995

  • added a way to avoid the ""Genshi UnicodeDecodeError..."

comment:3 Changed 8 years ago by anonymous

My tests is successful. Working with capital chars in dir_basedn

comment:4 Changed 8 years ago by bebbo

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bebbo.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.