From 85ebf42353e5f8f460eaeb8961df0c8e78b9fdc8 Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Sat, 3 Jun 2017 11:00:54 +0200 Subject: [PATCH] Fixes Python 2. --- cachalot/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()