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
Provenance
- Commit
2629c09- Tree
84d0840- Author
Alex Gaynor <alex.gaynor@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
c054a72- Parent 2
2057558
12 files changed+53 added−23 removed
modified:docs/_templates/sidebarintro.html-5 removed
14 unmodified lines1516171819202122231920212249 unmodified lines14 unmodified lines</p>
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>
<h3>Stickers!</h3>
<script src="https://gumroad.com/js/gumroad.js"></script><a class="gumroad-button" href="https://gum.co/requests-stickers" target="_blank">Order Stickers!</a>
<h3>Stay Informed</h3><p>Receive updates on new releases and upcoming projects.</p>
<p><iframe src="http://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false"49 unmodified linesmodified:docs/_templates/sidebarlogo.html-6 removed
21 unmodified lines222324252627282930312627282933 unmodified lines21 unmodified lines<hr/>
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>
<h3>Stickers!</h3>
<script src="https://gumroad.com/js/gumroad.js"></script><a class="gumroad-button" href="https://gum.co/requests-stickers" target="_blank">Order Stickers!</a>
<p>If you enjoy using this project, <a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>
<p><iframe src="http://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false" allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>33 unmodified linesmodified:requests/__init__.py+1 added-1 removed
55 unmodified lines56 57 # 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 linesmodified:requests/__version__.py+2 added-2 removed
3 unmodified lines4 5 __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 linemodified:requests/help.py+7 added-3 removed
83 unmodified lines84 cryptography_info = {85 'version': getattr(cryptography, '__version__', ''),86 }87 88+ # 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+ }93+94 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 linesmodified:requests/models.py-2 removed
584 unmodified lines585 'encoding', 'reason', 'cookies', 'elapsed', 'request'586 ]587 588 def __init__(self):589- super(Response, self).__init__()590-589 self._content = False590 self._content_consumed = False591 self._next = None592 356 unmodified linesmodified:requests/sessions.py+7 added-1 removed
95 unmodified lines96 class SessionRedirectMixin(object):97 98 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 very599 unmodified lines709 710 def mount(self, prefix, adapter):711 """Registers a connection adapter to a prefix.712 707- 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 linesadded:tests/test_help.py+21 added
1+# -*- encoding: utf-82+3+import sys4+5+import pytest6+7+from requests.help import info8+9+10+@pytest.mark.skipif(sys.version_info[:2] != (2,6), reason="Only run on Python 2.6")11+def 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': ''}16+17+18+@pytest.mark.skipif(sys.version_info < (2,7), reason="Only run on Python 2.7+")19+def 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 lines9 **Improvements**10 11 **Bugfixes**12 13+2.18.2 (2017-07-25)14++++++++++++++++++++15+16+**Bugfixes**17+18+- ``requests.help`` no longer fails on Python 2.6 due to the absence of19+ ``ssl.OPENSSL_VERSION_NUMBER``.20+21+**Dependencies**22+23+- We now support urllib3 v1.22.24+25 2.18.1 (2017-06-14)26 +++++++++++++++++++27 28 **Bugfixes**1483 unmodified linesmodified:MANIFEST.in+1 added-1 removed
1-include README.rst LICENSE NOTICE HISTORY.rst pytest.ini1+include README.rst LICENSE NOTICE HISTORY.rst pytest.ini requirements.txt2 recursive-include tests *.pymodified:README.rst+1 added-1 removed
91 unmodified lines92 93 $ pip install requests94 ✨🍰✨95 96-Satisfaction, guaranteed.96+Satisfaction guaranteed.97 98 Documentation99 -------------100 14 unmodified linesmodified:setup.py+1 added-1 removed
42 unmodified lines43 44 requires = [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'49 50 ]51 test_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