diff --git a/CHANGES/3090.removal b/CHANGES/3090.removal new file mode 100644 index 00000000000..88bf040d364 --- /dev/null +++ b/CHANGES/3090.removal @@ -0,0 +1 @@ +Drop ``reader`` parameter from ``request.multipart()``. \ No newline at end of file diff --git a/aiohttp/web_request.py b/aiohttp/web_request.py index 09b518e4f0f..d3f341bb958 100644 --- a/aiohttp/web_request.py +++ b/aiohttp/web_request.py @@ -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 @@ -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.""" diff --git a/docs/web_reference.rst b/docs/web_reference.rst index 52d459a74de..10776df52bb 100644 --- a/docs/web_reference.rst +++ b/docs/web_reference.rst @@ -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. @@ -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 ` that reads POST parameters from