maybe related to mimetype message/rfc822
{{{
File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py",
line 292, in send return
self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/python3.5/dist-
packages/django/core/mail/backends/smtp.py", line 107, in send_messages
sent = self._send(message)
File "/usr/local/lib/python3.5/dist-
packages/django/core/mail/backends/smtp.py", line 121, in _send message =
email_message.message()
File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py",
line 256, in message msg = self._create_message(msg)
File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py",
line 344, in _create_message return self._create_attachments(msg)
File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py",
line 357, in _create_attachments
msg.attach(self._create_attachment(*attachment)) File
"/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line
399, in _create_attachment attachment =
self._create_mime_attachment(content, mimetype)
File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py",
line 380, in _create_mime_attachment content =
message_from_string(content) File "/usr/lib/python3.5/email/__init__.py",
line 38, in message_from_string return Parser(*args, **kws).parsestr(s)
File "/usr/lib/python3.5/email/parser.py", line 68, in parsestr return
self.parse(StringIO(text), headersonly=headersonly)
TypeError: initial_value must be str or None, not bytes
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27848>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
New description:
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:1>
Old description:
> .eml file could not be attached to EmailMessage using .attach_file()
New description:
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:2>
* stage: Unreviewed => Accepted
Comment:
Reproduced with the attached test.
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:3>
* Attachment "27848-test.diff" added.
* owner: nobody => Dariush Azimi
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:4>
Comment (by Dariush):
Hi Ramage,
Trying to reproduce the error. Can you provide the steps to reproduce the
error? I see the test case but that is all there is.
Thanks
Dariush
Replying to [ticket:27848 RAMAGE Sébastien]:
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:5>
Comment (by Tim Graham):
To reproduce, apply the patch I provided and run that test from the Django
test suite.
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:6>
* status: assigned => new
* owner: Dariush Azimi => (none)
* has_patch: 0 => 1
* version: 1.9 => master
Comment:
[https://github.com/django/django/pull/8281 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:7>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:8>
* owner: (none) => Claude Paroz <claude@…>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"9a9e22832166594e3561fa1911dd255a2fb09b2b" 9a9e2283]:
{{{
#!CommitTicketReference repository=""
revision="9a9e22832166594e3561fa1911dd255a2fb09b2b"
Fixed #27848 -- Prevented crash when attaching a .eml file to a message
Thanks Sébastien Ramage for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27848#comment:9>