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

Changeset 961

Show
Ignore:
Timestamp:
02/08/06 01:51:42
Author:
fumanchu
Message:

Fix for #456: No readlines() method in lib.httptools.SizeCheckWrapper?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/httptools.py

    r957 r961  
    503503                return ''.join(res) 
    504504     
     505    def readlines(self, sizehint = 0): 
     506        # Shamelessly stolen from StringIO 
     507        total = 0 
     508        lines = [] 
     509        line = self.readline() 
     510        while line: 
     511            lines.append(line) 
     512            total += len(line) 
     513            if 0 < sizehint <= total: 
     514                break 
     515            line = self.readline() 
     516        return lines 
     517     
    505518    def close(self): 
    506519        self.rfile.close() 

Hosted by WebFaction

Log in as guest/cpguest to create tickets