Feature or enhancement
Proposal:
|
# Fast seek uncompressed unencrypted file |
|
elif self._compress_type == ZIP_STORED and self._decrypter is None and read_offset > 0: |
|
# disable CRC checking after first seeking - it would be invalid |
|
self._expected_crc = None |
|
# seek actual file taking already buffered data into account |
|
read_offset -= len(self._readbuffer) - self._offset |
|
self._fileobj.seek(read_offset, os.SEEK_CUR) |
|
self._left -= read_offset |
|
read_offset = 0 |
|
# flush read buffer |
|
self._readbuffer = b'' |
|
self._offset = 0 |
|
elif read_offset < 0: |
|
# Position is before the current position. Reset the ZipExtFile |
if read_offset < 0, ZipExtFile is reset and read from the beginning. I think read_offset > 0 is unnecessary.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Feature or enhancement
Proposal:
cpython/Lib/zipfile/__init__.py
Lines 1164 to 1177 in 78ffba4
if read_offset < 0, ZipExtFile is reset and read from the beginning. I think
read_offset > 0is unnecessary.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs