summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-16 01:14:20 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-16 01:14:20 (GMT)
commite6f060903cf2080b6570a87fde5021aa14d05530 (patch)
tree7aa104e7862ff4cb1f61baf74bf09d78f11094db /Misc
parentce6e06874b235f7825888c20fd2c6f4670a4aeba (diff)
downloadcpython-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/NEWS6
1 files changed, 6 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 9a147c4..0b9f6f0 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.