class documentation

class _LengthLimitedFile:

Constructor: _LengthLimitedFile(input, max_bytes)

View In Hierarchy

Wrapper class to limit the length of reads from a file-like object.

This is used to ensure EOF is read from the wsgi.input object once Content-Length bytes are read. This behavior is required by the WSGI spec but not implemented in wsgiref as of 2.5.

Method __init__ Undocumented
Method read Read up to size bytes from the limited input.
Instance Variable _bytes_avail Undocumented
Instance Variable _input Undocumented
def __init__(self, input: BinaryIO, max_bytes: int):

Undocumented

def read(self, size: int = -1) -> bytes:

Read up to size bytes from the limited input.

Parameters
size:intMaximum number of bytes to read, or -1 for all available
Returns
bytesUp to size bytes of data
_bytes_avail =

Undocumented

_input =

Undocumented