attach_enctype_error_multidict() — flask Function Reference
Architecture documentation for the attach_enctype_error_multidict() function in debughelpers.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD 6a550efd_c111_6300_d6cd_0d4f9678b80f["attach_enctype_error_multidict()"] 7fa0faba_d854_797c_b6bd_20820e905793["debughelpers.py"] 6a550efd_c111_6300_d6cd_0d4f9678b80f -->|defined in| 7fa0faba_d854_797c_b6bd_20820e905793 5f88d5d7_124f_d106_8824_7973e1208398["_load_form_data()"] 5f88d5d7_124f_d106_8824_7973e1208398 -->|calls| 6a550efd_c111_6300_d6cd_0d4f9678b80f style 6a550efd_c111_6300_d6cd_0d4f9678b80f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/flask/debughelpers.py lines 81–104
def attach_enctype_error_multidict(request: Request) -> None:
"""Patch ``request.files.__getitem__`` to raise a descriptive error
about ``enctype=multipart/form-data``.
:param request: The request to patch.
:meta private:
"""
oldcls = request.files.__class__
class newcls(oldcls): # type: ignore[valid-type, misc]
def __getitem__(self, key: str) -> t.Any:
try:
return super().__getitem__(key)
except KeyError as e:
if key not in request.form:
raise
raise DebugFilesKeyError(request, key).with_traceback(
e.__traceback__
) from None
newcls.__name__ = oldcls.__name__
newcls.__module__ = oldcls.__module__
request.files.__class__ = newcls
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does attach_enctype_error_multidict() do?
attach_enctype_error_multidict() is a function in the flask codebase, defined in src/flask/debughelpers.py.
Where is attach_enctype_error_multidict() defined?
attach_enctype_error_multidict() is defined in src/flask/debughelpers.py at line 81.
What calls attach_enctype_error_multidict()?
attach_enctype_error_multidict() is called by 1 function(s): _load_form_data.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free