From 0c8bee639368324b750176ee171cadd33847f18e Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Fri, 9 Oct 2009 21:50:54 +0000 Subject: Issue #7082: When falling back to the MIME 'name' parameter, the correct place to look for it is the Content-Type header. Patch by Darren Worrall. --- Lib/email/message.py | 2 +- Lib/email/test/data/msg_44.txt | 6 ++---- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/email/message.py b/Lib/email/message.py index 129f4ba..db09dee 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -674,7 +674,7 @@ class Message: missing = object() filename = self.get_param('filename', missing, 'content-disposition') if filename is missing: - filename = self.get_param('name', missing, 'content-disposition') + filename = self.get_param('name', missing, 'content-type') if filename is missing: return failobj return utils.collapse_rfc2231_value(filename).strip() diff --git a/Lib/email/test/data/msg_44.txt b/Lib/email/test/data/msg_44.txt index ae462a6..15a2252 100644 --- a/Lib/email/test/data/msg_44.txt +++ b/Lib/email/test/data/msg_44.txt @@ -16,16 +16,14 @@ X-Oblique-Strategy: Make a door into a window --h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; name="msg.txt" +Content-Type: text/plain; name="msg.txt" Content-Transfer-Encoding: 7bit a simple kind of mirror to reflect upon our own --h90VIIIKmx -Content-Type: text/plain -Content-Disposition: inline; name="msg.txt" +Content-Type: text/plain; name="msg.txt" Content-Transfer-Encoding: 7bit a simple kind of mirror diff --git a/Misc/ACKS b/Misc/ACKS index 753ca7b..6383a46 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -807,6 +807,7 @@ David Wolever Klaus-Juergen Wolf Dan Wolfe Richard Wolff +Darren Worrall Gordon Worley Thomas Wouters Heiko Wundram diff --git a/Misc/NEWS b/Misc/NEWS index f1fad86..f3941c0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -398,6 +398,9 @@ Core and Builtins Library ------- +- Issue #7082: When falling back to the MIME 'name' parameter, the + correct place to look for it is the Content-Type header. + - Issue #7048: Force Decimal.logb to round its result when that result is too large to fit in the current precision. -- cgit v0.12