首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python 3.4.1 make test失败:错误: test_connect_starttls (test.test_smtpnet.SmtpTest)

Python 3.4.1 make test失败:错误: test_connect_starttls (test.test_smtpnet.SmtpTest)
EN

Stack Overflow用户
提问于 2014-07-22 10:47:16
回答 1查看 1.1K关注 0票数 1

我刚刚在我的centos 6.4虚拟机上下载了python 3.4.1,并按照自述文件中的说明进行操作。首先是./configure,然后是make,最后是make test。

当我运行make test时,它有一个错误,我不知道为什么,我只是完全按照给出的指令操作。下面是输出:

代码语言:javascript
复制
test test_smtpnet failed -- Traceback (most recent call last):
  File "/usr/local/Python-3.4.1/Lib/test/test_smtpnet.py", line 30, in test_connect_starttls
    server = smtplib.SMTP(self.testServer, self.remotePort)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 242, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 321, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 292, in _get_socket
    self.source_address)
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 509, in create_connection
    raise err
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 495, in create_connection
    sock = socket(af, socktype, proto)
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 123, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
368 tests OK.
1 test failed:
    test_smtpnet
7 tests altered the execution environment:
    test_calendar test_float test_locale test_site test_strptime
    test_types test_warnings
12 tests skipped:
    test_curses test_devpoll test_gdb test_kqueue test_msilib
    test_ossaudiodev test_startfile test_tk test_ttk_guionly
    test_winreg test_winsound test_zipfile64
Re-running failed tests in verbose mode
Re-running test 'test_smtpnet' in verbose mode
test_connect_starttls (test.test_smtpnet.SmtpTest) ... ERROR
test_connect (test.test_smtpnet.SmtpSSLTest) ... ok
test_connect_default_port (test.test_smtpnet.SmtpSSLTest) ... ok
test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest) ... ok
test_connect_using_sslcontext_verified (test.test_smtpnet.SmtpSSLTest) ... ok

======================================================================
ERROR: test_connect_starttls (test.test_smtpnet.SmtpTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Python-3.4.1/Lib/test/test_smtpnet.py", line 30, in test_connect_starttls
    server = smtplib.SMTP(self.testServer, self.remotePort)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 242, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 321, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/Python-3.4.1/Lib/smtplib.py", line 292, in _get_socket
    self.source_address)
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 509, in create_connection
    raise err
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 495, in create_connection
    sock = socket(af, socktype, proto)
  File "/usr/local/Python-3.4.1/Lib/socket.py", line 123, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

----------------------------------------------------------------------
Ran 5 tests in 42.864s

FAILED (errors=1)
test test_smtpnet failed
make: *** [test] Error 1

因此,_socket模块似乎尝试使用协议不支持的“地址族”(不管它是什么)。这个例外可以更模糊一些吗?

有人知道我错过了什么吗?

EN

回答 1

Stack Overflow用户

发布于 2014-08-24 05:34:51

看起来测试用例确实需要启用IPv6。因此,在未启用IPv6支持的系统上,它将失败。检查ip a s的输出,查看VM是否设置了IPv6地址,例如,通常以fe80::开头。地址族可以是用于IPv4的AF_INET或用于IPv6的AF_INET6。实际上,这是一个测试用例错误。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24878081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档