[web/controller] req.form is supposed to contain unicode-data
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 16 Sep 2015 18:41:12 +0200
changeset 10698 bee7de3b4e55
parent 10697 c99130d18356
child 10699 9bad9e061932
[web/controller] req.form is supposed to contain unicode-data
web/controller.py
--- a/web/controller.py	Wed Sep 16 18:40:03 2015 +0200
+++ b/web/controller.py	Wed Sep 16 18:41:12 2015 +0200
@@ -19,6 +19,8 @@
 
 __docformat__ = "restructuredtext en"
 
+from six import PY2
+
 from logilab.mtconverter import xml_escape
 from logilab.common.registry import yes
 from logilab.common.deprecation import deprecated
@@ -87,7 +89,7 @@
         rql = req.form.get('rql')
         if rql:
             req.ensure_ro_rql(rql)
-            if not isinstance(rql, unicode):
+            if PY2 and not isinstance(rql, unicode):
                 rql = unicode(rql, req.encoding)
             pp = req.vreg['components'].select_or_none('magicsearch', req)
             if pp is not None: