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

Add get_content_disposition() to email.message.Message #65282

Closed
brandon-rhodes mannequin opened this issue Mar 28, 2014 · 9 comments
Closed

Add get_content_disposition() to email.message.Message #65282

brandon-rhodes mannequin opened this issue Mar 28, 2014 · 9 comments
Labels
topic-email type-feature A feature request or enhancement

Comments

@brandon-rhodes
Copy link
Mannequin

brandon-rhodes mannequin commented Mar 28, 2014

BPO 21083
Nosy @warsaw, @bitdancer
Files
  • c_d.patch
  • c_d-revised.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-16.19:42:03.626>
    created_at = <Date 2014-03-28.11:13:22.801>
    labels = ['type-feature', 'expert-email']
    title = 'Add get_content_disposition() to email.message.Message'
    updated_at = <Date 2015-05-16.19:42:03.624>
    user = 'https://bugs.python.org/brandon-rhodes'

    bugs.python.org fields:

    activity = <Date 2015-05-16.19:42:03.624>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-05-16.19:42:03.626>
    closer = 'r.david.murray'
    components = ['email']
    creation = <Date 2014-03-28.11:13:22.801>
    creator = 'brandon-rhodes'
    dependencies = []
    files = ['35177', '35178']
    hgrepos = []
    issue_num = 21083
    keywords = ['patch']
    message_count = 9.0
    messages = ['215036', '218074', '218076', '218084', '218087', '218088', '218092', '243362', '243363']
    nosy_count = 5.0
    nosy_names = ['barry', 'r.david.murray', 'brandon-rhodes', 'python-dev', 'abhilash.raj']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21083'
    versions = ['Python 3.5']

    @brandon-rhodes
    Copy link
    Mannequin Author

    brandon-rhodes mannequin commented Mar 28, 2014

    "Content-Disposition is an optional header field. In its absence, the MUA may use whatever presentation method it deems suitable." — RFC 2183

    The email.message.Message class should gain a get_content_disposition() method with the three possible return values 'inline', 'attachment', and None so that email clients can easily distinguish between the three states described in the RFC.

    See also the discussion at http://bugs.python.org/issue21079

    @brandon-rhodes brandon-rhodes mannequin added topic-email type-feature A feature request or enhancement labels Mar 28, 2014
    @abhilashraj
    Copy link
    Mannequin

    abhilashraj mannequin commented May 7, 2014

    I read the discussion on issue bpo-21079. Does this issue still needs a patch? If yes I am willing to write one.

    @bitdancer
    Copy link
    Member

    Yes, that would be great.

    @abhilashraj
    Copy link
    Mannequin

    abhilashraj mannequin commented May 7, 2014

    I have attached my patch. Reviews?

    @bitdancer
    Copy link
    Member

    Looks pretty good.

    The docs should say that the value of header is returned, and should also mentioned that the value is lower cased. You should also add a 'versionadded' directive, and for bonus points an entry in the whatsnew document for 3.5. Also, all three possible values should be tested, and a mixed case version of at last one of them, as well as a header that mime parameters in addition to the header value.

    @abhilashraj
    Copy link
    Mannequin

    abhilashraj mannequin commented May 7, 2014

    I have updated the patch. The header with mime parameter 'filename' in addition to header value is already added, will that not be enough?

    @bitdancer
    Copy link
    Member

    Looks good, thanks.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 16, 2015

    New changeset 29ba76f5c3dc by R David Murray in branch 'default':
    bpo-21083: add get_content_disposition method to email.message.
    https://hg.python.org/cpython/rev/29ba76f5c3dc

    @bitdancer
    Copy link
    Member

    Thanks, Abhilash.

    @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
    topic-email type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant