summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-02-14 06:50:42 (GMT)
committerNed Deily <nad@acm.org>2014-02-14 06:50:42 (GMT)
commitb24f481ab4de08e92f5901391594024b2eff0995 (patch)
treede9b979d0e79bdcf44e9cb0ce1d46cec578d5677
parentffadbb7ee7ff770d818607f6c03ef6c37a177a6f (diff)
downloadcpython-b24f481ab4de08e92f5901391594024b2eff0995.zip
cpython-b24f481ab4de08e92f5901391594024b2eff0995.tar.gz
cpython-b24f481ab4de08e92f5901391594024b2eff0995.tar.bz2
Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust.
-rw-r--r--Lib/test/test_socket.py10
-rw-r--r--Misc/NEWS2
2 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 67ff1be..450aee1 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 e5157cf..b226072 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
-------------