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
74e68c75
Kaydet (Commit)
74e68c75
authored
Agu 31, 2007
tarafından
Thomas Wouters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test_smtplib by munging asynchat some more.
üst
828f04ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
asynchat.py
Lib/asynchat.py
+10
-1
test_smtplib.py
Lib/test/test_smtplib.py
+2
-2
No files found.
Lib/asynchat.py
Dosyayı görüntüle @
74e68c75
...
...
@@ -46,6 +46,7 @@ method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
"""
import
sys
import
socket
import
asyncore
from
collections
import
deque
...
...
@@ -91,6 +92,8 @@ class async_chat (asyncore.dispatcher):
self
.
handle_error
()
return
if
isinstance
(
data
,
str
):
data
=
data
.
encode
(
'ascii'
)
self
.
ac_in_buffer
=
self
.
ac_in_buffer
+
bytes
(
data
)
# Continue to search for self.terminator in self.ac_in_buffer,
...
...
@@ -126,6 +129,8 @@ class async_chat (asyncore.dispatcher):
# 3) end of buffer does not match any prefix:
# collect data
terminator_len
=
len
(
terminator
)
if
isinstance
(
terminator
,
str
):
terminator
=
terminator
.
encode
(
'ascii'
)
index
=
self
.
ac_in_buffer
.
find
(
terminator
)
if
index
!=
-
1
:
# we found the terminator
...
...
@@ -195,11 +200,15 @@ class async_chat (asyncore.dispatcher):
self
.
close
()
return
elif
isinstance
(
p
,
str
)
or
isinstance
(
p
,
bytes
):
if
isinstance
(
p
,
str
):
p
=
p
.
encode
(
'ascii'
)
self
.
producer_fifo
.
pop
()
self
.
ac_out_buffer
=
self
.
ac_out_buffer
+
bytes
(
p
)
self
.
ac_out_buffer
=
self
.
ac_out_buffer
+
p
return
data
=
p
.
more
()
if
data
:
if
isinstance
(
data
,
str
):
data
=
data
.
encode
(
'ascii'
)
self
.
ac_out_buffer
=
self
.
ac_out_buffer
+
bytes
(
data
)
return
else
:
...
...
Lib/test/test_smtplib.py
Dosyayı görüntüle @
74e68c75
...
...
@@ -405,8 +405,8 @@ class SMTPSimTests(TestCase):
self
.
assertEqual
(
smtp
.
vrfy
(
email
),
expected_known
)
u
=
'nobody@nowhere.com'
expected_unknown
=
(
550
,
bytes
(
'No such user:
%
s'
%
smtplib
.
quoteaddr
(
u
)))
expected_unknown
=
(
550
,
(
'No such user:
%
s'
%
smtplib
.
quoteaddr
(
u
))
.
encode
(
'ascii'
)
)
self
.
assertEqual
(
smtp
.
vrfy
(
u
),
expected_unknown
)
smtp
.
quit
()
...
...
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