(self, newdata)
| 1105 | return buf |
| 1106 | |
| 1107 | def _update_crc(self, newdata): |
| 1108 | # Update the CRC using the given data. |
| 1109 | if self._expected_crc is None: |
| 1110 | # No need to compute the CRC if we don't have a reference value |
| 1111 | return |
| 1112 | self._running_crc = crc32(newdata, self._running_crc) |
| 1113 | # Check the CRC if we're at the end of the file |
| 1114 | if self._eof and self._running_crc != self._expected_crc: |
| 1115 | raise BadZipFile("Bad CRC-32 for file %r" % self.name) |
| 1116 | |
| 1117 | def read1(self, n): |
| 1118 | """Read up to n bytes with at most one read() system call.""" |
no test coverage detected