From ed9e06cb21c4437aa87bb23c6509d3dd3274d0fc Mon Sep 17 00:00:00 2001 From: Richard Oudkerk Date: Sun, 13 Jan 2013 22:46:48 +0000 Subject: Issue #16955: Fix the poll() method for multiprocessing's socket connections on Windows. --- Lib/multiprocessing/connection.py | 2 +- Lib/test/test_multiprocessing.py | 11 +++++++++++ Misc/NEWS | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index 2ae8a81..25b0326 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -405,7 +405,7 @@ class Connection(_ConnectionBase): 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 index 533dbac..bb09638 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -2383,6 +2383,17 @@ class _TestListenerClient(BaseTestCase): 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 index d09406b..c444ed6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -147,6 +147,9 @@ Core and Builtins 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 -- cgit v0.12