Merge pull request #5152 from achillesrasquinha/py3

[FIX] safe_encode Email
This commit is contained in:
Achilles Rasquinha 2018-03-08 18:36:01 +05:30 committed by GitHub
commit f312dfad32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ import time, _socket, poplib, imaplib, email, email.utils, datetime, chardet, re
from email_reply_parser import EmailReplyParser
from email.header import decode_header
import frappe
from frappe import _, safe_decode
from frappe import _, safe_decode, safe_encode
from frappe.utils import (extract_email_id, convert_utc_to_user_timezone, now,
cint, cstr, strip, markdown, parse_addr)
from frappe.utils.scheduler import log
@ -360,7 +360,7 @@ class Email:
"""Parses headers, content, attachments from given raw message.
:param content: Raw message."""
self.raw = safe_decode(content)
self.raw = safe_encode(content)
self.mail = email.message_from_string(self.raw)