From 301798d87a25e7ed2290af909a814a89107fd667 Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Wed, 28 Jun 2017 09:44:32 -0400 Subject: [PATCH] Fix encoding issue when saving servers. Fixes #2518 Patch by Khushboo, based on a suggested fix from Ladislav Jech --- web/pgadmin/utils/crypto.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/pgadmin/utils/crypto.py b/web/pgadmin/utils/crypto.py index 5d8bb50a2..1c16e6d27 100644 --- a/web/pgadmin/utils/crypto.py +++ b/web/pgadmin/utils/crypto.py @@ -71,6 +71,10 @@ def pad(str): if str_len == 16 or str_len == 24 or str_len == 32: return str + # Convert bytes to string (python3) + if not hasattr(str, 'decode'): + padding_string = padding_string.decode() + # Add padding to make key 32 bytes long return str + ((32 - len(str) % 32) * padding_string)