X-Git-Url: http://git.ipfire.org/?p=ddns.git;a=blobdiff_plain;f=src%2Fddns%2Fsystem.py;h=73a27a5cd0b56484feda70006b3ba4065e11e0c8;hp=c2dc4309e6c39adb0ac53db2b87dd3f4de7b4992;hb=921d1afbeaf1b71309d121a7da4ed35e59c0c241;hpb=f1c737c0ed2e73022b08d478848db98f2f9abeb9 diff --git a/src/ddns/system.py b/src/ddns/system.py index c2dc430..73a27a5 100644 --- a/src/ddns/system.py +++ b/src/ddns/system.py @@ -142,7 +142,7 @@ class DDNSSystem(object): if username and password: basic_auth_header = self._make_basic_auth_header(username, password) - req.add_header("Authorization", "Basic %s" % basic_auth_header) + req.add_header("Authorization", "Basic %s" % basic_auth_header.decode()) # Set the user agent. req.add_header("User-Agent", self.USER_AGENT) @@ -259,10 +259,7 @@ class DDNSSystem(object): authstring = "%s:%s" % (username, password) # Encode authorization data in base64. - authstring = base64.encodebytes(authstring) - - # Remove any newline characters. - authstring = authstring.replace("\n", "") + authstring = base64.b64encode(authstring.encode()) return authstring