Skip to content

Commit

Permalink
Fix #3090: Drop reader parameter from request.multipart() (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Jun 19, 2018
1 parent 7cf5785 commit 69f5c56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
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

0 comments on commit 69f5c56

Please sign in to comment.