Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop reader parameter from request.multipart() #3091

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/3090.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop ``reader`` parameter from ``request.multipart()``.
7 changes: 4 additions & 3 deletions aiohttp/web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
from yarl import URL

from . import hdrs, multipart
from . import hdrs
from .helpers import DEBUG, ChainMapProxy, HeadersMixin, reify, sentinel
from .multipart import MultipartReader
from .streams import EmptyStreamReader, StreamReader
from .typedefs import JSONDecoder, LooseHeaders, RawHeaders, StrOrURL
from .web_exceptions import HTTPRequestEntityTooLarge
Expand Down Expand Up @@ -548,9 +549,9 @@ async def json(self, *, loads: JSONDecoder=DEFAULT_JSON_DECODER) -> Any:
body = await self.text()
return loads(body)

async def multipart(self, *, reader=multipart.MultipartReader):
async def multipart(self) -> MultipartReader:
"""Return async iterator to process BODY as multipart."""
return reader(self._headers, self._payload)
return MultipartReader(self._headers, self._payload)

async def post(self) -> MultiDictProxy:
"""Return POST parameters."""
Expand Down
6 changes: 5 additions & 1 deletion docs/web_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ and :ref:`aiohttp-web-signals` handlers.
:meth:`~Request.json` call will return the same value.


.. comethod:: multipart(*, reader=aiohttp.multipart.MultipartReader)
.. comethod:: multipart()

Returns :class:`aiohttp.multipart.MultipartReader` which processes
incoming *multipart* request.
Expand All @@ -432,6 +432,10 @@ and :ref:`aiohttp-web-signals` handlers.

.. seealso:: :ref:`aiohttp-multipart`

.. versionchanged:: 3.4

Dropped *reader* parameter.

.. comethod:: post()

A :ref:`coroutine <coroutine>` that reads POST parameters from
Expand Down