]> granicus.if.org Git - python/commitdiff
Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 9 Nov 2010 23:10:33 +0000 (23:10 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 9 Nov 2010 23:10:33 +0000 (23:10 +0000)
Lorenzo M. Catucci.

Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/ACKS
Misc/NEWS

index 1b375465af68f42334038be2083493215fe0fc29..e020747e6ce098610f94378930f3424dddae4b3d 100644 (file)
@@ -260,6 +260,7 @@ class IMAP4:
     def shutdown(self):
         """Close I/O established in "open"."""
         self.file.close()
+        self.sock.shutdown(socket.SHUT_RDWR)
         self.sock.close()
 
 
index 8d86ce6f4b050e6f20241abe9647fb5b0b54b547..351659d7ce785bcef10a640888842658da148235 100644 (file)
@@ -217,6 +217,7 @@ class RemoteIMAPTest(unittest.TestCase):
 
     def test_logout(self):
         rs = self.server.logout()
+        self.server = None
         self.assertEqual(rs[0], 'BYE')
 
 
index 361cdf94f45ec8c4b890416ab6424d0b6cdb735e..3cb3a29595d6dcd5dc1feac79a279fb353a8ae15 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -130,6 +130,7 @@ Tony Campbell
 Brett Cannon
 Mike Carlton
 Terry Carroll
+Lorenzo M. Catucci
 Donn Cave
 Charles Cazabon
 Per Cederqvist
index 19e653cb3209eac9a09f0fbe37453ebbfdf601bf..5cd664755a8c5272d4fed7ad062d6ea76125ad93 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by
+  Lorenzo M. Catucci.
+
 - Fix IMAP.login() to work properly.
 
 - Issue #9244: multiprocessing pool worker processes could terminate