• Martin Panter's avatar
    Issue #17214: Percent-encode non-ASCII bytes in redirect targets · e6f06090
    Martin Panter authored
    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.
    e6f06090
test_urllib2.py 72 KB