msg71292 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2008-08-17 21:21 |
OpenDNS has a "feature" where if you enter an address that doesn't exist, you get a 404 and a Google-looking search page. Problem is that urllib.urlopen() does not raise any exception on a 404. Probably should just change the test such that if no exception is raised, check if a 404 was returned and still consider the test passed. |
|
|
msg71319 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2008-08-18 10:52 |
Are many people using OpenDNS? Is there a way to detect that OpenDNS is being used and trigger a separate path in the test? I say that because returning a 404 when the domain lookup has failed is wrong. Perhaps the test should check for a 404 and still raise an exception, but with an appropriate message indicating that it may be due to a "featureful" DNS service. |
|
|
msg71352 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2008-08-18 17:19 |
On Mon, Aug 18, 2008 at 3:52 AM, Antoine Pitrou <report@bugs.python.org> wrote: > > Antoine Pitrou <pitrou@free.fr> added the comment: > > Are many people using OpenDNS? Is there a way to detect that OpenDNS is > being used and trigger a separate path in the test? > I say that because returning a 404 when the domain lookup has failed is > wrong. Perhaps the test should check for a 404 and still raise an > exception, but with an appropriate message indicating that it may be due > to a "featureful" DNS service. > That's also a possibility. Out of curiosity, what HTTP response should be received? |
|
|
msg71353 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2008-08-18 17:50 |
Le lundi 18 août 2008 à 17:19 +0000, Brett Cannon a écrit : > That's also a possibility. > > Out of curiosity, what HTTP response should be received? There shouldn't be an HTTP response at all. If DNS lookup fails, connecting to the server simply fails. |
|
|
msg87786 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2009-05-15 01:39 |
I got a similar problem but here the ISP returned an error/search page and a "302 Found". test_urllibnet.test_bad_address() failed with "AssertionError: IOError not raised by urlopen" >>> import http.client >>> conn = http.client.HTTPConnection("www.somerandominvalidpage.edu") >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> r1.status, r1.reason (302, 'Found') test_xmlrpc_net failed for the same reason (see #6027). |
|
|
msg124676 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-12-26 19:30 |
I think the best we can do here is add a message explaining that the error may be due to a broken DNS server (one with a wildcard dns record for all non-existent top level domains). However, assertRaises, even in context manager form, doesn't take a msg argument (yet). I've opened an issue with a feature request to fix that and made it a dependency of this issue. Note that the test uses a domain name ending in ".d", and for a while before that used '.invalid', so the test should not fail if the ISP is only capturing valid top level domains with wildcards, something that seems to be far more common than catching invalid domains. |
|
|
msg179693 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-01-11 16:18 |
New changeset acce13a6e728 by Brett Cannon in branch 'default': Issue #3583: mention that testing whether a bad address not triggering http://hg.python.org/cpython/rev/acce13a6e728 |
|
|