New submission from daz <ad...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue8058>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to