From 7d08e42bbe34e01eef5649af4d98a51513f35d47 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Tue, 7 Jun 2016 13:26:26 +0530 Subject: [PATCH] During encryption password is converted to buffer (instead of bytearray), and that is causing the issue in Python 2. This was regress of commit-id: 37e2e1d24beb9d5a4474dfaacfa209d2c060991f --- web/pgadmin/utils/driver/psycopg2/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py index 0be232dab..21fa452c8 100644 --- a/web/pgadmin/utils/driver/psycopg2/__init__.py +++ b/web/pgadmin/utils/driver/psycopg2/__init__.py @@ -1049,7 +1049,10 @@ class ServerManager(object): res = dict() res['sid'] = self.sid - res['password'] = self.password.decode('utf-8') + if hasattr(self.password, 'decode'): + res['password'] = self.password.decode('utf-8') + else: + res['password'] = str(self.password) connections = res['connections'] = dict()