From c2e2473bc210ff83c2cbc73c4b916893f773b480 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Wed, 7 Sep 2016 13:39:36 -0400 Subject: 27988: Make sure iter_attachments does not mutate the payload list. --- Lib/email/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/email') 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 -- cgit v1.2.1