Two tests in test_urllib fail. Output from the brew build log [1]: test_urllib failed -- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.5/Lib/test/test_urllib.py", line 235, in test_missing_localfile fp.close() UnboundLocalError: local variable 'fp' referenced before assignment ok ====================================================================== ERROR: test_missing_localfile (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.5/Lib/test/test_urllib.py", line 235, in test_missing_localfile fp.close() UnboundLocalError: local variable 'fp' referenced before assignment ---------------------------------------------------------------------- This certainly shouldn't block anything, but it'd be nice to find out why the test is failing and fix it. [1] http://download.devel.redhat.com/brewroot/packages/python27-python/2.7.5/9.el6/data/logs/x86_64/build.log
Python tracker issue #16450 [0] seems to be related, in which case commit [1] should fix this. [0] http://bugs.python.org/issue16450 [1] http://hg.python.org/cpython/rev/60c195e89c88
Applying the above patch reveals that the real problem is: ====================================================================== ERROR: test_missing_localfile (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.5/Lib/test/test_urllib.py", line 233, in test_missing_localfile fp = urllib.urlopen(tmp_fileurl) File "/builddir/build/BUILD/Python-2.7.5/Lib/urllib.py", line 87, in urlopen return opener.open(url) File "/builddir/build/BUILD/Python-2.7.5/Lib/urllib.py", line 208, in open return getattr(self, name)(url) File "/builddir/build/BUILD/Python-2.7.5/Lib/urllib.py", line 463, in open_file return self.open_local_file(url) File "/builddir/build/BUILD/Python-2.7.5/Lib/urllib.py", line 494, in open_local_file and socket.gethostbyname(host) in (localhost(), thishost()): File "/builddir/build/BUILD/Python-2.7.5/Lib/urllib.py", line 822, in thishost _thishost = socket.gethostbyname(socket.gethostname()) IOError: [Errno socket error] [Errno -3] Temporary failure in name resolution ---------------------------------------------------------------------- which, looking at #221583, appears to be caused by a misconfiguration of DNS and has nothing to do with python.