summaryrefslogtreecommitdiff
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-07 13:39:36 -0400
committerR David Murray <rdmurray@bitdance.com>2016-09-07 13:39:36 -0400
commitc2e2473bc210ff83c2cbc73c4b916893f773b480 (patch)
tree7d773f8dc337bc685924c6a99c1703692ce47f11 /Lib/email
parent48c88307d87ae0704885b9b5c692ded861077a71 (diff)
downloadcpython-git-c2e2473bc210ff83c2cbc73c4b916893f773b480.tar.gz
27988: Make sure iter_attachments does not mutate the payload list.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index aefaf57d00..6cd6cb77c0 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -1022,7 +1022,7 @@ class MIMEPart(Message):
maintype, subtype = self.get_content_type().split('/')
if maintype != 'multipart' or subtype == 'alternative':
return
- parts = self.get_payload()
+ parts = self.get_payload().copy()
if maintype == 'multipart' and subtype == 'related':
# For related, we treat everything but the root as an attachment.
# The root may be indicated by 'start'; if there's no start or we