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
95bcb930
Kaydet (Commit)
95bcb930
authored
Şub 25, 2011
tarafından
Giampaolo Rodolà
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 11291: poplib suppresses errors on QUIT.
üst
103a6d6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
poplib.py
Lib/poplib.py
+10
-7
test_poplib.py
Lib/test/test_poplib.py
+13
-2
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/poplib.py
Dosyayı görüntüle @
95bcb930
...
...
@@ -250,15 +250,18 @@ class POP3:
def
quit
(
self
):
"""Signoff: commit changes on server, unlock mailbox, close connection."""
try
:
resp
=
self
.
_shortcmd
(
'QUIT'
)
except
error_proto
as
val
:
resp
=
val
self
.
file
.
close
()
self
.
sock
.
close
()
del
self
.
file
,
self
.
sock
resp
=
self
.
_shortcmd
(
'QUIT'
)
self
.
close
()
return
resp
def
close
(
self
):
"""Close the connection without assuming anything about it."""
if
self
.
file
is
not
None
:
self
.
file
.
close
()
if
self
.
sock
is
not
None
:
self
.
sock
.
close
()
self
.
file
=
self
.
sock
=
None
#__del__ = quit
...
...
Lib/test/test_poplib.py
Dosyayı görüntüle @
95bcb930
...
...
@@ -108,6 +108,10 @@ class DummyPOP3Handler(asynchat.async_chat):
def
cmd_apop
(
self
,
arg
):
self
.
push
(
'+OK done nothing.'
)
def
cmd_quit
(
self
,
arg
):
self
.
push
(
'+OK closing.'
)
self
.
close_when_done
()
class
DummyPOP3Server
(
asyncore
.
dispatcher
,
threading
.
Thread
):
...
...
@@ -165,10 +169,10 @@ class TestPOP3Class(TestCase):
def
setUp
(
self
):
self
.
server
=
DummyPOP3Server
((
HOST
,
PORT
))
self
.
server
.
start
()
self
.
client
=
poplib
.
POP3
(
self
.
server
.
host
,
self
.
server
.
port
)
self
.
client
=
poplib
.
POP3
(
self
.
server
.
host
,
self
.
server
.
port
,
timeout
=
3
)
def
tearDown
(
self
):
self
.
client
.
quit
()
self
.
client
.
close
()
self
.
server
.
stop
()
def
test_getwelcome
(
self
):
...
...
@@ -228,6 +232,12 @@ class TestPOP3Class(TestCase):
self
.
client
.
uidl
()
self
.
client
.
uidl
(
'foo'
)
def
test_quit
(
self
):
resp
=
self
.
client
.
quit
()
self
.
assertTrue
(
resp
)
self
.
assertIsNone
(
self
.
client
.
sock
)
self
.
assertIsNone
(
self
.
client
.
file
)
SUPPORTS_SSL
=
False
if
hasattr
(
poplib
,
'POP3_SSL'
):
...
...
@@ -274,6 +284,7 @@ if hasattr(poplib, 'POP3_SSL'):
else
:
DummyPOP3Handler
.
handle_read
(
self
)
class
TestPOP3_SSLClass
(
TestPOP3Class
):
# repeat previous tests by using poplib.POP3_SSL
...
...
Misc/NEWS
Dosyayı görüntüle @
95bcb930
...
...
@@ -35,6 +35,8 @@ Core and Builtins
Library
-------
- Issue 11291: poplib.POP no longer suppresses errors on quit().
- Issue 11177: asyncore'
s
create_socket
()
arguments
can
now
be
omitted
.
-
Issue
#
6064
:
Add
a
``
daemon
``
keyword
argument
to
the
threading
.
Thread
...
...
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