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
b10be155
Kaydet (Commit)
b10be155
authored
Agu 30, 2014
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge #22215: have the smtplib 'quit' command reset the state.
üst
5ce8f359
0cff49fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
smtplib.py
Lib/smtplib.py
+4
-0
test_smtplib.py
Lib/test/test_smtplib.py
+15
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/smtplib.py
Dosyayı görüntüle @
b10be155
...
...
@@ -891,6 +891,10 @@ class SMTP:
def
quit
(
self
):
"""Terminate the SMTP session."""
res
=
self
.
docmd
(
"quit"
)
# A new EHLO is required after reconnecting with connect()
self
.
ehlo_resp
=
self
.
helo_resp
=
None
self
.
esmtp_features
=
{}
self
.
does_esmtp
=
False
self
.
close
()
return
res
...
...
Lib/test/test_smtplib.py
Dosyayı görüntüle @
b10be155
...
...
@@ -876,6 +876,21 @@ class SMTPSimTests(unittest.TestCase):
str
(
err
))
smtp
.
close
()
def
test_quit_resets_greeting
(
self
):
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
15
)
code
,
message
=
smtp
.
ehlo
()
self
.
assertEqual
(
code
,
250
)
self
.
assertIn
(
'size'
,
smtp
.
esmtp_features
)
smtp
.
quit
()
self
.
assertNotIn
(
'size'
,
smtp
.
esmtp_features
)
smtp
.
connect
(
HOST
,
self
.
port
)
self
.
assertNotIn
(
'size'
,
smtp
.
esmtp_features
)
smtp
.
ehlo_or_helo_if_needed
()
self
.
assertIn
(
'size'
,
smtp
.
esmtp_features
)
smtp
.
quit
()
def
test_with_statement
(
self
):
with
smtplib
.
SMTP
(
HOST
,
self
.
port
)
as
smtp
:
code
,
message
=
smtp
.
noop
()
...
...
Misc/NEWS
Dosyayı görüntüle @
b10be155
...
...
@@ -124,6 +124,10 @@ Core and Builtins
Library
-------
-
Issue
#
22216
:
smtplib
now
resets
its
state
more
completely
after
a
quit
.
The
most
obvious
consequence
of
the
previous
behavior
was
a
STARTTLS
failure
during
a
connect
/
starttls
/
quit
/
connect
/
starttls
sequence
.
-
Issue
#
22098
:
ctypes
' BigEndianStructure and LittleEndianStructure now
define an empty __slots__ so that subclasses don'
t
always
get
an
instance
dict
.
Patch
by
Claudiu
Popa
.
...
...
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