Skip to content
Myr

Merge branch 'master' into doc-import

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

authored by Kelley Robinson · committed by GitHub · parents d758f0c, f78a579 · Browse files · 11 files+61 added−16 removed
This commit

State

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

Diff stats

11 files+61 added−16 removed

  • tests:+29 added−1 removed
  • other:+32 added−15 removed

11 files+61 added−16 removed

modified:docs/user/advanced.rst+2 added
591 unmodified lines
592 'http': 'socks5://user:pass@host:port',593 'https': 'socks5://user:pass@host:port'594 }595596Using the scheme ``socks5`` causes the DNS resolution to happen on the client, rather than on the proxy server. This is in line with curl, which uses the scheme to decide whether to do the DNS resolution on the client or proxy. If you want to resolve the domains on the proxy server, use ``socks5h`` as the scheme.597598.. _compliance:599600Compliance601----------
389 unmodified lines
modified:requests/__version__.py+2 added-2 removed
3 unmodified lines
45__title__ = 'requests'6__description__ = 'Python HTTP for Humans.'7__url__ = 'http://python-requests.org'8__version__ = '2.18.2'9__build__ = 0x0218028__version__ = '2.18.3'9__build__ = 0x02180310__author__ = 'Kenneth Reitz'11__author_email__ = 'me@kennethreitz.org'12__license__ = 'Apache 2.0'13__copyright__ = 'Copyright 2017 Kenneth Reitz'
1 unmodified line
modified:requests/adapters.py+5 added
499 unmodified lines
500501 if isinstance(e.reason, _ProxyError):502 raise ProxyError(e, request=request)503504 if isinstance(e.reason, _SSLError):505 # This branch is for urllib3 v1.22 and later.506 raise SSLError(e, request=request)507508 raise ConnectionError(e, request=request)509510 except ClosedPoolError as e:511 raise ConnectionError(e, request=request)
2 unmodified lines
514 raise ProxyError(e)515516 except (_SSLError, _HTTPError) as e:517 if isinstance(e, _SSLError):518 # This branch is for urllib3 versions earlier than v1.22519 raise SSLError(e, request=request)520 elif isinstance(e, ReadTimeoutError):521 raise ReadTimeout(e, request=request)522 else:
3 unmodified lines
modified:requests/compat.py+1 added-3 removed
25 unmodified lines
26is_py3 = (_ver[0] == 3)2728try:29 import simplejson as json30except (ImportError, SyntaxError):31 # simplejson does not support Python 3.2, it throws a SyntaxError32 # because of u'...' Unicode literals.30except ImportError:31 import json3233# ---------34# Specifics
35 unmodified lines
modified:requests/help.py+5 added
4 unmodified lines
5import platform6import sys7import ssl89import idna10import urllib311import chardet1213from . import __version__ as requests_version
70 unmodified lines
84 }85 cryptography_info = {86 'version': getattr(cryptography, '__version__', ''),87 }88 idna_info = {89 'version': getattr(idna, '__version__', ''),90 }9192 # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module.93 system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None)94 system_ssl_info = {
8 unmodified lines
103 'pyOpenSSL': pyopenssl_info,104 'urllib3': urllib3_info,105 'chardet': chardet_info,106 'cryptography': cryptography_info,107 'idna': idna_info,108 'requests': {109 'version': requests_version,110 },111 }
9 unmodified lines
modified:requests/models.py-2 removed
584 unmodified lines
585 'encoding', 'reason', 'cookies', 'elapsed', 'request'586 ]587588 def __init__(self):589 super(Response, self).__init__()590589 self._content = False590 self._content_consumed = False591 self._next = None592
356 unmodified lines
modified:tests/test_help.py+19 added
17 unmodified lines
18@pytest.mark.skipif(sys.version_info < (2,7), reason="Only run on Python 2.7+")19def test_system_ssl():20 """Verify we're actually setting system_ssl when it should be available."""21 assert info()['system_ssl']['version'] != ''222324class VersionedPackage(object):25 def __init__(self, version):26 self.__version__ = version272829def test_idna_without_version_attribute(mocker):30 """Older versions of IDNA don't provide a __version__ attribute, verify31 that if we have such a package, we don't blow up.32 """33 mocker.patch('requests.help.idna', new=None)34 assert info()['idna'] == {'version': ''}353637def test_idna_with_version_attribute(mocker):38 """Verify we're actually setting idna version when it should be available."""39 mocker.patch('requests.help.idna', new=VersionedPackage('2.6'))40 assert info()['idna'] == {'version': '2.6'}
modified:tests/test_requests.py+10 added-1 removed
21 unmodified lines
22 cookiejar_from_dict, morsel_to_cookie)23from requests.exceptions import (24 ConnectionError, ConnectTimeout, InvalidSchema, InvalidURL,25 MissingSchema, ReadTimeout, Timeout, RetryError, TooManyRedirects,26 ProxyError, InvalidHeader, UnrewindableBodyError)26 ProxyError, InvalidHeader, UnrewindableBodyError, SSLError)27from requests.models import PreparedRequest28from requests.structures import CaseInsensitiveDict29from requests.sessions import SessionRedirectMixin30from requests.models import urlencode
780 unmodified lines
811 warnings_category = tuple(812 item.category.__name__ for item in warning_records)813 assert warnings_category == warnings_expected814815 def test_certificate_failure(self, httpbin_secure):816 """817 When underlying SSL problems occur, an SSLError is raised.818 """819 with pytest.raises(SSLError):820 # Our local httpbin does not have a trusted CA, so this call will821 # fail if we use our default trust bundle.822 requests.get(httpbin_secure('status', '200'))823824 def test_urlencoded_get_query_multivalued_param(self, httpbin):825826 r = requests.get(httpbin('get'), params=dict(test=['foo', 'baz']))827 assert r.status_code == 200
1559 unmodified lines
modified:AUTHORS.rst-7 removed
8 unmodified lines
9- Ian Cordasco <graffatcolmingov@gmail.com> `@sigmavirus24 <https://github.com/sigmavirus24>`_10- Nate Prewitt <nate.prewitt@gmail.com> `@nateprewitt <https://github.com/nateprewitt>`_11121314Urllib315```````1617- Andrey Petrov <andrey.petrov@shazow.net>181913Patches and Suggestions14```````````````````````1516- Various Pocoo Members
164 unmodified lines
modified:HISTORY.rst+16 added
8 unmodified lines
9**Improvements**1011**Bugfixes**1213**Dependencies**1415- We now support idna v2.6.16172.18.3 (2017-08-02)18+++++++++++++++++++1920**Improvements**2122- Running ``$ python -m requests.help`` now includes the installed version of idna.2324**Bugfixes**2526- Fixed issue where Requests would raise ``ConnectionError`` instead of27 ``SSLError`` when encountering SSL problems when using urllib3 v1.22.28292.18.2 (2017-07-25)30+++++++++++++++++++3132**Bugfixes**
1495 unmodified lines
modified:setup.py+1 added-1 removed
41 unmodified lines
42packages = ['requests']4344requires = [45 'chardet>=3.0.2,<3.1.0',46 'idna>=2.5,<2.6',46 'idna>=2.5,<2.7',47 'urllib3>=1.21.1,<1.23',48 'certifi>=2017.4.17'4950]
51 unmodified lines