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
2d44ceea
Kaydet (Commit)
2d44ceea
authored
Agu 15, 2012
tarafından
Petri Lehtinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11062: Fix adding a message from file to Babyl mailbox
üst
becfcc0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
mailbox.py
Lib/mailbox.py
+1
-1
test_mailbox.py
Lib/test/test_mailbox.py
+13
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/mailbox.py
Dosyayı görüntüle @
2d44ceea
...
@@ -1386,9 +1386,9 @@ class Babyl(_singlefileMailbox):
...
@@ -1386,9 +1386,9 @@ class Babyl(_singlefileMailbox):
line
=
message
.
readline
()
line
=
message
.
readline
()
self
.
_file
.
write
(
line
.
replace
(
'
\n
'
,
os
.
linesep
))
self
.
_file
.
write
(
line
.
replace
(
'
\n
'
,
os
.
linesep
))
if
line
==
'
\n
'
or
line
==
''
:
if
line
==
'
\n
'
or
line
==
''
:
self
.
_file
.
write
(
'*** EOOH ***'
+
os
.
linesep
)
if
first_pass
:
if
first_pass
:
first_pass
=
False
first_pass
=
False
self
.
_file
.
write
(
'*** EOOH ***'
+
os
.
linesep
)
message
.
seek
(
original_pos
)
message
.
seek
(
original_pos
)
else
:
else
:
break
break
...
...
Lib/test/test_mailbox.py
Dosyayı görüntüle @
2d44ceea
...
@@ -8,6 +8,7 @@ import email.message
...
@@ -8,6 +8,7 @@ import email.message
import
re
import
re
import
shutil
import
shutil
import
StringIO
import
StringIO
import
tempfile
from
test
import
test_support
from
test
import
test_support
import
unittest
import
unittest
import
mailbox
import
mailbox
...
@@ -75,6 +76,18 @@ class TestMailbox(TestBase):
...
@@ -75,6 +76,18 @@ class TestMailbox(TestBase):
for
i
in
(
1
,
2
,
3
,
4
):
for
i
in
(
1
,
2
,
3
,
4
):
self
.
_check_sample
(
self
.
_box
[
keys
[
i
]])
self
.
_check_sample
(
self
.
_box
[
keys
[
i
]])
def
test_add_file
(
self
):
with
tempfile
.
TemporaryFile
(
'w+'
)
as
f
:
f
.
write
(
_sample_message
)
f
.
seek
(
0
)
key
=
self
.
_box
.
add
(
f
)
self
.
assertEqual
(
self
.
_box
.
get_string
(
key
)
.
split
(
'
\n
'
),
_sample_message
.
split
(
'
\n
'
))
def
test_add_StringIO
(
self
):
key
=
self
.
_box
.
add
(
StringIO
.
StringIO
(
self
.
_template
%
"0"
))
self
.
assertEqual
(
self
.
_box
.
get_string
(
key
),
self
.
_template
%
"0"
)
def
test_remove
(
self
):
def
test_remove
(
self
):
# Remove messages using remove()
# Remove messages using remove()
self
.
_test_remove_or_delitem
(
self
.
_box
.
remove
)
self
.
_test_remove_or_delitem
(
self
.
_box
.
remove
)
...
...
Misc/NEWS
Dosyayı görüntüle @
2d44ceea
...
@@ -92,6 +92,8 @@ Core and Builtins
...
@@ -92,6 +92,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