From f89b5a5d90d7b45a7f59dbd2bb29ae2f400aba44 Mon Sep 17 00:00:00 2001 From: sh1buy Date: Sat, 11 Apr 2015 00:23:07 +0300 Subject: [PATCH 1/3] fix bug 2540 --- requests/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 806004c0..869a9424 100644 --- a/requests/models.py +++ b/requests/models.py @@ -358,7 +358,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): if not scheme: raise MissingSchema("Invalid URL {0!r}: No schema supplied. " - "Perhaps you meant http://{0}?".format(url)) + "Perhaps you meant http://{0}?".format(url.encode('utf8'))) if not host: raise InvalidURL("Invalid URL %r: No host supplied" % url) From f02d0f9e79a3aa3f0b716871f457ceb8f446bdba Mon Sep 17 00:00:00 2001 From: sh1buy Date: Sat, 11 Apr 2015 01:41:02 +0300 Subject: [PATCH 2/3] Fix bug 2540 --- requests/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 869a9424..545c5257 100644 --- a/requests/models.py +++ b/requests/models.py @@ -358,7 +358,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): if not scheme: raise MissingSchema("Invalid URL {0!r}: No schema supplied. " - "Perhaps you meant http://{0}?".format(url.encode('utf8'))) + "Perhaps you meant http://{0}?".format(to_native_string(url,encoding='utf8'))) if not host: raise InvalidURL("Invalid URL %r: No host supplied" % url) From 599f8343512277671d08e043a0505a82630c641d Mon Sep 17 00:00:00 2001 From: sh1buy Date: Sat, 11 Apr 2015 03:29:21 +0300 Subject: [PATCH 3/3] fix bug 2540 --- requests/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 545c5257..31bff1ac 100644 --- a/requests/models.py +++ b/requests/models.py @@ -358,7 +358,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): if not scheme: raise MissingSchema("Invalid URL {0!r}: No schema supplied. " - "Perhaps you meant http://{0}?".format(to_native_string(url,encoding='utf8'))) + "Perhaps you meant http://{0}?" + .format(to_native_string(url, 'utf8'))) if not host: raise InvalidURL("Invalid URL %r: No host supplied" % url)