Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c2e2473b
Kaydet (Commit)
c2e2473b
authored
Eyl 07, 2016
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
27988: Make sure iter_attachments does not mutate the payload list.
üst
48c88307
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
message.py
Lib/email/message.py
+1
-1
test_message.py
Lib/test/test_email/test_message.py
+10
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/email/message.py
Dosyayı görüntüle @
c2e2473b
...
...
@@ -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
...
...
Lib/test/test_email/test_message.py
Dosyayı görüntüle @
c2e2473b
...
...
@@ -732,6 +732,16 @@ class TestEmailMessageBase:
m
.
set_param
(
'filename'
,
'abc.png'
,
'Content-Disposition'
)
self
.
assertTrue
(
m
.
is_attachment
())
def
test_iter_attachments_mutation
(
self
):
# We had a bug where iter_attachments was mutating the list.
m
=
self
.
_make_message
()
m
.
set_content
(
'arbitrary text as main part'
)
m
.
add_related
(
'more text as a related part'
)
m
.
add_related
(
'yet more text as a second "attachment"'
)
orig
=
m
.
get_payload
()
.
copy
()
self
.
assertEqual
(
len
(
list
(
m
.
iter_attachments
())),
2
)
self
.
assertEqual
(
m
.
get_payload
(),
orig
)
class
TestEmailMessage
(
TestEmailMessageBase
,
TestEmailBase
):
message
=
EmailMessage
...
...
Misc/NEWS
Dosyayı görüntüle @
c2e2473b
...
...
@@ -62,6 +62,8 @@ Core and Builtins
Library
-------
-
Issue
27988
:
Fix
email
iter_attachments
incorrect
mutation
of
payload
list
.
-
Issue
#
27691
:
Fix
ssl
module
's parsing of GEN_RID subject alternative name
fields in X.509 certs.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment