]> granicus.if.org Git - python/commitdiff
Merged revisions 86383 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 9 Nov 2010 23:15:18 +0000 (23:15 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 9 Nov 2010 23:15:18 +0000 (23:15 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86383 | antoine.pitrou | 2010-11-10 00:10:33 +0100 (mer., 10 nov. 2010) | 4 lines

  Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by
  Lorenzo M. Catucci.
........

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

index 8734a8430419109f42d67d24e660c51ee10316dc..c8f32a7b60347d139e87be4ee90d2d31d2308348 100644 (file)
@@ -248,6 +248,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 a04ae65dfb1faf973673c6e572faa06a0d99fc89..00db29db271eefc2e7afdb803d18044dc821dfaf 100644 (file)
@@ -203,6 +203,7 @@ class RemoteIMAPTest(unittest.TestCase):
 
     def test_logout(self):
         rs = self.server.logout()
+        self.server = None
         self.assertEqual(rs[0], 'BYE')
 
 
index 28850b0873883431bc443c0047a76dedf399c740..4d2d4bbed66c6ff2cec6d5ecb042b7817a6d8d69 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -123,6 +123,7 @@ Tony Campbell
 Brett Cannon
 Mike Carlton
 Terry Carroll
+Lorenzo M. Catucci
 Donn Cave
 Charles Cazabon
 Per Cederqvist
index d4da0fd070a558f5019d235f33b1eb9e67207cdd..ab8e270c28b4130ad193e55363cb6f8e53935323 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -69,6 +69,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by
+  Lorenzo M. Catucci.
+
 - Issue #10126: Fix distutils' test_build when Python was built with
   --enable-shared.