Merge pull request #8204 from ashish-greycube/patch-8
fix(email): AttributeError: 'Message' object has no attribute 'encode' #8148
This commit is contained in:
commit
005c1951b0
1 changed files with 1 additions and 4 deletions
|
|
@ -481,10 +481,7 @@ class Email:
|
|||
"""Detect chartset."""
|
||||
charset = part.get_content_charset()
|
||||
if not charset:
|
||||
if six.PY2:
|
||||
charset = chardet.detect(str(part))['encoding']
|
||||
else:
|
||||
charset = chardet.detect(part.encode())['encoding']
|
||||
charset = chardet.detect(frappe.safe_encode(part))['encoding']
|
||||
|
||||
return charset
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue