Commit 268a64a6 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Kazuhiko Shiozaki

sqltest: decode strings (to the specified encoding ot 'utf-8') only in Python3

as it is done in other places of this file
parent f02e7d62
......@@ -174,13 +174,13 @@ else: # For easy diff with original (ZSQLMethods 3.14)
else:
if not isinstance(v, StringTypes):
v = str(v)
if isinstance(v, six.binary_type):
v = v.decode('utf-8')
if six.PY3 and isinstance(v, six.binary_type):
v = v.decode(self.encoding or 'UTF-8')
# The call to sql_quote__ can return something that is not
# a native string anymore!
v = md.getitem('sql_quote__', 0)(v)
if isinstance(v, six.binary_type):
v = v.decode('utf-8')
if six.PY3 and isinstance(v, six.binary_type):
v = v.decode(self.encoding or 'UTF-8')
# if v.find("\'") >= 0: v="''".(v.split("\'"))
# v="'%s'" % v
vs.append(v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment