inpho / inphosite

The InPhO API
https://inphoproject.org
15 stars 5 forks source link

internal server error - unicode related #171

Closed colinallen closed 6 years ago

colinallen commented 6 years ago

Error - <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\u0141' in position 4: ordinal not in range(128) URL: https://www.inphoproject.org/idea/1221

Full error stack below

Error - <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\u0141' in position 4: ordinal not in range(128)
URL: https://www.inphoproject.org/idea/1221
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/WebError-0.10.3-py2.7.egg/weberror/errormiddleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/repoze.who-1.0.19-py2.7.egg/repoze/who/middleware.py', line 107 in __call__
  app_iter = app(environ, wrapper.wrap_start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Beaker-1.9.0-py2.7.egg/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Beaker-1.9.0-py2.7.egg/beaker/middleware.py', line 156 in __call__
  return self.wrap_app(environ, session_start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Routes-2.4.1-py2.7.egg/routes/middleware.py', line 141 in __call__
  response = self.app(environ, start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/wsgiapp.py', line 103 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/wsgiapp.py', line 313 in dispatch
  return controller(environ, start_response)
File '/var/inpho/inphosite/inphosite/lib/base.py', line 23 in __call__
  return WSGIController.__call__(self, environ, start_response)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/controllers/core.py', line 214 in __call__
  response = self._dispatch_call()
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/controllers/core.py', line 164 in _dispatch_call
  response = self._inspect_call(func)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/controllers/core.py', line 107 in _inspect_call
  result = self._perform_call(func, args)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/controllers/core.py', line 57 in _perform_call
  return func(**args)
File '/var/inpho/inphosite/inphosite/controllers/idea.py', line 337 in view
  return render('idea/idea.' + filetype)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/templating.py', line 244 in render_mako
  cache_type=cache_type, cache_expire=cache_expire)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/templating.py', line 219 in cached_template
  return render_func()
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/templating.py', line 241 in render_template
  return literal(template.render_unicode(**globs))
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/template.py', line 311 in render_unicode
  as_unicode=True)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py', line 660 in _render
  **_kwargs_for_callable(callable_, data))
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py', line 692 in _render_context
  _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py', line 713 in _exec_template
  _render_error(template, context, e)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Mako-0.5.0-py2.7.egg/mako/runtime.py', line 722 in _render_error
  result = template.error_handler(context, error)
File '/home/inphosite/miniconda2/lib/python2.7/site-packages/Pylons-1.0.2-py2.7.egg/pylons/error.py', line 22 in handle_mako_error
  raise (exc, None, sys.exc_info()[2])
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0141' in position 4: ordinal not in range(128)

CGI Variables
-------------
  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
  HTTP_ACCEPT_ENCODING: 'gzip, deflate, br'
  HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.9,fr;q=0.8'
  HTTP_CACHE_CONTROL: 'max-age=0'
  HTTP_CONNECTION: 'close'
  HTTP_DNT: '1'
  HTTP_HOST: 'www.inphoproject.org'
  HTTP_REFERER: 'https://www.inphoproject.org/taxonomy/2350'
  HTTP_UPGRADE_INSECURE_REQUESTS: '1'
  HTTP_USER_AGENT: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36'
  HTTP_X_FORWARDED_FOR: '108.18.5.174'
  HTTP_X_FORWARDED_PROTO: 'https'
  HTTP_X_REAL_IP: '108.18.5.174'
  PATH_INFO: '/idea/1221'
  RAW_URI: '/idea/1221'
  REQUEST_METHOD: 'GET'
  SERVER_NAME: 'www.inphoproject.org'
  SERVER_PORT: '443'
  SERVER_PROTOCOL: 'HTTP/1.0'
  SERVER_SOFTWARE: 'gunicorn/19.7.1'

WSGI Variables
--------------
  application: <repoze.who.middleware.PluggableAuthenticationMiddleware object at 0x7f77b5568d90>
  beaker.cache: <beaker.cache.CacheManager object at 0x7f77b5568b90>
  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f77b5568890>>
  beaker.session: {'_accessed_time': 1515441152.943331, '_creation_time': 1515441152.943331}
  gunicorn.socket: <socket._socketobject object at 0x7f77ae4da6e0>
  paste.cookies: (<SimpleCookie: >, '')
  paste.registry: <paste.registry.Registry object at 0x7f77aee06490>
  paste.throw_errors: True
  pylons.action_method: <bound method IdeaController.view of <inphosite.controllers.idea.IdeaController object at 0x7f77ae6078d0>>
  pylons.controller: <inphosite.controllers.idea.IdeaController object at 0x7f77ae6078d0>
  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
  pylons.log_debug: False
  pylons.pylons: <pylons.util.PylonsContext object at 0x7f77ae607610>
  pylons.routes_dict: {'action': u'view', 'controller': u'idea', 'id': u'1221'}
  repoze.who.logger: <logging.Logger object at 0x7f77b5503e50>
  repoze.who.plugins: {'inphosite.lib.auth:UserModelPlugin': <inphosite.lib.auth.UserModelPlugin object at 0x7f77b5503b90>, 'auth_tkt': <AuthTktCookiePlugin 140152120183632>, 'form': <RedirectingFormPlugin 140152120184336>, 'basicauth': <BasicAuthPlugin 140152119767120>}
  routes.route: <routes.route.Route object at 0x7f77b554f9d0>
  routes.url: <routes.util.URLGenerator object at 0x7f77aee06650>
  webob._parsed_query_vars: (GET([]), '')
  wsgi process: 'Multiprocess'
  wsgi.file_wrapper: <class 'gunicorn.http.wsgi.FileWrapper'>
  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f77aee06650>, {'action': u'view', 'controller': u'idea', 'id': u'1221'})
------------------------------------------------------------
colinallen commented 6 years ago

First related thinker is https://www.inphoproject.org/thinker/3445 (Lesniewski) which also raises same error.