Skip to content
Myr

Merge branch 'master' into patch-2

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

authored by Alex Gaynor · committed by GitHub · parents c054a72, 2057558 · Browse files · 12 files+53 added−23 removed
This commit

State

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

Diff stats

12 files+53 added−23 removed

  • tests:+21 added−0 removed
  • other:+32 added−23 removed

12 files+53 added−23 removed

modified:docs/_templates/sidebarintro.html-5 removed
modified:docs/_templates/sidebarlogo.html-6 removed
modified:requests/__init__.py+1 added-1 removed
55 unmodified lines
5657 # Check urllib3 for compatibility.58 major, minor, patch = urllib3_version # noqa: F81159 major, minor, patch = int(major), int(minor), int(patch)60 # urllib3 >= 1.21.1, < 1.2260 # urllib3 >= 1.21.1, <= 1.2261 assert major == 162 assert minor >= 2163 assert minor <= 2264
57 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.1'9__build__ = 0x0218018__version__ = '2.18.2'9__build__ = 0x02180210__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/help.py+7 added-3 removed
83 unmodified lines
84 cryptography_info = {85 'version': getattr(cryptography, '__version__', ''),86 }8788 # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module.89 system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None)90 system_ssl_info = {91 'version': '%x' % system_ssl if system_ssl is not None else ''92 }9394 return {95 'platform': platform_info,96 'implementation': implementation_info,91 'system_ssl': {92 'version': '%x' % ssl.OPENSSL_VERSION_NUMBER,93 },97 'system_ssl': system_ssl_info,98 'using_pyopenssl': pyopenssl is not None,99 'pyOpenSSL': pyopenssl_info,100 'urllib3': urllib3_info,101 'chardet': chardet_info,
14 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:requests/sessions.py+7 added-1 removed
95 unmodified lines
96class SessionRedirectMixin(object):9798 def get_redirect_target(self, resp):99 """Receives a Response. Returns a redirect URI or ``None``"""100 # Due to the nature of how requests processes redirects this method will101 # be called at least once upon the original response and at least twice102 # on each subsequent redirect response (if any).103 # If a custom mixin is used to handle this logic, it may be advantageous104 # to cache the redirect location onto the response object as a private105 # attribute.106 if resp.is_redirect:107 location = resp.headers['location']108 # Currently the underlying http module on py3 decode headers109 # in latin1, but empirical evidence suggests that latin1 is very
599 unmodified lines
709710 def mount(self, prefix, adapter):711 """Registers a connection adapter to a prefix.712707 Adapters are sorted in descending order by key length.713 Adapters are sorted in descending order by prefix length.714 """715 self.adapters[prefix] = adapter716 keys_to_move = [k for k in self.adapters if len(k) < len(prefix)]717
20 unmodified lines
added:tests/test_help.py+21 added
1# -*- encoding: utf-823import sys45import pytest67from requests.help import info8910@pytest.mark.skipif(sys.version_info[:2] != (2,6), reason="Only run on Python 2.6")11def test_system_ssl_py26():12 """OPENSSL_VERSION_NUMBER isn't provided in Python 2.6, verify we don't13 blow up in this case.14 """15 assert info()['system_ssl'] == {'version': ''}161718@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'] != ''
modified:HISTORY.rst+12 added
8 unmodified lines
9**Improvements**1011**Bugfixes**12132.18.2 (2017-07-25)14+++++++++++++++++++1516**Bugfixes**1718- ``requests.help`` no longer fails on Python 2.6 due to the absence of19 ``ssl.OPENSSL_VERSION_NUMBER``.2021**Dependencies**2223- We now support urllib3 v1.22.24252.18.1 (2017-06-14)26+++++++++++++++++++2728**Bugfixes**
1483 unmodified lines
modified:MANIFEST.in+1 added-1 removed
1include README.rst LICENSE NOTICE HISTORY.rst pytest.ini1include README.rst LICENSE NOTICE HISTORY.rst pytest.ini requirements.txt2recursive-include tests *.py
modified:README.rst+1 added-1 removed
91 unmodified lines
9293 $ pip install requests94 ✨🍰✨9596Satisfaction, guaranteed.96Satisfaction guaranteed.9798Documentation99-------------100
14 unmodified lines
modified:setup.py+1 added-1 removed
42 unmodified lines
4344requires = [45 'chardet>=3.0.2,<3.1.0',46 'idna>=2.5,<2.6',47 'urllib3>=1.21.1,<1.22',47 'urllib3>=1.21.1,<1.23',48 'certifi>=2017.4.17'4950]51test_requirements = ['pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock', 'pytest-xdist', 'PySocks>=1.5.6, !=1.5.7', 'pytest>=2.8.0']
50 unmodified lines