From afcc883d7f5968a8d64ea400335fb47f3f73d042 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sat, 6 Apr 2013 11:26:52 -0400 Subject: [PATCH] Fix #1293 --- requests/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 34213f75..10528775 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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: