Fix #1293
authorIan Cordasco <graffatcolmingov@gmail.com>
Sat, 6 Apr 2013 15:26:52 +0000 (11:26 -0400)
committerIan Cordasco <graffatcolmingov@gmail.com>
Sat, 6 Apr 2013 15:26:52 +0000 (11:26 -0400)
requests/models.py

index 34213f7..1052877 100644 (file)
@@ -284,9 +284,12 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
         # Support for unicode domain names and paths.
         scheme, netloc, path, _params, query, fragment = urlparse(url)
 
-        if not (scheme and netloc):
+        if not scheme:
             raise MissingSchema("Invalid URL %r: No schema supplied" % url)
 
+        if not netloc:
+            raise InvalidURL("Invalid URL %t: No netloc supplied" % url)
+
         try:
             netloc = netloc.encode('idna').decode('utf-8')
         except UnicodeError: