diff --git a/cachalot/utils.py b/cachalot/utils.py index 11017fd..5102aa2 100644 --- a/cachalot/utils.py +++ b/cachalot/utils.py @@ -77,7 +77,8 @@ def get_query_cache_key(compiler): """ sql, params = compiler.as_sql() check_parameter_types(params) - cache_key = '%s:%s:%s' % (compiler.using, sql, [str(p) for p in params]) + cache_key = '%s:%s:%s' % (compiler.using, sql, + [text_type(p) for p in params]) return sha1(cache_key.encode('utf-8')).hexdigest()