summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-01 02:47:40 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-01 02:47:59 +0000
commit9bac37baf76dbd0831230e4d01d5269b6e4a9438 (patch)
treedec647097aeac2cae7a58593ea683c7eabfd2feb /lib/extras.py
parent2e2dcd536bb06c07747e28ad98f4fb8e3053748e (diff)
downloadpsycopg2-9bac37baf76dbd0831230e4d01d5269b6e4a9438.tar.gz
Fixed execute_values with unicode
Also added unicode tests.
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 2636655..2d26402 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -1220,6 +1220,6 @@ def execute_values(cur, sql, argslist, template=None, page_size=100):
if template is None:
template = '(%s)' % ','.join(['%s'] * len(page[0]))
values = b",".join(cur.mogrify(template, args) for args in page)
- if isinstance(values, bytes) and _sys.version_info[0] > 2:
+ if isinstance(values, bytes):
values = values.decode(_ext.encodings[cur.connection.encoding])
cur.execute(sql % (values,))