1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #27848 -- Prevented crash when attaching a .eml file to a message

Thanks Sébastien Ramage for the report.
This commit is contained in:
Claude Paroz
2017-04-01 15:08:21 +02:00
parent bde86ce9ae
commit 9a9e228321
3 changed files with 46 additions and 1 deletions

View File

@@ -381,7 +381,7 @@ class EmailMessage:
elif not isinstance(content, Message):
# For compatibility with existing code, parse the message
# into an email.Message object if it is not one already.
content = message_from_string(content)
content = message_from_string(force_text(content))
attachment = SafeMIMEMessage(content, subtype)
else: