From 0a2dc74ecbbb375b6d5171eb588ee69ca59b1898 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 9 Aug 2017 19:01:52 +0100 Subject: [PATCH 001/276] Drop Python 3.3 support --- .travis.yml | 1 - appveyor.yml | 5 ----- setup.py | 1 - 3 files changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a938f5ee..395f5731 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: python python: - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" diff --git a/appveyor.yml b/appveyor.yml index d2d6b6bb..4f06557e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,11 +10,6 @@ environment: PYTHON_ARCH: "64" TOXENV: "py27" - - PYTHON: "C:\\Python33-x64" - PYTHON_VERSION: "3.3.x" - PYTHON_ARCH: "64" - TOXENV: "py33" - - PYTHON: "C:\\Python34-x64" PYTHON_VERSION: "3.4.x" PYTHON_ARCH: "64" diff --git a/setup.py b/setup.py index 25887bb3..ed4892d4 100755 --- a/setup.py +++ b/setup.py @@ -83,7 +83,6 @@ setup( 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', From c31a450c55da44cb33ece953ef8cddbf3310538a Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 9 Aug 2017 19:40:52 +0100 Subject: [PATCH 002/276] Remove references to 3.3 from the docs --- docs/community/faq.rst | 1 - docs/dev/todo.rst | 1 - docs/index.rst | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/community/faq.rst b/docs/community/faq.rst index e835b122..70872292 100644 --- a/docs/community/faq.rst +++ b/docs/community/faq.rst @@ -56,7 +56,6 @@ supported: * Python 2.6 * Python 2.7 -* Python 3.3 * Python 3.4 * Python 3.5 * Python 3.6 diff --git a/docs/dev/todo.rst b/docs/dev/todo.rst index 88f0073c..75ec3085 100644 --- a/docs/dev/todo.rst +++ b/docs/dev/todo.rst @@ -51,7 +51,6 @@ Requests currently supports the following versions of Python: - Python 2.6 - Python 2.7 -- Python 3.3 - Python 3.4 - Python 3.5 - Python 3.6 diff --git a/docs/index.rst b/docs/index.rst index b17605bb..b9f0f4af 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -104,7 +104,7 @@ Requests is ready for today's web. - Chunked Requests - ``.netrc`` Support -Requests officially supports Python 2.6–2.7 & 3.3–3.7, and runs great on PyPy. +Requests officially supports Python 2.6–2.7 & 3.4–3.7, and runs great on PyPy. The User Guide From d758f0cf97b949b4782c3238f3ace01fa9d1b194 Mon Sep 17 00:00:00 2001 From: kelley Date: Thu, 10 Aug 2017 10:23:43 -0700 Subject: [PATCH 003/276] Adds import statement to front page of docs for clarity and quicker start up --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index b17605bb..0f5b2b22 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -36,6 +36,7 @@ constantly reading documentation, depression, headaches, or even death.* **Behold, the power of Requests**:: + >>> import requests >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')) >>> r.status_code 200 From cee8fae65efc1d4557d1b2291963a729444a5f42 Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Fri, 11 Aug 2017 15:37:57 -0400 Subject: [PATCH 004/276] Adding header name to exception Adds the name of the header to the invalid header exception raised on TypeError. --- requests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 1e4960d7..2104da8f 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -868,8 +868,8 @@ def check_header_validity(header): if not pat.match(value): raise InvalidHeader("Invalid return character or leading space in header: %s" % name) except TypeError: - raise InvalidHeader("Header value %s must be of type str or bytes, " - "not %s" % (value, type(value))) + raise InvalidHeader("Header %s value %s must be of type str or bytes, " + "not %s" % (name, value, type(value))) def urldefragauth(url): From ba21d149768909ffb63a5d5f9bd35f1f85a3371a Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Fri, 11 Aug 2017 16:12:36 -0400 Subject: [PATCH 005/276] Improving message formatting --- requests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 2104da8f..23a87bc1 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -868,8 +868,8 @@ def check_header_validity(header): if not pat.match(value): raise InvalidHeader("Invalid return character or leading space in header: %s" % name) except TypeError: - raise InvalidHeader("Header %s value %s must be of type str or bytes, " - "not %s" % (name, value, type(value))) + raise InvalidHeader("Value for header {%s:%s} must be of type str or " + "bytes, not %s" % (name, value, type(value))) def urldefragauth(url): From 308343508b9b2e88e720477f0a31e752d246f3dd Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Fri, 11 Aug 2017 16:14:13 -0400 Subject: [PATCH 006/276] Removing trailing whitespace --- requests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/utils.py b/requests/utils.py index 23a87bc1..f7a36ad7 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -868,7 +868,7 @@ def check_header_validity(header): if not pat.match(value): raise InvalidHeader("Invalid return character or leading space in header: %s" % name) except TypeError: - raise InvalidHeader("Value for header {%s:%s} must be of type str or " + raise InvalidHeader("Value for header {%s:%s} must be of type str or " "bytes, not %s" % (name, value, type(value))) From e36083b89cf729a7dc12a3f505106141f4e58e02 Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Fri, 11 Aug 2017 16:19:43 -0400 Subject: [PATCH 007/276] Adding space after colon --- requests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/utils.py b/requests/utils.py index f7a36ad7..5c47de98 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -868,7 +868,7 @@ def check_header_validity(header): if not pat.match(value): raise InvalidHeader("Invalid return character or leading space in header: %s" % name) except TypeError: - raise InvalidHeader("Value for header {%s:%s} must be of type str or " + raise InvalidHeader("Value for header {%s: %s} must be of type str or " "bytes, not %s" % (name, value, type(value))) From cbc7c2d1c9ceaa0ae73a1da3ceb3b29ed278d785 Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Fri, 11 Aug 2017 17:18:58 -0400 Subject: [PATCH 008/276] Modifying tests to include header name info --- tests/test_requests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_requests.py b/tests/test_requests.py index 7ef6bfee..a2b2213f 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1401,14 +1401,17 @@ class TestRequests: headers_list = {'baz': ['foo', 'bar']} # Test for int - with pytest.raises(InvalidHeader): + with pytest.raises(InvalidHeader) as excinfo: r = requests.get(httpbin('get'), headers=headers_int) + assert 'foo' in str(excinfo.value) # Test for dict - with pytest.raises(InvalidHeader): + with pytest.raises(InvalidHeader) as excinfo: r = requests.get(httpbin('get'), headers=headers_dict) + assert 'bar' in str(excinfo.value) # Test for list - with pytest.raises(InvalidHeader): + with pytest.raises(InvalidHeader) as excinfo: r = requests.get(httpbin('get'), headers=headers_list) + assert 'baz' in str(excinfo.value) def test_header_no_return_chars(self, httpbin): """Ensure that a header containing return character sequences raise an From d528106876ff0754edde90e081bdb28341cb3ae5 Mon Sep 17 00:00:00 2001 From: mgasvoda Date: Sat, 12 Aug 2017 10:23:45 -0400 Subject: [PATCH 009/276] Adding record to history --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index de6ba5c4..4d77d189 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ dev +++ **Improvements** +- Error messages for invalid headers now include the header name for easier debugging **Bugfixes** From a3d7cf3f27e74c28ef30f01e9f2e483570ab042e Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Tue, 15 Aug 2017 14:22:52 +0100 Subject: [PATCH 010/276] v2.18.4 --- HISTORY.rst | 7 +++---- requests/__version__.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4d77d189..d634e1fd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,13 +3,12 @@ Release History --------------- -dev -+++ +2.18.4 (2017-08-15) ++++++++++++++++++++ **Improvements** -- Error messages for invalid headers now include the header name for easier debugging -**Bugfixes** +- Error messages for invalid headers now include the header name for easier debugging **Dependencies** diff --git a/requests/__version__.py b/requests/__version__.py index 2d60bcc0..dc33eef6 100644 --- a/requests/__version__.py +++ b/requests/__version__.py @@ -5,8 +5,8 @@ __title__ = 'requests' __description__ = 'Python HTTP for Humans.' __url__ = 'http://python-requests.org' -__version__ = '2.18.3' -__build__ = 0x021803 +__version__ = '2.18.4' +__build__ = 0x021804 __author__ = 'Kenneth Reitz' __author_email__ = 'me@kennethreitz.org' __license__ = 'Apache 2.0' From af9dd61fcba5a1d0b3f75abf5499f6e1f845349c Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Tue, 15 Aug 2017 14:24:20 +0100 Subject: [PATCH 011/276] Prepare for new release --- HISTORY.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index d634e1fd..5e7b24a7 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,13 @@ Release History --------------- +dev ++++ + +**Improvements** + +**Bugfixes** + 2.18.4 (2017-08-15) +++++++++++++++++++ From 965ada6f660a423ec259fe3ad12d24022a55d37b Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Wed, 16 Aug 2017 22:10:20 -0400 Subject: [PATCH 012/276] Fix parse_header_links on empty header --- requests/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/requests/utils.py b/requests/utils.py index 5c47de98..c52ce2d0 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -743,7 +743,7 @@ def default_headers(): def parse_header_links(value): - """Return a dict of parsed link headers proxies. + """Return a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" @@ -754,6 +754,10 @@ def parse_header_links(value): replace_chars = ' \'"' + value = value.strip(replace_chars) + if not value: + return links + for val in re.split(', *<', value): try: url, params = val.split(';', 1) From 7d190ef0108f8466e0a6b7db41b01cae944313cf Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Thu, 17 Aug 2017 12:56:38 -0400 Subject: [PATCH 013/276] Add entry in HISTORY.rst --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 5e7b24a7..4694e495 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,8 @@ dev **Bugfixes** +- Parsing empty ``Link`` headers with ``parse_header_links()`` no longer return one bogus entry + 2.18.4 (2017-08-15) +++++++++++++++++++ From 8e411d0f99310320463254e8a364271f64f14c78 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Thu, 17 Aug 2017 12:56:45 -0400 Subject: [PATCH 014/276] Add test case for empty `Link:` header --- tests/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_utils.py b/tests/test_utils.py index b3f398ee..32e4d4a5 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -498,6 +498,10 @@ def test_iter_slices(value, length): {'url': 'http://.../back.jpeg'} ] ), + ( + '', + [] + ), )) def test_parse_header_links(value, expected): assert parse_header_links(value) == expected From e5666b93cf89886d399ee5bd794a2e76b948564d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 20 Aug 2017 20:56:48 -0400 Subject: [PATCH 015/276] btc Signed-off-by: Kenneth Reitz --- docs/_templates/sidebarintro.html | 2 +- docs/_templates/sidebarlogo.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index f840e9ef..adf031cd 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -25,7 +25,7 @@

Say Thanks!

Join Mailing List.

- +

BTC: 1Me2iXTJ91FYZhrGvaGaRDCBtnZ4KdxCug

Other Projects

diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index fba676f1..f1897afe 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -24,6 +24,7 @@

If you enjoy using this project, Say Thanks!

+

BTC: 1Me2iXTJ91FYZhrGvaGaRDCBtnZ4KdxCug

From 8ad09b68ea69a00a9f28c7b82a8867526f5575b1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 25 Aug 2017 22:02:03 -0400 Subject: [PATCH 016/276] coinbin.org --- 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 adf031cd..edd6731f 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -31,7 +31,7 @@

More Kenneth Reitz projects: