src/flask/debughelpers.py
def attach_enctype_error_multidict(request):
    """Since Flask 0.8 we're monkeypatching the files object in case a
    request is detected that does not use multipart form data but the files
    object is accessed.
    """
    oldcls = request.files.__class__

    class newcls(oldcls):
        def __getitem__(self, key):
            try:
                return oldcls.__getitem__(self, key)
            except KeyError as e:
                if key not in request.form:
                    raise

                raise DebugFilesKeyError(request, key) from e

    newcls.__name__ = oldcls.__name__
    newcls.__module__ = oldcls.__module__
    request.files.__class__ = newcls
Since Flask 0.8 we're monkeypatching the files object in case a
    request is detected that does not use multipart form data but the files
    object is accessed.
    
Since Flask 0.8 we're monkeypatching the files object in case a
request is detected that does not use multipart form data but the files
object is accessed.
Since Flask 0 . 8 we ' re monkeypatching the files object in case a request is detected that does not use multipart form data but the files object is accessed .
def attach_enctype_error_multidict(request):
    oldcls = request.files.__class__
    class newcls(oldcls):
        def __getitem__(self, key):
            try:
                return oldcls.__getitem__(self, key)
            except KeyError as e:
                if key not in request.form:
                    raise
                raise DebugFilesKeyError(request, key) from e
    newcls.__name__ = oldcls.__name__
    newcls.__module__ = oldcls.__module__
    request.files.__class__ = newcls
def attach_enctype_error_multidict ( request ) : oldcls = request . files . __class__ class newcls ( oldcls ) : def __getitem__ ( self , key ) : try : return oldcls . __getitem__ ( self , key ) except KeyError as e : if key not in request . form : raise raise DebugFilesKeyError ( request , key ) from e newcls . __name__ = oldcls . __name__ newcls . __module__ = oldcls . __module__ request . files . __class__ = newcls
Since Flask 0.8 we're monkeypatching the files object in case a
request is detected that does not use multipart form data but the files
object is accessed.
Since Flask 0 . 8 we ' re monkeypatching the files object in case a request is detected that does not use multipart form data but the files object is accessed .
"""Since Flask 0.8 we're monkeypatching the files object in case a
    request is detected that does not use multipart form data but the files
    object is accessed.
    """
request