我使用Ubuntu 14.04并在安装Python 3.5.1时,运行make test后出现以下错误。
3 tests failed again:
test_httplib test_ssl test_urllibnet
test_urllibnet
test test_urllibnet failed -- Traceback (most recent call last):
File "/home/user/Softwares/Python-3.5.1/Lib/test/test_urllibnet.py", line 100, in test_getcode
self.assertEqual(code, 404)
AssertionError: 500 != 404
test_httplib
test test_httplib failed -- Traceback (most recent call last):
File "/home/user/Softwares/Python-3.5.1/Lib/test/test_httplib.py", line 1325, in test_networked_good_cert
h.request('GET', '/')
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 1083, in request
self._send_request(method, url, body, headers)
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 1128, in _send_request
self.endheaders(body)
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 1079, in endheaders
self._send_output(message_body)
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 911, in _send_output
self.send(msg)
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 854, in send
self.connect()
File "/home/user/Softwares/Python-3.5.1/Lib/http/client.py", line 1237, in connect
server_hostname=server_hostname)
File "/home/user/Softwares/Python-3.5.1/Lib/ssl.py", line 376, in wrap_socket
_context=self)
File "/home/user/Softwares/Python-3.5.1/Lib/ssl.py", line 747, in __init__
self.do_handshake()
File "/home/user/Softwares/Python-3.5.1/Lib/ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "/home/user/Softwares/Python-3.5.1/Lib/ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
test_ssl
Resource 'sha256.tbs-internet.com' is not available
/home/user/Softwares/Python-3.5.1/Lib/unittest/case.py:628: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('192.168.0.9', 42188), raddr=('82.94.164.164', 443)>
outcome.errors.clear()
/home/user/Softwares/Python-3.5.1/Lib/unittest/case.py:628: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('192.168.0.9', 42198), raddr=('82.94.164.164', 443)>
outcome.errors.clear()
/home/user/Softwares/Python-3.5.1/Lib/unittest/case.py:628: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('192.168.0.9', 42213), raddr=('82.94.164.164', 443)>
outcome.errors.clear()
/home/user/Softwares/Python-3.5.1/Lib/unittest/case.py:628: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('192.168.0.9', 42235), raddr=('82.94.164.164', 443)>
outcome.errors.clear()
test test_ssl failed -- multiple errors occurred; run in verbose mode for details
如果我继续安装会影响将来吗? 有什么理由吗?有任何解决方法可以解决这个问题吗?
谢谢
答案 0 :(得分:1)
对我来说,这看起来主机的互联网连接存在问题。试试
wget http://www.google.com
看看你是否得到任何结果。
解答:
看起来我发现了这个问题:这是2015年test.py中的一个错误psf.upfronthosting.co.za/issue25674我建议您从新位置获取或重新安装Python,此错误已修补