Issue 20098: email policy needs a mangle_from setting (original) (raw)

Created on 2013-12-30 23:35 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
20098.patch gennad,2014-01-01 16:55 review
mangle_from.patch zvyn,2014-03-03 15:01 sets default value for mangle_from_ in Policy and changes Generator to use it if not given explicitly. review
mangle_from_with_doc.patch zvyn,2014-03-09 22:43 review
mangle_from_20140424.patch zvyn,2014-04-24 12:24 review
Messages (11)
msg207116 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-12-30 23:35
I missed this. It still defaults to True in Generator. It should default to False in the new policies (but True in compat32).
msg207136 - (view) Author: Gennadiy Zlobin (gennad) * Date: 2014-01-01 16:55
I created the patch, please review it.
msg207140 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-01-01 23:48
Sorry, my message wasn't clear. The current default needs to remain the same. What needs to be added is email.policy.Policy.mange_from, which should be True in the compat32 policy and False in EmailPolicy. Then it needs to be hooked up the Generator, so that an explicit specificaion in the __init__ overrides the policy, but specifying one of EmailPolicy dervived policies will override the default value of the __init__ argument if the argument is not speicifed explicitly in the Generator constructor call. (Backward compatibility is a pain.)
msg212636 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-03-03 13:36
(@r.david.murray) I just implemented what you suggested: - Policy has a mangle_from_ property, overridden in EMailPolicy - Generator and DecodedGenerator default to policy.mangle_from_ or True if policy is None. Would be glad if it helps :)
msg212641 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-03-03 15:01
Updates patch to include necessary changes to test_policy.py.
msg212992 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-03-09 22:27
Added documentation for mangle_from. since the name "mangle_from_" is not supported by the markup, changed it to "mangle_from" everywhere, which looks better anyway (I understand why it was the other way so). If it was a bad idea, I can undo it but am unable to do the doc.
msg212995 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-03-09 22:37
Rollback to mangle_from_, sorry for the noise.
msg215088 - (view) Author: Steve Holden (holdenweb) * (Python committer) Date: 2014-03-28 22:48
This is an easy issue?
msg217122 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-04-24 12:13
Updated the last patch according to the review comments at https://bugs.python.org/review/20098/.
msg243419 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-17 18:24
New changeset df81f9b67736 by R David Murray in branch 'default': #20098: add mangle_from_ policy option. https://hg.python.org/cpython/rev/df81f9b67736
msg243420 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-05-17 18:25
Thanks, Milan.
History
Date User Action Args
2022-04-11 14:57:56 admin set github: 64297
2015-05-17 18:25:22 r.david.murray set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2015-05-17 18:24:51 python-dev set nosy: + python-devmessages: +
2014-04-24 12:24:26 zvyn set files: - mangle_from_20140424.patch
2014-04-24 12:24:14 zvyn set files: + mangle_from_20140424.patch
2014-04-24 12:13:30 zvyn set files: + mangle_from_20140424.patchmessages: +
2014-03-28 22:48:41 holdenweb set nosy: + holdenwebmessages: +
2014-03-16 09:17:30 berker.peksag set stage: needs patch -> patch review
2014-03-09 22:43:12 zvyn set files: - mangle_from_with_doc.patch
2014-03-09 22:43:01 zvyn set files: + mangle_from_with_doc.patch
2014-03-09 22:38:12 zvyn set files: - mangle_from_with_doc.patch
2014-03-09 22:37:40 zvyn set files: + mangle_from_with_doc.patchmessages: +
2014-03-09 22:27:57 zvyn set files: + mangle_from_with_doc.patchmessages: +
2014-03-03 15:01:04 zvyn set files: + mangle_from.patchmessages: +
2014-03-03 14:57:29 zvyn set files: - mangle_from.patch
2014-03-03 13:36:15 zvyn set files: + mangle_from.patchnosy: + zvynmessages: +
2014-01-01 23:48:10 r.david.murray set messages: +
2014-01-01 16:55:56 gennad set files: + 20098.patchnosy: + gennadmessages: + keywords: + patch
2013-12-30 23:35:17 r.david.murray create