From 7e3f55514f616d32eb4fa468323f089c756d8793 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 13 Dec 2017 17:37:45 +0200 Subject: [PATCH] Drop encoding param (#2606) * Drop encoding param * Add CHANGES --- CHANGES/2606.removal | 1 + aiohttp/client.py | 9 --------- tests/test_client_functional.py | 13 ------------- 3 files changed, 1 insertion(+), 22 deletions(-) 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 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):