[Django] #36309: EmailAlternative is not serializable

9 views
Skip to first unread message

Django

unread,
Apr 8, 2025, 3:20:43 PMApr 8
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------+---------------------------------------
Reporter: Florent Messa | Type: Bug
Status: new | Component: Core (Mail)
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+---------------------------------------
Since 5.2, the type `EmailAlternative` has been introduced but it doesn't
seem to be serializable due to its typename.


{{{
In [1]: from django.core.mail.message import EmailAlternative

In [2]: import pickle

In [3]: pickle.loads(pickle.dumps(EmailAlternative('test', 'test')))
---------------------------------------------------------------------------
PicklingError Traceback (most recent call
last)
Cell In[3], line 1
----> 1 pickle.loads(pickle.dumps(EmailAlternative('test', 'test')))

PicklingError: Can't pickle <class
'django.core.mail.message.Alternative'>: attribute lookup Alternative on
django.core.mail.message failed
}}}

I have already the patch, the typename should be updated for both
`EmailAlternative` and `EmailAttachment`.
--
Ticket URL: <https://code.djangoproject.com/ticket/36309>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 9, 2025, 3:45:15 AMApr 9
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
---------------------------------+-----------------------------------------
Reporter: Florent Messa | Owner: Florent Messa
Type: Bug | Status: assigned
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Sarah Boyce):

* cc: Jake Howard (added)
* owner: (none) => Florent Messa
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* status: new => assigned

Comment:

Thank you! Refs #35537
Feel free to create a PR
--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:1>

Django

unread,
Apr 16, 2025, 1:26:05 PMApr 16
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
---------------------------------+-----------------------------------------
Reporter: Florent Messa | Owner: Florent Messa
Type: Bug | Status: assigned
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Mike Edmunds):

* cc: Mike Edmunds (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:2>

Django

unread,
Apr 17, 2025, 9:45:22 AMApr 17
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
---------------------------------+-----------------------------------------
Reporter: Florent Messa | Owner: Florent Messa
Type: Bug | Status: assigned
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Comment (by Sarah Boyce):

Not sure if you're still planning on creating a PR Florent, but just to
note that we will probably pick this up next week if you haven't already.
As it's a release blocker, we need to resolve this soon 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:3>

Django

unread,
Apr 23, 2025, 4:45:06 PMApr 23
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------------+-------------------------------------
Reporter: Florent Messa | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* owner: Florent Messa => Natalia Bidart

--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:4>

Django

unread,
Apr 23, 2025, 5:18:30 PMApr 23
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------------+-------------------------------------
Reporter: Florent Messa | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:5>

Django

unread,
Apr 24, 2025, 9:11:28 AMApr 24
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------------+-------------------------------------
Reporter: Florent Messa | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"0596263c3136bc26cffa670e5322bd0aa56c4d34" 0596263c]:
{{{#!CommitTicketReference repository=""
revision="0596263c3136bc26cffa670e5322bd0aa56c4d34"
Fixed #36309 -- Made email alternatives and attachments pickleable.

Regression in aba0e541caaa086f183197eaaca0ac20a730bbe4 and in
d5bebc1c26d4c0ec9eaa057aefc5b38649c0ba3b.

Thanks Florent Messa for the report, and Jake Howard and Claude
Paroz for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:6>

Django

unread,
Apr 24, 2025, 9:11:47 AMApr 24
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------------+-------------------------------------
Reporter: Florent Messa | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:7>

Django

unread,
Apr 24, 2025, 9:13:08 AMApr 24
to django-...@googlegroups.com
#36309: EmailAlternative is not serializable
-------------------------------------+-------------------------------------
Reporter: Florent Messa | Owner: Natalia
| Bidart
Type: Bug | Status: closed
Component: Core (Mail) | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"90fa9f4cc090d07bc59717120cc1a5a3a84e1acb" 90fa9f4c]:
{{{#!CommitTicketReference repository=""
revision="90fa9f4cc090d07bc59717120cc1a5a3a84e1acb"
[5.2.x] Fixed #36309 -- Made email alternatives and attachments
pickleable.

Regression in aba0e541caaa086f183197eaaca0ac20a730bbe4 and in
d5bebc1c26d4c0ec9eaa057aefc5b38649c0ba3b.

Thanks Florent Messa for the report, and Jake Howard and Claude
Paroz for the review.

Backport of 0596263c3136bc26cffa670e5322bd0aa56c4d34 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36309#comment:8>
Reply all
Reply to author
Forward
0 new messages