mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
Fix issue14826 - make urllib.request.Request quoted url consistent with URLOpener open method.
Patch contributed by Stephen Thorne.
This commit is contained in:
parent
11f0b41e9d
commit
b7451cecad
3 changed files with 12 additions and 1 deletions
|
@ -180,7 +180,8 @@ class Request:
|
|||
def __init__(self, url, data=None, headers={},
|
||||
origin_req_host=None, unverifiable=False):
|
||||
# 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 = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue