This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients LDTech, Mi.Zou, Strecke, Uche Ogbuji, berker.peksag, christian.heimes, ezio.melotti, martin.panter, orsenthil, terry.reedy, vajrasky
Date 2015-10-30.23:50:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446249030.47.0.983641825488.issue17214@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-10-30 23:50:30martin.pantersetrecipients: + martin.panter, terry.reedy, orsenthil, christian.heimes, ezio.melotti, berker.peksag, Mi.Zou, vajrasky, LDTech, Uche Ogbuji, Strecke
2015-10-30 23:50:30martin.pantersetmessageid: <1446249030.47.0.983641825488.issue17214@psf.upfronthosting.co.za>
2015-10-30 23:50:30martin.panterlinkissue17214 messages
2015-10-30 23:50:30martin.pantercreate