[issue23788] test_urllib2_localnet.test_bad_address fails: OSError not raised by urlopen

Martin Panter report at bugs.python.org
Mon Dec 7 01:25:16 EST 2015


Martin Panter added the comment:

Steve and/or Raniere: I suspect this is the same problem as mentioned in the giant comment, Issue 17564. In other words, it is probably your ISP or DNS which is broken, not Python.

However, rather than expecting everyone to automatically read the giant wall of comment in the source code, perhaps we could improve the failure message:

with self.assertRaises(OSError,
        msg="Perhaps your ISP hijacked the DNS request; "
        "see the source code comments"):
    # Giant comment
    urllib.request.urlopen(...)

Then the failure would look like this:

AssertionError: OSError not raised : Perhaps your ISP hijacked the DNS request; see the source code comments

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23788>
_______________________________________


More information about the Python-bugs-list mailing list