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: Can't read some http URLs using neither urllib, nor urllib2
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: doerwalter, georg.brandl, ncoghlan, nnseva
Priority: normal Keywords:

Created on 2004-11-01 10:47 by nnseva, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg22972 - (view) Author: Vsevolod Novikov (nnseva) Date: 2004-11-01 10:47
HTTP connection maden by urllib, as well as by urllib2,
on some URL sleeps forever (until timeout happens) on
reading from the socket.
The popular Linux 'wget' utility behaviour is the same.
The Mozilla browser, as well as Internet Explorer
browser read this URL successfully, over proxy, as well
as directly.
The example URL is:

http://nds.nokia.com/uaprof/N3510ir100.xml

The example code is:

import urllib2
u =
urllib2.urlopen('http://nds.nokia.com/uaprof/N3510ir100.xml')
print u.info()
print '-------------'
for l in u :
    print l
The urllib library does the same.

Info list was (on the moment when I tried it last time):
Accept-Ranges: bytes
Date: Mon, 01 Nov 2004 10:29:58 GMT
Content-Length: 9710
Content-Type: text/plain
Cache-Control: no-cache
Server: Netscape-Enterprise/4.1
X-WR-FLAGS: CCHOMode=7200:0:force
Etag: "acbd4f76-6-25ee-40910c98"
Last-modified: Thu, 29 Apr 2004 14:09:28 GMT
Via: 1.1 saec-nokp02ca (NetCache NetApp/5.3.1R2)

I have no idea why it happens. May be, the HTTP server
waits some additional headers? In any case, it is not a
good behaviour of the library, I think.
msg22973 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2004-11-01 13:37
Logged In: YES 
user_id=89016

Work here without any problems:
Python 2.3.4 (#2, Sep 29 2004, 18:56:11) 
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import urllib
>>> d = urllib.urlopen
("http://nds.nokia.com/uaprof/N3510ir100.xml").read()
>>> len(d)
9710
>>> d[:30] 
'<?xml version="1.0"?>\n<!-- ==='
msg22974 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2004-11-08 13:03
Logged In: YES 
user_id=1038590

I can't reproduce it either - Windows XP, Cygwin build of
Python 2.4 CVS as of a day or two ago.

OP needs to provide Python and OS version info - it may be a
platform problem, or a problem with an early version of
Python 2.3
msg22975 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-26 22:32
Logged In: YES 
user_id=1188172

I can't reproduce it too, with 2.4 and 2.5 CVS. If, as OP
says, wget shows this behaviour too, it's likely that it was
a bug in his OS's libraries.

Closing as Invalid.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41112
2004-11-01 10:47:01nnsevacreate