(self, amt=None)
| 597 | return chunk_left |
| 598 | |
| 599 | def _read_chunked(self, amt=None): |
| 600 | assert self.chunked != _UNKNOWN |
| 601 | if amt is not None and amt < 0: |
| 602 | amt = None |
| 603 | value = [] |
| 604 | try: |
| 605 | while (chunk_left := self._get_chunk_left()) is not None: |
| 606 | if amt is not None and amt <= chunk_left: |
| 607 | value.append(self._safe_read(amt)) |
| 608 | self.chunk_left = chunk_left - amt |
| 609 | break |
| 610 | |
| 611 | value.append(self._safe_read(chunk_left)) |
| 612 | if amt is not None: |
| 613 | amt -= chunk_left |
| 614 | self.chunk_left = 0 |
| 615 | return b''.join(value) |
| 616 | except IncompleteRead as exc: |
| 617 | raise IncompleteRead(b''.join(value)) from exc |
| 618 | |
| 619 | def _readinto_chunked(self, b): |
| 620 | assert self.chunked != _UNKNOWN |
no test coverage detected