[Python-checkins] cpython (merge 3.3 -> default): Issue #16955: Fix the poll() method for multiprocessing's socket

richard.oudkerk python-checkins at python.org
Sun Jan 13 23:54:29 CET 2013


http://hg.python.org/cpython/rev/d904a741afde
changeset:   81496:d904a741afde
parent:      81494:50606131a987
parent:      81495:e1c81ab5ad97
user:        Richard Oudkerk <shibturn at gmail.com>
date:        Sun Jan 13 22:52:13 2013 +0000
summary:
  Issue #16955: Fix the poll() method for multiprocessing's socket
connections on Windows.

files:
  Lib/multiprocessing/connection.py |   2 +-
  Lib/test/test_multiprocessing.py  |  11 +++++++++++
  Misc/NEWS                         |   3 +++
  3 files changed, 15 insertions(+), 1 deletions(-)


diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -405,7 +405,7 @@
         return self._recv(size)
 
     def _poll(self, timeout):
-        r = wait([self._handle], timeout)
+        r = wait([self], timeout)
         return bool(r)
 
 
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -2358,6 +2358,17 @@
         p.join()
         l.close()
 
+    def test_issue16955(self):
+        for fam in self.connection.families:
+            l = self.connection.Listener(family=fam)
+            c = self.connection.Client(l.address)
+            a = l.accept()
+            a.send_bytes(b"hello")
+            self.assertTrue(c.poll(1))
+            a.close()
+            c.close()
+            l.close()
+
 class _TestPoll(unittest.TestCase):
 
     ALLOWED_TYPES = ('processes', 'threads')
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -217,6 +217,9 @@
 Library
 -------
 
+- Issue #16955: Fix the poll() method for multiprocessing's socket
+  connections on Windows.
+
 - SSLContext.load_dh_params() now properly closes the input file.
 
 - Issue #16829: IDLE printing no longer fails if there are spaces or other

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list