mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
27988: Make sure iter_attachments does not mutate the payload list.
This commit is contained in:
parent
48c88307d8
commit
c2e2473bc2
3 changed files with 13 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue