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