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 till
Recipients till
Date 2009-07-23.21:52:47
SpamBayes Score 0.040766306
Marked as misclassified No
Message-id <1248385969.73.0.0313821964129.issue6557@psf.upfronthosting.co.za>
In-reply-to
Content
If urllib.urlopen is pointed to an url that returns a redirection with a
location header that points to a url containing spaces, that are
properly urlencoded, then it creates a bad request with the spaces not
encoded in the url. Here is an example/test case:

In [1]: import urllib

In [2]:
u=urllib.urlopen("http://sourceforge.net/project/showfiles.php?group_id=16847&package_id=13374")

In [3]: u.url
Out[3]: 'http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c Super
Stable/download'

In [4]: u.read()
Out[4]: '<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body
bgcolor="white">\r\n<center><h1>400 Bad
Request</h1></center>\r\n<hr><center>nginx/0.7.60</center>\r\n</body>\r\n</html>\r\n'

In [5]:
u=urllib.urlopen("http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c%20Super%20Stable/download")

In [6]: u.read()[0:100]
Out[6]: '\n\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xh'

In [7]:
History
Date User Action Args
2009-07-23 21:52:49tillsetrecipients: + till
2009-07-23 21:52:49tillsetmessageid: <1248385969.73.0.0313821964129.issue6557@psf.upfronthosting.co.za>
2009-07-23 21:52:48tilllinkissue6557 messages
2009-07-23 21:52:47tillcreate