From: Ronald Oussoren Date: Fri, 24 May 2013 11:51:21 +0000 (+0200) Subject: (3.3->default) Issue #17269: Workaround for a platform bug in getaddrinfo on OSX X-Git-Tag: v3.4.0a1~648 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc3e6cc452a2a4409a4d12804fab4e474abbf9ff;p=thirdparty%2FPython%2Fcpython.git (3.3->default) Issue #17269: Workaround for a platform bug in getaddrinfo on OSX Without this patch socket.getaddrinfo crashed when called with some unusual argument combinations. --- dc3e6cc452a2a4409a4d12804fab4e474abbf9ff diff --cc Lib/test/test_socket.py index 546d79309128,546a10d23a7f..a2de398c80d6 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@@ -1201,9 -1166,12 +1201,12 @@@ class GeneralModuleTests(unittest.TestC # 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) + self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0) @unittest.skipUnless(support.is_resource_enabled('network'), 'network is not enabled') diff --cc Misc/NEWS index de8b8cea391e,125b153ee70f..7a4ac3fba4c9 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -96,38 -112,6 +96,41 @@@ Core and Builtin Library ------- ++- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X ++ with port None or "0" and flags AI_NUMERICSERV. ++ +- Issue #16986: ElementTree now correctly parses a string input not only when + an internal XML encoding is UTF-8 or US-ASCII. + +- Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX. + +- Issue #17900: Allowed pickling of recursive OrderedDicts. Decreased pickled + size and pickling time. + +- Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an + initial patch by Trent Nelson. + +- Issue #17812: Fixed quadratic complexity of base64.b32encode(). + Optimize base64.b32encode() and base64.b32decode() (speed up to 3x). + +- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of + service using certificates with many wildcards (CVE-2013-2099). + +- Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity. + +- Issue #14596: The struct.Struct() objects now use more compact implementation. + +- Issue #17981: Closed socket on error in SysLogHandler. + +- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function + is long, not int. + +- Fix typos in the multiprocessing module. + +- Issue #17754: Make ctypes.util.find_library() independent of the locale. + +- Issue #17968: Fix memory leak in os.listxattr(). + - Issue #17606: Fixed support of encoded byte strings in the XMLGenerator characters() and ignorableWhitespace() methods. Original patch by Sebastian Ortiz Vasquez.