[New-bugs-announce] [issue8058] incorrect behavior of get_filename() method in email pkg

daz report at bugs.python.org
Thu Mar 4 17:57:09 CET 2010


New submission from daz <admin at dazadi.com>:

get_filename() does not parse the Content-Type header for a "name" parameter. This is the old-style RFC 1341 header. Example:

Content-Type: application/octet-stream;
 name="somefile.pdf"
Content-Transfer-Encoding: base64

The email package documentation states:

get_filename([failobj])
    Return the value of the filename parameter of the Content-Disposition header of the message. If the header does not have a filename parameter, this method falls back to looking for the name parameter. If neither is found, or the header is missing, then failobj is returned...

As documented, get_filename() falls back to looking for the "name"
parameter in the Content-Disposition header. Instead, it should fall
back to looking for the "name" parameter in the Content-Type header.

----------
components: Library (Lib)
messages: 100399
nosy: daz
severity: normal
status: open
title: incorrect behavior of get_filename() method in email pkg
type: behavior
versions: Python 2.6, Python 3.1

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


More information about the New-bugs-announce mailing list