projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cc898f
)
Decode URL to utf-8 before joining.
author
Chris Dary
<umbrae@gmail.com>
Tue, 28 Feb 2012 17:08:37 +0000
(12:08 -0500)
committer
Chris Dary
<umbrae@gmail.com>
Tue, 28 Feb 2012 17:08:37 +0000
(12:08 -0500)
To avoid UnicodeDecodeError's like on http://blip.fm/~1abvfu
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index 8368c9fb4235e56e03392afd356a4e0942b8cec7..aea7723754e8cfd08fe55ce7544828f81e69ce00 100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-227,6
+227,8
@@
class Request(object):
# Facilitate non-RFC2616-compliant 'location' headers
# (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
if not urlparse(url).netloc:
+ if not isinstance(url, unicode):
+ url = url.decode('utf-8', 'ignore')
url = urljoin(r.url, url)
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4