class documentation

class FileWrapper:

View In Hierarchy

This class can be used to convert a file-like object into an iterable. It yields buffer_size blocks until the file is fully read.

You should not use this class directly but rather use the wrap_file function that uses the WSGI server's file wrapper support if it's available.

New in version 0.5.

If you're using this object together with a Response you have to use the direct_passthrough mode.

Parameters
filea file-like object with a ~file.read method.
buffer​_sizenumber of bytes for one iteration.
Method __init__ Undocumented
Method __iter__ Undocumented
Method __next__ Undocumented
Method close Undocumented
Method seek Undocumented
Method seekable Undocumented
Method tell Undocumented
Instance Variable buffer​_size Undocumented
Instance Variable file Undocumented
def __init__(self, file, buffer_size=8192):

Undocumented

Parameters
file:t.IO[bytes]Undocumented
buffer​_size:intUndocumented
def __iter__(self):

Undocumented

Returns
FileWrapperUndocumented
def __next__(self):

Undocumented

Returns
bytesUndocumented
def close(self):

Undocumented

def seek(self, *args):

Undocumented

Parameters
*args:t.AnyUndocumented
def seekable(self):

Undocumented

Returns
boolUndocumented
def tell(self):

Undocumented

Returns
t.Optional[int]Undocumented
buffer_size =

Undocumented

file =

Undocumented