Show More
@@ -899,7 +899,7 b' class chunkbuffer(object):' | |||||
899 | """Read L bytes of data from the iterator of chunks of data. |
|
899 | """Read L bytes of data from the iterator of chunks of data. | |
900 | Returns less than L bytes if the iterator runs dry.""" |
|
900 | Returns less than L bytes if the iterator runs dry.""" | |
901 | left = l |
|
901 | left = l | |
902 |
buf = |
|
902 | buf = [] | |
903 | queue = self._queue |
|
903 | queue = self._queue | |
904 | while left > 0: |
|
904 | while left > 0: | |
905 | # refill the queue |
|
905 | # refill the queue | |
@@ -917,11 +917,11 b' class chunkbuffer(object):' | |||||
917 | left -= len(chunk) |
|
917 | left -= len(chunk) | |
918 | if left < 0: |
|
918 | if left < 0: | |
919 | queue.appendleft(chunk[left:]) |
|
919 | queue.appendleft(chunk[left:]) | |
920 |
buf |
|
920 | buf.append(chunk[:left]) | |
921 | else: |
|
921 | else: | |
922 |
buf |
|
922 | buf.append(chunk) | |
923 |
|
923 | |||
924 | return buf |
|
924 | return ''.join(buf) | |
925 |
|
925 | |||
926 | def filechunkiter(f, size=65536, limit=None): |
|
926 | def filechunkiter(f, size=65536, limit=None): | |
927 | """Create a generator that produces the data in the file size |
|
927 | """Create a generator that produces the data in the file size |
General Comments 0
You need to be logged in to leave comments.
Login now