You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/20 09:41:29 UTC

[GitHub] Fokko closed pull request #3757: [AIRFLOW-2907] Fix Sendgrid attachments bytes error

Fokko closed pull request #3757: [AIRFLOW-2907] Fix Sendgrid attachments bytes error
URL: https://github.com/apache/incubator-airflow/pull/3757
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/contrib/utils/sendgrid.py b/airflow/contrib/utils/sendgrid.py
index 6d8b5f5ddb..ceb3718ff5 100644
--- a/airflow/contrib/utils/sendgrid.py
+++ b/airflow/contrib/utils/sendgrid.py
@@ -88,7 +88,7 @@ def send_email(to, subject, html_content, files=None,
         basename = os.path.basename(fname)
         attachment = Attachment()
         with open(fname, "rb") as f:
-            attachment.content = base64.b64encode(f.read())
+            attachment.content = str(base64.b64encode(f.read()), 'utf-8')
             attachment.type = mimetypes.guess_type(basename)[0]
             attachment.filename = basename
             attachment.disposition = "attachment"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services