gh-48241: Clarify URL needs to be encoded when provided to urlopen and Request#103855
gh-48241: Clarify URL needs to be encoded when provided to urlopen and Request#103855ambv merged 4 commits intopython:mainfrom
Conversation
6625de1 to
7abcc62
Compare
0fe1b87 to
007d540
Compare
|
@ambv This is ready |
ambv
left a comment
There was a problem hiding this comment.
Do you think we can drop the comma between "encoded" and "URL"?
…pen function as well as the Request class.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
…pen and Request (pythonGH-103855) (cherry picked from commit 44010d0) Co-authored-by: Michael Blahay <mblahay@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
GH-103891 is a backport of this pull request to the 3.11 branch. |
|
A bit hard to understand what means My problem: is I've tried urlparsed = urllib.parse.urlparse(url)
urlparsed_unicode_sanitized_query = urllib.parse.ParseResult(urlparsed.scheme, urlparsed.netloc, urlparsed.path, urlparsed.params, urllib.parse.quote(urlparsed.query), urlparsed.fragment)
urlopen_url = urllib.parse.urlunparse(urlparsed_unicode_sanitized_query)but this also fails if the query string is already url-encoded :( |
Adding note about url needing to be encoded when provided to the urlopen function as well as the Request class.
This is a documentation change