Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aGS5C-0004TY-Oe for pgadmin-hackers@arkaria.postgresql.org; Tue, 05 Jan 2016 13:55:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aGS5C-0003mY-6p for pgadmin-hackers@arkaria.postgresql.org; Tue, 05 Jan 2016 13:55:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aGS5B-0003kL-GZ for pgadmin-hackers@postgresql.org; Tue, 05 Jan 2016 13:55:29 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aGS58-0008L6-Le for pgadmin-hackers@postgresql.org; Tue, 05 Jan 2016 13:55:28 +0000 Received: by mail-pa0-x232.google.com with SMTP id uo6so196359851pac.1 for ; Tue, 05 Jan 2016 05:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-type; bh=P4yzU3EvpXNFR/tBCr5A1C4bzYhK76/onQgyExFtnwA=; b=JNSSKGRaI4or55A5fOEk0RFSns41UWxDUQ1d4wDKIB7UWkRrsoCBBzAUv4MaIKHgaK Nn5L2yKnt4CZnrS7JvCSGyHCPmAGjgG+PcawpQ6PNDpASZ95xrUbgZ9igHAxN5IQadyC pZvmxXO1LbUMlvJCH5OJbWYGZFwZTwbi+1i+VKJNxCggugolKUs6Z825dqQKSVmBw2Cy Jb6xMCDrM2NrhdeWYLT048Lhcy9axIzrcyfw3FH8h/z9zd+MZaJVYIgLdmUvDk5WwtLs 8kbpCybtZXdWgWJ0SJEpQMFcHKPnUFosSu5HjKwvGnaK9p0AoQ0h2IiH9yzPRGlQZK9p 00mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type; bh=P4yzU3EvpXNFR/tBCr5A1C4bzYhK76/onQgyExFtnwA=; b=mwfz5Lb3zwI13mgL32TJsy4/G6PmNjFx2VhCAbCgWR0pD5KJdPLqYTOvjQM4zqXCNU TqH8QPlE3a/ZtDYk6w69EKxwfjGhXdJtqgA2SF+siQiGDpjK6WiPpcDPZ42Nps5l7JJw zMrYWs5VzuOsbz8i5wpOCKvDuGsFWHfT/ooWeCtW8hryPTcoNfArQIc+5C3BqjIgJHZx aTJhGM0m9lIIsA2VOacaldg0Tm3+NOTm6jCxlIabHljhcvC6Q5ApSRiFgpjgY00PhB3b pKhyE8oy8X6WIApCOHImjOrY1Zts57J4IpxFhE8fTN42riJu1ziOfs5wzYxJXUWDklRJ 7Bbg== X-Gm-Message-State: ALoCoQnH/y4qKcxNc96RfoOE6Tnq/mKgW3h9hAA4dddaJ6KnGtmWKtNGPFz6Ax8nknP+HBI0sRZJAhhZWY5GoqmpkHzk06rRsiaHv3ryXKM6tBJvTDn1r2JI/wcVOZTlYUxWW2Mz7W24pt1+/1k7/BF8DBkpgkC+zTTI0JuuFZupI4xJnI91rO0jE/6i4UoZ2qJosMycHGXC7AepVvGqJkz17aYSydpHOQ== X-Received: by 10.66.216.7 with SMTP id om7mr132986440pac.90.1452002125185; Tue, 05 Jan 2016 05:55:25 -0800 (PST) Received: from [172.24.35.244] ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id dz12sm70702788pac.2.2016.01.05.05.55.23 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 05:55:24 -0800 (PST) To: pgadmin-hackers@postgresql.org From: Murtuza Zabuawala Subject: PATCH: Minor patch to fix 'qtLiteral' function in pgAdmin4 Message-ID: <568BCB49.5060508@enterprisedb.com> Date: Tue, 5 Jan 2016 19:25:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060305090309000208050304" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------060305090309000208050304 Content-Type: multipart/alternative; boundary="------------050004020103050108090401" --------------050004020103050108090401 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------050004020103050108090401 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit 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
--------------050004020103050108090401-- --------------060305090309000208050304 Content-Type: text/x-patch; name="fixed_qtLiteral.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fixed_qtLiteral.patch" 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): --------------060305090309000208050304 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --------------060305090309000208050304--