Ticket #8149: UploadedFile-r8225.diff

File UploadedFile-r8225.diff, 593 bytes (added by Tai Lee, 16 years ago)

fix iteration of UploadedFile objects on newlines.

  • django/core/files/uploadedfile.py

     
    141141        # Iterate over this file-like object by newlines
    142142        buffer_ = None
    143143        for chunk in self.chunks():
    144             chunk_buffer = StringIO(chunk)
    145 
    146             for line in chunk_buffer:
     144            for line in chunk.splitlines():
    147145                if buffer_:
    148146                    line = buffer_ + line
    149147                    buffer_ = None
Back to Top