summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/email/message.py2
-rw-r--r--Lib/email/test/data/msg_44.txt6
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
4 files changed, 7 insertions, 5 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 412a550..d89e37e 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -681,7 +681,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 8ef4198..bd76d43 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -820,6 +820,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 f542bcb..b2c2e6f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -87,6 +87,9 @@ C-API
Library
-------
+- Issue #7082: When falling back to the MIME 'name' parameter, the
+ correct place to look for it is the Content-Type header.
+
- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
builtin tokenizer.