code: def handle_chunk_wrapper(self, status, name, content, file_info):
          
          out = self.output
          if out is not None:
              with out:
                  print("handling chunk " + repr(type(content)))
                  self.handle_chunk(status, name, content, file_info)
          else:
              self.handle_chunk(status, name, content, file_info)
docs: wrapper to allow output redirects for handle_chunk.