Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#36309 closed Bug (fixed)

EmailAlternative is not serializable

Reported by: Florent Messa Owned by: Natalia Bidart
Component: Core (Mail) Version: 5.2
Severity: Release blocker Keywords:
Cc: Jake Howard, Mike Edmunds Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (8)

comment:1 by Sarah Boyce, 5 months ago

Cc: Jake Howard added
Owner: set to Florent Messa
Severity: NormalRelease blocker
Status: newassigned
Triage Stage: UnreviewedAccepted

Thank you! Refs #35537
Feel free to create a PR

comment:2 by Mike Edmunds, 5 months ago

Cc: Mike Edmunds added

comment:3 by Sarah Boyce, 5 months ago

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 👍

comment:4 by Natalia Bidart, 4 months ago

Owner: changed from Florent Messa to Natalia Bidart

comment:5 by Natalia Bidart, 4 months ago

Has patch: set

comment:6 by GitHub <noreply@…>, 4 months ago

Resolution: fixed
Status: assignedclosed

In 0596263c:

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.

comment:7 by Natalia Bidart, 4 months ago

Triage Stage: AcceptedReady for checkin

comment:8 by Natalia <124304+nessita@…>, 4 months ago

In 90fa9f4c:

[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.

Note: See TracTickets for help on using tickets.
Back to Top