Gregory P. Smith added the comment:

Reopening to expand upon this issue which is still a large problem:

If you run on an IPv6-only Linux host, the following standard library tests all 
fail:

test_asynchat, test_asyncio, test_asyncore, test_docxmlrpc, test_epoll, 
test_httpservers, test_logging, test_multiprocessing_fork, 
test_multiprocessing_forkserver, test_os, test_poplib, test_pydoc, 
test_robotparser, test_ssl, test_support, test_telnetlib, 
test_urllib2_localnet, test_urllib_response, test_uuid, test_xmlrpc

I won't attempt to paste all of the errors into here but the errors have a few 
themes, here's a couple examples:

ERROR: test_arp_getnode (test.test_uuid.TestUUID)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lib/python3.4/test/test_uuid.py", line 324, in test_arp_getnode
    node = uuid._arp_getnode()
  File "lib/python3.4/uuid.py", line 364, in _arp_getnode
    ip_addr = socket.gethostbyname(socket.gethostname())
socket.gaierror: [Errno -2] Name or service not known


ERROR: test_getwelcome (test.test_poplib.TestPOP3Class)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lib/python3.4/test/test_poplib.py", line 246, in setUp
    self.server = DummyPOP3Server((HOST, PORT))
  File "lib/python3.4/test/test_poplib.py", line 199, in __init__
    self.create_socket(af, socket.SOCK_STREAM)
  File "lib/python3.4/asyncore.py", line 289, in create_socket
    sock = socket.socket(family, type)
  File "lib/python3.4/socket.py", line 126, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

(yes I know those are from an old 3.4 test suite run but code inspection of 3.6 
shows that the underlying issues appear to remain)

Someone will need to setup an IPv6 only host in order to work on these and can 
generate the full modern list of errors.

It appears we have things that explicitly use IPv4 specific socket flags when 
unwarranted or use old API calls that don't deal with IPv6 at all, and 
represent IP addresses as strings within most of our standard library rather 
than adopting our own high level ipaddress module for API compatibility 
reasons.  (see https://bugs.python.org/issue20215 regarding TCPServer not 
supporting IPv6 at all)

Taking this on will keep Python relevant for the future without forcing people 
to jump through hoops or abandon the stdlib and only use third party networking 
libraries.

----------
nosy: +gregory.p.smith
resolution: wont fix -> 
status: closed -> open
title: socket.gethostbyname  doesn't return an ipv6 address -> Python does not 
work on an IPv6 only host
type:  -> behavior
versions: +Python 2.7, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to