You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
If new email policies are used, default message factory should be EmailMessage #64675
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-09-09.23:05:04.098>created_at=<Date2014-02-01.22:08:05.645>labels= ['type-feature', 'library', 'expert-email', 'docs']
title='If new email policies are used, default message factory should be EmailMessage'updated_at=<Date2016-09-10.04:25:34.025>user='https://github.com/bitdancer'
This was part of the design of the new stuff added in 3.4, so it is a bug that it doesn't work...somehow I missed implementing this detail. The full implementation should make this a policy setting, so that a custom policy could specify its own factory. However, since 3.4 is in beta it would be a bad time to add that to the policy.
The patch proposed here implements the required behavior by hardcoding any non-compat32 policy to use EmailMessage instead of Message in feedparser.
Activity
bitdancer commentedon Feb 1, 2014
This was part of the design of the new stuff added in 3.4, so it is a bug that it doesn't work...somehow I missed implementing this detail. The full implementation should make this a policy setting, so that a custom policy could specify its own factory. However, since 3.4 is in beta it would be a bad time to add that to the policy.
The patch proposed here implements the required behavior by hardcoding any non-compat32 policy to use EmailMessage instead of Message in feedparser.
python-dev commentedon Feb 7, 2014
New changeset 77082b818676 by R David Murray in branch 'default':
bpo-20476: use EmailMessage as factory if non-compat32 policy is used.
http://hg.python.org/cpython/rev/77082b818676
bitdancer commentedon Feb 7, 2014
I'm leaving this open and changing the version to 3.5 to remind myself to fix this right once default is open for 3.5 changes.
bitdancer commentedon Sep 7, 2016
Here's the patch to add the message_factory policy attribute.
python-dev commentedon Sep 9, 2016
New changeset 9ba8f4be0651 by R David Murray in branch 'default':
bpo-20476: add a message_factory policy attribute to email.
https://hg.python.org/cpython/rev/9ba8f4be0651
python-dev commentedon Sep 10, 2016
New changeset 8375b8d54bf7 by R David Murray in branch 'default':
bpo-20476: Deal with the message_factory circular import differently.
https://hg.python.org/cpython/rev/8375b8d54bf7