Ensure client password defaults to empty string

In case the a None value is passed during initialization, this ensures the password defaults to an empty string. This prevents receiving a "'NoneType' object has no attribute 'encode'" when preparing the connection.
This commit is contained in:
Byron Ruth
2013-12-30 09:41:57 -05:00
parent 1fabcf3143
commit 35a4dcc147

View File

@@ -590,7 +590,7 @@ class Connection(object):
self.host = host
self.port = port
self.user = user or DEFAULT_USER
self.password = passwd
self.password = passwd or ""
self.db = database
self.no_delay = no_delay
self.unix_socket = unix_socket