-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-48241: Clarify URL needs to be encoded when provided to urlopen and Request #103855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6625de1
to
7abcc62
Compare
0fe1b87
to
007d540
Compare
@ambv This is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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