Document skipping in PreparedRequest; followup to #2222
authorDaniel Hahler <git@thequod.de>
Fri, 12 Sep 2014 15:13:43 +0000 (17:13 +0200)
committerDaniel Hahler <git@thequod.de>
Fri, 12 Sep 2014 16:07:28 +0000 (18:07 +0200)
requests/models.py
test_requests.py

index 03ff627adffa009306b77c64488aeb045a882404..bbf08c81358cfdd208c1301cbc209855355da178 100644 (file)
@@ -334,7 +334,9 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
         except UnicodeDecodeError:
             pass
 
-        # Don't do any URL preparation for oddball schemes
+        # Don't do any URL preparation for non-HTTP schemes like `mailto`,
+        # `data` etc to work around exceptions from `url_parse`, which
+        # handles RFC 3986 only.
         if ':' in url and not url.lower().startswith('http'):
             self.url = url
             return
index 9f75a9d9e9608bc978d0500c2ec538cc84229b2f..4fccc3468addb7e7c1eb2cd31b28f2029aafe4dd 100755 (executable)
@@ -922,7 +922,7 @@ class RequestsTestCase(unittest.TestCase):
 
         assert p.headers['Content-Length'] == length
 
-    def test_oddball_schemes_dont_check_URLs(self):
+    def test_nonhttp_schemes_dont_check_URLs(self):
         test_urls = (
             'data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==',
             'file:///etc/passwd',