diff --git a/docs/en_US/release_notes_4_22.rst b/docs/en_US/release_notes_4_22.rst index 7e44b1ea9..acfcf23b7 100644 --- a/docs/en_US/release_notes_4_22.rst +++ b/docs/en_US/release_notes_4_22.rst @@ -13,6 +13,7 @@ New features Housekeeping ************ +| `Issue #5443 `_ - Remove support for Python 2. | `Issue #5444 `_ - Cleanup Python detection in the runtime project file. Bug fixes diff --git a/web/pgadmin/utils/driver/psycopg2/server_manager.py b/web/pgadmin/utils/driver/psycopg2/server_manager.py index c14831a8c..64004c691 100644 --- a/web/pgadmin/utils/driver/psycopg2/server_manager.py +++ b/web/pgadmin/utils/driver/psycopg2/server_manager.py @@ -120,22 +120,13 @@ class ServerManager(object): res['ver'] = self.ver res['sversion'] = self.sversion if hasattr(self, 'password') and self.password: - # If running under PY2 - if hasattr(self.password, 'decode'): - res['password'] = self.password.decode('utf-8') - else: - res['password'] = str(self.password) + res['password'] = str(self.password) else: res['password'] = self.password if self.use_ssh_tunnel: if hasattr(self, 'tunnel_password') and self.tunnel_password: - # If running under PY2 - if hasattr(self.tunnel_password, 'decode'): - res['tunnel_password'] = \ - self.tunnel_password.decode('utf-8') - else: - res['tunnel_password'] = str(self.tunnel_password) + res['tunnel_password'] = str(self.tunnel_password) else: res['tunnel_password'] = self.tunnel_password