Closed 7f693efa-c293-4e08-80e6-4c8268e300a5 closed 9 years ago
"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
I read the discussion on issue bpo-21079. Does this issue still needs a patch? If yes I am willing to write one.
Yes, that would be great.
I have attached my patch. Reviews?
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.
I have updated the patch. The header with mime parameter 'filename' in addition to header value is already added, will that not be enough?
Looks good, thanks.
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
Thanks, Abhilash.
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: ```python assignee = None closed_at =
created_at =
labels = ['type-feature', 'expert-email']
title = 'Add get_content_disposition() to email.message.Message'
updated_at =
user = 'https://bugs.python.org/brandon-rhodes'
```
bugs.python.org fields:
```python
activity =
actor = 'r.david.murray'
assignee = 'none'
closed = True
closed_date =
closer = 'r.david.murray'
components = ['email']
creation =
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']
```