From 48f2aafbc958288012de90e81b45c2421131e7ab Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 13 Dec 2017 15:42:58 +0200 Subject: [PATCH 1/2] Drop encoding param --- aiohttp/client.py | 9 --------- tests/test_client_functional.py | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/aiohttp/client.py b/aiohttp/client.py index 8dd5fd90e16..6f205326bfb 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -154,7 +154,6 @@ async def _request(self, method, url, *, auth=None, allow_redirects=True, max_redirects=10, - encoding=None, compress=None, chunked=None, expect100=False, @@ -172,12 +171,6 @@ async def _request(self, method, url, *, # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. - if encoding is not None: - warnings.warn( - "encoding parameter is not supported, " - "please use FormData(charset='utf-8') instead", - DeprecationWarning) - if self.closed: raise RuntimeError('Session is closed') @@ -793,7 +786,6 @@ def request(method, url, *, auth=None, allow_redirects=True, max_redirects=10, - encoding=None, version=http.HttpVersion11, compress=None, chunked=None, @@ -854,7 +846,6 @@ def request(method, url, *, auth=auth, allow_redirects=allow_redirects, max_redirects=max_redirects, - encoding=encoding, compress=compress, chunked=chunked, expect100=expect100, diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py index d06c97eb067..f7892ed766a 100644 --- a/tests/test_client_functional.py +++ b/tests/test_client_functional.py @@ -2004,19 +2004,6 @@ async def handler_redirect(request): assert data == body -async def test_encoding_deprecated(loop, test_client): - - async def handler_redirect(request): - return web.Response(status=301) - - app = web.Application() - app.router.add_route('GET', '/redirect', handler_redirect) - client = await test_client(app) - - with pytest.warns(DeprecationWarning): - await client.get('/', encoding='utf-8') - - async def test_chunked_deprecated(loop, test_client): async def handler_redirect(request): From 53914c50ff9ea4b3747c5a183bd85bb2e8d39453 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 13 Dec 2017 15:52:13 +0200 Subject: [PATCH 2/2] Add CHANGES --- CHANGES/2606.removal | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGES/2606.removal diff --git a/CHANGES/2606.removal b/CHANGES/2606.removal new file mode 100644 index 00000000000..3230db74f9f --- /dev/null +++ b/CHANGES/2606.removal @@ -0,0 +1 @@ +Drop deprecated `encoding` parameter from client API