Skip to content
Myr

Merge pull request #1376 from papaeye/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix typo, %t -> %r

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 2aabb71, 2a34335 · Browse files · 2 files+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−3 removed

  • other:+6 added−3 removed

2 files+6 added−3 removed

modified:requests/models.py+1 added-1 removed
289 unmodified lines
290 if not scheme:291 raise MissingSchema("Invalid URL %r: No schema supplied" % url)292293 if not host:294 raise InvalidURL("Invalid URL %t: No host supplied" % url)294 raise InvalidURL("Invalid URL %r: No host supplied" % url)295296 # Only want to apply IDNA to the hostname297 try:298 host = host.encode('idna').decode('utf-8')
388 unmodified lines
modified:test_requests.py+5 added-2 removed
12 unmodified lines
13from requests.auth import HTTPDigestAuth14from requests.adapters import HTTPAdapter15from requests.compat import str, cookielib16from requests.cookies import cookiejar_from_dict17from requests.exceptions import InvalidURL, MissingSchema18from requests.structures import CaseInsensitiveDict1920try:21 import StringIO
31 unmodified lines
53 requests.patch54 requests.post5556 def test_invalid_url(self):56 self.assertRaises(ValueError, requests.get, 'hiwpefhipowhefopw')57 self.assertRaises(MissingSchema, requests.get, 'hiwpefhipowhefopw')58 self.assertRaises(InvalidURL, requests.get, 'http://')5960 def test_basic_building(self):61 req = requests.Request()62 req.url = 'http://kennethreitz.org/'
281 unmodified lines
344 files={'file': ('test_requests.py', open(__file__, 'rb'))})345 self.assertEqual(r.status_code, 200)346347 def test_unicode_multipart_post_fieldnames(self):348 filename = os.path.splitext(__file__)[0] + '.py'349 r = requests.Request(method='POST',350 url=httpbin('post'),351 data={'stuff'.encode('utf-8'): 'elixr'},352 files={'file': ('test_requests.py',350 open(__file__, 'rb'))})353 open(filename, 'rb'))})354 prep = r.prepare()355 self.assertTrue(b'name="stuff"' in prep.body)356 self.assertFalse(b'name="b\'stuff\'"' in prep.body)357
349 unmodified lines