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.

Title: test_urllib2net fails
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: test_urlwithfrag fail
View: 16969
Assigned To: Nosy List:, ezio.melotti, ned.deily, r.david.murray, zach.ware
Priority: normal Keywords:

Created on 2013-02-08 16:45 by, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (10)
msg181682 - (view) Author: ( Date: 2013-02-08 16:45
test_urllib2net fails as follows. Looking at" line 165 does not reveal anything interesting to me

./python Lib/test/ -uall -v test_urllib2net
== CPython 2.7.3 (default, Feb 8 2013, 08:28:21) [GCC 4.7.2]
==   Linux-2.6.32-220.13.1.el6.x86_64-x86_64-with-redhat-6.2-Santiago little-endian
==   /glade/scratch/ddvento/build/Python-2.7.3-westmere/build/test_python_7544
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... ok
test_file (test.test_urllib2net.OtherNetworkTests) ... ok
test_fileno (test.test_urllib2net.OtherNetworkTests) ... ok
test_ftp (test.test_urllib2net.OtherNetworkTests) ... ok
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... ok
test_urlwithfrag (test.test_urllib2net.OtherNetworkTests) ... FAIL
test_close (test.test_urllib2net.CloseSocketTest) ... ok
test_ftp_basic (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_basic (test.test_urllib2net.TimeoutTest) ... ok
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_timeout (test.test_urllib2net.TimeoutTest) ... ok

FAIL: test_urlwithfrag (test.test_urllib2net.OtherNetworkTests)
Traceback (most recent call last):
  File "/glade/scratch/ddvento/build/Python-2.7.3-westmere/Lib/test/", line 165, in test_urlwithfrag
AssertionError: '' != ''

Ran 15 tests in 14.684s

FAILED (failures=1)
test test_urllib2net failed -- Traceback (most recent call last):
  File "/glade/scratch/ddvento/build/Python-2.7.3-westmere/Lib/test/", line 165, in test_urlwithfrag
AssertionError: '' != ''

1 test failed:
msg181683 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-08 17:07
It passes on all our buildbots, and for me locally.  Is it possible there is a proxy server between you and that is changing the url returned?
msg181685 - (view) Author: ( Date: 2013-02-08 17:21
Yes, it is possible, do you want me to investigate more with my network 
msg181686 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-08 17:27
I think only if you want to.  As far as we are concerned the test is correct and passing.  (And this kind of thing is the reason that that test set is only run when -uall is specified.)

I'm going to close the issue.  If you do investigate, and feel that you've found a real bug, please reopen it.
msg181691 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-02-08 18:46
The test is failing because of a restructuring of the website.  The test was changed on 2012-10-28 to use the new URL (923ca6d73bad and friends).  That change will be in the next set of maintenance releases including 2.7.4 real soon now.
msg182096 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-02-14 13:36
See also #16969.
msg216369 - (view) Author: ( Date: 2014-04-15 19:32
Reopening, since this is still broken in Python 2.7.6

I wonder why do we have to use real websites instead of mocks for this test. And if there are really really really really good reasons, if we can use instead as in issue #20939 (maybe that is more stable than
msg217051 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-04-23 03:32
This was already fixed, just not before 2.7.6 was released.
msg217052 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-04-23 03:42
Actually, that's not quite right.  It was fixed in 2.7.6, then changes to the website broke it again and it has been fixed again since then.  Either way, it ain't broke right now ;)
msg217075 - (view) Author: ( Date: 2014-04-23 16:15
Well, ok, thanks :-)

But I'm still wondering if it's not possible to use mocks for this test. 
or at least (as in issue #20939) which is supposed to be 
more stable than
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61362
2014-04-23 16:15:03ddvento@ucar.edusetmessages: + msg217075
2014-04-23 03:42:21zach.waresetmessages: + msg217052
2014-04-23 03:32:17zach.waresetstatus: open -> closed
nosy: + zach.ware
messages: + msg217051

2014-04-15 19:32:10ddvento@ucar.edusetstatus: closed -> open

messages: + msg216369
2013-02-14 13:36:13ezio.melottisetnosy: + ezio.melotti
messages: + msg182096
resolution: out of date -> duplicate

type: behavior
superseder: test_urlwithfrag fail
2013-02-08 18:46:47ned.deilysetresolution: works for me -> out of date

messages: + msg181691
nosy: + ned.deily
2013-02-08 17:27:20r.david.murraysetstatus: open -> closed
resolution: works for me
messages: + msg181686

stage: resolved
2013-02-08 17:21:56ddvento@ucar.edusetmessages: + msg181685
2013-02-08 17:07:20r.david.murraysetnosy: + r.david.murray
messages: + msg181683
2013-02-08 16:45:53ddvento@ucar.educreate