Lines Matching refs:amt
450 def read(self, amt=None):
451 """Read and return the response body, or up to the next amt bytes."""
460 return self._read_chunked(amt)
462 if amt is not None:
463 if self.length is not None and amt > self.length:
465 amt = self.length
466 s = self.fp.read(amt)
467 if not s and amt:
578 def _read_chunked(self, amt=None):
587 if amt is not None and amt <= chunk_left:
588 value.append(self._safe_read(amt))
589 self.chunk_left = chunk_left - amt
593 if amt is not None:
594 amt -= chunk_left
624 def _safe_read(self, amt):
627 This function should be used when <amt> bytes "should" be present for
631 data = self.fp.read(amt)
632 if len(data) < amt:
633 raise IncompleteRead(data, amt-len(data))
638 amt = len(b)
640 if n < amt:
641 raise IncompleteRead(bytes(b[:n]), amt-n)