This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: incorrect behavior of get_filename() method in email pkg
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Patch for get_filename in email.message when content-disposition is missing
View: 7082
Assigned To: Nosy List: daz, r.david.murray
Priority: normal Keywords:

Created on 2010-03-04 16:57 by daz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg100399 - (view) Author: daz (daz) Date: 2010-03-04 16:57
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.
msg100400 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-03-04 17:34
Duplicate of issue 7082.  However, I fixed the documentation in r78656.
msg100401 - (view) Author: daz (daz) Date: 2010-03-04 17:48
Thank you.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52306
2010-03-04 17:48:06dazsetmessages: + msg100401
2010-03-04 17:34:58r.david.murraysetstatus: open -> closed
priority: normal
superseder: Patch for get_filename in email.message when content-disposition is missing


nosy: + r.david.murray
messages: + msg100400
resolution: duplicate
stage: resolved
2010-03-04 16:57:07dazcreate