cpython: acce13a6e728 (original) (raw)
Mercurial > cpython
changeset 81419:acce13a6e728
Issue #3583: mention that testing whether a bad address not triggering an OSError can mean a bad DNS server and not an actual bug. [#3583]
Brett Cannon brett@python.org | |
---|---|
date | Fri, 11 Jan 2013 11:17:53 -0500 |
parents | 1aac333f320a |
children | 21abd27ca9ed b94f308e9b47 |
files | Lib/test/test_urllibnet.py |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-)[+] [-] Lib/test/test_urllibnet.py 19 |
line wrap: on
line diff
--- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -121,16 +121,15 @@ class urlopenNetworkTests(unittest.TestC else: # This happens with some overzealous DNS providers such as OpenDNS self.skipTest("%r should not resolve for test to work" % bogus_domain)
self.assertRaises(OSError,[](#l1.7)
# SF patch 809915: In Sep 2003, VeriSign started[](#l1.8)
# highjacking invalid .com and .net addresses to[](#l1.9)
# boost traffic to their own site. This test[](#l1.10)
# started failing then. One hopes the .invalid[](#l1.11)
# domain will be spared to serve its defined[](#l1.12)
# purpose.[](#l1.13)
# urllib.urlopen, "http://www.sadflkjsasadf.com/")[](#l1.14)
urllib.request.urlopen,[](#l1.15)
"http://sadflkjsasf.i.nvali.d/")[](#l1.16)
failure_explanation = ('opening an invalid URL did not raise OSError; '[](#l1.17)
'can be caused by a broken DNS server '[](#l1.18)
'(e.g. returns 404 or hijacks page)')[](#l1.19)
with self.assertRaises(OSError, msg=failure_explanation):[](#l1.20)
# SF patch 809915: In Sep 2003, VeriSign started highjacking[](#l1.21)
# invalid .com and .net addresses to boost traffic to their own[](#l1.22)
# site. This test started failing then. One hopes the .invalid[](#l1.23)
# domain will be spared to serve its defined purpose.[](#l1.24)
urllib.request.urlopen("http://sadflkjsasf.i.nvali.d/")[](#l1.25)