Do not decrypt the password when the password is 'None'. Fixes #2765

This should avoid the common but harmless exception "ValueError: IV must be 16 bytes long while decrypting the password."
This commit is contained in:
Murtuza Zabuawala
2018-01-03 13:19:58 +00:00
committed by Dave Page
parent e64bc2a821
commit 1dd1c10255

View File

@@ -1653,10 +1653,14 @@ class ServerManager(object):
res = dict()
res['sid'] = self.sid
if hasattr(self.password, 'decode'):
res['password'] = self.password.decode('utf-8')
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)
else:
res['password'] = str(self.password)
res['password'] = self.password
connections = res['connections'] = dict()