Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-1914

email utils in airflow in airflow does not support multibyte string content

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 1.10.0, 2.0.0
    • operators

    Description

      The built-in email utils does not support multibyte string content, for example, Japanese.

      issue in file: https://github.com/apache/incubator-airflow/blob/master/airflow/utils/email.py#L73

      >>> mime_text = MIMEText(html_content, 'html')
      The charset is not passed in and the default charset is "us-ascii"

      The fix is to pass in the right charset base on html_context:
      >>> mime_text = MIMEText(html_content, 'html’, “us-ascii" if isinstance(html_content, str) else "utf-8”)

      Attachments

        Activity

          People

            ama Alan Ma
            Edward_tian edward
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: