Skip to content

Provisional new email API: new policy implementing custom header objects #56795

Closed

Description

@bitdancer
BPO 12586
Nosy @warsaw, @bitdancer
Dependencies
  • bpo-14731: Enhance Policy framework in preparation for adding email6 policies as provisional
  • Files
  • email6.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 2012-05-26.03:30:28.400>
    created_at = <Date 2011-07-19.18:24:20.573>
    labels = ['type-feature', 'expert-email']
    title = 'Provisional new email API: new policy implementing custom header objects'
    updated_at = <Date 2012-05-26.03:30:28.399>
    user = 'https://github.com/bitdancer'

    bugs.python.org fields:

    activity = <Date 2012-05-26.03:30:28.399>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-05-26.03:30:28.400>
    closer = 'r.david.murray'
    components = ['email']
    creation = <Date 2011-07-19.18:24:20.573>
    creator = 'r.david.murray'
    dependencies = ['14731']
    files = ['25693']
    hgrepos = []
    issue_num = 12586
    keywords = ['patch']
    message_count = 6.0
    messages = ['140687', '161171', '161628', '161638', '161640', '161641']
    nosy_count = 3.0
    nosy_names = ['barry', 'r.david.murray', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue12586'
    versions = ['Python 3.3']

    Activity

    1. bitdancer commented on Jul 19, 2011

      @bitdancer
      MemberAuthor

      The work I've been doing on email6 has reached a stage where I'm confident about the overall plan of the new code, and am ready for people to review it and make suggestions. The patch represents a working state of the code, but with several omissions that I will continue to work on while the rest of the code is reviewed. The major omissions are that address headers don't yet handle encoded words in their 'value' and related attributes, and that structured headers do not properly support unicode characters when the message is flattened. (The traditional email5 methods for handling unicode in structured headers still work fine, though). There are also edge-cases where the address parser does not do as well as email.utils.parseaddr (and other cases where it does better).

      A goal of email6 is to be 100% backward compatible with the existing email5.1 API. If you find any deviations please let me know.

      A new policy, email6_defaults, allows you to run the code with what are intended to be the defaults in Python 3.4. (Not specifying either email6_defaults or email5_defaults when creating a message will result in warning messages in cases where it would make a difference which policy was in force). The only difference between the two right now is that email6_defaults sets 'use_decoded' true, which means that the string value of header objects is the fully unicode version, not the ASCII-only version that comes from the source as is true with email5_defaults.

      I've also released this version of the code as email-6.0.0a1 on pypi, so that it can be tested using 3.2 (you import it as 'email6').

      I will separately attach here the README from the pypi package, which details the header features that are finished and the ones that still need work.

      After review, I'd like to go ahead and check this in to default and continue the work from there. From this point until I start work on the message_factory all changes will be incremental. When we originally planned out email6 we thought we'd be making a "compatibility break" with backward compatibility shims. As things have turned out the work is more a matter of incremental improvement of the API while maintaining the old API, and thus it seems reasonable to me to work on it directly in default rather than continue to work on it in a separate feature branch.

      If, that is, the approach here is accepted :) The email-sig seems to like it.

      Oh, yeah, and there's room for plenty of bike-shedding about certain attribute names &c.

    2. self-assigned this
      on Jul 19, 2011
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jul 19, 2011
    4. bitdancer commented on May 19, 2012

      @bitdancer
      MemberAuthor

      As mentioned on python-dev, I'm planning to introduce the new header parsing/folding code as a provisional API in the spirit if not quite the letter of PEP-411. bpo-14731 is a pre-requisite for this issue, since this patch builds on to of that one.

      This patch is almost entirely additions. At a later stage I can probably remove some of the older code, but the bulk of the backward compatibility stuff may have to remain around until Python4.

    5. added and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on May 19, 2012
    6. changed the title [-]Enhanced email API: header objects[/-] [+]Provisional new email API: new policy implementing custom header objects[/+] on May 19, 2012
    7. removed their assignment
      on May 19, 2012
    8. python-dev commented on May 25, 2012

      python-devmannequin
      Mannequin

      New changeset 0189b9d2d6bc by R David Murray in branch 'default':
      bpo-12586: add provisional email policy with new header parsing and folding.
      http://hg.python.org/cpython/rev/0189b9d2d6bc

    9. python-dev commented on May 26, 2012

      python-devmannequin
      Mannequin

      New changeset 331cceee3b45 by R David Murray in branch 'default':
      bpo-12586: Expand What's New email entry with provisional policy features.
      http://hg.python.org/cpython/rev/331cceee3b45

    10. python-dev commented on May 26, 2012

      python-devmannequin
      Mannequin

      New changeset 09e97829ed1e by R David Murray in branch 'default':
      Add news entries for bpo-14731 and bpo-12586.
      http://hg.python.org/cpython/rev/09e97829ed1e

    11. python-dev commented on May 26, 2012

      python-devmannequin
      Mannequin

      New changeset 2b6f183091b9 by R David Murray in branch 'default':
      bpo-12586: Fix a small oversight in the new email policy header setting code.
      http://hg.python.org/cpython/rev/2b6f183091b9

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions