Fix issue14826 - make urllib.request.Request quoted url consistent with URLOpener open method.

Patch contributed by Stephen Thorne.
This commit is contained in:
Senthil Kumaran 2012-07-07 17:15:52 -07:00
commit 540715a369
3 changed files with 12 additions and 1 deletions

View file

@ -263,7 +263,8 @@ class Request:
origin_req_host=None, unverifiable=False,
method=None):
# unwrap('<URL:type://host/path>') --> 'type://host/path'
self.full_url = unwrap(url)
self.full_url = unwrap(to_bytes(url))
self.full_url = quote(self.full_url, safe="%/:=&?~#+!$,;'@()*[]|")
self.full_url, self.fragment = splittag(self.full_url)
self.data = data
self.headers = {}