Issue #17269: Workaround for a platform bug in getaddrinfo on OSX

Without this patch socket.getaddrinfo crashed when called
with some unusual argument combinations.
This commit is contained in:
Ronald Oussoren 2013-05-24 13:47:37 +02:00
parent 05ec6aca3a
commit 27a4ac535f
3 changed files with 15 additions and 0 deletions

View file

@ -1166,6 +1166,9 @@ class GeneralModuleTests(unittest.TestCase):
# Issue #6697.
self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800')
# Issue 17269
socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV)
def test_getnameinfo(self):
# only IP addresses are allowed
self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)