From 7c2c7249784ac8c995ed0470584bb3529a50a8cd Mon Sep 17 00:00:00 2001 From: John Bowen Date: Tue, 22 Nov 2016 16:52:53 -0500 Subject: [PATCH 1/2] Updated 'action' to 'api_action'. Linode must have updated the syntax of their API call. --- LinodeDynDNS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LinodeDynDNS.py b/LinodeDynDNS.py index f0187b3..a0d28c8 100755 --- a/LinodeDynDNS.py +++ b/LinodeDynDNS.py @@ -102,7 +102,7 @@ def execute(action, parameters): # Execute a query and return a Python dictionary. - uri = "{0}&action={1}".format(API.format(KEY), action) + uri = "{0}&api_action={1}".format(API.format(KEY), action) if parameters and len(parameters) > 0: uri = "{0}&{1}".format(uri, urlencode(parameters)) if DEBUG: From d68eeaf7f09cb51de7d3c68e5b552e57a6c05fdf Mon Sep 17 00:00:00 2001 From: John Bowen Date: Tue, 15 Mar 2022 12:47:08 -0400 Subject: [PATCH 2/2] Remove 'encoding' argument from json.load call In Python 3.9.7, the deprecated 'encoding' argument in json.load now throws an error. Removing it entirely gets the code working, again. --- LinodeDynDNS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LinodeDynDNS.py b/LinodeDynDNS.py index a0d28c8..42d8d51 100755 --- a/LinodeDynDNS.py +++ b/LinodeDynDNS.py @@ -113,7 +113,7 @@ def execute(action, parameters): print(headers, end="") print(open(file).read()) print() - json = load(open(file), encoding="utf-8") + json = load(open(file)) if len(json["ERRORARRAY"]) > 0: err = json["ERRORARRAY"][0] raise Exception("Error {0}: {1}".format(int(err["ERRORCODE"]),