From: Ned Deily Date: Fri, 14 Feb 2014 06:49:30 +0000 (-0800) Subject: Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. X-Git-Tag: v2.7.7rc1~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e789a1d866b279e20fe3426732cf681b5b44e96a;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 5fd96fec64..5d5005bc6c 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -663,9 +663,15 @@ class GeneralModuleTests(unittest.TestCase): socket.getaddrinfo(None, 0, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE) - # 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 check_sendall_interrupted(self, with_timeout): # socketpair() is not stricly required, but it makes things easier. diff --git a/Misc/NEWS b/Misc/NEWS index a823fa7692..178fd5b759 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -282,6 +282,8 @@ Tests - Issue #19085: Added basic tests for all tkinter widget options. +- Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. + Documentation -------------