mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix Python 2.6 support for SQL_ASCII data in the query tool.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user