msg321575 - (view) |
Author: Lysandros Nikolaou (lys.nikolaou) *  |
Date: 2018-07-12 18:49 |
On my Mac OS X 10.13.6 system test_socket.test_host_resolution_bad_address fails with the following error: ====================================================================== FAIL: test_host_resolution_bad_address (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/path/to/cpython/Lib/test/test_socket.py", line 897, in test_host_resolution_bad_address socket.gethostbyname(addr) AssertionError: OSError not raised : 0.1.1.~1 ---------------------------------------------------------------------- Ran 555 tests in 24.950s FAILED (failures=1, skipped=141) /path/to/cpython/Lib/test/test_socket.py:2345: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /path/to/cpython/Lib/test/test_socket.py:2436: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) test test_socket failed == Tests result: FAILURE == 1 test failed: test_socket Total duration: 25 sec 423 ms Tests result: FAILURE When I manually run socket.gethostbyname('0.1.1.~1'), it returns an IP address, no exception thrown. |
|
|
msg322987 - (view) |
Author: Lysandros Nikolaou (lys.nikolaou) *  |
Date: 2018-08-02 18:34 |
Is this expected behaviour, should the tests be changes, or is it a bug? |
|
|
msg322990 - (view) |
Author: Ronald Oussoren (ronaldoussoren) *  |
Date: 2018-08-02 20:08 |
This is not expected, but I don't know where the problem is. On my machine I get: >>> socket.gethostbyname('0.1.1.~1') Traceback (most recent call last): File "", line 1, in socket.gaierror: [Errno 8] nodename nor servname provided, or not known This is on a machine running 10.13.6: $ sw_vers ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65 I'm using a checkout of master of about a week all, and get the same exception with 3.7.0. I also get the same exception on the current beta of macOS 10.14 (With python 3.7.0) I'm currently building the current master to check if that changes anything. |
|
|
msg322992 - (view) |
Author: Ronald Oussoren (ronaldoussoren) *  |
Date: 2018-08-02 20:12 |
Note that the test itself has the following comment: def test_host_resolution_bad_address(self): # These are all malformed IP addresses and expected not to resolve to # any result. But some ISPs, e.g. AWS, may successfully resolve these # IPs. Does the following shell command give an error? : host '0.1.1.~1' |
|
|
msg322996 - (view) |
Author: Lysandros Nikolaou (lys.nikolaou) *  |
Date: 2018-08-02 22:59 |
When running the terminal command host '0.1.1.~1' I get the following output: 0.1.1.~1 has address 62.138.239.45 0.1.1.~1 has address 62.138.238.45 Host 0.1.1.~1 not found: 3(NXDOMAIN) Host 0.1.1.~1 not found: 3(NXDOMAIN) If I ping the above IP address 62.138.239.45, it does not respond. |
|
|
msg323025 - (view) |
Author: Ronald Oussoren (ronaldoussoren) *  |
Date: 2018-08-03 05:45 |
For some reason your system resolves invalid names, likely due to some upstream nameserver misbehaving. Is your Internet provider T-Online in Germany? The address 62.138.239.45 is registered to that company, the IP address also appears to host some kind of search page. This is sadly behaviour of some Internet provider: provide a DNS server to customers that won't return "domain not found", but returns a search page with advertising instead. All in all I think this is not a bug in Python. |
|
|