utf8 in LDAP authentication names breaks stuff

Issue #315 wontfix
Former user created an issue

Error - <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xe4 in position 1: ordinal not in range(128)

URL: http://127.0.0.1:5000/_admin/users

File '/usr/lib/python2.6/site-packages/weberror/errormiddleware.py', line 162 in call app_iter = self.application(environ, sr_checker)

File '/usr/lib/python2.6/site-packages/RhodeCode-1.2.3-py2.6.egg/rhodecode/lib/middleware/simplegit.py', line 106 in call return self.application(environ, start_response)

File '/usr/lib/python2.6/site-packages/RhodeCode-1.2.3-py2.6.egg/rhodecode/lib/middleware/simplehg.py', line 71 in call return self.application(environ, start_response)

File '/usr/lib/python2.6/site-packages/beaker/middleware.py', line 152 in call return self.wrap_app(environ, session_start_response)

File '/usr/lib/python2.6/site-packages/routes/middleware.py', line 131 in call response = self.app(environ, start_response)

File '/usr/lib/python2.6/site-packages/pylons/wsgiapp.py', line 107 in call response = self.dispatch(controller, environ, start_response)

File '/usr/lib/python2.6/site-packages/pylons/wsgiapp.py', line 312 in dispatch return controller(environ, start_response)

File '/usr/lib/python2.6/site-packages/RhodeCode-1.2.3-py2.6.egg/rhodecode/lib/base.py', line 52 in call return WSGIController.call(self, environ, start_response)

File '/usr/lib/python2.6/site-packages/pylons/controllers/core.py', line 211 in call response = self._dispatch_call()

File '/usr/lib/python2.6/site-packages/pylons/controllers/core.py', line 162 in _dispatch_call response = self._inspect_call(func)

File '/usr/lib/python2.6/site-packages/pylons/controllers/core.py', line 105 in _inspect_call result = self._perform_call(func, args)

File '/usr/lib/python2.6/site-packages/pylons/controllers/core.py', line 57 in _perform_call return func(**args)

File '/usr/lib/python2.6/site-packages/RhodeCode-1.2.3-py2.6.egg/rhodecode/controllers/admin/users.py', line 67 in index return render('admin/users/users.html')

File '/usr/lib/python2.6/site-packages/pylons/templating.py', line 243 in render_mako cache_type=cache_type, cache_expire=cache_expire)

File '/usr/lib/python2.6/site-packages/pylons/templating.py', line 218 in cached_template return render_func()

File '/usr/lib/python2.6/site-packages/pylons/templating.py', line 240 in render_template return literal(template.render_unicode(**globs))

File '/usr/lib/python2.6/site-packages/mako/template.py', line 311 in render_unicode as_unicode=True)

File '/usr/lib/python2.6/site-packages/mako/runtime.py', line 660 in render **_kwargs_for_callable(callable, data))

File '/usr/lib/python2.6/site-packages/mako/runtime.py', line 692 in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)

File '/usr/lib/python2.6/site-packages/mako/runtime.py', line 713 in _exec_template _render_error(template, context, e)

File '/usr/lib/python2.6/site-packages/mako/runtime.py', line 722 in _render_error result = template.error_handler(context, error)

File '/usr/lib/python2.6/site-packages/mako/runtime.py', line 711 in exec_template callable(context, args, *kwargs)

File '/var/www/rhodecode/data/templates/base/root.html.py', line 62 in render_body __M_writer(escape(next.body()))

File '/var/www/rhodecode/data/templates/base/base.html.py', line 160 in render_body __M_writer(escape(next.main()))

File '/var/www/rhodecode/data/templates/admin/users/users.html.py', line 108 in render_main __M_writer(escape(user.lastname))

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 1: ordinal not in range(128)

This happens when someone with scandinavian letters in their lastname logins the first time with their LDAP account to Rhodecode. How fix it? Cannot view users or add new ones until it is fixed..

Comments (2)

  1. Marcin Kuzminski repo owner

    That should not happen firstname and lastname are converted to unicode BEFORE creating an ldap user inside rhodecode. How does this user look in database ?

    Are you sure you are using utf8 ?

  2. Log in to comment