diff -r 24393ce335f5 -r 62918203b9fc cubicweb/server/sources/rql2sql.py --- a/cubicweb/server/sources/rql2sql.py Wed Nov 29 17:08:05 2017 +0100 +++ b/cubicweb/server/sources/rql2sql.py Fri Sep 15 17:01:04 2017 +0200 @@ -49,7 +49,7 @@ import threading -from six import PY2 +from six import PY2, text_type from six.moves import range from logilab.database import FunctionDescr, SQL_FUNCTIONS_REGISTRY @@ -1511,7 +1511,7 @@ return self.keyword_map[value]() if constant.type == 'Substitute': _id = value - if PY2 and isinstance(_id, unicode): + if PY2 and isinstance(_id, text_type): _id = _id.encode() else: _id = str(id(constant)).replace('-', '', 1)