Fix Python 2.6 support for SQL_ASCII data in the query tool.

This commit is contained in:
Dave Page
2018-06-21 17:06:28 -04:00
parent 560e5f225a
commit 4ba0e1a6f3

View File

@@ -622,14 +622,15 @@ WHERE
# We need to esacpe the data so that it does not fail when
# it is encoded with python ascii
# unicode_escape helps in escaping and unescaping
if self.conn.encoding in ('SQL_ASCII', 'SQLASCII',
'MULE_INTERNAL', 'MULEINTERNAL')\
and params is not None and type(params) == dict:
params = {
key: val.encode('unicode_escape')
.decode('raw_unicode_escape')
for key, val in params.items()
}
if self.conn:
if self.conn.encoding in ('SQL_ASCII', 'SQLASCII',
'MULE_INTERNAL', 'MULEINTERNAL')\
and params is not None and type(params) == dict:
params = dict(
(key, val.encode('unicode_escape')
.decode('raw_unicode_escape'))
for key, val in params.items()
)
return params
def __internal_blocking_execute(self, cur, query, params):