From fd5923695de3c35f7ce0fc76f350256c74fa1022 Mon Sep 17 00:00:00 2001 From: Esper Kuijs Date: Mon, 13 Jan 2020 14:12:35 +0100 Subject: [PATCH] Fix twilio provider b64encode error in python3 --- dbmail/providers/twilio/sms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbmail/providers/twilio/sms.py b/dbmail/providers/twilio/sms.py index 936e410..9538786 100644 --- a/dbmail/providers/twilio/sms.py +++ b/dbmail/providers/twilio/sms.py @@ -29,9 +29,9 @@ def send(sms_to, sms_body, **kwargs): "Content-type": "application/x-www-form-urlencoded", "User-Agent": "DBMail/%s" % get_version(), 'Authorization': 'Basic %s' % b64encode( - "%s:%s" % ( + "{}:{}".format( settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN - )).decode("ascii") + ).encode("utf-8")).decode("ascii") }