Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email policy needs a mangle_from setting #64297

Closed
bitdancer opened this issue Dec 30, 2013 · 11 comments
Closed

email policy needs a mangle_from setting #64297

bitdancer opened this issue Dec 30, 2013 · 11 comments
Labels
easy expert-email type-feature A feature request or enhancement

Comments

@bitdancer
Copy link
Member

bitdancer commented Dec 30, 2013

BPO 20098
Nosy @warsaw, @bitdancer, @zvyn
Files
  • 20098.patch
  • mangle_from.patch: sets default value for mangle_from_ in Policy and changes Generator to use it if not given explicitly.
  • mangle_from_with_doc.patch
  • mangle_from_20140424.patch
  • 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 = None
    closed_at = <Date 2015-05-17.18:25:22.954>
    created_at = <Date 2013-12-30.23:35:17.252>
    labels = ['easy', 'type-feature', 'expert-email']
    title = 'email policy needs a mangle_from setting'
    updated_at = <Date 2015-05-17.18:25:22.952>
    user = 'https://github.com/bitdancer'

    bugs.python.org fields:

    activity = <Date 2015-05-17.18:25:22.952>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-05-17.18:25:22.954>
    closer = 'r.david.murray'
    components = ['email']
    creation = <Date 2013-12-30.23:35:17.252>
    creator = 'r.david.murray'
    dependencies = []
    files = ['33293', '34277', '34322', '35021']
    hgrepos = []
    issue_num = 20098
    keywords = ['patch', 'easy']
    message_count = 11.0
    messages = ['207116', '207136', '207140', '212636', '212641', '212992', '212995', '215088', '217122', '243419', '243420']
    nosy_count = 6.0
    nosy_names = ['barry', 'holdenweb', 'r.david.murray', 'python-dev', 'gennad', 'zvyn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20098'
    versions = ['Python 3.5']

    @bitdancer
    Copy link
    Member Author

    bitdancer commented Dec 30, 2013

    I missed this. It still defaults to True in Generator. It should default to False in the new policies (but True in compat32).

    @bitdancer bitdancer added expert-email easy type-feature A feature request or enhancement labels Dec 30, 2013
    @gennad
    Copy link
    Mannequin

    gennad mannequin commented Jan 1, 2014

    I created the patch, please review it.

    @bitdancer
    Copy link
    Member Author

    bitdancer commented Jan 1, 2014

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

    @zvyn
    Copy link
    Mannequin

    zvyn mannequin commented Mar 3, 2014

    (@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 :)

    @zvyn
    Copy link
    Mannequin

    zvyn mannequin commented Mar 3, 2014

    Updates patch to include necessary changes to test_policy.py.

    @zvyn
    Copy link
    Mannequin

    zvyn mannequin commented Mar 9, 2014

    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.

    @zvyn
    Copy link
    Mannequin

    zvyn mannequin commented Mar 9, 2014

    Rollback to mangle_from_, sorry for the noise.

    @holdenweb
    Copy link
    Member

    holdenweb commented Mar 28, 2014

    This is an easy issue?

    @zvyn
    Copy link
    Mannequin

    zvyn mannequin commented Apr 24, 2014

    Updated the last patch according to the review comments at https://bugs.python.org/review/20098/.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 17, 2015

    New changeset df81f9b67736 by R David Murray in branch 'default':
    bpo-20098: add mangle_from_ policy option.
    https://hg.python.org/cpython/rev/df81f9b67736

    @bitdancer
    Copy link
    Member Author

    bitdancer commented May 17, 2015

    Thanks, Milan.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy expert-email type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants