Skip to content

Commit

Permalink
Drop encoding param (aio-libs#2606)
Browse files Browse the repository at this point in the history
* Drop encoding param

* Add CHANGES
  • Loading branch information
asvetlov authored Dec 13, 2017
1 parent 94e6ee5 commit 7e3f555
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
1 change: 1 addition & 0 deletions CHANGES/2606.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop deprecated `encoding` parameter from client API
9 changes: 0 additions & 9 deletions aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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')

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions tests/test_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7e3f555

Please sign in to comment.