[issue21079] EmailMessage.is_attachment == False if filename is present

R. David Murray report at bugs.python.org
Thu Mar 27 19:49:14 CET 2014


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 <report at bugs.python.org>
<http://bugs.python.org/issue21079>
_______________________________________


More information about the Python-bugs-list mailing list