twisted.web.client.FileBodyProducer(object)class documentation

FileBodyProducer
produces bytes from an input file object incrementally and writes them to a
consumer.

Since file-like objects cannot be read from in an event-driven manner,
FileBodyProducer
uses a Cooperator
instance to schedule reads from the file. This process is also paused and
resumed based on notifications from the IConsumer
provider being written to.

The file is closed after it has been read, or if the producer is stopped
early.