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.

Author ambarish
Recipients ambarish
Date 2008-05-06.21:30:12
SpamBayes Score 0.16312802
Marked as misclassified No
Message-id <1210109415.44.0.221361539235.issue2776@psf.upfronthosting.co.za>
In-reply-to
Content
Try the following code:
import urllib
import urllib2

url =
'http://features.us.reuters.com//autos/news/95ED98EE-A837-11DC-BCB3-4F218271.html'

data = urllib.urlopen(url).read()
data2 = urllib2.urlopen(url).read()

The attempt to get it with urllib works fine. With urllib2, the request
is malformed and I get back a HTTP 404

Request in the 2nd case is:
GET //autos/news/95ED98EE-A837-11DC-BCB3-4F218271.html HTTP/1.1\r\n
Accept-Encoding: identity\r\n
Host: autos\r\n
Connection: close\r\n
....

The host line seems to be looking for the last // rather than the first.
History
Date User Action Args
2008-05-06 21:30:16ambarishsetspambayes_score: 0.163128 -> 0.16312802
recipients: + ambarish
2008-05-06 21:30:16ambarishsetspambayes_score: 0.163128 -> 0.163128
messageid: <1210109415.44.0.221361539235.issue2776@psf.upfronthosting.co.za>
2008-05-06 21:30:14ambarishlinkissue2776 messages
2008-05-06 21:30:13ambarishcreate