(self, limit=-1)
| 677 | return self.fp.peek(n) |
| 678 | |
| 679 | def readline(self, limit=-1): |
| 680 | if self.fp is None or self._method == "HEAD": |
| 681 | return b"" |
| 682 | if self.chunked: |
| 683 | # Fallback to IOBase readline which uses peek() and read() |
| 684 | return super().readline(limit) |
| 685 | if self.length is not None and (limit < 0 or limit > self.length): |
| 686 | limit = self.length |
| 687 | result = self.fp.readline(limit) |
| 688 | if not result and limit: |
| 689 | self._close_conn() |
| 690 | elif self.length is not None: |
| 691 | self.length -= len(result) |
| 692 | if not self.length: |
| 693 | self._close_conn() |
| 694 | return result |
| 695 | |
| 696 | def _read1_chunked(self, n): |
| 697 | # Strictly speaking, _get_chunk_left() may cause more than one read, |
no test coverage detected