@@ -179,10 +179,8 @@ class FormDataParser:
179179 :param cls: an optional dict class to use. If this is not specified
180180 or `None` the default :class:`MultiDict` is used.
181181 :param silent: If set to False parsing errors will not be caught.
182- :param max_form_parts: the maximum number of parts to be accepted for the
183- multipart data sent. If this is exceeded an
184- :exc:`~exceptions.RequestEntityTooLarge` exception
185- is raised.
182+ :param max_form_parts: The maximum number of parts to be parsed. If this is
183+ exceeded, a :exc:`~exceptions.RequestEntityTooLarge` exception is raised.
186184 """
187185
188186 def __init__ (
@@ -194,6 +192,7 @@ def __init__(
194192 max_content_length : t .Optional [int ] = None ,
195193 cls : t .Optional [t .Type [MultiDict ]] = None ,
196194 silent : bool = True ,
195+ * ,
197196 max_form_parts : t .Optional [int ] = None ,
198197 ) -> None :
199198 if stream_factory is None :
@@ -204,13 +203,13 @@ def __init__(
204203 self .errors = errors
205204 self .max_form_memory_size = max_form_memory_size
206205 self .max_content_length = max_content_length
206+ self .max_form_parts = max_form_parts
207207
208208 if cls is None :
209209 cls = MultiDict
210210
211211 self .cls = cls
212212 self .silent = silent
213- self .max_form_parts = max_form_parts
214213
215214 def get_parse_func (
216215 self , mimetype : str , options : t .Dict [str , str ]
@@ -419,7 +418,7 @@ def parse(
419418 )
420419
421420 parser = MultipartDecoder (
422- boundary , self .max_form_memory_size , self .max_form_parts
421+ boundary , self .max_form_memory_size , max_parts = self .max_form_parts
423422 )
424423
425424 fields = []
0 commit comments