Martin Panter added the comment: This bug only applies to Python 3. In Python 2, the non-ASCII bytes are sent through to the redirect target verbatim. I think this would also be the ideal way to handle the problem in 3, but percent-encoding them as proposed also seems good enough, and does not require hacking the HTTPConnection.putrequest() internals.
My patch updates Christian’s patch: * Tested, so hopefully no typos :) * Add test cases based on Issue 22248, as well as a URL already including a percent sign * Process entire URL, not just the path component. A non-ASCII byte could just as easily be in the query component, for example. * Remove redundant encoding of space character from redirect_request() method. ---------- stage: test needed -> patch review versions: +Python 3.5, Python 3.6 Added file: http://bugs.python.org/file40907/issue17214.redirect.v2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17214> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com