Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

random access uncompressed unencrypted ZipExtFile #128131

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@vvb2060

Description

@vvb2060

Feature or enhancement

Proposal:

# Fast seek uncompressed unencrypted file
elifself._compress_type==ZIP_STOREDandself._decrypterisNoneandread_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
elifread_offset<0:
# Position is before the current position. Reset the ZipExtFile

if read_offset < 0, ZipExtFile is reset and read from the beginning. I thinkread_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp