Hmm, it looks like a web server problem to me. urllib2 uses the HTTP/1.1 protocol, and sends the "Connection: close" header. I hacked urllib2: when this header is not sent, the content is retrieved normally. This page: http://www.mail-archive.com/users@tomcat.apache.org/msg28684.html describes the same problem. The web site above does use Tomcat (can be seen in the response headers), maybe they have a wrong version?
Thanks Amaury, that was nice debugging. The problem is with Apache tomcat server at the remote end, which is misbehaving on Connection:close header being sent by urllib2. We can't do anything about it, the bug reporter can take it up with server. However, in the Urllib2 documentation, if needed, it can be mentioned that urllib2 is sending Connection:close while using HTTP/1.1 whereas urllib uses HTTP/1.0. Closing this bug as Invalid.
History
Date
User
Action
Args
2022-04-11 14:57:05
admin
set
github: 53864
2010-08-21 15:33:18
orsenthil
set
status: open -> closedresolution: accepted -> not a bugmessages: + stage: needs patch -> resolved