Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #929 (enhancement)

Opened 10 months ago

Last modified 9 months ago

needless work in Response.collapse_body()

Status: closed (fixed)

Reported by: visteya Assigned to: fumanchu
Priority: normal Milestone: 3.2
Component: CherryPy code Keywords:
Cc:

In _cprequest.py, class Response:

    def collapse_body(self):
        """Collapse self.body to a single string; replace it and return it."""
        newbody = ''.join([chunk for chunk in self.body])
        self.body = newbody
        return newbody

If response.body is a large string, this function generates a lot of heat performing a no-op. An isinstance(self.body, basestring) test could avoid that.

Change History

06/14/09 23:29:05: Modified by visteya

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r2447 (trunk), and r2448 (python3)

Hosted by WebFaction

Log in as guest/cpguest to create tickets