Skip to content

Support copy() for zipfile #151824

@danny0838

Description

@danny0838

Feature or enhancement

Proposal:

Currently, copying an entry within a ZIP file is cumbersome due to the lack of support for simultaneous reading and writing. The implementer must either:

  • Read the entire entry and write afterwards (which is memory-intensive and inefficient for large files), or
  • Use a temporary file for buffered copying.

Both approaches are more complex and less performant, due to the need to decompress and recompress data.

If would be much more performant and friendly by implementing a copy() method, using the similar internal buffered copying technique introduced by #134627 with the internal _ZipRepacker.

This also opens the door to support an efficient move() operation, composed of copy(), remove(), and optionally repack().

Has this already been discussed elsewhere?

Mentioned in #134627

Links to previous discussion of this feature:

#134627

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions