Ticket #8149: UploadedFile-r8226.diff
File UploadedFile-r8226.diff, 711 bytes (added by , 16 years ago) |
---|
-
django/core/files/base.py
1 1 import os 2 import re 2 3 3 4 from django.utils.encoding import smart_str, smart_unicode 4 5 … … 97 98 # Iterate over this file-like object by newlines 98 99 buffer_ = None 99 100 for chunk in self.chunks(): 100 chunk_buffer = StringIO(chunk) 101 102 for line in chunk_buffer: 101 for line in re.findall(r'[^\r\n]+(?:\r\n|\r|\n)?|(?:\r\n|\r|\n)', chunk): 103 102 if buffer_: 104 103 line = buffer_ + line 105 104 buffer_ = None