public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: [email protected]
Subject: PATCH: Minor patch to fix 'qtLiteral' function in pgAdmin4
Date: Tue, 5 Jan 2016 19:25:21 +0530
Message-ID: <[email protected]> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi,

Please find minor patch to fix 'qtLiteral' function in pgAdmin4.

_Issue:_
'qtLiteral' functions returns in 'bytes' but we need to convert it in 
string for Python3.


Regards,
Murtuza Zabuawala


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [text/x-patch] fixed_qtLiteral.patch (670B, 3-fixed_qtLiteral.patch)
  download | inline diff:
diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py
index f5346ba..c24cb77 100644
--- a/web/pgadmin/utils/driver/psycopg2/__init__.py
+++ b/web/pgadmin/utils/driver/psycopg2/__init__.py
@@ -760,7 +760,12 @@ class Driver(BaseDriver):
 
     @staticmethod
     def qtLiteral(value):
-        return adapt(value).getquoted()
+        # Returns in bytes, we need to convert it in string
+        if isinstance(adapt(value).getquoted(), bytes):
+            return adapt(value).getquoted().decode()
+        else:
+            return adapt(value).getquoted()
+
 
     @staticmethod
     def ScanKeywordExtraLookup(key):


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: PATCH: Minor patch to fix 'qtLiteral' function in pgAdmin4
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox