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

Brandon Rhodes report at bugs.python.org
Thu Mar 27 18:12:10 CET 2014


New submission from Brandon Rhodes:

Most attachments (in my inbox, at least) specify a filename, and thus
have a Content-Disposition header that looks like:

Content-Disposition: attachment; filename="attachment.gz"

In fact, this sample header was generated by the new add_attachment()
method in Python itself. Unfortunately, the is_attachment property
currently does this test:

c_d.lower() == 'attachment'

Which means that it returns False for almost all attachments in my
email archive. I believe that the test should instead be:

c_d.split(';', 1)[0].lower() == 'attachment'

----------
components: email
messages: 214969
nosy: barry, brandon-rhodes, r.david.murray
priority: normal
severity: normal
status: open
title: EmailMessage.is_attachment == False if filename is present
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21079>
_______________________________________


More information about the Python-bugs-list mailing list