Fwd: Error when registering a user with a non ASCII character

Angel Ezquerra angel.ezquerra at gmail.com
Tue Feb 16 07:41:45 UTC 2016


Hi,

one of my users tried to register into our Kallithea server. His last
name contains a non ASCII character (é, i.e. an accented e). This
resulted in the following error (which I have redacted a bit to avoid
leaking personal info). The relevant part seems to be the
"('lastname', 'Jim\xc3\xa9nez')".


Module ?:2 in register

Module kallithea.lib.auth:847 in __wrapper

<<          if self.check_permissions():
                   log.debug('Permission granted for %s %s', cls, self.user)
                   return func(*fargs, **fkwargs)

               else:

>>  return func(*fargs, **fkwargs)

Module kallithea.controllers.login:151 in register

<<                                                   error_dict=error_dict)

                       UserModel().create_registration(form_result)
                       h.flash(_('You have successfully registered
into Kallithea'),
                               category='success')

>>  UserModel().create_registration(form_result)

Module kallithea.model.user:199 in create_registration

<<              '- Full Name: {user.full_name}\n'
                   '- Email: {user.email}\n'
                   ).format(user=new_user)
               edit_url = h.canonical_url('edit_user', id=new_user.user_id)
               email_kwargs = {

>>  ).format(user=new_user)

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

CGI Variables

CONTENT_TYPE

'application/x-www-form-urlencoded; charset="utf-8"'

HTTP_ACCEPT

'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'

HTTP_ACCEPT_ENCODING

'gzip, deflate'

HTTP_ACCEPT_LANGUAGE

'en-US,en;q=0.8,es;q=0.6'

HTTP_CACHE_CONTROL

'max-age=0'

HTTP_CONNECTION

'keep-alive'

HTTP_COOKIE

'kallithea=1b65f2d7f850013cb31308e31b3241c7b4d8f5048da944d0a12140cabec6cbe6fc8a7604'

HTTP_HOST

'mercurial:5000'

HTTP_ORIGIN

'http://mercurial:5000'

HTTP_REFERER

'http://mercurial:5000/_admin/register'

HTTP_UPGRADE_INSECURE_REQUESTS

'1'

HTTP_USER_AGENT

'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/48.0.2564.109 Safari/537.36'

PATH_INFO

'/_admin/register'

REMOTE_ADDR

'10.114.69.183'

REQUEST_METHOD

'POST'

SERVER_NAME

'localhost'

SERVER_PORT

'5000'

SERVER_PROTOCOL

'HTTP/1.1'

SERVER_SOFTWARE

'waitress'



WSGI Variables

application

<kallithea.lib.middleware.sessionmiddleware.SecureSessionMiddleware
object at 0x033DE5F0>

beaker.get_session

<bound method SecureSessionMiddleware._get_session of
<kallithea.lib.middleware.sessionmiddleware.SecureSessionMiddleware
object at 0x033DE5F0>>

beaker.session

{'_authentication_token': '86409488413256790970956427956537973024',
'_accessed_time': 1455606164.269, '_creation_time': 1455606032.307}

paste.registry

<paste.registry.Registry object at 0x0506AAF0>

paste.throw_errors

True

pylons.action_method

<bound method LoginController.register of
<kallithea.controllers.login.LoginController object at 0x05159150>>

pylons.controller

<kallithea.controllers.login.LoginController object at 0x05159150>

pylons.environ_config

{'session': 'beaker.session', 'cache': 'beaker.cache'}

pylons.log_debug

True

pylons.pylons

<pylons.util.PylonsContext object at 0x0506A370>

pylons.routes_dict

{'action': u'register', 'controller': u'login'}

routes.route

<routes.route.Route object at 0x032118F0>

routes.url

<routes.util.URLGenerator object at 0x0506A870>

webob._body_file

(<LimitedLengthFile(<cStringIO.StringI object at 0x04F17A40>,
maxlen=220)>, <cStringIO.StringI object at 0x04F17A40>)

webob._parsed_post_vars

(MultiDict([('_authentication_token',
'86409488413256790970956427956537973024'), ('username', 'djimenez'),
('password', '******'), ('password_confirmation', '******'),
('firstname', 'FirstName'), ('lastname', 'Jim\xc3\xa9nez'), ('email',
'firstname_jimenez at company.com'), ('sign_up', 'Sign Up')]),
<FakeCGIBody at 0x506a730 viewing MultiDict([('_a...p')])>)

webob._parsed_query_vars

(GET([]), '')

webob.adhoc_attrs

{'errors': 'ignore'}

webob.is_body_readable

True

webob.is_body_seekable

False

wsgi process

'Multithreaded'

wsgi.file_wrapper

<class 'waitress.buffers.ReadOnlyFileBasedBuffer'>

wsgiorg.routing_args

(<routes.util.URLGenerator object at 0x0506A870>, {'action':
u'register', 'controller': u'login'})


More information about the kallithea-general mailing list