def _writeloop(self, consumer):
        """
        Return an iterator which reads one chunk of bytes from the input file
        and writes them to the consumer for each time it is iterated.
        """
        while True:
            bytes = self._inputFile.read(self._readSize)
            if not bytes:
                self._inputFile.close()
                break
            consumer.write(bytes)
            yield None

        Return an iterator which reads one chunk of bytes from the input file
        and writes them to the consumer for each time it is iterated.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/client.py