Issue #4473: Ensure the socket is shutdown cleanly in POP3.close().
Patch by Lorenzo Catucci.
This commit is contained in:
parent
ff790aac66
commit
d89824b0e2
@ -259,6 +259,13 @@ class POP3:
|
|||||||
if self.file is not None:
|
if self.file is not None:
|
||||||
self.file.close()
|
self.file.close()
|
||||||
if self.sock is not None:
|
if self.sock is not None:
|
||||||
|
try:
|
||||||
|
self.sock.shutdown(socket.SHUT_RDWR)
|
||||||
|
except socket.error as e:
|
||||||
|
# The server might already have closed the connection
|
||||||
|
if e.errno != errno.ENOTCONN:
|
||||||
|
raise
|
||||||
|
finally:
|
||||||
self.sock.close()
|
self.sock.close()
|
||||||
self.file = self.sock = None
|
self.file = self.sock = None
|
||||||
|
|
||||||
|
@ -138,6 +138,9 @@ Core and Builtins
|
|||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #4473: Ensure the socket is shutdown cleanly in POP3.close().
|
||||||
|
Patch by Lorenzo Catucci.
|
||||||
|
|
||||||
- Issue #16522: added FAIL_FAST flag to doctest.
|
- Issue #16522: added FAIL_FAST flag to doctest.
|
||||||
|
|
||||||
- Issue #15627: Add the importlib.abc.SourceLoader.compile_source() method.
|
- Issue #15627: Add the importlib.abc.SourceLoader.compile_source() method.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user