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

While performance testing with 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/", line 337, in service
File "/usr/lib/python2.7/dist-packages/waitress/", line 173, in service
File "/usr/lib/python2.7/dist-packages/waitress/", line 392, in execute
  app_iter =, start_response)
File "/usr/lib/python2.7/dist-packages/", line 140, in __call__
  return self.application(environ, custom_start_response)
File "/usr/lib/python2.7/dist-packages/pyramid/", line 242, in __call__
  response = self.invoke_subrequest(request, use_tweens=True)
File "/usr/lib/python2.7/dist-packages/pyramid/", line 217, in invoke_subrequest
  response = handle_request(request)
File "/usr/lib/python2.7/dist-packages/pyramid/", line 46, in excview_tween
  response = view_callable(exc, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/", line 287, in _authdebug_view
  return view(context, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/", line 385, in viewresult_to_response
  result = view(context, request)
File "/usr/lib/python2.7/dist-packages/pyramid/config/", line 460, in mapped_view
  return _mapped_view(context, request)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/", line 134, in error_handler
  req = request.cw_request
File "/usr/lib/python2.7/dist-packages/pyramid/", line 37, in __get__
  val = self.wrapped(inst)
File "/usr/lib/python2.7/dist-packages/pyramid/", line 52, in <lambda>
  fn = lambda this: callable(this)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/", line 320, in _cw_request
  req = CubicWebPyramidRequest(request)
File "/usr/lib/python2.7/dist-packages/cubicweb/pyramid/", line 131, in __init__
  post = request.params.mixed()
File "/usr/lib/python2.7/dist-packages/webob/", line 856, in params
  params = NestedMultiDict(self.GET, self.POST)
File "/usr/lib/python2.7/dist-packages/webob/", line 838, in GET
  vars = GetDict(data, env)
File "/usr/lib/python2.7/dist-packages/webob/", line 287, in __init__
  MultiDict.__init__(self, data)
File "/usr/lib/python2.7/dist-packages/webob/", line 38, in __init__
  items = list(args[0])
File "/usr/lib/python2.7/dist-packages/webob/", line 125, in parse_qsl_text
  yield (x.decode(encoding), y.decode(encoding))
File "/usr/lib/python2.7/encodings/", 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/", line 391, in core_handle
  result = controller.publish(rset=rset)
File "/usr/lib/python2.7/dist-packages/cubicweb/web/views/", line 136, in publish
  rset=rset, view=view)
File "/usr/lib/python2.7/dist-packages/cubicweb/", line 221, in main_template
  res = obj.render(**kwargs)
File "/usr/lib/python2.7/dist-packages/cubicweb/", line 138, in render
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/", line 66, in call
  context = self.template_context(view)
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/", line 186, in template_context
  ctx['langswitch'] = list(langswitch_comp.lang_urls())
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/", line 82, in lang_urls
  url = self.url(lang)
File "/usr/lib/python2.7/dist-packages/cubicweb_app/views/", 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' ?) but this doesn't seem to fix my problem. might have the same problem ?

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