This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test "test_bad_address" fails on Python 3.4.2 under Linux Mint 13 Maya
Type: Stage: resolved
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_urllib2_localnet fails
View: 17564
Assigned To: Nosy List: Steve.P, ned.deily
Priority: normal Keywords:

Created on 2014-10-14 23:43 by Steve.P, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg229386 - (view) Author: Steve P (Steve.P) Date: 2014-10-14 23:43
Looking in past bug reports, I suspect the test itself is problematic. When I paste the (erroneous) URL the tests is using into Firefox, I get a page back from my ISP with "Sorry, the website sadflkjsasf.i.nvali.d cannot be found"

Here's the output of the test:

@chimp:~/Downloads/Python-3.4.2 $ ./python -m test -v test_bad_address
== CPython 3.4.2 (default, Oct 14 2014, 15:34:15) [GCC 4.6.3]
==   Linux-3.2.0-23-generic-i686-with-debian-wheezy-sid little-endian
==   hash algorithm: siphash24 32bit
==   /home/sp/Downloads/Python-3.4.2/build/test_python_11906
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_bad_address
test test_bad_address crashed -- Traceback (most recent call last):
  File "/home/sp/Downloads/Python-3.4.2/Lib/test/regrtest.py", line 1271, in runtest_inner
    the_module = importlib.import_module(abstest)
  File "/home/sp/Downloads/Python-3.4.2/Lib/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'test.test_bad_address'

1 test failed:
    test_bad_address
msg229387 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-10-14 23:56
I'm not sure what you are trying to do but there is no test module named test_bad_address in the standard library, which is why you get that error.  Doing a quick search of Lib/test shows three different cases of test_bad_address: in the test_ipaddress, test_urllib2_localnet, and test_urllibnet modules.  If you want to just run those tests, you'd need to specify the module names.  Plus two of them require network access so you'll need to enable the "network" test resource.  Try something like:

./python -m test -v -u network test_ipaddress test_urllib2_localnet test_urllibnet
msg229396 - (view) Author: Steve P (Steve.P) Date: 2014-10-15 02:19
I got "test_bad_address" from what was reported using "make test".  Perhaps
at I read the log wrong, but it was clear I got a failure.  At any rate,
here's what I get with the correct test name:

sp@chip:~/Downloads/Python-3.4.2 $ ./python -m test -v -u network
> test_urllib2_localnet
> == CPython 3.4.2 (default, Oct 14 2014, 15:34:15) [GCC 4.6.3]
> ==   Linux-3.2.0-23-generic-i686-with-debian-wheezy-sid little-endian
> ==   hash algorithm: siphash24 32bit
> ==   /home/sp/Downloads/Python-3.4.2/build/test_python_16076
> Testing with flags: sys.flags(debug=0, inspect=0, interactive=0,
> optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0,
> ignore_environment=0, verbose=0, bytes_warning=0, quiet=0,
> hash_randomization=1, isolated=0)
> [1/1] test_urllib2_localnet
> test_basic_auth_httperror (test.test_urllib2_localnet.BasicAuthTests) ...
> ok
> test_basic_auth_success (test.test_urllib2_localnet.BasicAuthTests) ... ok
> test_proxy_qop_auth_int_works_or_throws_urlerror
> (test.test_urllib2_localnet.ProxyAuthTests) ... ok
> test_proxy_qop_auth_works (test.test_urllib2_localnet.ProxyAuthTests) ...
> ok
> test_proxy_with_bad_password_raises_httperror
> (test.test_urllib2_localnet.ProxyAuthTests) ... ok
> test_proxy_with_no_password_raises_httperror
> (test.test_urllib2_localnet.ProxyAuthTests) ... ok
> test_200 (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_200_with_parameters (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_404 (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_bad_address (test.test_urllib2_localnet.TestUrlopen) ... FAIL
> test_basic (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_chunked (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_geturl (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_https (test.test_urllib2_localnet.TestUrlopen) ... stopping HTTPS
> server
> joining HTTPS thread
> ok
> test_https_sni (test.test_urllib2_localnet.TestUrlopen) ... stopping HTTPS
> server
> joining HTTPS thread
> ok
> test_https_with_cadefault (test.test_urllib2_localnet.TestUrlopen) ... Got
> an error:
> [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:600)
> stopping HTTPS server
> joining HTTPS thread
> ok
> test_https_with_cafile (test.test_urllib2_localnet.TestUrlopen) ... Got an
> error:
> [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:600)
> stopping HTTPS server
> joining HTTPS thread
> stopping HTTPS server
> joining HTTPS thread
> ok
> test_info (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_iteration (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_line_iteration (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_redirection (test.test_urllib2_localnet.TestUrlopen) ... ok
> test_sending_headers (test.test_urllib2_localnet.TestUrlopen) ... ok
>
> ======================================================================
> FAIL: test_bad_address (test.test_urllib2_localnet.TestUrlopen)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/sp/Downloads/Python-3.4.2/Lib/test/test_urllib2_localnet.py", line
> 655, in test_bad_address
>     "http://sadflkjsasf.i.nvali.d./")
> AssertionError: OSError not raised by urlopen
>
> ----------------------------------------------------------------------
> Ran 22 tests in 5.260s
>
> FAILED (failures=1)
> test test_urllib2_localnet failed
> 1 test failed:
>     test_urllib2_localnet
>

On Tue, Oct 14, 2014 at 4:56 PM, Ned Deily <report@bugs.python.org> wrote:

>
> Ned Deily added the comment:
>
> I'm not sure what you are trying to do but there is no test module named
> test_bad_address in the standard library, which is why you get that error.
> Doing a quick search of Lib/test shows three different cases of
> test_bad_address: in the test_ipaddress, test_urllib2_localnet, and
> test_urllibnet modules.  If you want to just run those tests, you'd need to
> specify the module names.  Plus two of them require network access so
> you'll need to enable the "network" test resource.  Try something like:
>
> ./python -m test -v -u network test_ipaddress test_urllib2_localnet
> test_urllibnet
>
> ----------
> nosy: +ned.deily
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue22639>
> _______________________________________
>
msg229402 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-10-15 04:32
Thanks for the additional information.  It appears this is a duplicate of Issue17564 with the root cause being the ISP not properly rejecting an undefined host name as expected by the test case.  See the discussion there for more information.
msg229454 - (view) Author: Steve P (Steve.P) Date: 2014-10-15 14:49
I saw that issue, or one like it.  I was very tempted to not report but 
the README says if there are any test failures, there is a problem.  (I 
suppose it could mean there is a problem with my ISP, not python.)   The 
dilemma is that we want to be able to count on a clean pass of all tests 
even in the face of the misbehaving ISP (I believe someone in the 
discussion said there may be more of such in the future).

At the very least, if we are accepting a failure in the test suite as 
"ok", the README should say something to that effect.

On 10/14/2014 09:32 PM, Ned Deily wrote:
> Ned Deily added the comment:
>
> Thanks for the additional information.  It appears this is a duplicate of Issue17564 with the root cause being the ISP not properly rejecting an undefined host name as expected by the test case.  See the discussion there for more information.
>
> ----------
> resolution:  -> duplicate
> stage:  -> resolved
> status: open -> closed
> superseder:  -> test_urllib2_localnet fails
> type: crash ->
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue22639>
> _______________________________________
msg229492 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-10-15 18:49
I don't disagree that it would be better to have an error-free test run, independent of the ISP in use.  You could try using a different DNS server that behaves as expected (search the web for lists of free and public DNS servers).  Otherwise, you could try to re-open the discussion in Issue17564.  It's not going to be useful to duplicate that here.
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66829
2014-10-15 18:49:43ned.deilysetmessages: + msg229492
2014-10-15 14:49:07Steve.Psetmessages: + msg229454
2014-10-15 04:32:20ned.deilysetstatus: open -> closed
superseder: test_urllib2_localnet fails
messages: + msg229402

type: crash ->
resolution: duplicate
stage: resolved
2014-10-15 02:19:57Steve.Psetmessages: + msg229396
2014-10-14 23:56:24ned.deilysetnosy: + ned.deily
messages: + msg229387
2014-10-14 23:43:15Steve.Pcreate