diff --git a/ChangeLog b/ChangeLog index 5323c8bc..eab851b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19371,3 +19371,7 @@ 2019-12-20 Fred Gleason * Added a debugging message to the 'LocalAudio::pollData()' method in ripcd(8). +2019-12-23 Fred Gleason + * Added a work-around in the 'PyPAD.Receiver().__openDb()' method + to work with versions of MySQLdb that do not support the + 'password=' parameter in 'MySQLdb.connect()'. diff --git a/apis/pypad/api/pypad.py b/apis/pypad/api/pypad.py index b6a5bdd7..de52d7ac 100644 --- a/apis/pypad/api/pypad.py +++ b/apis/pypad/api/pypad.py @@ -797,9 +797,14 @@ class Receiver(object): def __openDb(self): creds=self.__getDbCredentials() - return MySQLdb.connect(user=creds[0],password=creds[1], - host=creds[2],database=creds[3], - charset='utf8mb4') + try: + return MySQLdb.connect(user=creds[0],passwd=creds[1], + host=creds[2],database=creds[3], + charset='utf8mb4') + except TypeError: + return MySQLdb.connect(user=creds[0],password=creds[1], + host=creds[2],database=creds[3], + charset='utf8mb4') def setPadCallback(self,callback): """