Skip to content
Myr

Decode URL to utf-8 before joining.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

To avoid UnicodeDecodeError's like on http://blip.fm/~1abvfu

authored by Chris Dary · committed by Chris Dary · parent 7cc898f · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:requests/models.py+2 added
225 unmodified lines
226227 # Facilitate non-RFC2616-compliant 'location' headers228 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')229 if not urlparse(url).netloc:230 if not isinstance(url, unicode):231 url = url.decode('utf-8', 'ignore')232 url = urljoin(r.url, url)233234 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4235 if r.status_code is codes.see_other:
563 unmodified lines