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:
e08b853
)
Throw InvalidURL not UnicodeError on bad label.
author
Cory Benfield
<lukasaoz@gmail.com>
Fri, 10 Aug 2012 16:29:12 +0000
(17:29 +0100)
committer
Cory Benfield
<lukasaoz@gmail.com>
Mon, 13 Aug 2012 20:18:56 +0000
(21:18 +0100)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
136427f
..
ae3c1be
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-413,7
+413,10
@@
class Request(object):
if not scheme in SCHEMAS:
raise InvalidSchema("Invalid scheme %r" % scheme)
- netloc = netloc.encode('idna').decode('utf-8')
+ try:
+ netloc = netloc.encode('idna').decode('utf-8')
+ except UnicodeError:
+ raise InvalidURL('URL has an invalid label.')
if not path:
path = '/'