R. David Murray added the comment:
That facility already mostly exists. The bug is that the code in question
doesn't use it.
>>> m['Content-Disposition'].content_disposition
'attachment'
>>> m['Content-Disposition'].params
{'filename': 'attachment.gz'}
On the other hand, looking at that it is obvious there should be a generic
'value' attribute on all MIME headers so that that could be written:
m['Content-Disposition'].value == 'attachment'
where value would be the 'canonical form' of the value for that header when
there is one, including normalizing the case. Some headers still want
specialized attributes (Content-Type's maintype and subtype, for example), but
there is always the value/params split, and that ought to be accessible
generically and currently isn't.
This is why this stuff is still provisional :)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21079>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com