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