Skip to content
Myr

Merge branch 'master' of https://github.com/ContinuousFunction/requests into pr/2344

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

authored by Ian Cordasco · committed by Ian Cordasco · parents f723ab5, 4c61fef · Browse files · 2 files+10 added−2 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+10 added−2 removed

  • other:+10 added−2 removed

2 files+10 added−2 removed

modified:requests/models.py+5 added-2 removed
18 unmodified lines
19from .packages.urllib3.fields import RequestField20from .packages.urllib3.filepost import encode_multipart_formdata21from .packages.urllib3.util import parse_url22from .packages.urllib3.exceptions import (23 DecodeError, ReadTimeoutError, ProtocolError)23 DecodeError, ReadTimeoutError, ProtocolError, LocationParseError)24from .exceptions import (25 HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,26 ContentDecodingError, ConnectionError, StreamConsumedError)27from .utils import (
321 unmodified lines
349 self.url = url350 return351352 # Support for unicode domain names and paths.353 try:353 scheme, auth, host, port, path, query, fragment = parse_url(url)354 scheme, auth, host, port, path, query, fragment = parse_url(url)355 except LocationParseError as e:356 raise InvalidURL(e.message)357358 if not scheme:359 raise MissingSchema("Invalid URL {0!r}: No schema supplied. "360 "Perhaps you meant http://{0}?".format(url))
479 unmodified lines
modified:test_requests.py+5 added
307 unmodified lines
308309 with pytest.raises(ConnectionError):310 requests.get("http://httpbin.org:1")311312 def test_LocationParseError(self):313 """Inputing a URL that cannot be parsed should raise an InvalidURL error"""314 with pytest.raises(InvalidURL):315 requests.get("http://fe80::5054:ff:fe5a:fc0")316317 def test_basicauth_with_netrc(self):318 auth = ('user', 'pass')319 wrong_auth = ('wronguser', 'wrongpass')320 url = httpbin('basic-auth', 'user', 'pass')
1238 unmodified lines