Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf2e0aa

Browse files
committed
Merged revisions 75301 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r75301 | r.david.murray | 2009-10-09 17:50:54 -0400 (Fri, 09 Oct 2009) | 5 lines 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. ........
1 parent 70affb3 commit bf2e0aa

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/email/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def get_filename(self, failobj=None):
681681
missing = object()
682682
filename = self.get_param('filename', missing, 'content-disposition')
683683
if filename is missing:
684-
filename = self.get_param('name', missing, 'content-disposition')
684+
filename = self.get_param('name', missing, 'content-type')
685685
if filename is missing:
686686
return failobj
687687
return utils.collapse_rfc2231_value(filename).strip()

Lib/email/test/data/msg_44.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ X-Oblique-Strategy: Make a door into a window
1616

1717

1818
--h90VIIIKmx
19-
Content-Type: text/plain
20-
Content-Disposition: inline; name="msg.txt"
19+
Content-Type: text/plain; name="msg.txt"
2120
Content-Transfer-Encoding: 7bit
2221

2322
a simple kind of mirror
2423
to reflect upon our own
2524

2625
--h90VIIIKmx
27-
Content-Type: text/plain
28-
Content-Disposition: inline; name="msg.txt"
26+
Content-Type: text/plain; name="msg.txt"
2927
Content-Transfer-Encoding: 7bit
3028

3129
a simple kind of mirror

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ David Wolever
820820
Klaus-Juergen Wolf
821821
Dan Wolfe
822822
Richard Wolff
823+
Darren Worrall
823824
Gordon Worley
824825
Thomas Wouters
825826
Heiko Wundram

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ C-API
8787
Library
8888
-------
8989

90+
- Issue #7082: When falling back to the MIME 'name' parameter, the
91+
correct place to look for it is the Content-Type header.
92+
9093
- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
9194
builtin tokenizer.
9295

0 commit comments

Comments
 (0)