cherrypy.lib package


Module contents

CherryPy Library.

class cherrypy.lib.file_generator(input, chunkSize=65536)[source]

Bases: object

Yield the given input (a file object) in chunks (default 64k).



Return next chunk of file.

cherrypy.lib.file_generator_limited(fileobj, count, chunk_size=65536)[source]

Yield the given file object in chunks.

Stopps after count bytes has been emitted. Default chunk size is 64kB. (Core)


Detect if the given object is both closable and iterator.


Detect if the object provided implements the iterator protocol.

(i.e. like a generator).

This will return False for objects which are iterable, but not iterators themselves.

cherrypy.lib.set_vary_header(response, header_name)[source]

Add a Vary header to a response.