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
7372a07f
Kaydet (Commit)
7372a07f
authored
Ock 26, 2011
tarafından
R. David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11019: Make BytesGenerator handle Message with None body.
Bug discovery and initial patch by Victor Stinner.
üst
a63a312a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
generator.py
Lib/email/generator.py
+2
-0
test_email.py
Lib/email/test/test_email.py
+7
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/email/generator.py
Dosyayı görüntüle @
7372a07f
...
...
@@ -377,6 +377,8 @@ class BytesGenerator(Generator):
def
_handle_text
(
self
,
msg
):
# If the string has surrogates the original source was bytes, so
# just write it back out.
if
msg
.
_payload
is
None
:
return
if
_has_surrogates
(
msg
.
_payload
):
self
.
write
(
msg
.
_payload
)
else
:
...
...
Lib/email/test/test_email.py
Dosyayı görüntüle @
7372a07f
...
...
@@ -2989,6 +2989,13 @@ class Test8BitBytesHandling(unittest.TestCase):
email
.
generator
.
BytesGenerator
(
out
)
.
flatten
(
msg
)
self
.
assertEqual
(
out
.
getvalue
(),
self
.
non_latin_bin_msg
)
def
test_bytes_generator_handles_None_body
(
self
):
#Issue 11019
msg
=
email
.
message
.
Message
()
out
=
BytesIO
()
email
.
generator
.
BytesGenerator
(
out
)
.
flatten
(
msg
)
self
.
assertEqual
(
out
.
getvalue
(),
b
"
\n
"
)
non_latin_bin_msg_as7bit_wrapped
=
textwrap
.
dedent
(
"""
\
From: foo@bar.com
To: =?unknown-8bit?q?b=C3=A1z?=
...
...
Misc/NEWS
Dosyayı görüntüle @
7372a07f
...
...
@@ -16,6 +16,9 @@ Core and Builtins
Library
-------
- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
with a None body.
- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
keyword-only argument. The preceding positional argument was deprecated,
so it made no sense to add filter as a positional argument.
...
...
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