From f73833b3e90ba52c9f7e13e8ca900948cda8a80f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 14 Sep 2022 23:47:02 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20contr=C3=B4le=20cotisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controle_cotisation/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controle_cotisation/main.py b/controle_cotisation/main.py index 3f8409b..7296a20 100755 --- a/controle_cotisation/main.py +++ b/controle_cotisation/main.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import os, requests, json, datetime, shutil, quopri, subprocess +import os, requests, json, datetime, shutil, quopri, subprocess, base64 from requests.auth import HTTPBasicAuth from requests.auth import HTTPDigestAuth @@ -105,7 +105,7 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin msg = bytes(headers + "\n", 'utf-8') \ + quopri.encodestring(bytes(data, 'utf-8')) \ + bytes(attachment_header + "\n", 'utf-8') \ - + base64(attachment) \ + + base64.b64encode(attachment) \ + bytes(ending + "\n", 'utf-8') subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg)