diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-05-16 01:14:20 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-05-16 01:14:20 (GMT) |
commit | e6f060903cf2080b6570a87fde5021aa14d05530 (patch) | |
tree | 7aa104e7862ff4cb1f61baf74bf09d78f11094db /Misc | |
parent | ce6e06874b235f7825888c20fd2c6f4670a4aeba (diff) | |
download | cpython-e6f060903cf2080b6570a87fde5021aa14d05530.zip cpython-e6f060903cf2080b6570a87fde5021aa14d05530.tar.gz cpython-e6f060903cf2080b6570a87fde5021aa14d05530.tar.bz2 |
Issue #17214: Percent-encode non-ASCII bytes in redirect targets
Some servers send Location header fields with non-ASCII bytes, but "http.
client" requires the request target to be ASCII-encodable, otherwise a
UnicodeEncodeError is raised. Based on patch by Christian Heimes.
Python 2 does not suffer any problem because it allows non-ASCII bytes in the
HTTP request target.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -121,6 +121,12 @@ Library - Issue #14132: Fix urllib.request redirect handling when the target only has a query string. Original fix by Ján Janech. +- Issue #17214: The "urllib.request" module now percent-encodes non-ASCII + bytes found in redirect target URLs. Some servers send Location header + fields with non-ASCII bytes, but "http.client" requires the request target + to be ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on + patch by Christian Heimes. + - Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch contributed by Chi Hsuan Yen. |