From: Ned Deily Date: Sat, 29 Mar 2014 07:07:42 +0000 (-0700) Subject: Issue #21093: Prevent failures of ctypes test_macholib on OS X if a X-Git-Tag: v2.7.7rc1~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ac866539f6b43aa61367749d7c7f2e8a71f5fa7;p=python Issue #21093: Prevent failures of ctypes test_macholib on OS X if a copy of libz exists in $HOME/lib or /usr/local/lib. --- diff --git a/Lib/ctypes/test/test_macholib.py b/Lib/ctypes/test/test_macholib.py index eda846d30a..cf50f50c79 100644 --- a/Lib/ctypes/test/test_macholib.py +++ b/Lib/ctypes/test/test_macholib.py @@ -52,8 +52,11 @@ class MachOTest(unittest.TestCase): '/usr/lib/libSystem.B.dylib') result = find_lib('z') - self.assertTrue(result.startswith('/usr/lib/libz.1')) - self.assertTrue(result.endswith('.dylib')) + # Issue #21093: dyld default search path includes $HOME/lib and + # /usr/local/lib before /usr/lib, which caused test failures if + # a local copy of libz exists in one of them. Now ignore the head + # of the path. + self.assertRegexpMatches(result, r".*/lib/libz\..*.*\.dylib") self.assertEqual(find_lib('IOKit'), '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit') diff --git a/Misc/NEWS b/Misc/NEWS index baeffbbb08..d08d0c1d6a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -336,6 +336,9 @@ Tests redirect of http://www.python.org/ to https://www.python.org: use http://www.example.com instead. +- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a + copy of libz exists in $HOME/lib or /usr/local/lib. + Documentation -------------