(self, n)
| 735 | return read |
| 736 | |
| 737 | def _peek_chunked(self, n): |
| 738 | # Strictly speaking, _get_chunk_left() may cause more than one read, |
| 739 | # but that is ok, since that is to satisfy the chunked protocol. |
| 740 | try: |
| 741 | chunk_left = self._get_chunk_left() |
| 742 | except IncompleteRead: |
| 743 | return b'' # peek doesn't worry about protocol |
| 744 | if chunk_left is None: |
| 745 | return b'' # eof |
| 746 | # peek is allowed to return more than requested. Just request the |
| 747 | # entire chunk, and truncate what we get. |
| 748 | return self.fp.peek(chunk_left)[:chunk_left] |
| 749 | |
| 750 | def fileno(self): |
| 751 | return self.fp.fileno() |
no test coverage detected