test_ftplib fails in TestIPv6Environment:
======================================================================
ERROR: test_makepasv (test.test_ftplib.TestIPv6Environment)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/cf/cpython/Lib/test/test_ftplib.py", line 651, in setUp
self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6)
File "/home/cf/cpython/Lib/test/test_ftplib.py", line 220, in __init__
self.bind(address)
File "/home/cf/cpython/Lib/asyncore.py", line 339, in bind
return self.socket.bind(addr)
socket.gaierror: [Errno -2] Name or service not known
======================================================================
ERROR: test_transfer (test.test_ftplib.TestIPv6Environment)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/cf/cpython/Lib/test/test_ftplib.py", line 651, in setUp
self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6)
File "/home/cf/cpython/Lib/test/test_ftplib.py", line 220, in __init__
self.bind(address)
File "/home/cf/cpython/Lib/asyncore.py", line 339, in bind
return self.socket.bind(addr)
socket.gaierror: [Errno -2] Name or service not known
----------------------------------------------------------------------
Ran 74 tests in 6.595s
FAILED (errors=2)
test test_ftplib failed -- multiple errors occurred
1 test failed:
test_ftplib
The reason is that support.HOST is 'localhost'. and on most machines, localhost is an alias for 127.0.0.1, and not the IPv6 loopback, so the address resolution fails.
One possible solution is simply to pass ::1 (IPv6 loopback address) instead of support.HOST.
Patch attached.
|