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
aae61b8c
Kaydet (Commit)
aae61b8c
authored
Agu 15, 2012
tarafından
Petri Lehtinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#11062: Fix adding a message from file to Babyl mailbox
üst
3115f0d1
3d12c431
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
mailbox.py
Lib/mailbox.py
+1
-1
test_mailbox.py
Lib/test/test_mailbox.py
+6
-12
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/mailbox.py
Dosyayı görüntüle @
aae61b8c
...
@@ -1440,9 +1440,9 @@ class Babyl(_singlefileMailbox):
...
@@ -1440,9 +1440,9 @@ class Babyl(_singlefileMailbox):
line
=
line
[:
-
1
]
+
b
'
\n
'
line
=
line
[:
-
1
]
+
b
'
\n
'
self
.
_file
.
write
(
line
.
replace
(
b
'
\n
'
,
linesep
))
self
.
_file
.
write
(
line
.
replace
(
b
'
\n
'
,
linesep
))
if
line
==
b
'
\n
'
or
not
line
:
if
line
==
b
'
\n
'
or
not
line
:
self
.
_file
.
write
(
b
'*** EOOH ***'
+
linesep
)
if
first_pass
:
if
first_pass
:
first_pass
=
False
first_pass
=
False
self
.
_file
.
write
(
b
'*** EOOH ***'
+
linesep
)
message
.
seek
(
original_pos
)
message
.
seek
(
original_pos
)
else
:
else
:
break
break
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
aae61b8c
...
@@ -152,20 +152,16 @@ class TestMailbox(TestBase):
...
@@ -152,20 +152,16 @@ class TestMailbox(TestBase):
f
.
write
(
_bytes_sample_message
)
f
.
write
(
_bytes_sample_message
)
f
.
seek
(
0
)
f
.
seek
(
0
)
key
=
self
.
_box
.
add
(
f
)
key
=
self
.
_box
.
add
(
f
)
# See issue 11062
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
if
not
isinstance
(
self
.
_box
,
mailbox
.
Babyl
):
_bytes_sample_message
.
split
(
b
'
\n
'
))
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
_bytes_sample_message
.
split
(
b
'
\n
'
))
def
test_add_binary_nonascii_file
(
self
):
def
test_add_binary_nonascii_file
(
self
):
with
tempfile
.
TemporaryFile
(
'wb+'
)
as
f
:
with
tempfile
.
TemporaryFile
(
'wb+'
)
as
f
:
f
.
write
(
self
.
_non_latin_bin_msg
)
f
.
write
(
self
.
_non_latin_bin_msg
)
f
.
seek
(
0
)
f
.
seek
(
0
)
key
=
self
.
_box
.
add
(
f
)
key
=
self
.
_box
.
add
(
f
)
# See issue 11062
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
if
not
isinstance
(
self
.
_box
,
mailbox
.
Babyl
):
self
.
_non_latin_bin_msg
.
split
(
b
'
\n
'
))
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
self
.
_non_latin_bin_msg
.
split
(
b
'
\n
'
))
def
test_add_text_file_warns
(
self
):
def
test_add_text_file_warns
(
self
):
with
tempfile
.
TemporaryFile
(
'w+'
)
as
f
:
with
tempfile
.
TemporaryFile
(
'w+'
)
as
f
:
...
@@ -173,10 +169,8 @@ class TestMailbox(TestBase):
...
@@ -173,10 +169,8 @@ class TestMailbox(TestBase):
f
.
seek
(
0
)
f
.
seek
(
0
)
with
self
.
assertWarns
(
DeprecationWarning
):
with
self
.
assertWarns
(
DeprecationWarning
):
key
=
self
.
_box
.
add
(
f
)
key
=
self
.
_box
.
add
(
f
)
# See issue 11062
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
if
not
isinstance
(
self
.
_box
,
mailbox
.
Babyl
):
_bytes_sample_message
.
split
(
b
'
\n
'
))
self
.
assertEqual
(
self
.
_box
.
get_bytes
(
key
)
.
split
(
b
'
\n
'
),
_bytes_sample_message
.
split
(
b
'
\n
'
))
def
test_add_StringIO_warns
(
self
):
def
test_add_StringIO_warns
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
with
self
.
assertWarns
(
DeprecationWarning
):
...
...
Misc/NEWS
Dosyayı görüntüle @
aae61b8c
...
@@ -13,6 +13,8 @@ Core and Builtins
...
@@ -13,6 +13,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #11062: Fix adding a message from file to Babyl mailbox.
- Issue #15646: Prevent equivalent of a fork bomb when using
- Issue #15646: Prevent equivalent of a fork bomb when using
multiprocessing on Windows without the "if __name__ == '
__main__
'"
multiprocessing on Windows without the "if __name__ == '
__main__
'"
idiom.
idiom.
...
...
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