(self)
| 543 | return n |
| 544 | |
| 545 | def _read_next_chunk_size(self): |
| 546 | # Read the next chunk size from the file |
| 547 | line = self.fp.readline(_MAXLINE + 1) |
| 548 | if len(line) > _MAXLINE: |
| 549 | raise LineTooLong("chunk size") |
| 550 | i = line.find(b";") |
| 551 | if i >= 0: |
| 552 | line = line[:i] # strip chunk-extensions |
| 553 | try: |
| 554 | return int(line, 16) |
| 555 | except ValueError: |
| 556 | # close the connection as protocol synchronisation is |
| 557 | # probably lost |
| 558 | self._close_conn() |
| 559 | raise |
| 560 | |
| 561 | def _read_and_discard_trailer(self): |
| 562 | # read and discard trailer up to the CRLF terminator |
no test coverage detected