-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
urlencode does not handle "bytes" and could easily handle alternate encodings #49718
Comments
urllib.parse.urlencode() uses quote_plus() extensively to create a
I have attached a new version of urlencode() that provides both of the |
I also made some tests for the new code that could be added to the unit |
I'm not sure I understand the part of the code that deals with binary |
Hello. Thanks for the feedback. With regards to RFC 2396, I see this: http://www.ietf.org/rfc/rfc2396.txt ==== To me, that text does not indicate that URLs are always encoded in I have also done a few tests, and have found that in practice, browsers I think that the general idea is ... URL data must be encoded into I hope that clarifies what I am reading in RFC 2396. In addition, quote_plus() already handles all the cases I placed into Jeremy Hylton wrote:
|
Indeed, I think I confused some other character encoding issues related |
parse_qs and parse_qsl should also grow encoding and errors parameters to |
I've attached a patch that provides similar functionality to Dan Mahn's (For the tests, I tried to match the style of the file I was adding to |
The question of whether % escape should be limited to utf-8 or not was discussed and decided in favor of 'not' in bpo-3300, quote and unquote. Last December, a websig post (referenced yesterday on pydev) reported a 'problem' that would be solved by Miles' suggestion to include parse_qs and parse_qsl. |
I see no problem in going ahead with the suggestion proposed and the patch.
Relevant line:
Jeremy, I shall go ahead with this and do the modifications, if required. |
Fixed and Committed revision 82510 (py3k) and revision 82511 (release31-maint). This fixes urlencode issue. parse_qs and parse_qsl can have the same capabilities. It will be done subsequently (in another commit or issue) Thanks Dan for the bug report and patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: