From: Ned Deily Date: Fri, 14 Feb 2014 06:50:42 +0000 (-0800) Subject: Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. X-Git-Tag: v3.3.5rc1^2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b24f481ab4de08e92f5901391594024b2eff0995;p=python Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 67ff1beede..450aee1d43 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1164,9 +1164,15 @@ class GeneralModuleTests(unittest.TestCase): # Issue #6697. self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800') - # Issue 17269 + # Issue 17269: test workaround for OS X platform bug segfault if hasattr(socket, 'AI_NUMERICSERV'): - socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV) + try: + # The arguments here are undefined and the call may succeed + # or fail. All we care here is that it doesn't segfault. + socket.getaddrinfo("localhost", None, 0, 0, 0, + socket.AI_NUMERICSERV) + except socket.gaierror: + pass def test_getnameinfo(self): # only IP addresses are allowed diff --git a/Misc/NEWS b/Misc/NEWS index e5157cf227..b226072509 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,8 @@ Tests - Issue #20474: Fix test_socket "unexpected success" failures on OS X 10.7+. +- Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. + Documentation -------------