cubicweb #16466560 UnicodeDecodeError : in basepath() ? [open]

While performance testing with https://artillery.io/ with a csv file with some terms with some accents, I get a bunch of UnicodeDecodeErrors :

2016-11-30 10:32:59 - (waitress) ERROR: Exception when serving /view
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/waitress/channel.py", line 337, in service
  task.service()
File "/usr/lib/python2.7/dist-packages/waitress/task.py", line 173, in service
  self.execute()
File "/usr/lib/python2.7/dist-packages/waitress/task.py", line 392, in execute
  app_iter = self.channel.server.application(env, start_response)
File "/usr/lib/python2.7/dist-packages/wsgicors.py", line 140, in __call__
  return self.application(environ, custom_start_response)
File "/usr/lib/python2.7/dist-packages/pyramid/router.py", line 242, in __call__
  response = self.invoke_subrequest(request, use_tweens=True)
File "/usr/lib/python2.7/dist-packages/pyramid/router.py", line 217, in invoke_subrequest
  response = handle_request(request)
File "/usr/lib/python2.7/dist-packages/pyramid/tweens.py", line 46, in excview_tween
  response = view_callable(exc, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/views.py", line 287, in _authdebug_view
  return view(context, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/views.py", line 385, in viewresult_to_response
  result = view(context, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/views.py", line 460, in mapped_view
  return _mapped_view(context, request)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/bwcompat.py", line 134, in error_handler
  req = request.cw_request
File "/usr/lib/python2.7/dist-packages/pyramid/decorator.py", line 37, in __get__
  val = self.wrapped(inst)
File "/usr/lib/python2.7/dist-packages/pyramid/util.py", line 52, in <lambda>
  fn = lambda this: callable(this)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/core.py", line 320, in _cw_request
  req = CubicWebPyramidRequest(request)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/core.py", line 131, in __init__
  post = request.params.mixed()
File "/usr/lib/python2.7/dist-packages/webob/request.py", line 856, in params
  params = NestedMultiDict(self.GET, self.POST)
File "/usr/lib/python2.7/dist-packages/webob/request.py", line 838, in GET
  vars = GetDict(data, env)
File "/usr/lib/python2.7/dist-packages/webob/multidict.py", line 287, in __init__
  MultiDict.__init__(self, data)
File "/usr/lib/python2.7/dist-packages/webob/multidict.py", line 38, in __init__
  items = list(args[0])
File "/usr/lib/python2.7/dist-packages/webob/compat.py", line 125, in parse_qsl_text
  yield (x.decode(encoding), y.decode(encoding))
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
  return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte

This is served with uwsgi behind a nginx server.

I then try serving with twisted

2016-11-30 10:49:03 - (cubicweb.web) ERROR: UnicodeDecodeError('ascii', 'view?vid=esearch&     search=Mort%20dEdm\xef\xbf\xbd%20Bouchardon', 35, 36, 'ordinal not in range(128)')
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cubicweb/web/application.py", line 391, in core_handle
  result = controller.publish(rset=rset)
File "/usr/lib/python2.7/dist-packages/cubicweb/web/views/basecontrollers.py", line 136, in publish
  rset=rset, view=view)
File "/usr/lib/python2.7/dist-packages/cubicweb/cwvreg.py", line 221, in main_template
  res = obj.render(**kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/view.py", line 138, in render
  view_func(**context)
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/templates.py", line 66, in call
  context = self.template_context(view)
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/templates.py", line 186, in template_context
  ctx['langswitch'] = list(langswitch_comp.lang_urls())
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/templates_components.py", line 82, in lang_urls
  url = self.url(lang)
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/templates_components.py", line 66, in url
  rest_path = u'%s/%s' % (lang, self.basepath())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 35: ordinal not in range(128)

which makes me think that the problem is in basepath (or maybe in my cube).

I think this line looks suspicious (missing a u' ?) https://hg.logilab.org/master/cubicweb/file/tip/cubicweb/pyramid/core.py#l166 but this doesn't seem to fix my problem. https://hg.logilab.org/master/cubicweb/file/tip/cubicweb/pyramid/core.py#l175 might have the same problem ?

prioritynormal
typebug
done in<not specified>
closed by<not specified>