MCPcopy Index your code
hub / github.com/django/django / ChunkIter

Class ChunkIter

django/http/multipartparser.py:541–562  ·  view source on GitHub ↗

An iterable that will yield chunks of data. Given a file-like object as the constructor, yield chunks of read operations from that object.

Source from the content-addressed store, hash-verified

539
540
541class ChunkIter:
542 """
543 An iterable that will yield chunks of data. Given a file-like object as the
544 constructor, yield chunks of read operations from that object.
545 """
546
547 def __init__(self, flo, chunk_size=64 * 1024):
548 self.flo = flo
549 self.chunk_size = chunk_size
550
551 def __next__(self):
552 try:
553 data = self.flo.read(self.chunk_size)
554 except InputStreamExhausted:
555 raise StopIteration()
556 if data:
557 return data
558 else:
559 raise StopIteration()
560
561 def __iter__(self):
562 return self
563
564
565class InterBoundaryIter:

Callers 2

_parseMethod · 0.85
exhaustFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…