From c14bd018adc715db2810c844258b392870fbc6fe Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 15 Oct 2017 19:48:10 -0700 Subject: Add missing trove classifier to document Python2 support --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7aa8d611..e3bc8761 100755 --- a/setup.py +++ b/setup.py @@ -81,6 +81,7 @@ setup( 'Natural Language :: English', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', @@ -98,4 +99,3 @@ setup( 'socks:sys_platform == "win32" and (python_version == "2.7" or python_version == "2.6")': ['win_inet_pton'], }, ) - -- cgit v1.2.1 From d3f14af44d9460a17c79de19ebdb65b3eec2e534 Mon Sep 17 00:00:00 2001 From: Alvaro Gutierrez Perez Date: Wed, 18 Oct 2017 19:27:06 +0200 Subject: Fix case-insensitive comparison in get_adapter() While trying to get the prefix for an url, the url was lowered before comparing but the prefix not, so if it contains non-lowercase characters (eg. https://api.example.com/sOmE_WeiRD_pReFIX/), it won't match. --- requests/sessions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/sessions.py b/requests/sessions.py index 391f857d..bb57f5d8 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -696,7 +696,7 @@ class Session(SessionRedirectMixin): """ for (prefix, adapter) in self.adapters.items(): - if url.lower().startswith(prefix): + if url.lower().startswith(prefix.lower()): return adapter # Nothing matches :-/ -- cgit v1.2.1 From af88af64e6c5bc026247f18e2e6de20605f51e7f Mon Sep 17 00:00:00 2001 From: Alvaro Gutierrez Perez Date: Thu, 19 Oct 2017 16:36:17 +0200 Subject: Add test for Session.get_adapter() case-insensitivity --- tests/test_requests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_requests.py b/tests/test_requests.py index 4d399518..76a528c9 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1351,6 +1351,18 @@ class TestRequests: assert 'http://' in s2.adapters assert 'https://' in s2.adapters + def test_session_get_adapter_prefix_matching_is_case_insensitive(self, httpbin): + mixed_case_prefix = 'hTtPs://eXamPle.CoM/MixEd_CAse_PREfix' + url_matching_prefix = mixed_case_prefix + '/full_url' + url_matching_prefix_with_different_case = 'HtTpS://exaMPLe.cOm/MiXeD_caSE_preFIX/another_url' + + s = requests.Session() + my_adapter = HTTPAdapter() + s.mount(mixed_case_prefix, my_adapter) + + assert s.get_adapter(url_matching_prefix) is my_adapter + assert s.get_adapter(url_matching_prefix_with_different_case) is my_adapter + def test_header_remove_is_case_insensitive(self, httpbin): # From issue #1321 s = requests.Session() -- cgit v1.2.1 From e11989e8ec5885ea36b9be25641fbd4ce9f0c4dd Mon Sep 17 00:00:00 2001 From: Alvaro Gutierrez Perez Date: Thu, 19 Oct 2017 16:37:09 +0200 Subject: Add test for Session.get_adapter() prefix matching --- tests/test_requests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_requests.py b/tests/test_requests.py index 76a528c9..a14a2c50 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1351,6 +1351,24 @@ class TestRequests: assert 'http://' in s2.adapters assert 'https://' in s2.adapters + def test_session_get_adapter_prefix_matching(self, httpbin): + prefix = 'https://example.com' + more_specific_prefix = prefix + '/some/path' + + url_matching_only_prefix = prefix + '/another/path' + url_matching_more_specific_prefix = more_specific_prefix + '/longer/path' + url_not_matching_prefix = 'https://another.example.com/' + + s = requests.Session() + prefix_adapter = HTTPAdapter() + more_specific_prefix_adapter = HTTPAdapter() + s.mount(prefix, prefix_adapter) + s.mount(more_specific_prefix, more_specific_prefix_adapter) + + assert s.get_adapter(url_matching_only_prefix) is prefix_adapter + assert s.get_adapter(url_matching_more_specific_prefix) is more_specific_prefix_adapter + assert s.get_adapter(url_not_matching_prefix) not in (prefix_adapter, more_specific_prefix_adapter) + def test_session_get_adapter_prefix_matching_is_case_insensitive(self, httpbin): mixed_case_prefix = 'hTtPs://eXamPle.CoM/MixEd_CAse_PREfix' url_matching_prefix = mixed_case_prefix + '/full_url' -- cgit v1.2.1 From d165b18b6e0c1aaabd8f652f88308008769f6625 Mon Sep 17 00:00:00 2001 From: Alvaro Gutierrez Perez Date: Thu, 19 Oct 2017 17:04:48 +0200 Subject: Split test in two better-defined tests --- tests/test_requests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_requests.py b/tests/test_requests.py index a14a2c50..05fe63e3 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1369,16 +1369,24 @@ class TestRequests: assert s.get_adapter(url_matching_more_specific_prefix) is more_specific_prefix_adapter assert s.get_adapter(url_not_matching_prefix) not in (prefix_adapter, more_specific_prefix_adapter) - def test_session_get_adapter_prefix_matching_is_case_insensitive(self, httpbin): + def test_session_get_adapter_prefix_matching_mixed_case(self, httpbin): mixed_case_prefix = 'hTtPs://eXamPle.CoM/MixEd_CAse_PREfix' url_matching_prefix = mixed_case_prefix + '/full_url' - url_matching_prefix_with_different_case = 'HtTpS://exaMPLe.cOm/MiXeD_caSE_preFIX/another_url' s = requests.Session() my_adapter = HTTPAdapter() s.mount(mixed_case_prefix, my_adapter) assert s.get_adapter(url_matching_prefix) is my_adapter + + def test_session_get_adapter_prefix_matching_is_case_insensitive(self, httpbin): + mixed_case_prefix = 'hTtPs://eXamPle.CoM/MixEd_CAse_PREfix' + url_matching_prefix_with_different_case = 'HtTpS://exaMPLe.cOm/MiXeD_caSE_preFIX/another_url' + + s = requests.Session() + my_adapter = HTTPAdapter() + s.mount(mixed_case_prefix, my_adapter) + assert s.get_adapter(url_matching_prefix_with_different_case) is my_adapter def test_header_remove_is_case_insensitive(self, httpbin): -- cgit v1.2.1 From a05aac7007dd802401d59b6380ef95095836ed9b Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sun, 1 Oct 2017 01:08:14 +0900 Subject: avoid import platform platform module is relatively large: it takes about 5ms to import --- requests/sessions.py | 4 ++-- requests/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requests/sessions.py b/requests/sessions.py index 391f857d..631fadb9 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -8,7 +8,7 @@ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os -import platform +import sys import time from collections import Mapping from datetime import timedelta @@ -38,7 +38,7 @@ from .status_codes import codes from .models import REDIRECT_STATI # Preferred clock, based on which one is more accurate on a given system. -if platform.system() == 'Windows': +if sys.platform == 'win32': try: # Python 3.4+ preferred_clock = time.perf_counter except AttributeError: # Earlier than Python 3. diff --git a/requests/utils.py b/requests/utils.py index c52ce2d0..35fff043 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -14,10 +14,10 @@ import collections import contextlib import io import os -import platform import re import socket import struct +import sys import warnings from .__version__ import __version__ @@ -39,7 +39,7 @@ NETRC_FILES = ('.netrc', '_netrc') DEFAULT_CA_BUNDLE_PATH = certs.where() -if platform.system() == 'Windows': +if sys.platform == 'win32': # provide a proxy_bypass version on Windows without DNS lookups def proxy_bypass_registry(host): -- cgit v1.2.1 From 1595e43812bdfcc4ef16567780e872b9eb79d9d2 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 15 Oct 2017 19:45:19 -0700 Subject: Include license file in the generated wheel package The wheel package format supports including the license file. This is done using the [metadata] section in the setup.cfg file. For additional information on this feature, see: https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 2a9acf13..ed8a958e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ [bdist_wheel] universal = 1 + +[metadata] +license_file = LICENSE -- cgit v1.2.1 From 2c4849defeda74c191c35c4b1997547b1aae425e Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Mon, 23 Oct 2017 08:30:35 +0100 Subject: Add something to the docs about hooks on Session() --- docs/user/advanced.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 613df205..443b43e9 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -458,6 +458,15 @@ Let's print some request method arguments at runtime:: http://httpbin.org +You can also assign hooks to a ``Session`` instance. The hook will then be +called on every request made to the session. For example:: + + >>> s = requests.Session() + >>> s.hooks = dict(response=print_url) + >>> s.get('http://httpbin.org') + http://httpbin.org + + .. _custom-auth: Custom Authentication -- cgit v1.2.1 From 87f3b0a5595d875515de15927e1d2803dbfda73c Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Mon, 23 Oct 2017 13:25:31 +0100 Subject: Switch to using dict literals, it's 2017 --- docs/user/advanced.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 443b43e9..93f86baa 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -436,7 +436,7 @@ You can assign a hook function on a per-request basis by passing a ``{hook_name: callback_function}`` dictionary to the ``hooks`` request parameter:: - hooks=dict(response=print_url) + hooks={'response': print_url} That ``callback_function`` will receive a chunk of data as its first argument. @@ -454,7 +454,7 @@ anything, nothing else is effected. Let's print some request method arguments at runtime:: - >>> requests.get('http://httpbin.org', hooks=dict(response=print_url)) + >>> requests.get('http://httpbin.org', hooks={'response': print_url}) http://httpbin.org @@ -462,7 +462,7 @@ You can also assign hooks to a ``Session`` instance. The hook will then be called on every request made to the session. For example:: >>> s = requests.Session() - >>> s.hooks = dict(response=print_url) + >>> s.hooks['response'].append(print_url) >>> s.get('http://httpbin.org') http://httpbin.org -- cgit v1.2.1 From 40c5a8b0c28e2756e83ecfab0160ca3be37391e1 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Mon, 23 Oct 2017 13:25:46 +0100 Subject: Clarify that a Session can have multiple hooks --- docs/user/advanced.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 93f86baa..c24f6e5b 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -458,8 +458,8 @@ Let's print some request method arguments at runtime:: http://httpbin.org -You can also assign hooks to a ``Session`` instance. The hook will then be -called on every request made to the session. For example:: +You can also add hooks to a ``Session`` instance. Any hooks you add will then +be called on every request made to the session. For example:: >>> s = requests.Session() >>> s.hooks['response'].append(print_url) @@ -467,6 +467,9 @@ called on every request made to the session. For example:: http://httpbin.org +A ``Session`` can have multiple hooks, which will be called in the order +they are added. + .. _custom-auth: Custom Authentication -- cgit v1.2.1 From c5ed41e00a2010fc251ed5655d9f1923c345878a Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Tue, 24 Oct 2017 07:27:55 +0100 Subject: Add an example of two hooks --- docs/user/advanced.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index c24f6e5b..587b3fdc 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -452,12 +452,24 @@ If the callback function returns a value, it is assumed that it is to replace the data that was passed in. If the function doesn't return anything, nothing else is effected. +:: + + def record_hook(r, *args, **kwargs): + r.hook_called = True + return r + Let's print some request method arguments at runtime:: >>> requests.get('http://httpbin.org', hooks={'response': print_url}) http://httpbin.org +You can add multiple hooks to a single request. Let's call two hooks at once:: + + >>> r = requests.get('http://httpbin.org', hooks={'response': [print_url, record_hook]}) + >>> r.hook_called + True + You can also add hooks to a ``Session`` instance. Any hooks you add will then be called on every request made to the session. For example:: -- cgit v1.2.1 From c86b09b3c67a437f8851d3be9232b0a1c8585e20 Mon Sep 17 00:00:00 2001 From: Arthur Vigil Date: Sun, 5 Nov 2017 10:50:35 -0800 Subject: support extraction of certificate bundle from a zip archive --- AUTHORS.rst | 1 + HISTORY.rst | 3 +++ requests/adapters.py | 8 ++++---- requests/utils.py | 34 ++++++++++++++++++++++++++++++++++ tests/test_utils.py | 30 +++++++++++++++++++++++++++++- 5 files changed, 71 insertions(+), 5 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index cdf8c516..1bec7846 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -179,3 +179,4 @@ Patches and Suggestions - Ed Morley (`@edmorley `_) - Matt Liu (`@mlcrazy `_) - Taylor Hoff (`@PrimordialHelios `_) +- Arthur Vigil (`@ahvigil `_) diff --git a/HISTORY.rst b/HISTORY.rst index 89a0b0dc..e6281c1e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,9 @@ dev **Bugfixes** - Parsing empty ``Link`` headers with ``parse_header_links()`` no longer return one bogus entry +- Fixed issue where loading the default certificate bundle from a zip archive + would raise an ``IOError`` + 2.18.4 (2017-08-15) +++++++++++++++++++ diff --git a/requests/adapters.py b/requests/adapters.py index 00f8792b..cdaabdbe 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -28,9 +28,9 @@ from urllib3.exceptions import ResponseError from .models import Response from .compat import urlparse, basestring -from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, - prepend_scheme_if_needed, get_auth_from_url, urldefragauth, - select_proxy) +from .utils import (DEFAULT_CA_BUNDLE_PATH, extract_zipped_paths, + get_encoding_from_headers, prepend_scheme_if_needed, + get_auth_from_url, urldefragauth, select_proxy) from .structures import CaseInsensitiveDict from .cookies import extract_cookies_to_jar from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, @@ -219,7 +219,7 @@ class HTTPAdapter(BaseAdapter): cert_loc = verify if not cert_loc: - cert_loc = DEFAULT_CA_BUNDLE_PATH + cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) if not cert_loc or not os.path.exists(cert_loc): raise IOError("Could not find a suitable TLS CA certificate bundle, " diff --git a/requests/utils.py b/requests/utils.py index 35fff043..1cba5a93 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -18,7 +18,9 @@ import re import socket import struct import sys +import tempfile import warnings +import zipfile from .__version__ import __version__ from . import certs @@ -216,6 +218,38 @@ def guess_filename(obj): return os.path.basename(name) +def extract_zipped_paths(path): + """Replace nonexistant paths that look like they refer to a member of a zip + archive with the location of an extracted copy of the target, or else + just return the provided path unchanged. + """ + if os.path.exists(path): + # this is already a valid path, no need to do anything further + return path + + # find the first valid part of the provided path and treat that as a zip archive + # assume the rest of the path is the name of a member in the archive + archive, member = os.path.split(path) + while archive and not os.path.exists(archive): + archive, prefix = os.path.split(archive) + member = '/'.join([prefix, member]) + + if not zipfile.is_zipfile(archive): + return path + + zip_file = zipfile.ZipFile(archive) + if member not in zip_file.namelist(): + return path + + # we have a valid zip archive and a valid member of that archive + tmp = tempfile.gettempdir() + extracted_path = os.path.join(tmp, *member.split('/')) + if not os.path.exists(extracted_path): + extracted_path = zip_file.extract(member, path=tmp) + + return extracted_path + + def from_key_val_list(value): """Take an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an diff --git a/tests/test_utils.py b/tests/test_utils.py index 32e4d4a5..2292a8f0 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,14 +2,16 @@ import os import copy +import filecmp from io import BytesIO +import zipfile import pytest from requests import compat from requests.cookies import RequestsCookieJar from requests.structures import CaseInsensitiveDict from requests.utils import ( - address_in_network, dotted_netmask, + address_in_network, dotted_netmask, extract_zipped_paths, get_auth_from_url, get_encoding_from_headers, get_encodings_from_content, get_environ_proxies, guess_filename, guess_json_utf, is_ipv4_address, @@ -256,6 +258,32 @@ class TestGuessFilename: assert isinstance(result, expected_type) +class TestExtractZippedPaths: + + @pytest.mark.parametrize( + 'path', ( + '/', + __file__, + pytest.__file__, + '/etc/invalid/location', + )) + def test_unzipped_paths_unchanged(self, path): + assert path == extract_zipped_paths(path) + + def test_zipped_paths_extracted(self, tmpdir): + zipped_py = tmpdir.join('test.zip') + with zipfile.ZipFile(zipped_py.strpath, 'w') as f: + f.write(__file__) + + _, name = os.path.splitdrive(__file__) + zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r'\/')) + extracted_path = extract_zipped_paths(zipped_path) + + assert extracted_path != zipped_path + assert os.path.exists(extracted_path) + assert filecmp.cmp(extracted_path, __file__) + + class TestContentEncodingDetection: def test_none(self): -- cgit v1.2.1 From 9a8a826f226e6973d72914b4a4fc806e0b5036f4 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Thu, 26 Oct 2017 10:33:05 -0400 Subject: Check if host is invalid for proxy According to RFC3986, the authority section can be empty for a given URL, however, for a proxy URL, it shouldn't be. This patch adds a check to verify that the parsed URL will have a valid host before creating the proxy manager. Fixes #4353 --- AUTHORS.rst | 1 + HISTORY.rst | 1 + requests/adapters.py | 7 ++++++- requests/exceptions.py | 4 ++++ tests/test_requests.py | 15 ++++++++++++++- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 1bec7846..8379f65c 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -180,3 +180,4 @@ Patches and Suggestions - Matt Liu (`@mlcrazy `_) - Taylor Hoff (`@PrimordialHelios `_) - Arthur Vigil (`@ahvigil `_) +- Nehal J Wani (`@nehaljwani `_) diff --git a/HISTORY.rst b/HISTORY.rst index e6281c1e..79202df6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,7 @@ dev **Improvements** - Warn user about possible slowdown when using cryptography version < 1.3.4 +- Check for invalid host in proxy URL, before forwarding request to adapter. **Bugfixes** diff --git a/requests/adapters.py b/requests/adapters.py index cdaabdbe..bc01e336 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -13,6 +13,7 @@ import socket from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.response import HTTPResponse +from urllib3.util import parse_url from urllib3.util import Timeout as TimeoutSauce from urllib3.util.retry import Retry from urllib3.exceptions import ClosedPoolError @@ -34,7 +35,7 @@ from .utils import (DEFAULT_CA_BUNDLE_PATH, extract_zipped_paths, from .structures import CaseInsensitiveDict from .cookies import extract_cookies_to_jar from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, - ProxyError, RetryError, InvalidSchema) + ProxyError, RetryError, InvalidSchema, InvalidProxyURL) from .auth import _basic_auth_str try: @@ -300,6 +301,10 @@ class HTTPAdapter(BaseAdapter): if proxy: proxy = prepend_scheme_if_needed(proxy, 'http') + proxy_url = parse_url(proxy) + if not proxy_url.host: + raise InvalidProxyURL("Please check proxy URL. It is malformed" + " and could be missing the host.") proxy_manager = self.proxy_manager_for(proxy) conn = proxy_manager.connection_from_url(url) else: diff --git a/requests/exceptions.py b/requests/exceptions.py index be7eaed6..a80cad80 100644 --- a/requests/exceptions.py +++ b/requests/exceptions.py @@ -85,6 +85,10 @@ class InvalidHeader(RequestException, ValueError): """The header value provided was somehow invalid.""" +class InvalidProxyURL(InvalidURL): + """The proxy URL provided is invalid.""" + + class ChunkedEncodingError(RequestException): """The server declared chunked encoding but sent an invalid chunk.""" diff --git a/tests/test_requests.py b/tests/test_requests.py index 05fe63e3..e6a026f2 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -23,7 +23,7 @@ from requests.cookies import ( from requests.exceptions import ( ConnectionError, ConnectTimeout, InvalidSchema, InvalidURL, MissingSchema, ReadTimeout, Timeout, RetryError, TooManyRedirects, - ProxyError, InvalidHeader, UnrewindableBodyError, SSLError) + ProxyError, InvalidHeader, UnrewindableBodyError, SSLError, InvalidProxyURL) from requests.models import PreparedRequest from requests.structures import CaseInsensitiveDict from requests.sessions import SessionRedirectMixin @@ -526,6 +526,19 @@ class TestRequests: with pytest.raises(ProxyError): requests.get('http://localhost:1', proxies={'http': 'non-resolvable-address'}) + def test_proxy_error_on_bad_url(self, httpbin, httpbin_secure): + with pytest.raises(InvalidProxyURL): + requests.get(httpbin_secure(), proxies={'https': 'http:/badproxyurl:3128'}) + + with pytest.raises(InvalidProxyURL): + requests.get(httpbin(), proxies={'http': 'http://:8080'}) + + with pytest.raises(InvalidProxyURL): + requests.get(httpbin_secure(), proxies={'https': 'https://'}) + + with pytest.raises(InvalidProxyURL): + requests.get(httpbin(), proxies={'http': 'http:///example.com:8080'}) + def test_basicauth_with_netrc(self, httpbin): auth = ('user', 'pass') wrong_auth = ('wronguser', 'wrongpass') -- cgit v1.2.1 From 7f08ad3b6c633193c80cf26eb2dc895ea41ed2ae Mon Sep 17 00:00:00 2001 From: Tal Einat Date: Thu, 16 Nov 2017 09:59:00 +0200 Subject: Corrent HTTP -> HTML in quickstart doc --- docs/user/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 7fe1e0d2..b5288ea3 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -110,7 +110,7 @@ using, and change it, using the ``r.encoding`` property:: If you change the encoding, Requests will use the new value of ``r.encoding`` whenever you call ``r.text``. You might want to do this in any situation where you can apply special logic to work out what the encoding of the content will -be. For example, HTTP and XML have the ability to specify their encoding in +be. For example, HTML and XML have the ability to specify their encoding in their body. In situations like this, you should use ``r.content`` to find the encoding, and then set ``r.encoding``. This will let you use ``r.text`` with the correct encoding. -- cgit v1.2.1 From 7cc3d8dc6a24975617e388e674d93251c74749f1 Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Fri, 17 Nov 2017 16:37:08 -0500 Subject: docs/quickstart: clarify raw response reading. --- docs/user/quickstart.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index b5288ea3..6829d592 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -189,6 +189,14 @@ download, the above is the preferred and recommended way to retrieve the content. Note that ``chunk_size`` can be freely adjusted to a number that may better fit your use cases. +.. note:: + + An important note about using ``Response.iter_content`` versus ``Response.raw``. + ``Response.iter_content`` will automatically decode the ``gzip`` and ``deflate`` + transfer-encodings. ``Response.raw`` is a raw stream of bytes -- it does not + transform the response content. If you really need access to the bytes as they + were returned, use ``Response.raw``. + Custom Headers -------------- -- cgit v1.2.1 From 775cde0914265d7dab2bc2501ed7abe6b85c4bae Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Mon, 20 Nov 2017 09:16:35 +0000 Subject: Clarify that Response.ok will *only* return True/False --- requests/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/models.py b/requests/models.py index 4041cac3..ce4e284e 100644 --- a/requests/models.py +++ b/requests/models.py @@ -686,11 +686,11 @@ class Response(object): @property def ok(self): - """Returns True if :attr:`status_code` is less than 400. + """Returns True if :attr:`status_code` is less than 400, False if not. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If - the status code, is between 200 and 400, this will return True. This + the status code is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. """ try: -- cgit v1.2.1 From acd2645444d280ac0c5d2d227fdd222cb1ac609c Mon Sep 17 00:00:00 2001 From: Mingyuan Xia Date: Tue, 21 Nov 2017 04:01:04 +0800 Subject: #4373, fix possible winreg value type difference (#4377) * #4373, fix possible winreg value type difference * add a test for ProxyOverride and ProxyEnable on win32 * add tests for winreg key ProxyEnable with two possible types * fixing AppVeyor failures --- requests/utils.py | 6 ++++-- tests/test_utils.py | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 1cba5a93..42daa2d7 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -52,8 +52,10 @@ if sys.platform == 'win32': try: internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') - proxyEnable = winreg.QueryValueEx(internetSettings, - 'ProxyEnable')[0] + # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it + proxyEnable = int(winreg.QueryValueEx(internetSettings, + 'ProxyEnable')[0]) + # ProxyOverride is almost always a string proxyOverride = winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0] except OSError: diff --git a/tests/test_utils.py b/tests/test_utils.py index 2292a8f0..2dd16923 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,6 +5,7 @@ import copy import filecmp from io import BytesIO import zipfile +from collections import deque import pytest from requests import compat @@ -666,6 +667,7 @@ def test_should_bypass_proxies_win_registry(url, expected, override, pass ie_settings = RegHandle() + proxyEnableValues = deque([1, "1"]) def OpenKey(key, subkey): return ie_settings @@ -673,7 +675,9 @@ def test_should_bypass_proxies_win_registry(url, expected, override, def QueryValueEx(key, value_name): if key is ie_settings: if value_name == 'ProxyEnable': - return [1] + # this could be a string (REG_SZ) or a 32-bit number (REG_DWORD) + proxyEnableValues.rotate() + return [proxyEnableValues[0]] elif value_name == 'ProxyOverride': return [override] @@ -684,6 +688,7 @@ def test_should_bypass_proxies_win_registry(url, expected, override, monkeypatch.setenv('NO_PROXY', '') monkeypatch.setattr(winreg, 'OpenKey', OpenKey) monkeypatch.setattr(winreg, 'QueryValueEx', QueryValueEx) + assert should_bypass_proxies(url, None) == expected @pytest.mark.parametrize( -- cgit v1.2.1 From 39446def395672b96642ad9b317fab09ee771be1 Mon Sep 17 00:00:00 2001 From: Daniel Roseman Date: Fri, 3 Nov 2017 13:53:08 +0000 Subject: Clarify behaviour of `json` parameter. `json` is ignored if `data` or `files` is not empty. --- docs/user/quickstart.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 6829d592..1a2c6fbf 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -281,6 +281,7 @@ the ``json`` parameter (added in version 2.4.2) and it will be encoded automatic >>> r = requests.post(url, json=payload) +Note, the ``json`` parameter is ignored if either ``data`` or ``files`` is passed. POST a Multipart-Encoded File ----------------------------- -- cgit v1.2.1 From 19919b44c4af95f125704c902acecdf83d70a3e4 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Tue, 21 Nov 2017 12:39:22 -0500 Subject: Add documentation for available status codes There was no way to determine what actual names were available outside of looking at the source code. They were not listed in the documentation or accessible through the interactive help. In addition, doing `pydoc requests.status_codes` displayed some pretty unhelpful information - the utf-8 encoding string was included in the module name, there was no description, and internal variables used for initialisation leaked into the module scope: DATA code = 511 codes = title = 'network_authentication' titles = ('network_authentication_required', 'network_auth', ... This change prevents the internal variables from leaking, adds a docstring (which has the side-effect of correcting the module name), and appends information on the allowed status code names to the docstring when the module is initialised. The improved module documentation is then used in the API documentation to provide another easy reference to the complete list of status codes. --- docs/api.rst | 12 +----------- requests/status_codes.py | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index ed61bb38..c3e00e54 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -109,17 +109,7 @@ Status Code Lookup .. autoclass:: requests.codes -:: - - >>> requests.codes['temporary_redirect'] - 307 - - >>> requests.codes.teapot - 418 - - >>> requests.codes['\o/'] - 200 - +.. automodule:: requests.status_codes Migrating to 1.x diff --git a/requests/status_codes.py b/requests/status_codes.py index dee89190..96b86ddb 100644 --- a/requests/status_codes.py +++ b/requests/status_codes.py @@ -1,5 +1,22 @@ # -*- coding: utf-8 -*- +""" +The ``codes`` object defines a mapping from common names for HTTP statuses +to their numerical codes, accessible either as attributes or as dictionary +items. + +>>> requests.codes['temporary_redirect'] +307 +>>> requests.codes.teapot +418 +>>> requests.codes['\o/'] +200 + +Some codes have multiple names, and both upper- and lower-case versions of +the names are allowed. For example, ``codes.ok``, ``codes.OK``, and +``codes.okay`` all correspond to the HTTP status code 200. +""" + from .structures import LookupDict _codes = { @@ -84,8 +101,19 @@ _codes = { codes = LookupDict(name='status_codes') -for code, titles in _codes.items(): - for title in titles: - setattr(codes, title, code) - if not title.startswith(('\\', '/')): - setattr(codes, title.upper(), code) +def _init(): + for code, titles in _codes.items(): + for title in titles: + setattr(codes, title, code) + if not title.startswith(('\\', '/')): + setattr(codes, title.upper(), code) + + def doc(code): + names = ', '.join('``%s``' % n for n in _codes[code]) + return '* %d: %s' % (code, names) + + global __doc__ + __doc__ = (__doc__ + '\n' + + '\n'.join(doc(code) for code in sorted(_codes))) + +_init() -- cgit v1.2.1 From 714c9dc96759942226a0dc16fa1e3d6d51f56291 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Fri, 10 Nov 2017 10:32:41 +0300 Subject: utils: winreg module may not exist like on windows universal platform. --- requests/utils.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 42daa2d7..f9565287 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -45,10 +45,14 @@ if sys.platform == 'win32': # provide a proxy_bypass version on Windows without DNS lookups def proxy_bypass_registry(host): - if is_py3: - import winreg - else: - import _winreg as winreg + try: + if is_py3: + import winreg + else: + import _winreg as winreg + except ImportError: + return False + try: internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') -- cgit v1.2.1 From 351ec982bb38a069a6b236b8d77dc09f26c2f444 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Sat, 25 Nov 2017 12:07:41 +0300 Subject: update changelog --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index 79202df6..b099ecdb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,7 @@ dev - Parsing empty ``Link`` headers with ``parse_header_links()`` no longer return one bogus entry - Fixed issue where loading the default certificate bundle from a zip archive would raise an ``IOError`` +- Fixed issue with unexpected ``ImportError`` on windows system which do not support ``winreg`` module 2.18.4 (2017-08-15) -- cgit v1.2.1 From d8666e190631b5330c2851bd354d07831afba114 Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Sun, 31 Dec 2017 14:46:15 -0600 Subject: Reduce overall memory usage of Requests module by removing cgi module dependency in utils.py. Instead wrote a nested function to parse header and return content type and params. --- requests/utils.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index f9565287..a1a3a7cb 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -8,7 +8,6 @@ This module provides utility functions that are used within Requests that are also useful for external consumption. """ -import cgi import codecs import collections import contextlib @@ -453,13 +452,28 @@ def get_encoding_from_headers(headers): :param headers: dictionary to extract encoding from. :rtype: str """ + def parse_header(content_type): + #Inner function to parse header + content_type_and_params_delimiter = ';' + + #append delimiter on end to ensure atleast two elements when split by ';' + content_type += content_type_and_params_delimiter + + tokens = content_type.split(content_type_and_params_delimiter) + content_type_index = 0 + params_index = 1 + + content_type = tokens[content_type_index] + params = tokens[params_index] + params_dict = dict(param.split('=') for param in params.split()) + return content_type,params_dict content_type = headers.get('content-type') if not content_type: return None - content_type, params = cgi.parse_header(content_type) + content_type, params = parse_header(content_type) if 'charset' in params: return params['charset'].strip("'\"") -- cgit v1.2.1 From cef08304197b8b8747015d94a1700716202355ee Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Sun, 31 Dec 2017 15:02:39 -0600 Subject: clean --- requests/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index a1a3a7cb..37e3e27d 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -454,9 +454,8 @@ def get_encoding_from_headers(headers): """ def parse_header(content_type): #Inner function to parse header - content_type_and_params_delimiter = ';' - #append delimiter on end to ensure atleast two elements when split by ';' + content_type_and_params_delimiter = ';' content_type += content_type_and_params_delimiter tokens = content_type.split(content_type_and_params_delimiter) -- cgit v1.2.1 From 19cfec28a8ee8f2044a883bc25406f7865fffeac Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Sun, 31 Dec 2017 22:18:19 -0600 Subject: CI --- .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/requests_open_source.iml | 11 ++ .idea/vcs.xml | 6 + .idea/workspace.xml | 398 +++++++++++++++++++++++++++++++++++++++++ .travis.yml | 4 +- 6 files changed, 429 insertions(+), 2 deletions(-) create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/requests_open_source.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..96eb542b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..85d7cf7a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/requests_open_source.iml b/.idea/requests_open_source.iml new file mode 100644 index 00000000..67116063 --- /dev/null +++ b/.idea/requests_open_source.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..f41d18e5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + header + encoding + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1514747970257 - - - 1514753175234 - - - 1514754159918 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 1ee87011..b7693f63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ language: python python: # - "2.6" - "2.7" -# - "3.4" -# - "3.5" + - "3.4" + - "3.5" - "3.6" # - "3.7-dev" # - "pypy" -- appears to hang -- cgit v1.2.1 From 1988d9cf72c3a3a6da87968e04ad57fb32df01cb Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Mon, 1 Jan 2018 14:20:55 -0600 Subject: Move nested function up to module level and rename. Add more tests for function. --- requests/utils.py | 46 +++++++++++++++++++++++++++++++--------------- tests/test_utils.py | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 16 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 37e3e27d..118e7e1b 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -446,33 +446,49 @@ def get_encodings_from_content(content): xml_re.findall(content)) +def _parse_content_type_header(header): + """Returns content type and parameters from given header + + :param header: string + :return: tuple containing content type and dictionary of + parameters + """ + if not header: + return None + # append delimiter on end to ensure at least two elements when split by ';' + header += ';' + # split content type's main value from params + tokens = header.split(';', 1) + content_type_index = 0 + params_index = 1 + + content_type = tokens[content_type_index].strip() + params = tokens[params_index] + params_dict = dict() + + for param in params.split(';'): + if param and not param.isspace(): + param = param.strip() + key, value = param, True + if '=' in param: + param_tokens = [x.strip('\'" ') for x in param.split('=', 1)] + key, value = param_tokens[0], param_tokens[1] + params_dict[key] = value + return content_type, params_dict + def get_encoding_from_headers(headers): """Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str """ - def parse_header(content_type): - #Inner function to parse header - #append delimiter on end to ensure atleast two elements when split by ';' - content_type_and_params_delimiter = ';' - content_type += content_type_and_params_delimiter - - tokens = content_type.split(content_type_and_params_delimiter) - content_type_index = 0 - params_index = 1 - - content_type = tokens[content_type_index] - params = tokens[params_index] - params_dict = dict(param.split('=') for param in params.split()) - return content_type,params_dict content_type = headers.get('content-type') if not content_type: return None - content_type, params = parse_header(content_type) + content_type, params = _parse_content_type_header(content_type) if 'charset' in params: return params['charset'].strip("'\"") diff --git a/tests/test_utils.py b/tests/test_utils.py index 2dd16923..e734b8f8 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -13,7 +13,7 @@ from requests.cookies import RequestsCookieJar from requests.structures import CaseInsensitiveDict from requests.utils import ( address_in_network, dotted_netmask, extract_zipped_paths, - get_auth_from_url, get_encoding_from_headers, + get_auth_from_url, _parse_content_type_header, get_encoding_from_headers, get_encodings_from_content, get_environ_proxies, guess_filename, guess_json_utf, is_ipv4_address, is_valid_cidr, iter_slices, parse_dict_header, @@ -470,6 +470,41 @@ def test_parse_dict_header(value, expected): assert parse_dict_header(value) == expected +@pytest.mark.parametrize( + 'value, expected', ( + ( + None, + None + ), +( + '', + None + ), + ( + 'application/xml', + ('application/xml', dict()) + ), + ( + 'application/json ; charset=utf-8', + ('application/json', {'charset': 'utf-8'}) + ), + ( + 'text/plain', + ('text/plain', dict()) + ), + ( + 'multipart/form-data; boundary = something ; \'boundary2=something_else\' ; no_equals ', + ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) + ), + ( + 'application/json ;; ; ', + ('application/json', dict()) + ) + )) +def test__parse_content_type_header(value, expected): + assert _parse_content_type_header(value) == expected + + @pytest.mark.parametrize( 'value, expected', ( ( -- cgit v1.2.1 From 071796d83f1bfb79793170945fdb4f623a1f344a Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Wed, 3 Jan 2018 23:40:08 -0600 Subject: implement changes after code review --- requests/utils.py | 21 +++++++-------------- tests/test_utils.py | 8 -------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 118e7e1b..44b3e016 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -453,20 +453,12 @@ def _parse_content_type_header(header): :return: tuple containing content type and dictionary of parameters """ - if not header: - return None - # append delimiter on end to ensure at least two elements when split by ';' - header += ';' - # split content type's main value from params - tokens = header.split(';', 1) - content_type_index = 0 - params_index = 1 - - content_type = tokens[content_type_index].strip() - params = tokens[params_index] - params_dict = dict() - - for param in params.split(';'): + + tokens = header.split(';') + content_type, params = tokens[0].strip(), tokens[1:] + params_dict = {} # Using dict is actually slower than a dictionary literal. Weird but tru + + for param in params: if param and not param.isspace(): param = param.strip() key, value = param, True @@ -476,6 +468,7 @@ def _parse_content_type_header(header): params_dict[key] = value return content_type, params_dict + def get_encoding_from_headers(headers): """Returns encodings from given HTTP Header Dict. diff --git a/tests/test_utils.py b/tests/test_utils.py index e734b8f8..f89d15aa 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -472,14 +472,6 @@ def test_parse_dict_header(value, expected): @pytest.mark.parametrize( 'value, expected', ( - ( - None, - None - ), -( - '', - None - ), ( 'application/xml', ('application/xml', dict()) -- cgit v1.2.1 From 80a790443e693d982296db93ceebc9135b6efb9c Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Wed, 3 Jan 2018 23:41:41 -0600 Subject: implement changes after code review --- requests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/utils.py b/requests/utils.py index 44b3e016..958f694d 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -456,7 +456,7 @@ def _parse_content_type_header(header): tokens = header.split(';') content_type, params = tokens[0].strip(), tokens[1:] - params_dict = {} # Using dict is actually slower than a dictionary literal. Weird but tru + params_dict = {} for param in params: if param and not param.isspace(): -- cgit v1.2.1 From cb0914407b6bb8153c8be5d52bc497e1d10b04ac Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Thu, 4 Jan 2018 10:30:50 -0600 Subject: Continue to refactor, remove list comprehension, add double quotes test case. --- AUTHORS.rst | 1 + requests/utils.py | 16 ++++++++++------ tests/test_utils.py | 12 ++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 8379f65c..481ac6c7 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -181,3 +181,4 @@ Patches and Suggestions - Taylor Hoff (`@PrimordialHelios `_) - Arthur Vigil (`@ahvigil `_) - Nehal J Wani (`@nehaljwani `_) +- Demetrios Bairaktaris (`@DemetriosBairaktaris `_) diff --git a/requests/utils.py b/requests/utils.py index 958f694d..6c2bf5f5 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -456,15 +456,19 @@ def _parse_content_type_header(header): tokens = header.split(';') content_type, params = tokens[0].strip(), tokens[1:] - params_dict = {} + params_dict = {} + items_to_strip = "\"' " for param in params: - if param and not param.isspace(): - param = param.strip() + param = param.strip() + if param: key, value = param, True - if '=' in param: - param_tokens = [x.strip('\'" ') for x in param.split('=', 1)] - key, value = param_tokens[0], param_tokens[1] + index_of_equals = param.find("=") + if index_of_equals != -1: + before_equals = slice(0, index_of_equals) + after_equals = slice(index_of_equals + 1, len(param)) + key = param[before_equals].strip(items_to_strip) + value = param[after_equals].strip(items_to_strip) params_dict[key] = value return content_type, params_dict diff --git a/tests/test_utils.py b/tests/test_utils.py index f89d15aa..53d27a26 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -474,7 +474,7 @@ def test_parse_dict_header(value, expected): 'value, expected', ( ( 'application/xml', - ('application/xml', dict()) + ('application/xml', {}) ), ( 'application/json ; charset=utf-8', @@ -482,15 +482,19 @@ def test_parse_dict_header(value, expected): ), ( 'text/plain', - ('text/plain', dict()) + ('text/plain', {}) ), ( 'multipart/form-data; boundary = something ; \'boundary2=something_else\' ; no_equals ', ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) ), ( - 'application/json ;; ; ', - ('application/json', dict()) + 'multipart/form-data; boundary = something ; \"boundary2=something_else\" ; no_equals ', + ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) + ), + ( + 'application/json ; ; ', + ('application/json', {}) ) )) def test__parse_content_type_header(value, expected): -- cgit v1.2.1 From 7deee699ada6e5ec0d41c7561d9b5fa4cd80e535 Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Thu, 4 Jan 2018 10:48:17 -0600 Subject: slice function removed --- requests/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 6c2bf5f5..8c1b9bec 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -465,10 +465,8 @@ def _parse_content_type_header(header): key, value = param, True index_of_equals = param.find("=") if index_of_equals != -1: - before_equals = slice(0, index_of_equals) - after_equals = slice(index_of_equals + 1, len(param)) - key = param[before_equals].strip(items_to_strip) - value = param[after_equals].strip(items_to_strip) + key = param[:index_of_equals].strip(items_to_strip) + value = param[index_of_equals + 1:].strip(items_to_strip) params_dict[key] = value return content_type, params_dict -- cgit v1.2.1 From e0ab287317fcde8fa4631bc7bee5aa1749bc4ac5 Mon Sep 17 00:00:00 2001 From: dbairaktaris1 Date: Thu, 4 Jan 2018 10:59:47 -0600 Subject: added more to test scenarios --- tests/test_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 53d27a26..01cabe23 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -484,12 +484,20 @@ def test_parse_dict_header(value, expected): 'text/plain', ('text/plain', {}) ), + ( + 'multipart/form-data; boundary = something ; boundary2=\'something_else\' ; no_equals ', + ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) + ), + ( + 'multipart/form-data; boundary = something ; boundary2="something_else" ; no_equals ', + ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) + ), ( 'multipart/form-data; boundary = something ; \'boundary2=something_else\' ; no_equals ', ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) ), ( - 'multipart/form-data; boundary = something ; \"boundary2=something_else\" ; no_equals ', + 'multipart/form-data; boundary = something ; "boundary2=something_else" ; no_equals ', ('multipart/form-data', {'boundary': 'something', 'boundary2': 'something_else', 'no_equals': True}) ), ( -- cgit v1.2.1 From 030dcce20cb8b4a82e7b0e5e09b7a8f33121938d Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 6 Jan 2018 11:20:54 -0800 Subject: Prefer https over http for links in the documentation - Fixed Read the Docs links - Fixed GitHub links - Fixed PyPI links --- README.rst | 2 +- docs/_templates/sidebarintro.html | 10 +++++----- docs/_templates/sidebarlogo.html | 4 ++-- docs/community/out-there.rst | 2 +- docs/community/recommended.rst | 2 +- docs/conf.py | 2 +- docs/dev/todo.rst | 2 +- docs/user/advanced.rst | 6 +++--- docs/user/authentication.rst | 10 +++++----- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 915f2a11..c7b033be 100644 --- a/README.rst +++ b/README.rst @@ -105,6 +105,6 @@ How to Contribute #. Write a test which shows that the bug was fixed or that the feature works as expected. #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_. -.. _`the repository`: http://github.com/requests/requests +.. _`the repository`: https://github.com/requests/requests .. _AUTHORS: https://github.com/requests/requests/blob/master/AUTHORS.rst .. _Contributor Friendly: https://github.com/requests/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 5b437d85..5087dbc0 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -5,7 +5,7 @@

-

@@ -20,7 +20,7 @@

Stay Informed

Receive updates on new releases and upcoming projects.

-

@@ -48,9 +48,9 @@

-
  • Requests @ GitHub
  • -
  • Requests @ PyPI
  • -
  • Issue Tracker
  • +
  • Requests @ GitHub
  • +
  • Requests @ PyPI
  • +
  • Issue Tracker
  • Release History
  • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index b31c3477..8a7d8d9a 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -4,7 +4,7 @@

    -

    @@ -25,7 +25,7 @@

    If you enjoy using this project, Say Thanks!

    -

    diff --git a/docs/community/out-there.rst b/docs/community/out-there.rst index 5ce5f79f..63e70169 100644 --- a/docs/community/out-there.rst +++ b/docs/community/out-there.rst @@ -18,7 +18,7 @@ Articles & Talks - `Python for the Web `_ teaches how to use Python to interact with the web, using Requests. - `Daniel Greenfeld's Review of Requests `_ - `My 'Python for Humans' talk `_ ( `audio `_ ) -- `Issac Kelly's 'Consuming Web APIs' talk `_ +- `Issac Kelly's 'Consuming Web APIs' talk `_ - `Blog post about Requests via Yum `_ - `Russian blog post introducing Requests `_ - `Sending JSON in Requests `_ diff --git a/docs/community/recommended.rst b/docs/community/recommended.rst index 0f652d54..88dcce8d 100644 --- a/docs/community/recommended.rst +++ b/docs/community/recommended.rst @@ -34,7 +34,7 @@ but do not belong in Requests proper. This library is actively maintained by members of the Requests core team, and reflects the functionality most requested by users within the community. -.. _Requests-Toolbelt: http://toolbelt.readthedocs.io/en/latest/index.html +.. _Requests-Toolbelt: https://toolbelt.readthedocs.io/en/latest/index.html Requests-Threads diff --git a/docs/conf.py b/docs/conf.py index 4bda98b0..503448d3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -376,4 +376,4 @@ epub_exclude_files = ['search.html'] # If false, no index is generated. #epub_use_index = True -intersphinx_mapping = {'urllib3': ('http://urllib3.readthedocs.io/en/latest', None)} +intersphinx_mapping = {'urllib3': ('https://urllib3.readthedocs.io/en/latest', None)} diff --git a/docs/dev/todo.rst b/docs/dev/todo.rst index 50b18155..707dea31 100644 --- a/docs/dev/todo.rst +++ b/docs/dev/todo.rst @@ -61,5 +61,5 @@ Requests currently supports the following versions of Python: Google AppEngine is not officially supported although support is available with the `Requests-Toolbelt`_. -.. _Requests-Toolbelt: http://toolbelt.readthedocs.io/ +.. _Requests-Toolbelt: https://toolbelt.readthedocs.io/ diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 587b3fdc..1bad6435 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -287,7 +287,7 @@ system. For the sake of security we recommend upgrading certifi frequently! .. _HTTP persistent connection: https://en.wikipedia.org/wiki/HTTP_persistent_connection -.. _connection pooling: http://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool +.. _connection pooling: https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool .. _certifi: http://certifi.io/ .. _Mozilla trust store: https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt @@ -657,7 +657,7 @@ When you receive a response, Requests makes a guess at the encoding to use for decoding the response when you access the :attr:`Response.text ` attribute. Requests will first check for an encoding in the HTTP header, and if none is present, will use `chardet -`_ to attempt to guess the encoding. +`_ to attempt to guess the encoding. The only time Requests will not do this is if no explicit charset is present in the HTTP headers **and** the ``Content-Type`` @@ -884,7 +884,7 @@ Link Headers Many HTTP APIs feature Link headers. They make APIs more self describing and discoverable. -GitHub uses these for `pagination `_ +GitHub uses these for `pagination `_ in their API, for example:: >>> url = 'https://api.github.com/users/kennethreitz/repos?page=1&per_page=10' diff --git a/docs/user/authentication.rst b/docs/user/authentication.rst index 8ffab504..411f79fd 100644 --- a/docs/user/authentication.rst +++ b/docs/user/authentication.rst @@ -136,11 +136,11 @@ Further examples can be found under the `Requests organization`_ and in the .. _OAuth: http://oauth.net/ .. _requests_oauthlib: https://github.com/requests/requests-oauthlib -.. _requests-oauthlib OAuth2 documentation: http://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html -.. _Web Application Flow: http://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#web-application-flow -.. _Mobile Application Flow: http://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#mobile-application-flow -.. _Legacy Application Flow: http://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#legacy-application-flow -.. _Backend Application Flow: http://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#backend-application-flow +.. _requests-oauthlib OAuth2 documentation: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html +.. _Web Application Flow: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#web-application-flow +.. _Mobile Application Flow: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#mobile-application-flow +.. _Legacy Application Flow: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#legacy-application-flow +.. _Backend Application Flow: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#backend-application-flow .. _Kerberos: https://github.com/requests/requests-kerberos .. _NTLM: https://github.com/requests/requests-ntlm .. _Requests organization: https://github.com/requests -- cgit v1.2.1 From 620a5391c38a2eef86ba69748833aa3c00aaef62 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 10 Jan 2018 18:37:22 -0800 Subject: Remove unsupported Python 3.3 from tox.ini Python 3.3 is not a supported version so don't test it. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 2a961c82..38bf3ac4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py26,py27,py33,py34,py35,py36 +envlist = py26,py27,py34,py35,py36 [testenv] commands = pip install -e .[socks] - python setup.py test \ No newline at end of file + python setup.py test -- cgit v1.2.1 From 7cefa939f5a0b25d8792a949b7ae708412d62681 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 10 Jan 2018 18:33:06 -0800 Subject: Pass python_requires argument to setuptools Helps pip decide what version of the library to install. https://packaging.python.org/tutorials/distributing-packages/#python-requires > If your project only runs on certain Python versions, setting the > python_requires argument to the appropriate PEP 440 version specifier > string will prevent pip from installing the project on other Python > versions. https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords > python_requires > > A string corresponding to a version specifier (as defined in PEP 440) > for the Python version, used to specify the Requires-Python defined in > PEP 345. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index e3bc8761..f32cca75 100755 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ setup( package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']}, package_dir={'requests': 'requests'}, include_package_data=True, + python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", install_requires=requires, license=about['__license__'], zip_safe=False, -- cgit v1.2.1 From 2255c34a65b5b1353004dc8d49cc397cd794ec15 Mon Sep 17 00:00:00 2001 From: Darren Dormer Date: Tue, 12 Dec 2017 15:53:09 +0100 Subject: Fix DNS resolution by using hostname instead of netloc and strip username and password when comparing against proxy bypass items. --- AUTHORS.rst | 1 + HISTORY.rst | 3 ++- requests/utils.py | 19 +++++++++++-------- tests/test_utils.py | 25 +++++++++++++++++++++++-- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 481ac6c7..2b4494ba 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -182,3 +182,4 @@ Patches and Suggestions - Arthur Vigil (`@ahvigil `_) - Nehal J Wani (`@nehaljwani `_) - Demetrios Bairaktaris (`@DemetriosBairaktaris `_) +- Darren Dormer (`@ddormer `_) diff --git a/HISTORY.rst b/HISTORY.rst index b099ecdb..db1d1f70 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -17,7 +17,8 @@ dev - Fixed issue where loading the default certificate bundle from a zip archive would raise an ``IOError`` - Fixed issue with unexpected ``ImportError`` on windows system which do not support ``winreg`` module - +- DNS resolution in proxy bypass no longer includes the username and password in + the request. This also fixes the issue of DNS queries failing on macOS. 2.18.4 (2017-08-15) +++++++++++++++++++ diff --git a/requests/utils.py b/requests/utils.py index 8c1b9bec..df18a0bf 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -703,28 +703,31 @@ def should_bypass_proxies(url, no_proxy): no_proxy_arg = no_proxy if no_proxy is None: no_proxy = get_proxy('no_proxy') - netloc = urlparse(url).netloc + parsed = urlparse(url) if no_proxy: # We need to check whether we match here. We need to see if we match - # the end of the netloc, both with and without the port. + # the end of the hostname, both with and without the port. no_proxy = ( host for host in no_proxy.replace(' ', '').split(',') if host ) - ip = netloc.split(':')[0] - if is_ipv4_address(ip): + if is_ipv4_address(parsed.hostname): for proxy_ip in no_proxy: if is_valid_cidr(proxy_ip): - if address_in_network(ip, proxy_ip): + if address_in_network(parsed.hostname, proxy_ip): return True - elif ip == proxy_ip: + elif parsed.hostname == proxy_ip: # If no_proxy ip was defined in plain IP notation instead of cidr notation & # matches the IP of the index return True else: + host_with_port = parsed.hostname + if parsed.port: + host_with_port += ':{0}'.format(parsed.port) + for host in no_proxy: - if netloc.endswith(host) or netloc.split(':')[0].endswith(host): + if parsed.hostname.endswith(host) or host_with_port.endswith(host): # The URL does match something in no_proxy, so we don't want # to apply the proxies on this URL. return True @@ -737,7 +740,7 @@ def should_bypass_proxies(url, no_proxy): # legitimate problems. with set_environ('no_proxy', no_proxy_arg): try: - bypass = proxy_bypass(netloc) + bypass = proxy_bypass(parsed.hostname) except (TypeError, socket.gaierror): bypass = False diff --git a/tests/test_utils.py b/tests/test_utils.py index 01cabe23..f39cd67b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -614,6 +614,7 @@ def test_urldefragauth(url, expected): ('http://172.16.1.1/', True), ('http://172.16.1.1:5000/', True), ('http://localhost.localdomain:5000/v1.0/', True), + ('http://google.com:6000/', True), ('http://172.16.1.12/', False), ('http://172.16.1.12:5000/', False), ('http://google.com:5000/v1.0/', False), @@ -622,11 +623,31 @@ def test_should_bypass_proxies(url, expected, monkeypatch): """Tests for function should_bypass_proxies to check if proxy can be bypassed or not """ - monkeypatch.setenv('no_proxy', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1') - monkeypatch.setenv('NO_PROXY', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1') + monkeypatch.setenv('no_proxy', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1, google.com:6000') + monkeypatch.setenv('NO_PROXY', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1, google.com:6000') assert should_bypass_proxies(url, no_proxy=None) == expected +@pytest.mark.parametrize( + 'url, expected', ( + ('http://172.16.1.1/', '172.16.1.1'), + ('http://172.16.1.1:5000/', '172.16.1.1'), + ('http://user:pass@172.16.1.1', '172.16.1.1'), + ('http://user:pass@172.16.1.1:5000', '172.16.1.1'), + ('http://hostname/', 'hostname'), + ('http://hostname:5000/', 'hostname'), + ('http://user:pass@hostname', 'hostname'), + ('http://user:pass@hostname:5000', 'hostname'), + )) +def test_should_bypass_proxies_pass_only_hostname(url, expected, mocker): + """The proxy_bypass function should be called with a hostname or IP without + a port number or auth credentials. + """ + proxy_bypass = mocker.patch('requests.utils.proxy_bypass') + should_bypass_proxies(url, no_proxy=None) + proxy_bypass.assert_called_once_with(expected) + + @pytest.mark.parametrize( 'cookiejar', ( compat.cookielib.CookieJar(), -- cgit v1.2.1 From 0813c865ee0495952c38d2b8e2932a184a1edcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=9A=D0=BE=D0=BD?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Thu, 18 Jan 2018 20:14:33 +0300 Subject: Fix broken link to Certifi --- docs/community/recommended.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/recommended.rst b/docs/community/recommended.rst index 88dcce8d..44804919 100644 --- a/docs/community/recommended.rst +++ b/docs/community/recommended.rst @@ -15,7 +15,7 @@ Certifi CA Bundle validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts. It has been extracted from the Requests project. -.. _Certifi: http://certifi.io/en/latest/ +.. _Certifi: https://github.com/certifi/python-certifi CacheControl ------------ -- cgit v1.2.1 From 599a8f11f85349a4b71115bf9736d26305eb391c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 20 Jan 2018 09:01:50 -0500 Subject: sidebar --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 5b437d85..c1ed8b89 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -30,7 +30,7 @@

    More Kenneth Reitz projects:

      -
    • edmsynths.com
    • +
    • howtopython.org
    • pipenv
    • pep8.org
    • httpbin.org
    • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index b31c3477..1803db45 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -35,7 +35,7 @@

      More Kenneth Reitz projects:

        -
      • edmsynths.com
      • +
      • howtopython.org
      • pipenv
      • pep8.org
      • httpbin.org
      • -- cgit v1.2.1 From f60324a3de41c10dd7af17cadd4322c895068a25 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Sun, 7 Jan 2018 17:24:09 -0800 Subject: append previous url fragment on redirect --- requests/sessions.py | 7 ++++- tests/test_lowlevel.py | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/test_requests.py | 8 ++++++ 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/requests/sessions.py b/requests/sessions.py index 2cedaa8f..4ffed46a 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -123,6 +123,7 @@ class SessionRedirectMixin(object): hist = [] # keep track of history url = self.get_redirect_target(resp) + previous_fragment = urlparse(req.url).fragment while url: prepared_request = req.copy() @@ -147,8 +148,12 @@ class SessionRedirectMixin(object): parsed_rurl = urlparse(resp.url) url = '%s:%s' % (to_native_string(parsed_rurl.scheme), url) - # The scheme should be lower case... + # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2) parsed = urlparse(url) + if parsed.fragment == '' and previous_fragment: + parsed = parsed._replace(fragment=previous_fragment) + elif parsed.fragment: + previous_fragment = parsed.fragment url = parsed.geturl() # Facilitate relative 'location' headers, as allowed by RFC 7231. diff --git a/tests/test_lowlevel.py b/tests/test_lowlevel.py index c87234bc..6d6268cd 100644 --- a/tests/test_lowlevel.py +++ b/tests/test_lowlevel.py @@ -235,3 +235,75 @@ def test_redirect_rfc1808_to_non_ascii_location(): assert r.url == u'{0}/{1}'.format(url, expected_path.decode('ascii')) close_server.set() + +def test_fragment_not_sent_with_request(): + """Verify that the fragment portion of a URI isn't sent to the server.""" + def response_handler(sock): + req = consume_socket_content(sock, timeout=0.5) + sock.send( + b'HTTP/1.1 200 OK\r\n' + b'Content-Length: '+bytes(len(req))+b'\r\n' + b'\r\n'+req + ) + + close_server = threading.Event() + server = Server(response_handler, wait_to_close_event=close_server) + + with server as (host, port): + url = 'http://{0}:{1}/path/to/thing/#view=edit&token=hunter2'.format(host, port) + r = requests.get(url) + raw_request = r.content + + assert r.status_code == 200 + headers, body = raw_request.split(b'\r\n\r\n', 1) + status_line, headers = headers.split(b'\r\n', 1) + + assert status_line == b'GET /path/to/thing/ HTTP/1.1' + for frag in (b'view', b'edit', b'token', b'hunter2'): + assert frag not in headers + assert frag not in body + + close_server.set() + +def test_fragment_update_on_redirect(): + """Verify we only append previous fragment if one doesn't exist on new + location. If a new fragment is encounterd in a Location header, it should + be added to all subsequent requests. + """ + + def response_handler(sock): + consume_socket_content(sock, timeout=0.5) + sock.send( + b'HTTP/1.1 302 FOUND\r\n' + b'Content-Length: 0\r\n' + b'Location: /get#relevant-section\r\n\r\n' + ) + consume_socket_content(sock, timeout=0.5) + sock.send( + b'HTTP/1.1 302 FOUND\r\n' + b'Content-Length: 0\r\n' + b'Location: /final-url/\r\n\r\n' + ) + consume_socket_content(sock, timeout=0.5) + sock.send( + b'HTTP/1.1 200 OK\r\n\r\n' + ) + + close_server = threading.Event() + server = Server(response_handler, wait_to_close_event=close_server) + + with server as (host, port): + url = 'http://{0}:{1}/path/to/thing/#view=edit&token=hunter2'.format(host, port) + r = requests.get(url) + raw_request = r.content + + assert r.status_code == 200 + assert len(r.history) == 2 + assert r.history[0].request.url == url + + # Verify we haven't overwritten the location with our previous fragment. + assert r.history[1].request.url == 'http://{0}:{1}/get#relevant-section'.format(host, port) + # Verify previous fragment is used and not the original. + assert r.url == 'http://{0}:{1}/final-url/#relevant-section'.format(host, port) + + close_server.set() diff --git a/tests/test_requests.py b/tests/test_requests.py index e6a026f2..b3747474 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -294,6 +294,14 @@ class TestRequests: for header in purged_headers: assert header not in next_resp.request.headers + def test_fragment_maintained_on_redirect(self, httpbin): + fragment = "#view=edit&token=hunter2" + r = requests.get(httpbin('redirect-to?url=get')+fragment) + + assert len(r.history) > 0 + assert r.history[0].request.url == httpbin('redirect-to?url=get')+fragment + assert r.url == httpbin('get')+fragment + def test_HTTP_200_OK_GET_WITH_PARAMS(self, httpbin): heads = {'User-agent': 'Mozilla/5.0'} -- cgit v1.2.1 From 512066488e039e048ff255d8322fbb53642166bd Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Sun, 21 Jan 2018 11:06:33 -0800 Subject: updating history --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index db1d1f70..9379cbe0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,7 @@ dev - Warn user about possible slowdown when using cryptography version < 1.3.4 - Check for invalid host in proxy URL, before forwarding request to adapter. +- Fragments are now properly maintained across redirects. (RFC7231 7.1.2) **Bugfixes** -- cgit v1.2.1 From 99533b0f0f7e3276ddef856fa05ff44e91d2235d Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Fri, 26 Jan 2018 03:01:22 -0800 Subject: start testing 3.7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b7693f63..e0fbdba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: - "3.4" - "3.5" - "3.6" - # - "3.7-dev" + - "3.7-dev" # - "pypy" -- appears to hang # - "pypy3" # command to install dependencies -- cgit v1.2.1 From 8e040523a4d3ce6e80b2edb7d3112480d697ddc8 Mon Sep 17 00:00:00 2001 From: Jonathan Elliott Blum Date: Fri, 2 Feb 2018 13:10:16 -0500 Subject: pass kwargs from send call to add_headers, per documentation --- requests/adapters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/adapters.py b/requests/adapters.py index bc01e336..a4b02842 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -411,7 +411,7 @@ class HTTPAdapter(BaseAdapter): self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) - self.add_headers(request) + self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies) chunked = not (request.body is None or 'Content-Length' in request.headers) -- cgit v1.2.1 From e8205c01310fcd846e081d2d8a818a0949a12125 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 4 Feb 2018 11:57:10 -0800 Subject: Trim trialing white space throughout the project Many editors clean up trailing white space on save. By removing it all in one go, it helps keep future diffs cleaner by avoiding spurious white space changes on unrelated lines. --- .travis.yml | 2 -- docs/_templates/sidebarintro.html | 1 - docs/_templates/sidebarlogo.html | 1 - docs/community/recommended.rst | 3 --- docs/community/updates.rst | 1 - docs/dev/todo.rst | 1 - docs/index.rst | 4 ++-- docs/user/advanced.rst | 10 +++++----- 8 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0fbdba9..aae4b560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,5 +27,3 @@ jobs: - stage: coverage python: 3.6 script: codecov - - diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 52c82aa5..179f043a 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -67,4 +67,3 @@
      • Italian
      • Spanish
      - diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index c2d824a4..2b317a28 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -59,4 +59,3 @@
    • Italian
    • Spanish
    - diff --git a/docs/community/recommended.rst b/docs/community/recommended.rst index 44804919..8fcd47a4 100644 --- a/docs/community/recommended.rst +++ b/docs/community/recommended.rst @@ -62,6 +62,3 @@ Betamax A VCR imitation designed only for Python-Requests. .. _betamax: https://github.com/sigmavirus24/betamax - - - diff --git a/docs/community/updates.rst b/docs/community/updates.rst index f755a493..3b9a3097 100644 --- a/docs/community/updates.rst +++ b/docs/community/updates.rst @@ -29,4 +29,3 @@ Release and Version History =========================== .. include:: ../../HISTORY.rst - diff --git a/docs/dev/todo.rst b/docs/dev/todo.rst index 707dea31..1766a28a 100644 --- a/docs/dev/todo.rst +++ b/docs/dev/todo.rst @@ -62,4 +62,3 @@ Google AppEngine is not officially supported although support is available with the `Requests-Toolbelt`_. .. _Requests-Toolbelt: https://toolbelt.readthedocs.io/ - diff --git a/docs/index.rst b/docs/index.rst index 72f93b90..ae5f5c7b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,8 +30,8 @@ consumption. .. note:: The use of **Python 3** is *highly* preferred over Python 2. Consider upgrading your applications and infrastructure if you find yourself *still* using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. —*Kenneth Reitz* - - + + ------------------- **Behold, the power of Requests**:: diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 1bad6435..e3ed5aa9 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -196,18 +196,18 @@ As a result an ``SSL: CERTIFICATE_VERIFY_FAILED`` is thrown. You can get around this behaviour by explicity merging the environment settings into your session:: from requests import Request, Session - + s = Session() req = Request('GET', url) - + prepped = s.prepare_request(req) - + # Merge environment settings into session settings = s.merge_environment_settings(prepped.url, None, None, None, None) resp = s.send(prepped, **settings) - + print(resp.status_code) - + .. _verification: SSL Cert Verification -- cgit v1.2.1 From 22120d423e5bd5981f8e4c715d3a26071ff8d278 Mon Sep 17 00:00:00 2001 From: Semen Zhydenko Date: Thu, 8 Feb 2018 01:25:22 +0100 Subject: Fix typos nonexistant -> nonexistent neccessary -> necessary --- HISTORY.rst | 2 +- requests/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9379cbe0..61f7e232 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -131,7 +131,7 @@ dev - Further restored the ``requests.packages`` namespace for compatibility reasons. -No code modification (noted below) should be neccessary any longer. +No code modification (noted below) should be necessary any longer. 2.16.1 (2017-05-27) +++++++++++++++++++ diff --git a/requests/utils.py b/requests/utils.py index df18a0bf..3f50d485 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -224,7 +224,7 @@ def guess_filename(obj): def extract_zipped_paths(path): - """Replace nonexistant paths that look like they refer to a member of a zip + """Replace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. """ -- cgit v1.2.1 From 3cd87fac5d1f5a7d0cafd963c6eaea15c7139399 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Feb 2018 09:42:09 -0500 Subject: new sidebar link Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 5b437d85..a73a7eab 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -30,7 +30,7 @@

    More Kenneth Reitz projects:

      -
    • edmsynths.com
    • +
    • monescate.com
    • pipenv
    • pep8.org
    • httpbin.org
    • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index b31c3477..bb9f7f9d 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -35,7 +35,7 @@

      More Kenneth Reitz projects:

        -
      • edmsynths.com
      • +
      • monescate.com
      • pipenv
      • pep8.org
      • httpbin.org
      • -- cgit v1.2.1 From 9c0db922497bfb5827ba2e604fbcf4f02e248b8e Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 2 Feb 2018 15:49:03 -0800 Subject: Clarify docs that Requests always uses certs from certifi Since commit 0d7de6430eef0cf09f9662746daf0c28d83f144e, certifi is always used for certificates. Certify became a hard dependency of the package in 628633143d5b8590b1dbdf5371fe81fb8250dffd. Now update the docs to clarify that Request will always use certificates from certifi. --- docs/user/advanced.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index e3ed5aa9..f3fb45a7 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -274,15 +274,14 @@ If you specify a wrong path or an invalid cert, you'll get a SSLError:: CA Certificates --------------- -By default, Requests bundles a set of root CAs that it trusts, sourced from the -`Mozilla trust store`_. However, these are only updated once for each Requests -version. This means that if you pin a Requests version your certificates can -become extremely out of date. - -From Requests version 2.4.0 onwards, Requests will attempt to use certificates -from `certifi`_ if it is present on the system. This allows for users to update -their trusted certificates without having to change the code that runs on their -system. +Requests uses certificates from the package `certifi`_. This allows for users +to update their trusted certificates without changing the version of Requests. + +Before version 2.16, Requests bundled a set of root CAs that it trusted, +sourced from the `Mozilla trust store`_. The certificates were only updated +once for each Requests version. When ``certifi`` was not installed, this led to +extremely out-of-date certificate bundles when using significantly older +versions of Requests. For the sake of security we recommend upgrading certifi frequently! -- cgit v1.2.1 From 265ef609d5903151374fba480aa81aafe68126ff Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 17 Feb 2018 06:15:54 -0800 Subject: Remove remaining references to removed, vendored packages (#4499) As the vendored packages were removing in version 2.16, all remaining doc references should be replaced with newer practices. --- docs/api.rst | 2 +- docs/community/release-process.rst | 17 ++++++++--------- docs/user/advanced.rst | 2 +- docs/user/quickstart.rst | 2 +- requests/help.py | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index c3e00e54..ef84bf60 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -181,7 +181,7 @@ API Changes logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests logging.getLogger().setLevel(logging.DEBUG) - requests_log = logging.getLogger("requests.packages.urllib3") + requests_log = logging.getLogger("urllib3") requests_log.setLevel(logging.DEBUG) requests_log.propagate = True diff --git a/docs/community/release-process.rst b/docs/community/release-process.rst index 2e317ceb..18f71168 100644 --- a/docs/community/release-process.rst +++ b/docs/community/release-process.rst @@ -19,19 +19,18 @@ Breaking changes are changes that break backwards compatibility with prior versions. If the project were to change the ``text`` attribute on a ``Response`` object to a method, that would only happen in a Major release. -Major releases may also include miscellaneous bug fixes and upgrades to -vendored packages. The core developers of Requests are committed to providing -a good user experience. This means we're also committed to preserving -backwards compatibility as much as possible. Major releases will be infrequent -and will need strong justifications before they are considered. +Major releases may also include miscellaneous bug fixes. The core developers of +Requests are committed to providing a good user experience. This means we're +also committed to preserving backwards compatibility as much as possible. Major +releases will be infrequent and will need strong justifications before they are +considered. Minor Releases -------------- -A minor release will not include breaking changes but may include -miscellaneous bug fixes and upgrades to vendored packages. If the previous -version of Requests released was ``v10.2.7`` a minor release would be -versioned as ``v10.3.0``. +A minor release will not include breaking changes but may include miscellaneous +bug fixes. If the previous version of Requests released was ``v10.2.7`` a minor +release would be versioned as ``v10.3.0``. Minor releases will be backwards compatible with releases that have the same major version number. In other words, all versions that would start with diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index f3fb45a7..e5f7f297 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -950,9 +950,9 @@ passed-through to `urllib3`. We'll make a Transport Adapter that instructs the library to use SSLv3:: import ssl + from urllib3.poolmanager import PoolManager from requests.adapters import HTTPAdapter - from requests.packages.urllib3.poolmanager import PoolManager class Ssl3HttpAdapter(HTTPAdapter): diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 1a2c6fbf..b0ff231b 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -171,7 +171,7 @@ server, you can access ``r.raw``. If you want to do this, make sure you set >>> r = requests.get('https://api.github.com/events', stream=True) >>> r.raw - + >>> r.raw.read(10) '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03' diff --git a/requests/help.py b/requests/help.py index 5440ee61..06e06b2a 100644 --- a/requests/help.py +++ b/requests/help.py @@ -13,7 +13,7 @@ import chardet from . import __version__ as requests_version try: - from .packages.urllib3.contrib import pyopenssl + from urllib3.contrib import pyopenssl except ImportError: pyopenssl = None OpenSSL = None -- cgit v1.2.1 From 6e76aaea4595d7c2a953fea5d624344e8c11f93a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 22 Feb 2018 08:34:32 -0500 Subject: nike Signed-off-by: Kenneth Reitz --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index ae5f5c7b..7934a298 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -59,7 +59,7 @@ are 100% automatic, thanks to `urllib3 `_. User Testimonials ----------------- -Twitter, Spotify, Microsoft, Amazon, Lyft, BuzzFeed, Reddit, The NSA, Her Majesty's Government, Google, Twilio, Runscope, Mozilla, Heroku, +Nike, Twitter, Spotify, Microsoft, Amazon, Lyft, BuzzFeed, Reddit, The NSA, Her Majesty's Government, Google, Twilio, Runscope, Mozilla, Heroku, PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington Post, SoundCloud, Kippt, Sony, and Federal U.S. Institutions that prefer to be unnamed claim to use Requests internally. -- cgit v1.2.1 From 44dbf8cf40ef5ebf221a95680b690599548d214a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 27 Feb 2018 08:44:29 -0500 Subject: updated copyright year Signed-off-by: Kenneth Reitz --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 503448d3..c952fe79 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,7 +58,7 @@ master_doc = 'index' # General information about the project. project = u'Requests' -copyright = u'MMXVII. A Kenneth Reitz Project' +copyright = u'MMXVIII. A Kenneth Reitz Project' author = u'Kenneth Reitz' # The version info for the project you're documenting, acts as replacement for -- cgit v1.2.1 From 06e788e253b5c05fbb1d99abfaf1e640d08727f3 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 27 Feb 2018 09:18:00 -0500 Subject:
      • Requests-HTML
      • Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index dcfbb461..3cd40946 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -30,7 +30,7 @@

        More Kenneth Reitz projects:

          -
        • monescate.com
        • +
        • Requests-HTML
        • howtopython.org
        • pipenv
        • pep8.org
        • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 1fb7eef6..636c51c1 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -35,7 +35,7 @@

          More Kenneth Reitz projects:

            -
          • monescate.com
          • +
          • Requests-HTML
          • howtopython.org
          • pipenv
          • pep8.org
          • -- cgit v1.2.1 From 4ea09e49f7d518d365e7c6f7ff6ed9ca70d6ec2e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 27 Feb 2018 10:19:31 -0500 Subject: .org Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 3cd40946..0b35068c 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -30,7 +30,7 @@

            More Kenneth Reitz projects:

              -
            • Requests-HTML
            • +
            • Requests-HTML
            • howtopython.org
            • pipenv
            • pep8.org
            • diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 636c51c1..6453fa2b 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -35,7 +35,7 @@

              More Kenneth Reitz projects:

                -
              • Requests-HTML
              • +
              • Requests-HTML
              • howtopython.org
              • pipenv
              • pep8.org
              • -- cgit v1.2.1 From 8ad24ad430f96c21c6143fc21e75b755e7ac5b69 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 16:44:57 -0500 Subject: experiment Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 16 ++++++++++++++++ docs/_templates/sidebarlogo.html | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 0b35068c..d30e56e7 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -14,6 +14,22 @@ human beings.

                +
                + + + + + +
                Email Address
                + + + +
                +

                Stickers!

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 6453fa2b..83c76b00 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -8,15 +8,35 @@ allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px">

                +

                Requests is an elegant and simple HTTP library for Python, built for human beings. You are currently looking at the documentation of the development release.

                + +
                + + + + + +
                Email Address
                + + + +
                +

                Stickers!

                Stay Informed

                Receive updates on new releases and upcoming projects.

                + +

                Join Mailing List.


                -- cgit v1.2.1 From d123e9fe78e7d76d407d7a46b0b5a70be5adecd5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 16:48:44 -0500 Subject: fix broken things Signed-off-by: Kenneth Reitz --- docs/_static/custom.css | 4 ++++ docs/_templates/sidebarintro.html | 2 ++ docs/_templates/sidebarlogo.html | 2 ++ 3 files changed, 8 insertions(+) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 3a8af312..761a1fb1 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,3 +1,7 @@ +select { + width: 100%; +} + #carbonads { display: block; overflow: hidden; diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index d30e56e7..f234fdc3 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -18,6 +18,8 @@ + +

                Support Requests Development (3.0)

                + +

                Support Requests Development (3.0)

                -

                Support Requests Development (3.0)

                +

                Support Requests Development (3.0):

                -

                Support Requests Development (3.0)

                +

                Support Requests Development (3.0):

                -

                Support Requests Development (3.0):

                +

                Support Requests Development (3.0):

                -

                Support Requests Development (3.0):

                +

                Support Requests Development (3.0):

                - + - -

                Support Requests Development (3.0):

                - +
                Email Address
                Email Address:
                + +

                Stickers!

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 88d8f726..25324b31 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -17,22 +17,23 @@
                - + - -

                Support Requests Development (3.0):

                - +
                Email Address
                Email Address:
                + +

                Stickers!

                Stay Informed

                Receive updates on new releases and upcoming projects.

                -- cgit v1.2.1 From 529c423fb5906e8eff77ed1985fa4d48438dc3c1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:15:59 -0500 Subject: support for Requests 3.0 Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 1 + docs/_templates/sidebarlogo.html | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 904cda1a..b5b79308 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -14,6 +14,7 @@ human beings.

                +

                Support Requests 3.0:

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 25324b31..e679d874 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -15,6 +15,7 @@ development release.

                +

                Support Requests 3.0:

                -- cgit v1.2.1 From 40f4b984ef471a53ed11a8a224c705d7f10b435a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:18:27 -0500 Subject: index Signed-off-by: Kenneth Reitz --- docs/index.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 7934a298..9f4414cc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -64,7 +64,7 @@ PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington Post, SoundCloud, Kippt, Sony, and Federal U.S. Institutions that prefer to be unnamed claim to use Requests internally. -**Armin Ronacher**— +**Armin Ronacher**, creator of Flask— *Requests is the perfect example how beautiful an API can be with the right level of abstraction.* @@ -83,6 +83,11 @@ Institutions that prefer to be unnamed claim to use Requests internally. Requests is one of the most downloaded Python packages of all time, pulling in over 13,000,000 downloads every month. All the cool kids are doing it! +If your organization uses Requests internally, consider `supporting the +development of 3.0 Date: Wed, 7 Mar 2018 17:33:51 -0500 Subject: top bar Signed-off-by: Kenneth Reitz --- docs/_templates/hacks.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/_templates/hacks.html b/docs/_templates/hacks.html index 0d88a6ec..b120a104 100644 --- a/docs/_templates/hacks.html +++ b/docs/_templates/hacks.html @@ -1,7 +1,6 @@ @@ -20,14 +19,14 @@ } - + -- cgit v1.2.1 From c436165a2dae7980fb4283bb8dd5a1c6fde3e2e9 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:34:04 -0500 Subject: gitignore Signed-off-by: Kenneth Reitz --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 19ebfd79..cd0c32e9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ t.py t2.py dist + +/.mypy_cache/ -- cgit v1.2.1 From 8ca453a8d76af5777edd77bd88dcfae7fe690cfc Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:35:21 -0500 Subject: white Signed-off-by: Kenneth Reitz --- docs/_static/custom.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 1e8eaef7..54def686 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -2,6 +2,10 @@ body > div.document > div.sphinxsidebar > div > form > table > tbody > tr:nth-ch width: 100%!important; } +#python27 > a { + color: white; +} + #carbonads { display: block; overflow: hidden; -- cgit v1.2.1 From a4f313a0e53c9fba64b8488a2034a7c249f9db86 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:36:35 -0500 Subject: development Signed-off-by: Kenneth Reitz --- docs/_templates/hacks.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_templates/hacks.html b/docs/_templates/hacks.html index b120a104..c3fe2d1e 100644 --- a/docs/_templates/hacks.html +++ b/docs/_templates/hacks.html @@ -1,6 +1,6 @@ -- cgit v1.2.1 From ac0a7ed152d370a2cc25d86cdb9ef4925ad13982 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:38:05 -0500 Subject: fix Signed-off-by: Kenneth Reitz --- docs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 9f4414cc..29245671 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -83,8 +83,7 @@ Institutions that prefer to be unnamed claim to use Requests internally. Requests is one of the most downloaded Python packages of all time, pulling in over 13,000,000 downloads every month. All the cool kids are doing it! -If your organization uses Requests internally, consider `supporting the -development of 3.0 `_. Your generosity will be greatly appreciated, and help drive the project forward into the future. -- cgit v1.2.1 From 773eeff1a2531904a7e7ba4dd95e58428c5fc26c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:40:38 -0500 Subject: authors Signed-off-by: Kenneth Reitz --- AUTHORS.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 2b4494ba..383df7d8 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -5,9 +5,13 @@ Keepers of the Four Crystals ```````````````````````````` - Kenneth Reitz `@kennethreitz `_, Keeper of the Master Crystal. +- Ian Cordasco `@sigmavirus24 `_. +- Nate Prewitt `@nateprewitt `_. + +Previous Keepers of Crystals +```````````````````````````` + - Cory Benfield `@lukasa `_ -- Ian Cordasco `@sigmavirus24 `_ -- Nate Prewitt `@nateprewitt `_ Patches and Suggestions -- cgit v1.2.1 From f51c489d38f7a1152be43ad103b3468db91cdd9c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 17:41:09 -0500 Subject: fix Signed-off-by: Kenneth Reitz --- AUTHORS.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 383df7d8..907687d4 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,8 +1,8 @@ Requests is written and maintained by Kenneth Reitz and various contributors: -Keepers of the Four Crystals -```````````````````````````` +Keepers of the Crystals +``````````````````````` - Kenneth Reitz `@kennethreitz `_, Keeper of the Master Crystal. - Ian Cordasco `@sigmavirus24 `_. -- cgit v1.2.1 From f21fd19ac55595fa6699c734399970b603978a59 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 18:44:36 -0500 Subject: goals Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 1 + docs/_templates/sidebarlogo.html | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index b5b79308..259d861f 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,6 +15,7 @@

                Support Requests 3.0:

                +

                Fundraising goal: $5,000. Amount raised: $0.00

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index e679d874..0036603d 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,6 +16,7 @@

                Support Requests 3.0:

                +

                Fundraising goal: $5,000. Amount raised: $0.00

                -- cgit v1.2.1 From 665bb2a6874bcbbfc864c100490b4dcb47a3aad9 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 18:49:49 -0500 Subject: fix Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 259d861f..a8377a7c 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000. Amount raised: $0.00

                +

                Fundraising goal: $5,000.
                Amount raised: $0.00

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 0036603d..35dd6755 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000. Amount raised: $0.00

                +

                Fundraising goal: $5,000.
                Amount raised: $0.00

                -- cgit v1.2.1 From f8ade967626ac36ccb26dd2788e2194df292a034 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 18:52:24 -0500 Subject: sidebar Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index a8377a7c..e0e2823e 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $0.00

                +

                Fundraising goal: $5,000.
                Amount raised: $0.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 35dd6755..4e8e3248 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $0.00

                +

                Fundraising goal: $5,000.
                Amount raised: $0.00.

                -- cgit v1.2.1 From 38a194795777e22b7a80712158bc186d78d9e7f4 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 19:11:45 -0500 Subject: $10 Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index e0e2823e..38bc92ac 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $0.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $10.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 4e8e3248..af167669 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $0.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $10.00.

                -- cgit v1.2.1 From 327a54d29d2c7fd09a137919e41a47f48848793b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 19:24:45 -0500 Subject: sidebar Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 38bc92ac..53f256c7 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $10.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $110.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index af167669..0011662f 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $10.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $110.00.

                -- cgit v1.2.1 From 8ce2c1a182a4ec91ed1bfcf47875aa0614f212b5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 19:27:15 -0500 Subject: one time Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 ++ docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 53f256c7..e9920e8f 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -33,6 +33,8 @@ +

                One time payments are also very welcome.

                + diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 0011662f..85b6dcb5 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -34,7 +34,7 @@ - +

                One time payments are also very welcome.

                Stickers!

                Stay Informed

                -- cgit v1.2.1 From b98027af9e4732d9c423393663e2231ef9acaaf0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 19:41:24 -0500 Subject: donations Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index e9920e8f..bb27cfc2 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -33,7 +33,7 @@ -

                One time payments are also very welcome.

                +

                One time donations are also very welcome.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 85b6dcb5..089ff489 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -34,7 +34,7 @@ -

                One time payments are also very welcome.

                +

                One time donations are also very welcome.

                Stickers!

                Stay Informed

                -- cgit v1.2.1 From 77aa42943ea65b50acc31f627ed1e3486da90a4d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 19:42:03 -0500 Subject: more info Signed-off-by: Kenneth Reitz --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 29245671..98d6d143 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,7 +74,7 @@ Institutions that prefer to be unnamed claim to use Requests internally. **Daniel Greenfeld**— *Nuked a 1200 LOC spaghetti code library with 10 lines of code thanks to - Kenneth Reitz's request library. Today has been AWESOME.* + Kenneth Reitz's Requests library. Today has been AWESOME.* **Kenny Meyers**— *Python HTTP: When in doubt, or when not in doubt, use Requests. Beautiful, -- cgit v1.2.1 From 0730b231ece46f86da4cc1baa5b12993e11e80e1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 20:02:12 -0500 Subject: $203 Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index bb27cfc2..92f9dbfb 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $110.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $203.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 089ff489..48fb7065 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $110.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $203.00.

                -- cgit v1.2.1 From 5daa6cc63c23ea3e880b52666715e501679537e3 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 7 Mar 2018 20:06:13 -0500 Subject: $253 Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 92f9dbfb..bbdbeb8a 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $203.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $253.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 48fb7065..c0b2f1ae 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $203.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $253.00.

                -- cgit v1.2.1 From d91b70bd29ff8a6dab7777d2db43a32e72d548ce Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 06:29:53 -0500 Subject: 512 Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index bbdbeb8a..621167ac 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $253.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $512.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index c0b2f1ae..f7d81d79 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $253.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $512.00.

                -- cgit v1.2.1 From 74cf6fc38ef3c655f87f0fb1e1c5696584506d2f Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 09:19:28 -0500 Subject: \o/ Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 621167ac..1394b65a 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $512.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $5,612.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index f7d81d79..b7a3fa4c 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,7 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $512.00.

                +

                Fundraising goal: $5,000.
                Amount raised: $5,612.00.

                -- cgit v1.2.1 From 3323e65e96dd294aaf796f82d1e19e5bbbf29bf2 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:11:59 -0500 Subject: track fundraiser on personal site Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 1 - docs/_templates/sidebarlogo.html | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 1394b65a..4a3b5d16 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,7 +15,6 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $5,612.00.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index b7a3fa4c..5388db7d 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -16,7 +16,6 @@

                Support Requests 3.0:

                -

                Fundraising goal: $5,000.
                Amount raised: $5,612.00.

                -- cgit v1.2.1 From d05840d34d8eb533bdde08c83bcf33c9a3a660fc Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:28:41 -0500 Subject: sponsors Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 45 insertions(+) create mode 100644 docs/community/sponsors.rst diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst new file mode 100644 index 00000000..e0ff01d3 --- /dev/null +++ b/docs/community/sponsors.rst @@ -0,0 +1,44 @@ +Corporate Sponsors +================== + +**tl;dr**: Requests development is currently `funded by the Python community `_, and +some wonderful organizations that utilize the software in their businesses. + +Requests is one of the most heavily–utilized Python packages in the world. + +It is used by major corporations worldwide for all tasks, both small and large — from writing one–off scripts to orchestrating millions of dollars of critical infrastructure. + +It's even embedded within pip, that tool that you use to install packages and deploy with every day! + +After losing our primary open source maintainer (who was sponsored by a company to work on Requests, and other projects, full–time), we are seeking community financial contributions towards the development of Requests 3.0. + +Patron Sponsors +---------------- + +We don't have any patrons yet — this slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year. + +By becoming a patron, your organization will receive the following benefits: + +- Priminent placement on the Requests documentation sidebar (~11,000 uniques / day). +- Honorable mention here, with logo. +- Peace of mind knowing that the infrastructure you rely on is being actively maintained. + +Organizations that sign up (if any decide to) will be listed in order — first come first serve! + +Major Contibutors +----------------- + +Heroku +////// + +Heroku has allowed Kenneth Reitz to work on open source projects for work, +including Requests (but mostly Pipenv), from time–to–time, so they are listed +here as an honorable mention. + +Slack — Bring your team together +//////////////////////////////// + +Slack has generously donated a large sum towards the `2018 Requests 3.0 fundraiser >`_, +and is helping the world become a better place through connectiveness, and reducing the amount of email we all have +to deal with on a daily basis. + diff --git a/docs/index.rst b/docs/index.rst index 98d6d143..3839618c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -137,6 +137,7 @@ Requests ecosystem and community. .. toctree:: :maxdepth: 2 + community/sponsors community/recommended community/faq community/out-there -- cgit v1.2.1 From afad1aab149d3ff1306816916269401eed7fe4c7 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:28:55 -0500 Subject: community Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index e0ff01d3..3051e3d0 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -1,4 +1,4 @@ -Corporate Sponsors +Community Sponsors ================== **tl;dr**: Requests development is currently `funded by the Python community `_, and -- cgit v1.2.1 From c55258792bfccc370511a1a375dc568c175df48a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:30:33 -0500 Subject: cleanup Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 ++ docs/_templates/sidebarlogo.html | 2 ++ docs/community/sponsors.rst | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 4a3b5d16..ce53b0cc 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -32,6 +32,8 @@ +

                Learn more.

                +

                One time donations are also very welcome.

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 5388db7d..f8c0e132 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -33,6 +33,8 @@ +

                Learn more.

                +

                One time donations are also very welcome.

                Stickers!

                diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 3051e3d0..20a527a8 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -38,7 +38,7 @@ here as an honorable mention. Slack — Bring your team together //////////////////////////////// -Slack has generously donated a large sum towards the `2018 Requests 3.0 fundraiser >`_, +Slack has generously donated a large sum towards the `2018 Requests 3.0 fundraiser `_, and is helping the world become a better place through connectiveness, and reducing the amount of email we all have to deal with on a daily basis. -- cgit v1.2.1 From 873e8914c1cb64a78963227603e7dff4cde729dd Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:31:18 -0500 Subject: some Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 20a527a8..6fe9c983 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -31,7 +31,7 @@ Major Contibutors Heroku ////// -Heroku has allowed Kenneth Reitz to work on open source projects for work, +Heroku has allowed Kenneth Reitz to work on some open source projects during work hours, including Requests (but mostly Pipenv), from time–to–time, so they are listed here as an honorable mention. -- cgit v1.2.1 From 05b14017955c9c486cc0c9521aef14c6913bf2e8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:32:18 -0500 Subject: links Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 6fe9c983..3e4b5df2 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -28,15 +28,15 @@ Organizations that sign up (if any decide to) will be listed in order — first Major Contibutors ----------------- -Heroku -////// +`Heroku `_ +///////////////////////////////////// Heroku has allowed Kenneth Reitz to work on some open source projects during work hours, including Requests (but mostly Pipenv), from time–to–time, so they are listed here as an honorable mention. -Slack — Bring your team together -//////////////////////////////// +`Slack — Bring your team together `_ +/////////////////////////////////////////////////////// Slack has generously donated a large sum towards the `2018 Requests 3.0 fundraiser `_, and is helping the world become a better place through connectiveness, and reducing the amount of email we all have -- cgit v1.2.1 From bf32936955f495615c0ab7bf0b5eef29ee647f40 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:33:26 -0500 Subject: cleanup Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 3e4b5df2..6d379763 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -17,7 +17,7 @@ Patron Sponsors We don't have any patrons yet — this slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year. -By becoming a patron, your organization will receive the following benefits: +By becoming a patron–level sponsor, your organization will receive the following benefits: - Priminent placement on the Requests documentation sidebar (~11,000 uniques / day). - Honorable mention here, with logo. -- cgit v1.2.1 From dc10a5daddcc9d2a1c64549c773f7b792e4c95cb Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:34:07 -0500 Subject: sponsors Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 6d379763..0d705541 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -28,6 +28,8 @@ Organizations that sign up (if any decide to) will be listed in order — first Major Contibutors ----------------- +The following organizations have significantly contributed towards Requests' sustainability: + `Heroku `_ ///////////////////////////////////// -- cgit v1.2.1 From d8cc045a2ed44a1384605158371190d4cc00fb15 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:35:39 -0500 Subject: contact Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 0d705541..8bb36f42 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -25,8 +25,8 @@ By becoming a patron–level sponsor, your organization will receive the followi Organizations that sign up (if any decide to) will be listed in order — first come first serve! -Major Contibutors ------------------ +Major Sponsors +-------------- The following organizations have significantly contributed towards Requests' sustainability: @@ -44,3 +44,7 @@ Slack has generously donated a large sum towards the `2018 Requests 3.0 fundrais and is helping the world become a better place through connectiveness, and reducing the amount of email we all have to deal with on a daily basis. + +---------------- + +If your organization is interested in becoming either a sponsor or a patron, please `send us an email `_. \ No newline at end of file -- cgit v1.2.1 From 8ce2fd25570a9be499b5bbad39ead28481a6b825 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:36:29 -0500 Subject: change order Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 8bb36f42..639af16e 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -30,13 +30,6 @@ Major Sponsors The following organizations have significantly contributed towards Requests' sustainability: -`Heroku `_ -///////////////////////////////////// - -Heroku has allowed Kenneth Reitz to work on some open source projects during work hours, -including Requests (but mostly Pipenv), from time–to–time, so they are listed -here as an honorable mention. - `Slack — Bring your team together `_ /////////////////////////////////////////////////////// @@ -44,6 +37,12 @@ Slack has generously donated a large sum towards the `2018 Requests 3.0 fundrais and is helping the world become a better place through connectiveness, and reducing the amount of email we all have to deal with on a daily basis. +`Heroku `_ +///////////////////////////////////// + +Heroku has allowed Kenneth Reitz to work on some open source projects during work hours, +including Requests (but mostly Pipenv), from time–to–time, so they are listed +here as an honorable mention. ---------------- -- cgit v1.2.1 From 667367d6b9875752c8144ee7a3f2c22a398671e2 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:38:55 -0500 Subject: better formatting Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 639af16e..d30d0df4 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -4,6 +4,10 @@ Community Sponsors **tl;dr**: Requests development is currently `funded by the Python community `_, and some wonderful organizations that utilize the software in their businesses. + +------------------- + + Requests is one of the most heavily–utilized Python packages in the world. It is used by major corporations worldwide for all tasks, both small and large — from writing one–off scripts to orchestrating millions of dollars of critical infrastructure. -- cgit v1.2.1 From c063938abb6464d4b1a2f0b426e7ecf2dd5619f8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:42:17 -0500 Subject: individuals Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index d30d0df4..7485a946 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -50,4 +50,12 @@ here as an honorable mention. ---------------- -If your organization is interested in becoming either a sponsor or a patron, please `send us an email `_. \ No newline at end of file +If your organization is interested in becoming either a sponsor or a patron, please `send us an email `_. + + +Individual Sponsors +------------------- + +Countless individuals, too many to list here, have individually contributed towards the sustainability of the Requests +project over the years. Some, financially, others, with code. Contributions (from humans) of all kinds are greatly +appreciated. \ No newline at end of file -- cgit v1.2.1 From 9de992e22c4d9f11f8ec16b85ff5806710a6bde5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:43:27 -0500 Subject: sign off Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 7485a946..ec090c79 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -58,4 +58,6 @@ Individual Sponsors Countless individuals, too many to list here, have individually contributed towards the sustainability of the Requests project over the years. Some, financially, others, with code. Contributions (from humans) of all kinds are greatly -appreciated. \ No newline at end of file +appreciated. + +✨🍰✨ \ No newline at end of file -- cgit v1.2.1 From f9a9233058314e815f7a8763e19f1e42ef1822d0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:56:40 -0500 Subject: slack improvements Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index ec090c79..57c8307b 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -37,8 +37,7 @@ The following organizations have significantly contributed towards Requests' sus `Slack — Bring your team together `_ /////////////////////////////////////////////////////// -Slack has generously donated a large sum towards the `2018 Requests 3.0 fundraiser `_, -and is helping the world become a better place through connectiveness, and reducing the amount of email we all have +Slack was extremely kind to be the first organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, surpassing our entire fundraising goal immediately! They are helping the world become a better place through connectiveness, and reducing the amount of email we all have to deal with on a daily basis. `Heroku `_ -- cgit v1.2.1 From eb692cb1e172cd3397412955a5f99b36544449a8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 15:57:33 -0500 Subject: hiring Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 57c8307b..795fcd9b 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -40,6 +40,8 @@ The following organizations have significantly contributed towards Requests' sus Slack was extremely kind to be the first organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, surpassing our entire fundraising goal immediately! They are helping the world become a better place through connectiveness, and reducing the amount of email we all have to deal with on a daily basis. +P.S. They're `hiring `_! + `Heroku `_ ///////////////////////////////////// -- cgit v1.2.1 From 742610c6b9e9b1b72ac13b784ba9c44685be1b92 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 8 Mar 2018 16:15:31 -0500 Subject: linode Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 795fcd9b..d140c47e 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -42,6 +42,12 @@ to deal with on a daily basis. P.S. They're `hiring `_! +`Linode — SSD Cloud Hosting & Linux Servers `_ +////////////////////////////////////////////////////////////////////// + +Whether you’re just getting started or deploying a complex system, launching a Linode cloud server has never been easier. They offer the fastest hardware and network in the industry with scalable environments, and their 24x7 customer support team is always standing by to help with any questions. + + `Heroku `_ ///////////////////////////////////// -- cgit v1.2.1 From 16b56d822e8999e236a027735c518229314a611a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 9 Mar 2018 11:07:37 -0500 Subject: twilio! Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index d140c47e..5cbf2870 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -42,6 +42,14 @@ to deal with on a daily basis. P.S. They're `hiring `_! + +`Twilio — Voice, SMS, and Video for Humans `_ +///////////////////////////////////////////////////////////////////// + +Twilio was the second organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, matching the donation of Slack! They are helping the world become a better place through interconnectivity, +providing easy–to–use APIs, and empowering developers world-over to help humans communicate in meaningful and effictive ways. + + `Linode — SSD Cloud Hosting & Linux Servers `_ ////////////////////////////////////////////////////////////////////// -- cgit v1.2.1 From 280c8b2a722568076c43d3fe9aac63d4183a984b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 9 Mar 2018 16:47:27 -0500 Subject: azure Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 5cbf2870..4b58e3af 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -50,10 +50,11 @@ Twilio was the second organization to generously donate a large sum towards the providing easy–to–use APIs, and empowering developers world-over to help humans communicate in meaningful and effictive ways. -`Linode — SSD Cloud Hosting & Linux Servers `_ -////////////////////////////////////////////////////////////////////// +`Microsoft Cloud Developer Advocates `_ +///////////////////////////////////////////////////////////////////////////////////////// + +Microsoft was the third organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, matching the donation of Twilio! Awesome group of generous folks :) -Whether you’re just getting started or deploying a complex system, launching a Linode cloud server has never been easier. They offer the fastest hardware and network in the industry with scalable environments, and their 24x7 customer support team is always standing by to help with any questions. `Heroku `_ -- cgit v1.2.1 From cf0b8ed291b18e548fa98223fbc706212714ccee Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 9 Mar 2018 16:50:13 -0500 Subject: azure Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 4b58e3af..b4dc25d7 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -50,10 +50,10 @@ Twilio was the second organization to generously donate a large sum towards the providing easy–to–use APIs, and empowering developers world-over to help humans communicate in meaningful and effictive ways. -`Microsoft Cloud Developer Advocates `_ -///////////////////////////////////////////////////////////////////////////////////////// +`Azure Cloud Developer Advocates `_ +///////////////////////////////////////////////////////////////////////////////////// -Microsoft was the third organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, matching the donation of Twilio! Awesome group of generous folks :) +Azure was the third organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, matching the donation of Twilio! Awesome group of generous folks :) -- cgit v1.2.1 From ee58368c9f1c96ca9c66adff6ed05d5f233bdb2b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 9 Mar 2018 17:02:15 -0500 Subject: typo Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index b4dc25d7..6d66d33e 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -23,7 +23,7 @@ We don't have any patrons yet — this slot is reserved for ethical organization By becoming a patron–level sponsor, your organization will receive the following benefits: -- Priminent placement on the Requests documentation sidebar (~11,000 uniques / day). +- Prominent placement on the Requests documentation sidebar (~11,000 uniques / day). - Honorable mention here, with logo. - Peace of mind knowing that the infrastructure you rely on is being actively maintained. -- cgit v1.2.1 From b1ba9173d09282e972d8694006d430894dd50d8a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 13:48:12 -0400 Subject: linode Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 6d66d33e..8ee70b20 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -19,7 +19,16 @@ After losing our primary open source maintainer (who was sponsored by a company Patron Sponsors ---------------- -We don't have any patrons yet — this slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year. + +`Linode — SSD Cloud Hosting & Linux Servers `_ +////////////////////////////////////////////////////////////////////// + +Whether you’re just getting started or deploying a complex system, launching a Linode cloud server has never been easier. They offer the fastest hardware and network in the industry with scalable environments, and their 24x7 customer support team is always standing by to help with any questions. + + +---------------------------------- + +This slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year. By becoming a patron–level sponsor, your organization will receive the following benefits: -- cgit v1.2.1 From b5eacad6381a0cd6d7140ece33f76d814fe172e9 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 13:50:12 -0400 Subject: patron sponsors Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 8ee70b20..1c480415 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -36,7 +36,7 @@ By becoming a patron–level sponsor, your organization will receive the followi - Honorable mention here, with logo. - Peace of mind knowing that the infrastructure you rely on is being actively maintained. -Organizations that sign up (if any decide to) will be listed in order — first come first serve! +Organizations that sign up will be listed in order — first come first serve! Major Sponsors -------------- -- cgit v1.2.1 From 3de173e1c9dc9f5fd142eabf6aca5b4b1e93b14e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 16:54:00 -0400 Subject: =?UTF-8?q?=E2=9C=A8=F0=9F=8D=B0=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/community/sponsors.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 1c480415..92d35262 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -25,6 +25,8 @@ Patron Sponsors Whether you’re just getting started or deploying a complex system, launching a Linode cloud server has never been easier. They offer the fastest hardware and network in the industry with scalable environments, and their 24x7 customer support team is always standing by to help with any questions. +✨🍰✨ +////// ---------------------------------- -- cgit v1.2.1 From 87872b9587c7e0e672161fc3ac6c87048a3e1676 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 16:59:11 -0400 Subject: =?UTF-8?q?sponsored=20by=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/_templates/sidebarintro.html | 4 +++- docs/_templates/sidebarlogo.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index ce53b0cc..ca7ed27a 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -14,7 +14,9 @@ human beings.

                -

                Support Requests 3.0:

                +

                Sponsored by Linode and other wonderful organizations.

                + +

                Support Requests:

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index f8c0e132..2859975c 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -15,7 +15,9 @@ development release.

                -

                Support Requests 3.0:

                +

                Sponsored by Linode and other wonderful organizations.

                + +

                Support Requests:

                -- cgit v1.2.1 From 130773a2d36c0d230fd9c3335bbf324bb5307cb2 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:02:06 -0400 Subject: sidebar updates Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 29 +++-------------------------- docs/_templates/sidebarlogo.html | 29 ++++------------------------- 2 files changed, 7 insertions(+), 51 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index ca7ed27a..8db98726 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -13,36 +13,14 @@ Requests is an elegant and simple HTTP library for Python, built for human beings.

                +

                Sponsored by Linode and other wonderful organizations.

                -

                Sponsored by Linode and other wonderful organizations.

                - -

                Support Requests:

                - - - - - - -
                Email Address:
                - - - - - -

                Learn more.

                - -

                One time donations are also very welcome.

                - +
                -

                Stickers!

                +

                Requests Stickers!

                Stay Informed

                Receive updates on new releases and upcoming projects.

                @@ -50,7 +28,6 @@ allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20">

                -

                Say Thanks!

                Join Mailing List.

                Other Projects

                diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 2859975c..8d679817 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -17,29 +17,10 @@

                Sponsored by Linode and other wonderful organizations.

                -

                Support Requests:

                -
                - - - - - -
                Email Address:
                - - - -
                - -

                Learn more.

                - -

                One time donations are also very welcome.

                - -

                Stickers!

                +
                + +

                Requests Stickers!

                +

                Stay Informed

                Receive updates on new releases and upcoming projects.

                @@ -51,8 +32,6 @@ -

                If you enjoy using this project, Say Thanks!

                -

                -- cgit v1.2.1 From 85e536f7eb9322c60e81eac05d4b94b5ebb3382a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:04:14 -0400 Subject: reorder Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarlogo.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 8d679817..e87a9f21 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -19,12 +19,10 @@
                -

                Requests Stickers!

                -

                Stay Informed

                Receive updates on new releases and upcoming projects.

                - +

                Requests Stickers!

                Join Mailing List.

                -- cgit v1.2.1 From 6576370b7bc227c7c0bec8517c3bac24d98e9e4f Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:04:31 -0400 Subject: cleanup Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 8db98726..047e6524 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -15,8 +15,6 @@

                Sponsored by Linode and other wonderful organizations.

                -
                - -- cgit v1.2.1 From b920c6e3f864c36c2fac2b8d49c8a780de07b5ac Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:05:01 -0400 Subject: no hr Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarlogo.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index e87a9f21..1b7afbd8 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -17,8 +17,6 @@

                Sponsored by Linode and other wonderful organizations.

                -
                -

                Stay Informed

                Receive updates on new releases and upcoming projects.

                -- cgit v1.2.1 From e203d50e10386e026c48c09a206ab0ce7b1e6ce1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:07:37 -0400 Subject: every day --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 3839618c..2a8994e9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,7 +81,7 @@ Institutions that prefer to be unnamed claim to use Requests internally. simple, Pythonic.* Requests is one of the most downloaded Python packages of all time, pulling in -over 13,000,000 downloads every month. All the cool kids are doing it! +over 400,000 downloads **every day**. If your organization uses Requests internally, consider `supporting the development of 3.0 `_. Your generosity will be greatly appreciated, and help drive the project forward -- cgit v1.2.1 From cd6eb30b20eba6d348a2b2cfedf220feb07b33c6 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Mar 2018 17:11:08 -0400 Subject: party time Signed-off-by: Kenneth Reitz --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 2a8994e9..bd9aded2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,7 +81,7 @@ Institutions that prefer to be unnamed claim to use Requests internally. simple, Pythonic.* Requests is one of the most downloaded Python packages of all time, pulling in -over 400,000 downloads **every day**. +over 400,000 downloads **each day**. Join the party! If your organization uses Requests internally, consider `supporting the development of 3.0 `_. Your generosity will be greatly appreciated, and help drive the project forward -- cgit v1.2.1 From 8246b82a161f8734f774546cfb8309f1dca5916c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 13 Mar 2018 11:28:31 -0400 Subject: niteo Signed-off-by: Kenneth Reitz --- docs/community/sponsors.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/community/sponsors.rst b/docs/community/sponsors.rst index 92d35262..f1e11efd 100644 --- a/docs/community/sponsors.rst +++ b/docs/community/sponsors.rst @@ -67,6 +67,12 @@ providing easy–to–use APIs, and empowering developers world-over to help hum Azure was the third organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser `_, matching the donation of Twilio! Awesome group of generous folks :) +`Niteo — Web Systems Development `_ +///////////////////////////////////////////////////////////// + +Niteo was the fourth company to generously donate towards the `2018 Requests 3.0 fundraiser `_. Niteo is a company employing tech enthusiasts from all over the world +who love to build great stuff. + `Heroku `_ ///////////////////////////////////// -- cgit v1.2.1 From 35af0b077f287274c16d80305bd4af967bd81fc1 Mon Sep 17 00:00:00 2001 From: Hackbright Student Date: Fri, 16 Mar 2018 12:34:24 -0700 Subject: add comment about json parameter changing content-type --- docs/user/quickstart.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index b0ff231b..032e70f8 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -283,6 +283,8 @@ the ``json`` parameter (added in version 2.4.2) and it will be encoded automatic Note, the ``json`` parameter is ignored if either ``data`` or ``files`` is passed. +Using the ``json`` parameter in the request will change the ``Content-Type`` in the header to ``application/json``. + POST a Multipart-Encoded File ----------------------------- -- cgit v1.2.1