]> granicus.if.org Git - python/commit
Issue #17214: Percent-encode non-ASCII bytes in redirect targets
authorMartin Panter <vadmium+py@gmail.com>
Mon, 16 May 2016 01:14:20 +0000 (01:14 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Mon, 16 May 2016 01:14:20 +0000 (01:14 +0000)
commite6f060903cf2080b6570a87fde5021aa14d05530
tree7aa104e7862ff4cb1f61baf74bf09d78f11094db
parentce6e06874b235f7825888c20fd2c6f4670a4aeba
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.
Lib/test/test_urllib2.py
Lib/urllib/request.py
Misc/NEWS